Abstract
We propose a denotational semantics for the two-level language of [GJ91, Gom92], and prove its correctness w.r.t. a standard denotational semantics. Other researchers (see [Gom91, GJ91, Gom92, JGS93, HM94]) have claimed correctness for lambda-mix (or extensions of it) based on denotational models, but the proofs of such claims rely on imprecise definitions and are basically flawed. At a technical level there are two important differences between our model and more naive models in Cpo: the domain for interpreting dynamic expressions is more abstract (we interpret code as λ-terms modulo α-conversion), the semantics of newname is handled differently (we exploit functor categories). The key idea is to interpret a two-level language in a suitable functor category Cpo Dop rather than Cpo. The semantics of newname follows the ideas pioneered by Oles and Reynolds for modeling the stack discipline of Algol-like languages. Indeed, we can think of the objects of D (i.e. the natural numbers) as the states of a name counter, which is incremented when entering the body of a λ-abstraction and decremented when coming out. Correctness is proved using Kripke logical relations (see [MM91, NN92]).
Chapter PDF
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
M. Fiore, E. Moggi, and D Sangiorgi. A fully-abstract model for the pi-calculus. In 11th LICS Conference. IEEE, 1996.
K. Gomard and N. Jones. A partial evaluator for the untyped lambda calculus. J. of Func. Program., 1(1), 1991.
Carsten Krogh Gomard. Program Analysis Matters. PhD thesis, DIKU, November 1991. DIKU report 91/17.
K. Gomard. A self-applicable partial evaluator for the lambda calculus. ACM Trans. on Progr. Lang. and Systems, 14(2), 1992.
F. Henglein and C. Mossin. Polymorphic binding-time analysis. In D. Sanella, editor, ESOP'94, volume 788 of LNCS. Springer Verlag, 1994.
Neil D. Jones, Carsten K. Gomard, and Peter Sestoft. Partial Evaluation and Automatic Program Generation. Prentice Hall International, 1993.
F.W. Lawvere. Functorial semantics of algebraic theories. Proc. Nat. Acad. Sci. U.S.A., 50, 1963.
John C. Mitchell. Foundations of Programming Languages. The MIT Press, Cambridge, MA, 1996.
J. Mitchell and E. Moggi. Kripke-style models for typed lambda calculus. Journal of Pure and Applied Algebra, 51, 1991.
E. Moggi. Notions of computation and monads. Information and Computation, 93(1), 1991.
E. Moggi. A categorical account of two-level languages. In MFPS XIII, ENTCS. Elsevier, 1997.
E. Moggi. Metalanguages and applications. In Semantics and Logics of Computation, Publications of the Newton Institute. CUP, 1997.
A. Meyer and M. Wand. Continuation semantics in typed lambda calculus. In R. Parikh, editor, Logics of Programs '85, volume 193 of LNCS. Springer Verlag, 1985.
F. Nielson and H.R. Nielson. Two-Level Functional Languages. Number 34 in Cambridge Tracts in Theoretical Computer Science. CUP, 1992.
F.J. Oles. Type algebras, functor categories and block structure. In M. Nivat and J.C. Reynolds, editors, Algebraic Methods in Semantics, 1985.
P.W. O'Hearn and R.D. Tennent. Semantics of local variables. In Applications of Categories in Computer Science, number 177 in L.M.S. Lecture Notes Series. CUP, 1992.
A.M. Pitts and I.D.B. Stark. Observable properties of higher order functions that dynamically create local names, or: What's new? In Math. Found. of Comp. Sci. '93, volume 711 of LNCS. Springer Verlag, 1993.
R.D. Tennent. Semantics of Programming Languages. Prentice Hall, 1991.
Mitchell Wand. Specifying the correctness of binding-time analysis. Journal of Functional Programming, 3(3):365–387, July 1993.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1998 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Moggi, E. (1998). Functor categories and two-level languages. In: Nivat, M. (eds) Foundations of Software Science and Computation Structures. FoSSaCS 1998. Lecture Notes in Computer Science, vol 1378. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0053552
Download citation
DOI: https://doi.org/10.1007/BFb0053552
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-64300-5
Online ISBN: 978-3-540-69720-6
eBook Packages: Springer Book Archive