Attribute grammars as tree transducers over cyclic representations of infinite trees and their descriptional composition - Université de Rennes Accéder directement au contenu
Article Dans Une Revue Theoretical Computer Science Année : 2013

Attribute grammars as tree transducers over cyclic representations of infinite trees and their descriptional composition

Résumé

Evaluation of attributes w.r.t. an attribute grammar can be obtained by inductively computing a function expressing the dependencies of the synthesized attributes on inherited attributes. This higher-order functional approach to attribute evaluation can straightforwardly be implemented in a higher-order lazy functional language like Haskell. The resulting evaluation functions are, however, not easily amenable to optimization when we want to compose two attribute grammars. We present an alternative first-order functional interpretation of attribute grammars where the input tree is replaced by an extended cyclic tree each node of which is aware of its context viewed as an additional child tree. These cyclic representations of zippers (trees with their context) are natural generalizations of doubly-linked lists to trees over an arbitrary signature. Then we show that, up to that representation, descriptional composition of attribute grammars reduces to the composition of tree transducers.
L'évaluation des attributs d'une grammaire attribuée peut s'obtenir inductivement à l'aide de fonctions exprimant les dépendances fonctionnelles entre attributs hérités et synthétisés d'un même noeud. Le codage de ce mécanisme d'évaluation se fait de manière directe dans un langage fonctionnel paresseux (comme Haskell). Néanmoins l'utilisation de fonctions d'ordres supérieurs rend difficile l'optimisation de ces fonctions lorsqu'il s'agit de composer de telles grammaires attribuées. Nous présentons une implémentation alternative de l'évaluation des attributs reposant uniquement sur des fonctions du premier ordre pour laquelle l'arbre d'entrée est néanmoins rendu cyclique en ajoutant un lien de chaque noeud vers son père permettant ainsi l'accès aux informations héritées. Ces représentations de zippers (arbres donnés avec leurs contextes) sont des généralisations naturelles des listes avec double chaînage pour une signature arbitraire. Nous montrons que par ce codage la composition descriptionnelle des grammaires attribuées se réduit à une composition de transducteurs d'arbres.
Fichier non déposé

Dates et versions

hal-00915031 , version 1 (06-12-2013)

Identifiants

Citer

Eric Badouel, Rodrigue Tchougong, Célestin Nkuimi-Jugnia, Bernard Fotsing. Attribute grammars as tree transducers over cyclic representations of infinite trees and their descriptional composition. Theoretical Computer Science, 2013, 480, pp.1-25. ⟨10.1016/j-tcs.2013.02.007⟩. ⟨hal-00915031⟩
260 Consultations
0 Téléchargements

Altmetric

Partager

Gmail Facebook X LinkedIn More