Denotational Semantics of Evaluation Order in Expressions with Side Effects

Abstract

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 strict order is enforced, the language becomes non-deterministic. In this paper we study the 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 the denotational semantics approach and use monads to improve modularity and to reduce the number of changes required for each transition. The result is a better understanding of different evaluation strategies, possibly leading to non-determinism in the presence of side effects, and a unified way of specifying their semantics. Furthermore, a significant step is achieved towards a correct denotational semantics f..

    Similar works

    Full text

    thumbnail-image

    Available Versions