[Reprint] syntax and Semantics

Source: Internet
Author: User
From Steve's blog.

In fact, it is also very simple.
For more details, see this book of Keith short: Adapted from models, frameworks and tools, which can be downloaded online.

Graphical syntax ages-Semantics vs syntax

Recent postings have talked about "semantics" of graphical languages. When I was involved in UML development this word caused a lot of argument and confusion. In my view, it goes like this.

 

A graphical language has three primary aspects: concrete syntax, abstract syntax, and semantics. concrete syntax (notation) defines what the language actually looks like on the screen or the paper: the shapes, connections, adornments and textual annotations that the user sees and manipulates, and the gestures used to manipulate them. abstract Syntax (grammar) gives names to the concepts that the notation depicts, and defines which tolerations of these are valid. often, the abstract syntax for a graphical language is defined using a model, itself expressed using a graphical language. some people call this a "metamodel"; my colleagues and I usually call it a domain model. usually such a model is insufficient on its own, and must be supplemented by an additional set of constraints, sometimes called "well-formedness Rules ". A typical such rule wocould be the constraint that an inheritance graph must not form cycles.

 

SemanticsIs none of the above, although terms such as "static semantics" or "short-range semantics" have been used to refer to what I called abstract syntax. semantics define what valid expressions in the language mean. (aside: saying "expressions in the language" is very easy when talking about textual ages, whereas thinking of a distrias as an expression may feel a little uncomfortable. you have to get used to it .) the way to give meaning to an expression is to map it to one or more other interesting structures whose meaning is known. to define semantics objectively, the mapping and the meaning of the result must both be precisely defined.

 

A mapping of the graphical language to statements in a natural language does not give objective semantics, although it may be useful. A precise mapping of the graphical language to a programming language gives objective semantics to the extent that the programming language does: Which is high, in the case of popular standardized ages. if such a mapping exists it probably means that the digrams is a visualization of some aspect of the structure of the program. another useful target for semantic mappings is expressions in some logical formalism, such as set theory, predicate logic or abstract algebra. examples of diagrams with this kind of semantics are Venn diagrams and Petri nets. A final useful target for semantic mappings is another graphical language, which itself has well-defined semantics.

 

You might observe that abstract syntax involves a mapping from expressions in the language to the Structure {valid, invalid}, and therefore is a kind of degenerate semantics. I prefer to distinguish validity from meaning. you might also observe that it might be desirable to give some kind of meaning to invalid expressions. to do that, you 'd have to introduce different kinds of validity.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.