Abstract
In this paper we introduce a new formal model for the concept of syntaxdirected semantics, calledmacro attributed tree transducer (for short: mat tree transducer). This model is based on (noncircular) attributed tree transducers and on macro tree transducers. In the first type of transducer, semantic values are computed by means of meaning names called synthesized attributes, and by means of context names called inherited attributes. Both, synthesized and inherited attributes represent basic semantic values. In the second type of transducer, semantic values are computed by meaning names only which are called states. However, in order to have a means of handling context information, states represent functions over semantic values. The new model integrates attributed tree transducers and macro tree transducers by allowing both, meaning names and context names to represent functions over semantic values. In analogy to the terminology of attributed tree transducers, we call such meaning names and context names also synthesized functions and inherited functions, respectively.
We present an inductive characterization of the tree transformation computed by an mat tree transducer. We prove that mat tree transducers are more powerful than both, attributed tree transducers and macro tree transducers. We characterize mat tree transducers by the two-fold composition of attributed tree transducers. This characterization has three consequences: (1) the height of output trees of mat tree transducers is bounded exponentially in the size of the input tree, (2) the composition hierarchy of mat tree transducers is strict, and (3) mat tree transducers are closed under right-composition with top-down tree transducers, but not under left-composition. Moreover, we prove that the addition of inherited attributes does not increase the computational power of macro tree transducers.
Similar content being viewed by others
References
[ASU86] Aho, A.V., Sethi, R., Ullman, J.D.: Compilers—principles, techniques, and tools. Reading, MA: Addison Wesley 1986
[AU71] Aho, A.V., Ullman, J.D.: Translations on a context free grammar. Inf. Control19, 439–475 (1971)
[AU73] Aho, A.V., Ullman, J.D.: The theory of parsing, translation and compiling, vol. I and vol. II. Englewood Cliffs, NJ: Prentice-Hall 1973
[BC87] Bauderon, M., Courcelle, B.: Graph expressions and graph rewritings. Math. Syst. Theory20, 83–127 (1987)
[CF82] Courcelle, B., Franchi-Zannettacci, P.: Attribute grammars and recursive program schemes. Theoret. Comput. Sci.17, 163–191, 235–257 (1982)
[Cou84] Courcelle, B.: Attribute grammars: definitions, analysis of dependencies, proof methods. In: Lorho, B. (ed.) Methods and tools for compiler construction, pp. 81–102. Cambdrige: Cambridge University Press 1984
[Cou87] Courcelle, B.: An axiomatic definition of context-free rewriting and its application to nlc graph grammars. Theoret. Comput. Sci.55, 141–181 (1987)
[DRT81] Demers, A., Reps, T., Teitelbaum, T.: Incremental evaluation for attribute grammars with application to syntax-directed editors. 8th Assoc. Comput. Sci Princ. of Progr. Lang. 1981, pp. 105–116, 1981
[EH91] Engelfriet, J., Heyker, L.: The string generation power of of context-free hypergraph grammars. J. Comput. Syst. Sci.43, 328–360 (1991)
[EH92] Engelfriet, J., Heyker, L.: Context-free hypergraph grammars have the same term-generating power as attribute grammars. Acta Inf.29, 161–210 (1992)
[Ems91] Emser-Loock, K. Integration von attributierten Grammatiken und primitiv-rekursiven Programmschemata. Master Thesis, RWTH Aachen, 1991
[Eng80] Engelfriet, J.: Some open questions and recent results on tree transducers and tree languages. In: Book, R.V. (ed.) Formal language theory; perspectives and open problems. New York: Academic Press, 1980
[Eng81] Engelfriet, J.: Tree transducers and syntax directed semantics. Technical Report Memorandum 363, Technische Hogeschool Twente, 1981
[Eng84] Engelfriet, J.: Attribute grammars: attribute evaluation methods. In: Lorho, B. (ed.) Methods and tools for compiler construction, pp. 103–138. Cambridge: Cambridge University Press, 1984
[Eng86] Engelfriet, J.: Context-free grammars with storage. Technical Report 86-11, University of Leiden, 1986
[EV85] Engelfriet, J., Vogler, H.: Macro tree transducers. J. Comput. Syst. Sci.31, 71–145 (1985)
[EV86] Engelfriet, J., Vogler, H.: Pushdown machines for the macro tree transducer. Theoret. Comput. Sci.42, 251–368 (1986)
[EV92] Engelfriet, J., Vogler, H.: The translation power of top-down tree-to-graph transducers. Technical Report 92-14, University of Ulm, 1992. To appear in J. Comput. Syst. Sci.
[FHVV93] Fülöp, Z., Herrmann, F., Vagvölgyi, S., Vogler, H.: Tree transducers with external functions. Theoret. Comput. Sci.108, 185–236 (1993)
[Fra82] Franchi-Zannettacci, P.: Attributs semantiques et schemas de programmes. PhD thesis, Universite de Bordeaux I, 1982
[Fül81] Fülöp, Z.: On attributed tree transducers. Acta Cybern.5, 261–279 (1981)
[FV91] Fülöp, Z., Vagvölgyi, S.: Attributed tree transducers cannot induce all deterministic bottom-up tree transformations. Manuscript (submitted for publication, 1991)
[Gie88] Giegerich, R.: Composition and evaluation of attribute coupled grammars. Acta Inf.25, 355–423 (1988)
[Gor79] Gordon, M.J.C.: The denotational description of programming languages; an introduction. Berlin, Heidelberg, New York: Springer 1979
[GTWW77] Goguen, J.A., Thatcher, J.W., Wagner, E.G., Wright, J.B.: Initial algebra semantics and continuous algebras. J. ACM24, 68–95 (1977)
[HK87] Habel, A., Kreowski, H.-J.: May we introduce to you: hyperedge replacement. In: Ehring, H., Nagl, M., Rozenberg, G., Rosenberg, A. (eds.) Graph grammars and their application to computer science (Lect. Notes Comput. Sci., vol. 291, pp. 15–26) Berlin, Heidelberg, New York: Springer 1987
[Hue80] Huet, G.: Confluent reductions: abstract properties and applications to term rewriting systems. J. ACM27, 797–821 (1980)
[Ind79] Indermark, K..: Functional compiler description. Banach Cent. Publ.21, 223–232 (1979)
[Iro61] Irons, E.T.: A syntax directed compiler for ALGOL 60. Commun. ACM4, 51–55 (1961)
[Knu68] Knuth, D.E.: Semantics of context-free languages. Math. Syst. Theory2, 127–145 (1968)
[Kos71] Koster, C.H.A.: Affix grammars. In: Proc. of the IFIP Working Conf. on ALGOL68 Implementation. Amsterdam: North-Holland 1971
[KSV89] Kuiper, M.F., Swierstra, S.D., Vogt, H.H.: Higher order attribute grammars. In: Proc. of SIGPLAN '89, Symp. Progr. Lang. Design and Impl., pp. 131–145. New York: ACM Press 1989
[KV92] Kühnemann, A., Vogler, H.: Synthesized and inherited functions—a new computational model for syntax-directed semantics. Technical Report 92-06, University of Ulm, 1992
[New42] Newman, M.H.A.: On theories with a combinatorial defnition of equivalence. Ann. Math.43, 223–243 (1942)
[Rou70] Rounds, W.C.: Mappings and grammars on trees. Math. Syst. Theory4, 257–287 (1970)
[RT89] Reps, Th.W., Teitelbaum, T.: The synthesizer generator—a system for constructing language-based editors. Berlin, Heidelberg, New York: Springer 1989
[SS71] Scott, D., Strachey, C.: Toward a mathematical semantics for computer languages. In: Fox, J. (ed.) Computers and automata, pp. 19–46. New York: Wiley 1971
[Tha70] Thatcher, J.W.: Generalized2 sequential machine maps. J. Comput. Syst. Sci.4, 339–367 (1970)
[TR81] Teitelbaum, T., Reps, T.: Cornell program synthesizer: syntax-directed programming env. Commun. ACM24, 563–573 (1981)
[Vog91] Vogler, H.: Functional description of the contextual analysis in block-structured programming languages: a case study of tree transducers. Sci. Comput. Program.16, 251–275 (1991)
Author information
Authors and Affiliations
Rights and permissions
About this article
Cite this article
Kühnemann, A., Vogler, H. Synthesized and inherited functions. Acta Informatica 31, 431–477 (1994). https://doi.org/10.1007/BF01178667
Received:
Issue Date:
DOI: https://doi.org/10.1007/BF01178667