LISP compilation viewed as provable semantics preserving program transformation
This paper is based on the view that the main stage of compilation, the code generation phase, has very much in common with the simplification of algebraic expressions. The compiler is seen as symbolic program manipulator, the so-called intermediary language as data-structure (a combination of tree structures and symbol table) to store programs which is convenient for executing simplification, decomposition and optimization steps. The main aspect of code generation is decomposition leading to a program which is still using constructs of the source language but without any composed parts. It is based on a few operations on the internal data-structure-representation of the source program.
This is demonstrated using the language LISP as an example. The decomposed program uses only seven basic language elements of LISP. To prove the preservation of semantics of the decomposing operations (described as transformation rules) we invented new axioms for LISP. Some of the axioms, transformation rules and correctness proofs are given. An example illustrates the steps of decomposition.
KeywordsTransformation Rule Source Language Correctness Proof Abstract Machine Syntax Tree
Unable to display preview. Download preview PDF.
- (BL).B. Buchberger, R. Loos: Algebraic Simplification. in: Computer Algebra — Symbolic and Algebraic Computation, Wien, New York 1982Google Scholar
- (D).L.H.Masinter,L.P.Deutsch: Local optimizations in a compiler for stack-based LISP-machines. 1980 LISP conference.Google Scholar
- (G-H).M.L. Griss,A.C. Hearn: A portable LISP compiler.Software — practice and experience,11,1981,p.541–605Google Scholar
- (Jue).H.Jürgensen: Zur Übersetzbarkeit von Programmiersprachen. in:3.Fachtagung über Programmiersprachen,LNCS 7,Berlin etc. 1974Google Scholar
- (PO).H.Stoyan: Peephole optimizations in the LISP-LAP.Manuscript. Erlangen 1982Google Scholar
- (TB).H.Stoyan: An approach to a theoretical basis for code generation in compilation of higher level programming languages.Manuscript. Erlangen 1983Google Scholar