Abstract
Consider the connection between denotational semantics for a language with goto statements and flow diagrams for programs in such a language. The main point of interest is that the denotational semantics uses a recursively defined environment to give the meaning of labels, while a flow diagram merely has a jump to the appropriate program point. A simple reduction called “indirection elimination” strips away the environment from the denotational semantics and extracts an expression with cycles (circular expression) that is very close to the flow diagram of a program. The same idea applies to associating bodies with recursive procedures, or to any construct whose semantics is not wedded to the syntax. Circular expressions are offered as a useful data structure and conceptual device. Expressions with cycles are well defined mathematical objects — their semantics can be given by unfolding them into infinite structures that have been well studied. The practicality of the elimination of environments has been tested by constructing a trial implementation, which serves as the front end of a semantics directed compiler generator. The implementation takes a denotational semantics of a language and constructs a “black box” that maps programs in the language into an intermediate representation. The intermediate representation is a circular expression.
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
adj: J. A. Goguen, J. W. Thatcher, E. G. Wagner, and J. B. Wright, “Initial algebra semantics and continuous algebras,” J. ACM 24(1), pp. 68–95 (January 1977).
A. V. Aho and J. D. Ullman, “Universality of data retrieval languages,” Sixth Annual ACM Symposium on Principles of Programming Languages, San Antonio TX, pp. 110–120 (January 1979).
A. Church, The calculi of lambda conversion, Annals of Math. Studies, No. 6, Princeton University Press, Princeton NJ (1941).
B. Courcelle and M. Nivat, “Algebraic families of interpretations,” 17th Annual Symposium on Foundations of Computer Science, Houston TX, pp. 137–146 (October 1976).
P. J. Downey, R. Sethi, and R. E. Tarjan, “Variations on the common subexpression problem,” J. ACM, pp. 758–771 (October 1980).
M. J. C. Gordon, The Denotational Description of Programming Languages, Springer-Verlag, New York NY (1979).
C. M. Hoffman and M. J. O'Donnell, "An interpreter generator using tree pattern matching," pp. 169–179 in Sixth Annual ACM Symposium on Principles of Programming Languages, San Antonio TX (January 1979).
G. Huet and J. J. Levy, "Call by need computations in non-ambiguous linear term rewriting systems," Rapport Laboria 359, IRIA (August 1979).
M. Hyland, "A syntactic characterization of the equality in some models for the lambda calculus," J. London Math Soc, Second Series 12(3), pp. 361–370 (February 1976).
S. C. Johnson, "Yacc — yet another compiler compiler," CSTR 32, Bell Laboratories, Murray Hill NJ (July 1975). See the UNIX Programmer's Manual 2 Section 19 (January 1979)
N. D. Jones (ed), in Semantics-Directed Compiler Generation, Lecture Notes in Computer Science 14, Springer-Verlag, Berlin (1980).
B. W. Kernighan and D. M. Ritchie, The C Programming Language, Prentice-Hall, Englewood Cliffs NJ (1978).
B. W. Kernighan, "PIC — A crude graphics language for typesetting," CSTR, Bell Laboratories, Murray Hill NJ (1980).
P. J. Landin, "The mechanical evaluation of expressions," Computer J. 6(4), pp. 308–320 (January 1964).
M. E. Lesk, "Lex — a lexical analyzer generator," CSTR 39, Bell Laboratories, Murray Hill NJ (October 1975). See the version by M. E. Lesk and E. Schmidt in the UNIX Programmer's Manual 2 Section 20 (January 1979)
J.-J. Levy, "An algebraic interpretation of the λβκ-calculus and an application of labelled λ-calculus," Theoretical Computer Science 2(1), pp. 97–114 (June 1976).
J. McCarthy, "Towards a mathematical science of computation," pp. 21–28 in Information Processing 1962, ed. C. M. Popplewell, North-Holland, Amsterdam (1963).
R. E. Milne and C. Strachey, A Theory of Programming Language Semantics, 2 Vols., Chapman and Hall, London, and John Wiley, New York (1976).
P. D. Mosses, "sis — semantics implementation system: Reference manual and user guide," DAIMI MD-30, Department of Computer Science, University of Aarhus, Denmark (August 1979).
P. D. Mosses, "sis — semantics implementation system: Tested examples," DAIMI MD-33, Department of Computer Science, University of Aarhus, Denmark (August 1979).
G. Pacini, C. Montangero, and F. Turini, "Graph representation and computation rules for typeless recursive languages," pp. 158–169 in Automata, Languages and Programming, 2nd Colloquium, Saarbrucken, Lecture Notes in Computer Science 14, Springer-Verlag, Berlin (1974).
D. M. R. Park, "The Y combinator in Scott's lambda-calculus models," unpublished, University of Warwick (1970).
M. Raskovsky, "Compiler generation and denotaional semantics," see [jon80].
J. C. Reynolds, "Semantics of the domain of flow diagrams," J. ACM 24(3), pp. 484–503 (July 1977).
D. S. Scott, "The lattice of flow diagrams," pp. 311–372 in Symposium on Semantics of Algorithmic Languages, ed. E. Engeler, Lecture Notes in Mathematics 188, Springer-Verlag, Berlin (1971).
D. S. Scott, "Lattice theoretic models for various type-free calculi," pp. 157–187 in Proc. IVth International Congress for Logic, Methodology and the Philosophy of Science, Bucharest, ed. P. Suppes et al., North-Holland, Amsterdam (1973).
D. S. Scott, "Data types as lattices," SIAM J. Computing 5(3), pp. 522–587 (September 1976).
J. Staples, "A graph-like lambda calculus for which leftmost-outermost reduction is optimal," pp. 440–455 in Graph-Grammars and Their Application to Computer Science and Biology, Lecture Notes in Computer Science 73, Springer-Verlag, Berlin (1979).
J. E. Stoy, Denotational Semantics, MIT Press, Cambridge MA (1977).
C. Strachey, "Varieties of programming language," pp. 222–233 in International Computing Symposium, Cini Foundation, Venice (April 1972).
B. Stroustrup, "Classes: An abstract data type facility for the C language," CSTR 84, Bell Laboratories, Murray Hill NJ (April 1980).
R. D. Tennent, "The denotational semantics of programming languages," Comm. ACM 19(8), pp. 437–453 (August 1976).
C. P. Wadsworth, "The relation between computational and denotational properties for Scott's D∞-models of the lambda calculus," SIAM J. Computing 5(3), pp. 488–521 (September 1976).
C. P. Wadsworth, "Approximate reductions and lambda calculus models," SIAM J. Computing 7(3), pp. 337–356 (August 1978).
M. Wand, "Deriving target code as a representation of continuation semantics," TR 94, Computer Science Department, Indiana University, Bloomington IN (July 1980).
P. H. Welch, "Continuous semantics and inside-out reductions," pp. 122–146 in λ-calculus and Computer Science Theory, Lecture Notes in Computer Science 37, Springer-Verlag, Berlin (1975).
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1981 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Sethi, R. (1981). Circular expressions: Elimination of static environments. In: Even, S., Kariv, O. (eds) Automata, Languages and Programming. ICALP 1981. Lecture Notes in Computer Science, vol 115. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-10843-2_31
Download citation
DOI: https://doi.org/10.1007/3-540-10843-2_31
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-10843-6
Online ISBN: 978-3-540-38745-9
eBook Packages: Springer Book Archive