Attribute Grammars as Recursion Schemes over Cyclic Representations of Zippers
Author(s) -
Éric Badouel,
Bernard Fotsing,
Rodrigue Tchougong
Publication year - 2011
Publication title -
electronic notes in theoretical computer science
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.242
H-Index - 60
ISSN - 1571-0661
DOI - 10.1016/j.entcs.2011.02.015
Subject(s) - haskell , l attributed grammar , functional programming , computer science , tree adjoining grammar , tree (set theory) , rule based machine translation , attribute domain , context (archaeology) , recursion (computer science) , theoretical computer science , context free grammar , node (physics) , programming language , mathematics , natural language processing , artificial intelligence , combinatorics , rough set , paleontology , structural engineering , engineering , biology
International audienceEvaluation 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 grammars leads to a straightforward implementation using a higher-order lazy functional language like Haskell. The resulting evaluation functions are, however, not easily amenable to optimization rules. We present an alternative first-order functional interpretation of attribute grammars where the input tree is replaced with an extended cyclic tree each node of which is aware of its context viewed as an additional child tree. By the way, we demonstrate that these cyclic representations of zippers (trees with their context) are natural generalizations of doubly-linked lists to trees over an arbitrary signature
Accelerating Research
Robert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom
Address
John Eccles HouseRobert Robinson Avenue,
Oxford Science Park, Oxford
OX4 4GP, United Kingdom