A study of evaluation order semantics in expressions with side effects

Autor: Dragan Maćoš, Nikolaos Papaspyrou
Rok vydání: 2000
Předmět:
Zdroj: Journal of Functional Programming. 10:227-244
ISSN: 1469-7653
0956-7968
DOI: 10.1017/s095679680000366x
Popis: The presence of side effects in even a very simple language of expressions gives rise to a number of semantic questions. The issue of evaluation order becomes a crucial one and, unless a specific order is enforced, the language becomes non-deterministic. In this paper we study the denotational semantics of such a language under a variety of possible evaluation strategies, from simpler to more complex, concluding with unspecified evaluation order, unspecified order of side effects and the mechanism of sequence points that is particular to the ANSI C programming language. In doing so, we adopt a dialect of Haskell as a metalanguage, instead of mathematical notation, and use monads and monad transformers to improve modularity. In this way, only small modifications are required for each transition. The result is a better understanding of different evaluation strategies and a unified way of specifying their semantics. Furthermore, a significant step is achieved towards a complete and accurate semantics for ANSI C.
Databáze: OpenAIRE