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

  • Authors:
  • E. Badouel;R. Tchougong;C. Nkuimi-Jugnia;B. Fotsing

  • Affiliations:
  • Inria Rennes Bretagne-Atlantique, Campus universitaire de Beaulieu, 35042 Rennes Cedex, France and LIRIMA, Yaoundé, Cameroon;University of Ngaoundéré, Cameroon and LIRIMA, Yaoundé, Cameroon;Faculty of Sciences, University of Yaoundé I, Cameroon and LIRIMA, Yaoundé, Cameroon;IUT Victor Fotso, Bandjoun, Cameroon and LIRIMA, Yaoundé, Cameroon

  • Venue:
  • Theoretical Computer Science
  • Year:
  • 2013

Quantified Score

Hi-index 5.23

Visualization

Abstract

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.