Abstract
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.
Similar content being viewed by others
References
M. Marcotty, H. F. Ledgard, and G. V. Bochmann, “A sampler of formal definitions,”ACM Comput. Surv. 8(2):191–276 (June 1976).
D. E. Knuth, “Semantics of context-free languages,”Math. Syst. Theory 2:127–145 (1968);5:95 (1971).
C. H. A. Koster, “Affix Grammars,” in J. E. L. Peck, ed.,Algol 68 Implementation (North Holland, Amsterdam, 1971), pp. 95–109.
G. V. Bochmann, “Semantic evaluation from left to right,”Commun. ACM 19(2): 55–62 (February 1976).
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).
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).
C. Pair, M. Amirchahy, and D. Neel,Correstness Proofs of Text-Processing Descriptions by Attributes (IRIA-Laboria, France, 1976).
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.
G. V. Bochmann, “Semantic Equivalence of Covering Attribute Grammars,” Publication #218, Département d'I.R.O., Université de Montréal (1975).
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.
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.
Author information
Authors and Affiliations
Additional information
This work was in part supported by the National Research Council of Canada.
Rights and permissions
About this article
Cite this article
Bochmann, G.V. Semantic equivalence of covering attribute grammars. International Journal of Computer and Information Sciences 8, 523–539 (1979). https://doi.org/10.1007/BF00995501
Received:
Revised:
Issue Date:
DOI: https://doi.org/10.1007/BF00995501