Extensible Denotational Language Speciications Extensible Denotational Language Specifications ? 2 Extensible Operational Semantics Are Expressions, with X Possibly Free in E, 4

Traditional denotational semantics assigns radically diier-ent meanings to one and the same phrase depending on the rest of the programming language. If the language is purely functional, the deno-tation 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 speciications, 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. A programming language like Scheme 25], Common LISP 32], or ML 19] consists of a rich functional core, augmented by destructive operations on data objects, control constructs, and possibly other imperative operators. Traditional denotational language speciications 1, 15, 27, 35] cope with these constructs by interpreting program phrases as functions that map environments stores continuations to values stores. Programmers, however, rely on simpler semantic descriptions when they reason about program phrases. Most program phrases do not exploit the full generality of the language, permitting their semantics to ? The paper is an extended and revised version of Rice be analyzed using a simpler semantic model. For example, if a program phrase is purely functional and its free variables are always bound to eeect-free procedures , it can be interpreted as a function mapping environments to values. Similarly, if an imperative program phrase does not use general control operators like callcc, goto, or catch and its free variables are always bound to values and procedures conforming to the same constraint, it can be interpreted as a function mapping environments stores into values stores. Unfortunately, denotational deenitions of practical programming languages are written in a form that makes it diicult to extract a simpliied deenition for a disciplined subset|much less prove that the deenitions are equivalent over the restricted language. Another way to describe the same problem is to observe what happens to the meanings of simple program …

[1]  John C. Reynolds,et al.  On the Relation between Direct and Continuation Semantics , 1974, ICALP.

[2]  Dana S. Scott,et al.  Data Types as Lattices , 1976, SIAM J. Comput..

[3]  G. Plotkin Tω as a Universal Domain , 1978 .

[4]  Michael J. C. Gordon,et al.  The Denotational Description of Programming Languages , 1979, Springer New York.

[5]  Mitchell Wand,et al.  Continuation-Based Multiprocessing , 1980, High. Order Symb. Comput..

[6]  Adrian Tang,et al.  Constructing Call-by-Value Continuation Semantics , 1980, JACM.

[7]  Joseph E. Stoy,et al.  The Congruence of two Programming Language Definitions , 1981, Theor. Comput. Sci..

[8]  D. Scott Domains for Denotational Semantics , 1982, ICALP.

[9]  Andrzej Tarlecki,et al.  Naive Denotational Semantics , 1983, IFIP Congress.

[10]  Daniel P. Friedman,et al.  Programming with Continuations , 1984 .

[11]  Albert R. Meyer,et al.  Continuation Semantics in Typed Lambda-Calculi (Summary) , 1985, Logic of Programs.

[12]  William D. Clinger,et al.  Revised3 report on the algorithmic language scheme , 1986, SIGP.

[13]  David A. Schmidt,et al.  Denotationaisemantics: a methodology for language development , 1986 .

[14]  Mitchell Wand,et al.  Obtaining Coroutines with Continuations , 1986, Comput. Lang..

[15]  Matthias Felleisen,et al.  A Reduction Semantics for Imperative Higher-Order Languages , 1987, PARLE.

[16]  Matthias Felleisen,et al.  A Syntactic Theory of Sequential Control , 1987, Theor. Comput. Sci..

[17]  Lloyd Allison,et al.  A Practical Introduction to Denotational Semantics , 1987 .

[18]  Matthias Felleisen,et al.  A Syntactic Theory of Sequential State , 1989, Theor. Comput. Sci..

[19]  Lloyd ALLISON Direct Semantics and Exceptions Define Jumps and Coroutines , 1989, Inf. Process. Lett..

[20]  Robert Hieb,et al.  Engines From Continuations , 1989, Comput. Lang..

[21]  Linda G. DeMichiel Overview: The common lisp object system , 1989, LISP Symb. Comput..

[22]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[23]  Peter D. Mosses,et al.  Denotational semantics , 1995, LICS 1995.

[24]  Carl A. Gunter,et al.  In handbook of theoretical computer science , 1990 .

[25]  Matthias Felleisen,et al.  Parameter-passing and the lambda calculus , 1991, POPL '91.

[26]  Robert Hieb,et al.  The Revised Report on the Syntactic Theories of Sequential Control and State , 1992, Theor. Comput. Sci..

[27]  Philip Wadler,et al.  The essence of functional programming , 1992, POPL '92.

[28]  Robert Cartwright,et al.  A practical soft type system for scheme , 1997, TOPL.

[29]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[30]  Guy L. Steele,et al.  Building interpreters by composing monads , 1994, POPL '94.

[31]  Andrzej Filinski,et al.  Representing monads , 1994, POPL '94.

[32]  R. Kent Dybvig,et al.  The Scheme Programming Language , 1995 .