Constraint%20Animation%20Using%20an%20Object-Oriented%20Declarative%20Language - PowerPoint PPT Presentation

About This Presentation
Title:

Constraint%20Animation%20Using%20an%20Object-Oriented%20Declarative%20Language

Description:

Constraint Animation Using an Object-Oriented Declarative Language Jeff Gray and Stephen Schach Vanderbilt University {jgray, srs}_at_vuse.vanderbilt.edu – PowerPoint PPT presentation

Number of Views:165
Avg rating:3.0/5.0
Slides: 26
Provided by: JeffG179
Learn more at: https://gray.cs.ua.edu
Category:

less

Transcript and Presenter's Notes

Title: Constraint%20Animation%20Using%20an%20Object-Oriented%20Declarative%20Language


1
Constraint Animation Using an Object-Oriented
Declarative Language
  • Jeff Gray and Stephen Schach
  • Vanderbilt University
  • jgray, srs_at_vuse.vanderbilt.edu
  • ACM Southeast Conference 2000
  • April 7-8, 2000
  • Clemson, SC

2
Overview
  • Problem Motivation
  • Specification Animation
  • UML/OCL
  • Prolog
  • Mapping UML/OCL to Prolog
  • Example
  • Using the Intelligence Server to construct a
    simple animation environment
  • Ideas for Improvement

3
Problem Motivation
  • Fact Our words are pregnant with meaning
  • Oxford English Dictionary
  • 500 words used most have an average of 23
    meanings
  • set has 430 different meanings 25 pgs. and 60k
    words
  • The Resulting Problem Ambiguity
  • Humorous statements
  • Military disasters (Tennysons poem on Crimean
    War)
  • Large Software Requirements Specification
  • Other Problems Inconsistency Confusing
    Verbiage

4
An Example
  • The Landing Pilot is the Non-Handling Pilot
    until the decision altitude call, when the
    Handling Non-Landing Pilot hands the handling to
    the Non-Handling Landing Pilot, unless the latter
    calls go around, in which case the Handling
    Non-Landing Pilot continues handling and the
    Non-Handling Landing Pilot continues non-handling
    until the next call of land or go around as
    appropriate. In view of recent confusions over
    these rules, it was deemed necessary to restate
    them clearly.
  • British Airways Memorandum, quoted in Pilot
    Magazine, December 1996.

5
Natural Language Problem
  • The Humpty-Dumpty Syndrome
  • When I use a word, Humpty Dumpty said, in a
    rather scornful tone,
  • it means just what I choose it to mean - nothing
    more nor less.
  • The question is, said Alice,
  • whether you can make words mean so many
    different things.

  • Lewis Carroll

6
Collection of Ambiguous or Inconsistent/Incomplet
e Statements
  • I will bring my bike tomorrow if it looks nice
    in the morning
  • I found a smoldering cigarette left by a horse
  • Check it out
  • http//www.vuse.vanderbilt.edu/jgray/ambig.html

7
Levels of Formalism
  • Categories of formalism
  • Informal natural language
  • Semi-formal notations
  • Formal specification languages

Informal
Familiarity
Semi-formal
Formal
Mathematical Rigor
8

Levels of Formalism
  • Semi-formal specifications lack the formality for
    rigorous mathematical verification
  • Formal specifications are not customer friendly
  • This returns us to the underlying tension in
    the software process that between the subjective
    and the objective, between the holistic mental
    view and the rigorous formal model. The first
    describes what is needed the second ensures that
    what was requested is delivered.
  • Blum, Bruce, A Taxonomy of Software Development
    Methods, Communications of the ACM, vol. 37, no.
    11, November 1994, pp. 82?94.

9
Graphical Notations
  • Petre, Marian, Why Looking Isnt Always Seeing
    Readership Skills and Graphical Programming,
    Communications of the ACM, June 1995, pp. 33?44.

10
UML/OCL
  • Enriching a UML diagram with OCL constraints can
    aid in improving the common understanding of the
    underlying model (natural language is not used to
    describe the effect of the constraint)
  • Several groups are working hard to rigorously
    define the UML semantics using formal languages
    (The Precise UML Group) several workshops
    exist
  • A rigorous semantics would permit a type of
    executable specification to be performed

11
Specification Animation
  • Offers a type of throw-away prototype resulting
    from an executable specification
  • Can aid in making the underlying formalism
    transparent to end-user
  • Wide body of literature
  • Debate between tradeoff of expressiveness with
    the speed of executability
  • Most efforts focus on animating Z
  • Declarative programming languages are often used
    to aid in the mapping from the specification(Prol
    og is the language used with most frequency)

12
Prolog
  • Vendor Logic Programming Associates
  • Combines the declarative power and inference
    engine of Prolog with the benefits of OOP
  • Supports
  • structural organization of Prolog predicates in
    classes
  • single/group of messages can be sent to
    single/group of objects
  • data driven programming - allows daemons to be
    attached to crucial events (construction/destructi
    on, value changes)
  • multiple inheritance and polymorphism
  • Drawback Very primitive environment costly

13
Mapping UML/OCL to Prolog
  • UML class diagrams provide
  • the corresponding class structure for the
    Prolog code
  • attributes/types and method names for Prolog
    code
  • aggregation/relations that must be Prolog parts
  • Many OCL collection operations have direct
    mappings to Prolog predicates (we get these
    free!)
  • OCL forall can often be mapped to Prolog all
    instance
  • OCL select -gt all instance sucthat...
  • An important asset is a library of Prolog
    predicates that emulate standard OCL operations
  • e.g., oclIsTypeOf, oclType, oclIsKindOf, size

14
Mapping UML/OCL to Prolog
  • oclIsTypeOf
  • A reflective class attribute must be defined,
    e.g.
  • class attributes
  • class_type outputPort.
  • operator then defined in Prolog as
  • oclIsTypeOf(AType) - self_at_class_type AType.
  • size
  • A class attribute called size_att must be defined
    for each class
  • Define a simple library function to increment
    size_att
  • size_func - size_att 1.
  • Generic size is then defined as
  • size(S) - size_att 0, (all instance
    class) lt- size_func, S _at_size_att.

15
Example
16
Example Constraint 1
  • It is invalid to connect an input port to another
    input port, or an output port to another output
    port
  • In OCL, this can expressed as
    Connection-gtforAll(c
    c.src.oclIsTypeOf(OutputPort) and
    c.dst.oclIsTypeOf(InputPort))
  • In Prolog inv_Connection - (all
    instance class)lt- (_at_srclt-oclIsTypeOf(
    'outputPort'), _at_dstlt-oclIsTypeOf(in
    putPort)).

17
Example Constraint 2
  • Microphones can only connect to preamps preamp
    outputs can only connect to poweramps poweramp
    outputs only to speakers
  • In OCL, this can expressed as (Microphone-gtPreamp)
    Mic-gtforAll(m

    m.OutputPort.dst.oclIsTypeOf(PreAmp))
  • In Prolog inv_Mic_Dst - (all
    instance class)lt-(outputPort_at_dstlt-
    oclIsTypeOf(preAmp')).

18
Example Constraint 3
  • At least one poweramp must exist in an audio
    system
  • In OCL, this can expressed as (Microphone-gtPreamp)
    PowerAmp.allInstances-gtsize gt 1.
  • In Prolog inv_powerAmp_existence -
    size(S), S gt 1.

19
Using the Intelligence Server
Developers
Customer
Animation Environment
Result
Query
20
Intelligence Server
Win-Prolog
Intelligence Server
Front End
Server.OVL
Server.DLL
PRO386W.EXE(runtime kernel)
Server.PC
User definedProlog code
21
Intelligence Server
  • Six Interface Functions of Server.DLL
  • LoadProlog
  • initialize/configure WinProlog
  • HaltProlog
  • shut down WinProlog
  • InitGoal
  • initialize a Prolog goal
  • CallGoal
  • call previous goal, return solution, backtrack
  • ExitGoal
  • exit a goal once solutions are no longer needed
  • TellGoal
  • send textual info back to a goal that requires
    input

22
Intelligence Server
Win-Prolog
Intelligence Server
Front End
Server.OVL
Server.DLL
PRO386W.EXE(runtime kernel)
Server.PC
User definedProlog code
Animation Environment
Translated OCL
23
Simple Animation Environment
24
Other Related Applications
25
Ideas for Improvement
  • Current work is very primitive - core functions
    of an animator are still needed
  • Automated Mapping to Prolog
  • Retrieve model from Rose (using COM)
  • Build on current OCL parsers
  • Incorporate Interaction (Sequence) Diagrams
  • an existing sequence diagram can be used as an
    example script to drive an animation session
  • the interactions among objects in an animation
    session could be captured to construct a sequence
    diagram
  • Support for pre/post-conditions
Write a Comment
User Comments (0)
About PowerShow.com