From Attribute Grammars to Constraint Handling Rules
نویسندگان
چکیده
Attribute grammars provide a framework to define computations over trees, by decorating those trees with attributes. Attribute grammars have been successfully applied in many areas, including compiler construction and natural language processing. In this paper we present a translation of attribute grammars to Constraint Handling Rules, a formalism based on constraint rewriting. Our translation is able to express in a simple way several extensions to attribute grammars. Higher-order attributes are attributes whose value is again a tree, for which attributes can be computed recursively. Lookahead enables attribute definitions to depend not only on the current node, but also on the shape of its subtrees. Specialization provides a way to override the default computation of an attribute when some conditions are met; a natural way to define exceptions to the default tree processing.
منابع مشابه
Logical Grammars Based on Constraint Handling Rules
A grammar formalism called GHRG based on CHR is proposed analogously to the way Definite Clause Grammars are defined and implemented on top of Prolog. A CHRG executes as a robust bottom-up parser with an inherent treatment of ambiguity. The rules of a CHRG may refer to grammar symbols on either side of a sequence to be matched and this provides a powerful way to let parsing and attribute evalua...
متن کاملCHR as grammar formalism. A first report
Grammars written as Constraint Handling Rules (CHR) can be executed as efficient and robust bottom-up parsers that provide a straightforward, non-backtracking treatment of ambiguity. Abduction with integrity constraints as well as other dynamic hypothesis generation techniques fit naturally into such grammars and are exemplified for anaphora resolution, coordination and text interpretation.
متن کاملParsing Natural Languages with CHR
In this paper, parsing as deduction and constraint programming are brought together to outline a procedure for the specification of constraint-based (chart) parsers. Extending the proposal in Shieber (1995) which provides a meta interpreter for several deduction systems, we show how to directly realize the inference rules for chart parsers as Constraint Handling Rules (Frühwirth, 1998) by viewi...
متن کاملTopological Parsing
We present a new grammar formalism for parsing with freer word-order languages, motivated by recent linguistic research in German and the Slavic languages. Unlike CFGs, these grammars contain two primitive notions of constituency that are used to preserve the semantic or interpretational aspects of phrase structure, while at the same time providing a more efficient backbone for parsing based on...
متن کاملar X iv : c s . PL / 0 10 60 59 v 1 2 9 Ju n 20 01 CHR as grammar formalism A first report
Grammars written as Constraint Handling Rules (CHR) can be executed as efficient and robust bottom-up parsers that provide a straightforward, non-backtracking treatment of ambiguity. Abduction with integrity constraints as well as other dynamic hypothesis generation techniques fit naturally into such grammars and are exemplified for anaphora resolution, coordination and text interpretation.
متن کامل