Abstract
We consider the problem of automatically deriving correct compilers from relational semantic specifications of programming languages. A relational semantics is an assignment of initial-state final-state relations (defined by means of proof rules) to programs. Compilers are generated in three steps. First, the language definition is transformed into a stack semantics in which the storage of semantic values is made explicit. Next, stack rules are assembled into a socalled language scheme containing exactly one rule for each language construct. We consider languages for which non-deterministic branches may be replaced by deterministic ones. Finally, rules are expanded for the purpose of recursion detection, thus obtaining schemes which may be used for code generation in a syntax-directed compiler.
Chapter PDF
Similar content being viewed by others
Keywords
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
J.A. Goguen, J.W. Thatcher, E.G. Wagner: An Initial Algebra Approach to the Specification, Correctness, and Implementation of Abstract Data Types. In: Current Trends in Programming Methodology, Vol. IV, R.T. Yeh (editor), Prentice-Hall 1978.
D. Bjørner: Formal Development of Interpreters and Compilers, DtH ID673, 1977.
J.W. De Bakker, W.P. De Roever: A Calculus for Recursive Program Schemes. In: Automata, Languages, Programming, Nivat (editor), North-Holland, Amsterdam 1972.
H. Ganzinger: Transforming Denotational Semantics into practical Attribute Grammars. In: Semantics-Directed Compiler Generation, LNCS 94, N.D. Jones (editor), 1980.
M.J.C. Gordon: The Denotational Description of Programming Languages — An Introduction, Springer-Verlag 1979.
I.Greif, A.R. Meyer: Specifying the Semantics of while Programs: A Tutorial and Critique of a Paper by Hoare and Lauer, ACM Transactions on Programming Languages and Systems, Vol. 3, No. 4, Oct. 1981.
C.A.R. Hoare, P.E. Lauer: Consistent and Complementary Formal Theories of the Semantics of Programming Languages, Acta Informatica 3, 1974.
F. Jensen, M. Dam: Automatisk generering af oversœttere udfra operationelt semantiske definitioner af programmeringssprog, M.Sc. Thesis (in danish), Aalborg University Centre, 1985.
N.D. Jones, H. Christiansen: Control Flow Treatment in a Simple Semantics-Directed Compiler Generator, DAIMI PB-137, sept. 1981.
N.D. Jones, D.A. Schmidt: Compiler Generation from Denotational Semantics. In: Semantics-Directed Compiler Generation, LNCS 94, N.D. Jones (editor), 1980.
R. Kowalski: Predicate Logic as Programming Language. In: Information Processing 74, North-Holland 1974.
R. Milne, C. Strachey: A Theory of Programming Language Semantics, Chapman and Hall, 1976.
F.L. Morris: Advice on Structuring Compilers and Proving Them Correct, Proc. 2nd ACM Symp. on Principles of Prog. Lan., 1973.
P. Mosses: SIS-Semantics Implementation System, Reference Manual and User's Guide, DAIMI MD-30, 1979.
P. Mosses: A Constructive Approach to Compiler Correctness. In: Semantics-Directed Compiler Generation, LNCS 94, N.D. Jones (editor), 1980.
H.R. Nielson: Hoare Logic's for Run-time Analysis of Programs, Ph.D. Thesis, University of Edinburgh, oct. 1984.
F. Nielson, H.R. Nielson: Pragmatic Aspects of Two-Level Denotational Meta-Languages, AUC R-85-13.
G.D. Plotkin: A Structural Approach to Operational Semantics, DAIMI FN-19, sept. 1981.
D.A. Schmidt: Detecting Global Variables in Denotational Specifications, ACM Transactions on Programming Languages and Systems, Vol. 7, No. 2, april 1985.
R. Sethi: Control-Flow Aspects of Semantics-Directed Compiling, ACM Transactions on Programming Languages and Systems, Vol. 5, No. 4, oct. 1983.
J.E. Stoy: Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory, MIT Press, 1977.
M. Wand: Deriving Target Code as a Representation of Continuation Semantics, ACM Transactions on Programming Languages and Systems, Vol. 4, No. 3, july 1982.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1986 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Dam, M., Jensen, F. (1986). Compiler generation from relational semantics. In: Robinet, B., Wilhelm, R. (eds) ESOP 86. ESOP 1986. Lecture Notes in Computer Science, vol 213. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-16442-1_1
Download citation
DOI: https://doi.org/10.1007/3-540-16442-1_1
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-16442-5
Online ISBN: 978-3-540-39782-3
eBook Packages: Springer Book Archive