Type Checking Semantic Functions in ASDF

When writing semantic descriptions of programming languages, it is convenient to have tools for checking the descriptions. With frameworks that use inductively defined semantic functions to map programs to their denotations, we would like to check that the semantic functions result in denotations with certain properties. In this paper we present a type system for a modular style of the action semantic framework that, given signatures of all the semantic functions used in a semantic equation defining a semantic function, performs a soft type check on the action in the semantic equation. We introduce types for actions that describe different properties of the actions, like the type of data they expect and produce, whether they can fail or have side effects, etc. A type system for actions which uses these new action types is presented. Using the new action types in the signatures of semantic functions, the language describer can assert properties of semantic functions and have the assertions checked by an implementation of the type system. The type system has been implemented for use in connection with the recently developed formalism ASDF. The formalism supports writing language definitions by combining modules that describe single language constructs. This is possible due to the inherent modularity in ASDF. We show how we manage to preserve the modularity and still perform specialised type checks for each module.

[1]  Peter D. Mosses,et al.  Composing programming languages by combining action-semantics modules , 2001, Sci. Comput. Program..

[2]  Olivier Danvy,et al.  A functional correspondence between monadic evaluators and abstract machines for languages with computational effects , 2003, Theor. Comput. Sci..

[3]  Peter D. Mosses,et al.  An Action Environment , 2004, LDTA@ETAPS.

[4]  David A. Schmidt,et al.  Type Inference for Action Semantics , 1990, ESOP.

[5]  Christian Kirkegaard,et al.  A Runtime System for XML Transformations in Java , 2004, XSym.

[6]  Peter D. Mosses,et al.  Constructive Action Semantics for Core ML , 2005, IEE Proc. Softw..

[7]  Joe B. Wells,et al.  The Essence of Principal Typings , 2002, ICALP.

[8]  Anders Møller,et al.  The Design Space of Type Checkers for XML Transformation Languages , 2004, ICDT.

[9]  Arie van Deursen,et al.  Language Prototyping: An Algebraic Specification Approach , 1996, AMAST Series in Computing.

[10]  Philipp Gerhardy A Quantitative Version of Kirk's Fixed Point Theorem for Asymptotic Contractions , 2004 .

[11]  Peter D. Mosses Action Semantics , 1986, ADT.

[12]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

[13]  David A. Schmidt,et al.  Extraction of Strong Typing Laws from Action Semantics Definitions , 1992, ESOP.

[14]  Action semantics-based compiler generation , 1999 .

[15]  Peter Ørbæk,et al.  Trust and Dependence Analysis , 1997 .

[16]  Olivier Danvy,et al.  An Operational Foundation for Delimited Continuations in the CPS Hierarchy , 2005, Log. Methods Comput. Sci..

[17]  Michael I. Schwartzbach,et al.  The Design Space of Type Checkers for XML Transformation Languages , 2004 .

[18]  Philipp Gerhardy,et al.  Strongly uniform bounds from semi-constructive proofs , 2004, Ann. Pure Appl. Log..

[19]  Deryck Forsyth Brown Sort inference in action semantics , 1996 .