290 likes | 496 Views
Meaningful Modeling: What’s the Semantics of “Semantics ”?. David Harel , Weizmann Institute of Science Bernhard Rumpe , Technische Universität Braunschweig. Presented by: K M Sabidur Rahman Date: Feb 25, 2014. Outline. Elements of language definition Syntax Semantic domain
E N D
Meaningful Modeling:What’s the Semanticsof “Semantics”? David Harel, Weizmann Institute of Science Bernhard Rumpe, TechnischeUniversitätBraunschweig Presented by: K M SabidurRahmanDate: Feb 25, 2014
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
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).
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
Example of Confusion • Two pieces of data with same information -June 20, 2000 -The last day of the first spring in the second millennium
Example of Confusion • Single data with multiple meaning - John’s Birthday * Depends on John who?
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
Syntax Can be - • words • Sentences • Statements • Boxes • Diagrams • Terms • Models • Clauses • Modules
Syntax • Textual Language – linear character sequences • Diagrammatic language - lines, arrows, curves and boxes • More intuitive/expressive than textual language • Harder to express formally
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.
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, and not all those that do so are (or need to be) executable
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
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
Arithmetic Expressions Semantic Domain, S : all natural numbers Semantic mapping, M : Obvious interpretation: Agreed on interpretation:
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.
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.
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.
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.
Degree of Formality Misconceptions • - Textual languages are more formal than Visual languages • - Formality means lots of Greek letters and mathematical symbols
Degree of formality It’s possible to make imprecise statements with a precise, rigorously defined language, but it’s hard to be precise with an imprecise language
Degree of formality What really matters? • -Well defined language • -Precise statements • - Model’s Detailedness
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.
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.”
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 specificationof important semantic domain properties? • If analysis techniques or transformations for the language exist, are they sound with respect to the semantics?
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