Initiality for Typed Syntax and Semantics
We give an algebraic characterization of the syntax and semantics of a class of simply–typed languages, such as the language PCF: we characterize simply–typed binding syntax equipped with reduction rules via a universal property, namely as the initial object of some category. For this purpose, we employ techniques developed in two previous works: in , we model syntactic translations between languages over different sets of types as initial morphisms in a category of models. In , we characterize untyped syntax with reduction rules as initial object in a category of models. In the present work, we show that those techniques are modular enough to be combined: we thus characterize simply–typed syntax with reduction rules as initial object in a category. The universal property yields an operator which allows to specify translations — that are semantically faithful by construction — between languages over possibly different sets of types.
We specify a language by a 2–signature, that is, a signature on two levels: the syntactic level specifies the types and terms of the language, and associates a type to each term. The semantic level specifies, through inequations, reduction rules on the terms of the language. To any given 2–signature we associate a category of models. We prove that this category has an initial object, which integrates the types and terms freely generated by the 2–signature, and the reduction relation on those terms generated by the given inequations. We call this object the (programming) language generated by the 2–signature.
KeywordsNatural Transformation Object Type Reduction Rule Initial Object Proof Assistant
Unable to display preview. Download preview PDF.
- 1.Ahrens, B.: Modules over relative monads for syntax and semantics (2011), http://arxiv.org/abs/1107.5252 (to be published in Math. Struct. in Comp. Science)
- 3.Ahrens, B.: Initiality for Typed Syntax and Semantics. Ph.D. thesis, University of Nice Sophia Antipolis, France (2012), http://benedikt-ahrens.org
- 5.Coq: The Coq Proof Assistant (2010), http://coq.inria.fr
- 10.Hirschowitz, A., Maggesi, M.: The algebraicity of the lambda-calculus. CoRR abs/0704.2900 (2007), http://arxiv.org/abs/0704.2900
- 12.Hur, C.K.: Categorical equational systems: algebraic models and equational reasoning. Ph.D. thesis, University of Cambridge, UK (2010)Google Scholar