The Semantics of the C Programming Language

We present formal operational semantics for the C programming language. Our starting point is the ANSI standard for C as described in [KR]. Knowledge of C is not necessary (though it may be helpful) for comprehension, since we explain all relevant aspects of C as we proceed. Our operational semantics is based on evolving algebras. An exposition on evolving algebras can be found in the tutorial [Gu]. In order to make this paper self-contained, we recall the notion of a (sequential) evolving algebra in Sect. 0.1. Our primary concern here is with semantics, not syntax. Consequently, we assume that all syntactic information regarding a given program is available to us at the beginning of the computation (via static functions). We intended to cover all constructs of the C programming language, but not the C standard library functions (e.g. fprintf(), fscanf()). It is not di cult to extend our description of C to include any desired library function or functions. Evolving algebra semantic speci cations may be provided on several abstraction levels for the same language. Having several such algebras is useful, for one can examine the semantics of a particular feature of a programming language at the desired level of abstraction, with unnecessary details omitted. It also makes comprehension easier. We present a series of four evolving algebras, each a re nement of the previous one. The nal algebra describes the C programming language in full detail. Our four algebras focus on the following topics respectively:

[1]  Yuri Gurevich,et al.  The evolving algebra semantics of C preliminary version , 1992 .

[2]  Charles Wallace,et al.  The semantics of the C++ programming language , 1995, Specification and validation methods.

[3]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.