Deriving Target Code as a Representation of Continuation Semantics

Reynolds' technique for deriving interpreters is extended to derive compilers from continuation semantics. The technique starts by eliminating h-variables from the semantic equations through the introduction of special-purpose combinators. The semantics of a program phrase may be represented by a term built from these combinators. Then associative and distributive laws are used to simplify the terms. Last, a machine is built to interpret the simplified terms as the functions they represent. The combinators reappear as the instructions of this machine. The technique is illustrated with three examples.

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

[2]  Mitchell Wand Semantics-directed machine architecture , 1982, POPL '82.

[3]  John McCarthy,et al.  Towards a Mathematical Science of Computation , 1962, IFIP Congress.

[4]  Gerald Jay Sussman,et al.  An Interpreter for Extended Lambda Calculus , 1975 .

[5]  Andrew S. Tanenbaum,et al.  Structured Computer Organization , 1976 .

[6]  Joseph E. Stoy,et al.  The Congruence of two Programming Language Definitions , 1981, Theor. Comput. Sci..

[7]  Jacques Loeckx Proceedings of the 2nd Colloquium on Automata, Languages and Programming , 1974 .

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

[9]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[10]  Marvin V. Zelkowitz,et al.  Programming Languages: Design and Implementation , 1975 .

[11]  Gerald J. Sussman,et al.  The dream of a lifetime: A lazy variable extent mechanism , 1980, LISP Conference.

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

[13]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[14]  Gerald Jay Sussman,et al.  The Dream of a Lifetime: A Lazy Scoping Mechanism , 1979 .

[15]  Peter D. Mosses A Constructive Approach to Compiler Correctness , 1980, ICALP.

[16]  Gerald J. Sussman,et al.  Design of a LISP-based microprocessor , 1980, CACM.

[17]  Willard Van Orman Quine,et al.  Word and Object , 1960 .

[18]  Donald E. Knuth The art of computer programming: fundamental algorithms , 1969 .

[19]  John C. Reynolds,et al.  On the Relation between Direct and Continuation Semantics , 1974, ICALP.

[20]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

[21]  Dines Bjørner,et al.  The Vienna Development Method: The Meta-Language , 1978, Lecture Notes in Computer Science.

[22]  Robin Milner,et al.  Proving compiler correctness in a mechanised logic , 1972 .

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

[24]  D. A. Turner,et al.  A new implementation technique for applicative languages , 1979, Softw. Pract. Exp..

[25]  Adrian Tang,et al.  Constructing Call-by-Value Continuation Semantics , 1980, JACM.

[26]  James H. Morris,et al.  Subgoal induction , 1977, CACM.

[27]  Mitchell Wand,et al.  Continuation-Based Program Transformation Strategies , 1980, JACM.

[28]  Robert D. Tennent,et al.  The denotational semantics of programming languages , 1976, CACM.

[29]  Christopher Strachey,et al.  A theory of programming language semantics , 1976 .

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

[31]  P. J. Landin The Mechanical Evaluation of Expressions , 1964, Comput. J..

[32]  Donald Ervin Knuth,et al.  The Art of Computer Programming , 1968 .

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

[34]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

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

[36]  John W. Backus Programming language semantics and closed applicative languages , 1973, POPL '73.