Compiler Generation for Substructural Operational Semantics

Semantic specifications of programming languages can be used to assist or automate compiler generation. Semantics-driven compiler generation has already been studied for specification techniques such as denotational semantics, natural semantics, structural operational semantics and action semantics. Compilers generated from such specifications bring some of the performance benefits of traditional compilers to prototype specifications of programming languages while reducing or eliminating the logistical overhead of implementing a separate piece of software and proving its correctness. This dissertation describes techniques that can be used to synthesize a compiler and virtual machine from a Substructural Operational Semantics (SSOS). Whereas prior work relied on techniques such as partial evaluation and staged computation to derive compilers from interpreters, we use linear logical approximations for synthesis. Our methodology is illustrated using language features from C0, a safe subset of C used to teach imperative programming at Carnegie Mellon University.

[1]  Neil D. Jones,et al.  What Not to Do When Writing an Interpreter for Specialisation , 1996, Dagstuhl Seminar on Partial Evaluation.

[2]  Frank Pfenning,et al.  Higher-order abstract syntax , 1988, PLDI '88.

[3]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.

[4]  Peter D. Mosses,et al.  Theory and Practice of Action Semantics , 1996, MFCS.

[5]  D. Walker,et al.  A concurrent logical framework I: Judgments and properties , 2003 .

[6]  David Walker,et al.  A Concurrent Logical Framework II: Examples and Applications , 2003 .

[7]  Olivier Danvy,et al.  Semantics-Based Compiling: A Case Study in Type-Directed Partial Evaluation , 1996, PLILP.

[8]  Frank Pfenning,et al.  A judgmental reconstruction of modal logic , 2001, Mathematical Structures in Computer Science.

[9]  Gordon D. Plotkin,et al.  A structural approach to operational semantics , 2004, J. Log. Algebraic Methods Program..

[10]  Olivier Danvy,et al.  From Interpreter to Compiler and Virtual Machine: A Functional Derivation , 2003 .

[11]  Harald Ganzinger,et al.  Logical Algorithms , 2002, ICLP.

[12]  Frank Pfenning Substructural Operational Semantics , 2006 .

[13]  Jack Minker,et al.  Logic and Databases: A 20 Year Retrospective , 1996, Logic in Databases.

[14]  P. Lee The automatic generation of realistic compilers from high-level semantic descriptions , 1987 .

[15]  Frank Pfenning,et al.  Mode and Termination Checking for Higher-Order Logic Programs , 1996, ESOP.

[16]  Frank Pfenning Substructural Operational Semantics and Linear Destination-Passing Style (Invited Talk) , 2004, APLAS.

[17]  Peter D. Mosses Foundations of Modular SOS , 1999, MFCS.

[18]  Bertram Raphael,et al.  The use of theorem-proving techniques in question-answering systems , 1968, ACM National Conference.

[19]  Chris Lattner,et al.  LLVM: AN INFRASTRUCTURE FOR MULTI-STAGE OPTIMIZATION , 2000 .

[20]  David A. Schmidt,et al.  Compiler generation from denotational semantics , 1980, Semantics-Directed Compiler Generation.

[21]  Peter Ørbæk OASIS: An Optimizing Action-Based Compiler Generator , 1994, CC.

[22]  Dino Pedreschi,et al.  Reasoning about Termination of Pure Prolog Programs , 1993, Inf. Comput..

[23]  Andre Scedrov,et al.  Relating state-based and process-based concurrency through linear logic (full-version) , 2009, Inf. Comput..

[24]  Robert J. Simmons,et al.  Linear logical approximations , 2009, PEPM '09.

[25]  Olivier Danvy,et al.  A functional correspondence between evaluators and abstract machines , 2003, PPDP '03.

[26]  Furio Honsell,et al.  A framework for defining logics , 1993, JACM.

[27]  Gérard P. Huet,et al.  Proving and applying program transformations expressed with second-order patterns , 1978, Acta Informatica.

[28]  Robert J. Simmons,et al.  Substructural Operational Semantics as Ordered Logic Programming , 2009, 2009 24th Annual IEEE Symposium on Logic In Computer Science.

[29]  Yoshihiko Futamura,et al.  Partial Evaluation of Computation Process--An Approach to a Compiler-Compiler , 1999, High. Order Symb. Comput..

[30]  Jesper Jørgensen,et al.  Compiler Generation by Partial Evaluation , 1992 .

[31]  Christopher Strachey,et al.  Toward a mathematical semantics for computer languages , 1971 .