Advertisement

Compiler generation from denotational semantics

  • Neil D. Jones
  • David A. Schmidt
Compilers Based On Denotational Semantics
Part of the Lecture Notes in Computer Science book series (LNCS, volume 94)

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.

Keywords

Transition Rule Parse Tree Abstract Interpretation Denotational Semantic Entry State 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. [ADJ79]
    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.Google Scholar
  2. [AhU72]
    Aho, A.V., and Ullman, J.D. The Theory of Parsing, Translation, and Compiling, Prentice-Hall, Englewood Cliffs, N.J. 1972.Google Scholar
  3. [BAC78]
    Backus, J. Can Programming Be Liberated from the von Neumann Style? Comm. ACM 21-8, 1978, 613–641.CrossRefGoogle Scholar
  4. [BER76]
    Berkling, K.J. Reduction Languages for Reduction Machines, Rpt. ISF-76-8, Gesellschaft für Mathematik und Datenverarbeitung MbH, Bonn, 1976.Google Scholar
  5. [COU77]
    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.Google Scholar
  6. [ERS78]
    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.Google Scholar
  7. [GAN79]
    Ganzinger, H. Some Principles for the Development of Compiler Descriptions from Denotational Language Definitions, Tech. Rpt., Technical University of Munich, 1979.Google Scholar
  8. [GOR79]
    Gordon, M.J.C. The Denotational Description of Programming Languages, Springer-Verlag, Berlin, 1979.Google Scholar
  9. [KIT80]
    Kitchen, C. Compiling State Transition Machines into Machine Language, M.S. Thesis, University of Kansas, forthcoming.Google Scholar
  10. [McC63]
    McCarthy, J. Towards a Mathematical Science of Computation, in IFIP 62, C.M. Poppelwell, ed., North-Holland, Amsterdam, 21–28.Google Scholar
  11. [MiS76]
    Milne, R., and Strachey, C. A Theory of Programming Language Semantics, Chapman and Hall, London, 1976.Google Scholar
  12. [MOR73]
    Morris, F.L. Advice on Structuring Compilers and Proving Them Correct, 1st ACM Symposium on Principles of Programming Languages, Boston, 1973, 144–152.Google Scholar
  13. [MOS75]
    Mosses, P.D. Mathematical Semantics and Compiler Generation, Ph.D. Thesis, University of Oxford, 1975.Google Scholar
  14. [MOS79]
    Mosses, P.D. A Constructive Approach to Compiler Correctness, DAIMI IR-16, University of Aarhus, 1979.Google Scholar
  15. [RAS79]
    Raskovsky, M., and Turner, R. Compiler Generation and Denotational Semantics, Fundamentals of Computation Theory, 1979.Google Scholar
  16. [REY72]
    Reynolds, J.C. Definitional Interpreters for Higher-Order Programming Languages, Proc. of the SCM National Conference, Boston, 1972, 717–740.Google Scholar
  17. [REY74]
    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.Google Scholar
  18. [SCH80]
    Schmidt, D.A. Compiler Generation from Lambda-Calculus Definitions of Programming Languages, Ph.D. Thesis, Kansas State University, Manhattan, Kansas, forthcoming.Google Scholar
  19. [STO77]
    Stoy, J.E. Denotational Semantics, MIT Press, Cambridge, Mass., 1977.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1980

Authors and Affiliations

  • Neil D. Jones
    • 1
    • 2
  • David A. Schmidt
    • 2
    • 3
  1. 1.University of KansasLawrenceUSA
  2. 2.University of AarhusAarhusDenmark
  3. 3.Kansas State UniversityManhattanUSA

Personalised recommendations