Upload
jason-doyle
View
226
Download
0
Embed Size (px)
Citation preview
Meaningful Modeling:What’s the Semanticsof “Semantics”?
David Harel, Weizmann Institute of ScienceBernhard Rumpe, Technische Universität Braunschweig
Presented by: K M Sabidur RahmanDate: Feb 25, 2014
1
Outline Elements of language definition
Syntax Semantic domain Semantic mapping
Representation Metamodeling in UML Degree of Formality Doodling Phenomenon Accommodating the intended audience Pertinent questions Summary
2
Why “Semantics”?• Confusion in definition in formal language• Distinction between Syntax and Semantics• Influence of assumptions in definition• Human factors (People gets confused)
This paper tries to clarify some concepts regarding Syntax and Semantics; their differences and other issues focusing on Unified Modeling Language (UML).
3
Elements of a Language Definition• Formal: Data is used in communication• Informal: Syntactic representation of Data• Mapping: Interpretation which assigns a meaning to each
piece of Data
4
Example of Confusion• Two pieces of data with same information
-June 20, 2000-The last day of the first spring in the second millennium
5
Example of Confusion• Single data with multiple meaning
- John’s Birthday
* Depends on John who?
6
Elements of a Language Definition
Language consists of:• Syntactic notation – infinite set of legal elements• Meaning of these elements – Semantic Domain• Mapping between Syntax and semantic domain
7
Syntax
Can be -• words• Sentences • Statements• Boxes• Diagrams• Terms• Models• Clauses• Modules
8
Syntax• Textual Language – linear character sequences
• Diagrammatic language - lines, arrows, curves and boxes- More intuitive/expressive than textual language- Harder to express formally
9
Syntax
10
Syntax• What does really “+” means?• Who said that read() is reading something as in English!
*Language must be clear and rigid about it’s rules and their meaning.
11
Wrong ways to view semantics• Semantics is the metamodel• Semantics is the semantic domain• Semantics is the context conditions• Semantics is dealing with behavior• Semantics is being executable• Semantics is the behavior of a system• Semantics is the meaning of individual constructs• Semantics means looking mathematical• Semantics is ________
* not all languages specify behavior, andnot all those that do so are (or need to be) executable
12
Semantic Domain• A language’s semantics must provide the meaning of each
expression, and that meaning must be an element in some well-defined and well-understood domain.
• Often confused with behavior• Serves as an abstraction of reality, capturing decisions about
the kinds of things the language should express• Prerequisite to comparing semantic definitions.• Independent of the notation• Description can be from plain English to rigorous mathematics
13
Semantic mapping• A sound language definition must relate the syntactic
expressions to the semantic domain elements so that each syntactic creature maps to its meaning.
• Can be explained by examples and plain English• Or more formally• Semantics are compositional; the meaning of a composite
creature being fully based on the meanings of its parts
14
Arithmetic Expressions
Semantic Domain, S : all natural numbers
Semantic mapping, M :
Obvious interpretation:
Agreed on interpretation:
15
Dataflow Diagrams
16
Representation
Layers of representation (textual languages):• A set of characters forms an alphabet.• Groups of characters form words.• A third layer groups these words into sentences or expressions• A fourth and final layer constrains the sentences by imposing
context conditions, for example, that variable use be consistent with variable types.
17
Representation
Layers of representation (visual languages): • create the first layer with two kinds of basic topological
elements: open and closed line segments• specialize these elements geometrically into several kinds of
lines and closed shapes—arrows, straight lines, splines, boxes and circles, and so on—with various line styles and colors
• arrange the geometric shapes into diagrams by first making topologically meaningful combinations using connectivity, insideness, partitioning and intersection, and the like and then laying these out geometrically in a 2D or 3D diagram
• create the fourth layer by imposing context conditions for the set of legal diagrams. 18
Representation
19
Metamodeling in UML• Official UML definitions use the class diagram approach in a
recursive, bootstrapping fashion: metamodeling.• Benefit is the user doesn’t need to learn a new external
notation• But, this only deals with syntax, not semantics.
20
Metamodeling in UML• The class diagram and Object constraint language used in
metamodeling must be defined with Semantics, first.• Currently, OMG doesn’t offer complete definition of UML’s
true semantics, not even semantic domain.• Only discussion on abstract syntax is not enough for
developers or vendors.
21
Degree of Formality
Misconceptions• - Textual languages are more formal than Visual languages• - Formality means lots of Greek letters and mathematical
symbols
22
Degree of formality
It’s possible to make imprecise statements with a precise, rigorouslydefined language, but it’s hard to be precise with an imprecise language
23
Degree of formality
What really matters?• -Well defined language• -Precise statements• - Model’s Detailedness
24
The Doodling Phenomenon• A mind-set that says diagrams are what an engineer scribbles
on the back of a napkin, but the real work is done with textual languages.
25
The Intended Audience• If the target audience is users, formulas won’t be suitable• Language developers and methodologists, would be willing to
cope with the notations for semantics. • Developers would gather insights into what would be the best
form for language concepts.• Methodologists would be motivated to use the notation in the
interest of discovering how to advise language users.• Tool vendors should also be exposed to a rigorous semantics,
but they are probably better off with precise descriptions of “how to deal with” instead of the “what” and the “why.”
26
Pertinent Questions• Does the given formalization capture the intended users’
intuition?• Are the context conditions sufficient to ensure that language
expressions are consistent and meaningful?• Does the notation permit the specification of important
semantic domain properties?• If analysis techniques or transformations for the language
exist, are they sound with respect to the semantics?
27
Summary Elements of language definition
Syntax Semantic domain Semantic mapping
Representation Metamodeling in UML Degree of Formality Doodling Phenomenon Accommodating the intended audience Pertinent questions
28
29