An Algebraic Approach to Compiler Design

This work investigates the design of compilers for procedural languages, based on the algebraic laws which these languages satisfy. The particular strategy adopted is to reduce an arbitrary source program to a general "normal form", capable of representing an arbitrary target machine. This is acheived by a series of normal form reduction theorems which are proved algebraically from the more basic laws. The normal form and the related reduction theorems can then be instantiated to design compilers for distinct target machines. This constitutes the main novelty of the author's approach to compilation, together with the fact that the entire process is formalized within a single and uniform semantic framework of a procedural language and its algebraic laws. Furthermore, by mechanizing the approach using the OBJ3 term rewriting system it is shown that a prototype compiler is developed as a byproduct of its own proof of correctness.

[1]  A. Tarski A LATTICE-THEORETICAL FIXPOINT THEOREM AND ITS APPLICATIONS , 1955 .

[2]  Joseph M. Morris,et al.  A Theoretical Basis for Stepwise Refinement and the Programming Calculus , 1987, Sci. Comput. Program..

[3]  David Gries,et al.  The Science of Programming , 1981, Text and Monographs in Computer Science.

[4]  Tony Hoare A Theory of Programming: Denotational‚ Algebraic‚ and Operational Semantics , 1993 .

[5]  Anders Bondorf,et al.  A self-applicable partial evaluator for the lambda calculus , 1990, Proceedings. 1990 International Conference on Computer Languages.

[6]  John McCarthy,et al.  Correctness of a compiler for arithmetic expressions , 1966 .

[7]  Carroll Morgan Procedures, parameters, and abstraction: Separate concerns , 1988, Sci. Comput. Program..

[8]  Michael Goldsmith The Oxford occam transformation system , 1988 .

[9]  Carsten K. Gomard A self-applicable partial evaluator for the lambda calculus: correctness and pragmatics , 1992, TOPL.

[10]  Ralph-Johan Back,et al.  Correctness preserving program refinements: Proof theory and applications , 1980 .

[11]  Jonathan P. Bowen From Programs to Object Code using Logic and Logic Programming , 1991, Code Generation.

[12]  Martin Fränzle,et al.  Provably Correct Compiler Development and Implementation , 1992, CC.

[13]  Paul H. B. Gardiner,et al.  Reasoning Algebraically about Recursion , 1992, Sci. Comput. Program..

[14]  José Meseguer,et al.  Order-Sorted Algebra I: Equational Deduction for Multiple Inheritance, Overloading, Exceptions and Partial Operations , 1992, Theor. Comput. Sci..

[15]  Jens Palsberg A Provably Correct Compiler Generator , 1992 .

[16]  Hartmut Ehrig,et al.  Programming in the Large with Algebraic Module Specifications (Invited Paper) , 1986, IFIP Congress.

[17]  C. A. R. Hoare,et al.  The Weakest Prespecification , 1987, Information Processing Letters.

[18]  Carroll Morgan,et al.  Programming from specifications , 1990, Prentice Hall International Series in computer science.

[19]  Edsger W. Dijkstra,et al.  A Discipline of Programming , 1976 .

[20]  SøndergaardHarald,et al.  An experiment in partial evaluation , 1985 .

[21]  Jifeng He,et al.  A Provably Correct Hardware Implementation of Occam , 1992 .

[22]  Joseph A. Goguen,et al.  Initial Algebra Semantics and Continuous Algebras , 1977, J. ACM.

[23]  Carroll Morgan,et al.  The specification statement , 1988, TOPL.

[24]  M. Gordon HOL: A Proof Generating System for Higher-Order Logic , 1988 .

[25]  David F. Martin,et al.  Toward compiler implementation correctness proofs , 1986, TOPL.

[26]  C. A. R. Hoare,et al.  Algebra and models , 1993, SIGSOFT '93.

[27]  Alfred V. Aho,et al.  Compilers: Principles, Techniques, and Tools , 1986, Addison-Wesley series in computer science / World student series edition.

[28]  F. Lockwood Morris,et al.  Advice on structuring compilers and proving them correct , 1973, POPL.

[29]  Peter D. Mosses An Introduction to Action Semantics , 1991 .

[30]  Wolfgang Polak,et al.  Compiler Specification and Verification , 1981 .

[31]  Ralph-Johan Back,et al.  Refinement Calculus, Part I: Sequential Nondeterministic Programs , 1989, REX Workshop.

[32]  Peter J. Landin,et al.  PROGRAMS AND THEIR PROOFS: AN ALGEBRAIC APPROACH, , 1968 .

[33]  James W. Thatcher,et al.  More on Advice on Structuring Compilers and Proving them Correct , 1979, Theor. Comput. Sci..