Semantic equivalence of covering attribute grammars
This paper investigates some methods for proving the equivalence of different language specifications that are given in terms of attribute grammars. Different specifications of the same language may be used for different purposes, such as language definition, program verification, or language implementation. The concept of syntactic coverings is extended to the semantic part of attribute grammars. Given two attribute grammars, the paper discusses several propositions that give sufficient conditions for one attribute grammar to be semantically covered by the other one. These tools are used for a comparison of two attribute grammars that specify syntax and semantics of mixed-type expressions. This example shows a trade-off between the complexity of syntactic and semantic specifications. Another example discussed is the equivalence of different attribute grammars for the translation of the while-statement, as used in compilers for top-down and bottom-up syntax analysis.
Key wordsSemantic equivalence attribute grammars equivalent semantic specifications coverings compiler correctness formal specification of semantics semantics of programming languages
Unable to display preview. Download preview PDF.
- 1.M. Marcotty, H. F. Ledgard, and G. V. Bochmann, “A sampler of formal definitions,”ACM Comput. Surv. 8(2):191–276 (June 1976).Google Scholar
- 2.D. E. Knuth, “Semantics of context-free languages,”Math. Syst. Theory 2:127–145 (1968);5:95 (1971).Google Scholar
- 3.C. H. A. Koster, “Affix Grammars,” in J. E. L. Peck, ed.,Algol 68 Implementation (North Holland, Amsterdam, 1971), pp. 95–109.Google Scholar
- 4.G. V. Bochmann, “Semantic evaluation from left to right,”Commun. ACM 19(2): 55–62 (February 1976).Google Scholar
- 5.J. C. Reynolds and R. Haskeil, “Grammatical Coverings,” unpublished manuscript, 1970. See also A. V. Aho and J. P. Ullman,The Theory of Parsing, Translation and Compiling, Vol. I, Sec. 3.4.5 (Prentice Hall, Englewood Cliffs, New Jersey, 1972).Google Scholar
- 6.G. Godbout, “Définition d'un langage intermédiaire pour un systeme d'écriture de compilateurs,” Master's thesis, Département d'Informatique et de Recherche Opérationnelle, Univrsité de Montréal (1976).Google Scholar
- 7.C. Pair, M. Amirchahy, and D. Neel,Correstness Proofs of Text-Processing Descriptions by Attributes (IRIA-Laboria, France, 1976).Google Scholar
- 8.P. M. Lewis, D. J. Rosenkrantz, and R. E. Stearns, “Attributed Translations,”Proceedings of the ACM Symposium on Theory of Computing, Austin (May 1973), pp. 160–171.Google Scholar
- 9.G. V. Bochmann, “Semantic Equivalence of Covering Attribute Grammars,” Publication #218, Département d'I.R.O., Université de Montréal (1975).Google Scholar
- 10.C. L. McGowan, “An Inductive Proof Technique for Interpreter Equivalence,” in R. Austin, ed.,Formal Semantics of Programming Languages (Prentice Hall, Englewood Cliffs, New Jersey, 1972), pp. 139–147.Google Scholar
- 11.C. A. R. Hoare, “Hints on Programming Language Design,” invited address at SIGACT/SIGPLAN Symposium on Principles of Programming Languages, Boston (October 973), and Stanford CS Report.Google Scholar