Extensible Denotational Language Specifications

Robert Cartwright, Matthias Felleisen. Extensible Denotational Language Specifications. In Masami Hagiya, John C. Mitchell, editors, Theoretical Aspects of Computer Software, International Conference TACS 94, Sendai, Japan, April 19-22, 1994, Proceedings. Volume 789 of Lecture Notes in Computer Science, pages 244-272, Springer, 1994.


Traditional denotational semantics assigns radically different meanings to one and the same phrase depending on the rest of the programming language. If the language is purely functional, the denotation of a numeral is a function from environments to integers. But, in a functional language with imperative control operators, a numeral denotes a function from environments and continuations to integers. This paper introduces a new format for denotational language specifications, extended direct semantics, that accommodates orthogonal extensions of a language without changing the denotations of existing phrases. An extended direct semantics always maps a numeral to the same denotation: the injection of the corresponding number into the domain of values. In general, the denotation of a phrase in a functional language is always a projection of the denotation of the same phrase in the semantics of an extended languageā€”no matter what the extension is. Based on extended direct semantics, it is also possible to construct interpreters for complete languages by composing interpreters for language fragments.