Monday, September 8, 2008

Modeling Languages

Modeling languages, like any language, have Syntax & Semantics . The Syntax defines the structure any instance model in it can take. each language will have an abstract syntax, and a number of concrete syntax it could be represented with.

Syntax:

concrete syntax can be visual or textual, depending on how we would like to describe the language. A modeling language can have both a textual and a visual syntax. ( think of to a very well defined toString method ) .
Visual Languages syntax can be divided into two streams:
  1. Connection based or Topological: where position and size of different language elements doesn't matter ( irrelevant ). the more specific next level in this branch is Graph based visual languages ( state charts ) , and the next is Plex languages ( DEVS or CBD) where the Arch attachment area have significance ( via ports for example )
  2. Geometric: where position of elements in the model instances does matter. a subset of this brach would the box based languages ( where no overlap is allowed ) (Snieder graphs). the next subset is iconic languages where overlap IS allowed, and the most specifc in this branch are string ( textual ) languages like programming languages for example.
Another thing should be mentioned is that all concrete syntax of a language are translated into the abstract tree syntax. which the essence of a model instance, and will be used in mapping to the semantics domain.
Note: the process of transforming a concrete syntax into the abstract is called Parsing. and the inverse is called pretty printing.

Semantics:
Each language has semantics which is defined by the semantics domain . for example if we take a sentence "2+3" for example, will map into "5" in the semantics domain.
The mapping function M[[ ]], can be in two forms ( they are both identical ):
  1. Denotational : like a translator describes "What"
  2. Operational: describes a procedure of "How" to compute . like a program.
The mapping function has to be unique ( meaning for each abstract syntax it will produce a mapping, and total, meaning that it can give a mapping for any valid input. note also that non-determinism here is ok.