Найти тему

Semantics of languages

Any new language is a set of signs with the help of which the user, following certain rules, can make a certain text (a meaningful design).
Traditionally, any language is divided into three dimensions: syntax, which defines the rules for constructing texts from characters, semantics, which defines the projections of characters on the subject area of the language, and pragmatics, which describes how the language is used by the user.


There are
three types of syntax for visual modeling languages: abstract, specific and service. The service syntax is responsible for the representation of visual specifications in a given language in memory. Abstract syntax defines a set of rules using which it is possible to unite simple components of a language (signs and designs) into complex ones (texts, i.e. visual models). Usually, it is set as a grammar or meta-model. A specific syntax (graphical notation or just a notation) consists of a formalized set of graphical symbols with which the user can write texts, i.e., the rules of representation of language constructions. Semantics allows you to give meaning to constructions, i.e. determine their correspondence to real situations from the subject area or any other formally defined area called semantic area. For example, semantics of interpretation is used to convert the abstract representation of these constructions into an executable one.
In the
theory of programming languages, there are four main types of semantics: operational, denotation, axiomatic and translational. Denotational semantics has been described in [42]. Usually, this approach uses some mathematical objects or functions called denotation as a semantic area, and the correspondence of language constructions to these objects is set recursively, i.e. the denotation for the expression should be composed of subexpression denotations. Often λ calculation is used to create this correspondence.
This type of semantics is mathematically strict and formal, but in its purest form sometimes does not have a sufficient degree of clarity for non-specialists.
Operating semantics is also mathematically rigorous and comes in two types: 2 structural operational semantics (small-step semantics, [38]) and natural semantics (big step semantics, [28]). Structural operational semantics consists of a set of rules with the help of which the execution of a concrete program in a given language will be is presented as a sequence of individual computational steps. After applying these rules, some residual calculations may remain, taking into account when further representing the program in the form of a set of computational steps.

https://cdn.pixabay.com/photo/2015/08/24/20/13/welcome-905562_960_720.png
https://cdn.pixabay.com/photo/2015/08/24/20/13/welcome-905562_960_720.png


Natural semantics prohibits such residual calculations and determines at once how the final result will be obtained by the expression.
Axiomatic semantics [25] is a set of logical axioms. For them, any expressions written in this language are considered in the form of logical formulas,
the value of which will be formally derived from the initial set of axioms.
Another important semantic type is translational [45]. They consist of a set of model transformation rules, with the help of which a model in the source language is translated into a model in another language, for which an executable semantics is already set.
For example, it often comes down to generating code in a general-purpose language for which compilers and debuggers already exist (Java, C++, Python, etc.). On the one hand, such an approach requires the developer to have knowledge in both areas (source and target) at once, and on the other hand, it is well received, because the concepts of abstract source domain are transformed into concrete constructions of the executable language.
Translational semantics, among other things, can be used to solve the problem of transformation of models, i.e. to provide transformation of models within one visual language (e.g., for model refactoring, which will be discussed in more detail in section 6), translation of models from one language to another (this is necessary, (e.g. to ensure that the model is exported from one language to another). The second language may be a text one, and then it will be a normal code generation. There are several different ways of specifying the transformation of models, some of which are based on graphical grammars [14]. Thus, the problem of transformation of models is rather actual up to now. One of the ways to solve it was is implemented in MetaLanguage [47].
Having given the main general types of tasks of semantics of programming languages, let's proceed to the consideration of a number of specific approaches proposed in various works and used in software tools.