Abstract
A methodology is described for generating provably correct compilers from denotational definitions of programming languages. An application is given to produce compilers into STM code (an STM or state transition machine is a flow-chart-like program, low-level enough to be translated into efficient code on conventional computers). First, a compiler ϕ: LAMC → STM from a lambda calculus dialect is defined. Any denotational definition Δ of language L defines a map \(\bar \Delta\): L → LAMC, so \(\bar \Delta ^ \circ \varphi\) compiles L into STM code. Correctness follows from the correctness of ϕ.
The algebraic framework of Morris, ADJ, etc. is used. The set of STMs is given an algebraic structure so any \(\bar \Delta ^ \circ \varphi\) may be specified by giving a derived operator on STM for each syntax rule of L.
This approach yields quite redundant object programs, so the paper ends by describing two flow analytic optimization methods. The first analyzes an already-produced STM to obtain information about its runtime behaviour which is used to optimize the STM. The second analyzes the generated compiling scheme to determine runtime properties of object programs in general which a compiler can use to produce less redundant STMs.
This publication contains material which may be used in this author's for thcoming doctoral dissertation.
Steven S. Muchnick was also involved in the earlier stages of this research.
Chapter PDF
References
Thatcher, J.W., Wagner, E.G., and Wright, J.B. More Advice on Structuring Compilers and Proving Them Correct, 6th Colloquium, Automata, Languages, and Programming, Graz, Austria, 1979, Springer Lecture Notes in Computer Science 71.
Aho, A.V., and Ullman, J.D. The Theory of Parsing, Translation, and Compiling, Prentice-Hall, Englewood Cliffs, N.J. 1972.
Backus, J. Can Programming Be Liberated from the von Neumann Style? Comm. ACM 21-8, 1978, 613–641.
Berkling, K.J. Reduction Languages for Reduction Machines, Rpt. ISF-76-8, Gesellschaft für Mathematik und Datenverarbeitung MbH, Bonn, 1976.
Cousot, P., and Cousot, R. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Con-Struction or Approximation of Fixpoints, 4th ACM Symposium onPrinciples of Programming Languages, Los Angeles, 1977, 234–252.
Ershov, A.P. On the Essence of Compilation, in Formal Description of Programming Language Concepts, E.J. Neuhold, ed., North-Holland, Amsterdam, 1976, 391–420.
Ganzinger, H. Some Principles for the Development of Compiler Descriptions from Denotational Language Definitions, Tech. Rpt., Technical University of Munich, 1979.
Gordon, M.J.C. The Denotational Description of Programming Languages, Springer-Verlag, Berlin, 1979.
Kitchen, C. Compiling State Transition Machines into Machine Language, M.S. Thesis, University of Kansas, forthcoming.
McCarthy, J. Towards a Mathematical Science of Computation, in IFIP 62, C.M. Poppelwell, ed., North-Holland, Amsterdam, 21–28.
Milne, R., and Strachey, C. A Theory of Programming Language Semantics, Chapman and Hall, London, 1976.
Morris, F.L. Advice on Structuring Compilers and Proving Them Correct, 1st ACM Symposium on Principles of Programming Languages, Boston, 1973, 144–152.
Mosses, P.D. Mathematical Semantics and Compiler Generation, Ph.D. Thesis, University of Oxford, 1975.
Mosses, P.D. A Constructive Approach to Compiler Correctness, DAIMI IR-16, University of Aarhus, 1979.
Raskovsky, M., and Turner, R. Compiler Generation and Denotational Semantics, Fundamentals of Computation Theory, 1979.
Reynolds, J.C. Definitional Interpreters for Higher-Order Programming Languages, Proc. of the SCM National Conference, Boston, 1972, 717–740.
Reynolds, J.C. On the Relation Between Direct and Continuation Semantics, 2nd Colloquium on Automata, Languages, and Programming, Saarbrücken, Springer-Verlag, Berling, 1974, 141–156.
Schmidt, D.A. Compiler Generation from Lambda-Calculus Definitions of Programming Languages, Ph.D. Thesis, Kansas State University, Manhattan, Kansas, forthcoming.
Stoy, J.E. Denotational Semantics, MIT Press, Cambridge, Mass., 1977.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1980 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Jones, N.D., Schmidt, D.A. (1980). Compiler generation from denotational semantics. In: Jones, N.D. (eds) Semantics-Directed Compiler Generation. SDCG 1980. Lecture Notes in Computer Science, vol 94. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-10250-7_19
Download citation
DOI: https://doi.org/10.1007/3-540-10250-7_19
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-10250-2
Online ISBN: 978-3-540-38339-0
eBook Packages: Springer Book Archive