3Semantics of Functional Features
In this chapter, we examine the semantics of the constructs that form the kernel of functional languages. We shall present several methods for expressing the meaning of these constructs, along with different ways of describing their semantics. The functional language studied here corresponds to the functional kernel of MLstyle languages. Many other published presentations of the semantics of functional features of languages exist, for example [DOW 11, FRI01].
3.1. Syntactic aspects
3.1.1. Syntax of a functional kernel
The language studied here, denoted as Exp2, includes only one syntactic category: expressions. Its abstract syntax is defined from a set X of (symbols of) variables, the set K = ℤ ⋃ of constant values (where ℤ is the set of relative integers and the set of booleans) and a set of primitive operators.
Table 3.1 presents the nine construction rules that enable the inductive definition of the set Exp2. An expression in this language can therefore be:
- 1) a constant denoting a value of K, which will be either a relative integer or true or false;
- 2) an identifier, here called a variable to maintain consistency with the usual terminology of expressions;
- 3) an application of a unary operator to an expression;
- 4) an application of a binary ...
Get Concepts and Semantics of Programming Languages 1 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.