Can we transform logic programs into attribute grammars?
نویسنده
چکیده
In this paper we study the relationship between Attribute Grammars and Logic Programs, concentrating on transforming logic programs into attribute grammars. This has potential applications in compilation techniques for logic programs. It does not seem possible to transform arbitrary Logic Programs into Attribute Grammars, basically because the same logic variables can sometimes be used as input and sometimes as output. We introduce the notion of an Abstract Attribute Grammar, which is similar to that of an Attribute Grammar with the exception that attributes are not classified into inherited and synthesized, and that the semantic equations are replaced by restriction sets. These sets represent a restriction on the values of attribute occurrences namely, all elements within each set have to be equal. We give an effective translation schema which produces an equivalent Abstract Attribute Grammar for a given Logic Program. We provide a formal proof of this equivalence. We then proceed to classify a class of Abstract Attribute Grammars that can be transformed into Attribute Grammars, and show how to achieve this transformation. By composing both transformations one can transform certain logic programs into attribute grammars. Complete proofs ar5e given. Center for Digital Economy Research Stem School of Business IVorking Paper IS-91-06 Can we transform Logic Programs into Attribute Grammars?
منابع مشابه
NP-Completeness Results Concerning the Transformation of Logic Programs into Attribute Grammars
Attribute grammars and logic programs are two well investigated formalisms, which were related in DM85] for the restricted class of simple logic programs. In this paper we deene the more restricted class of very simple logic programs and we prove that the problem of deciding, whether a given logic program is (very) simple, is NP{complete.
متن کاملAttributed Translation and the Semantics of Natural Language
When Knuth introduced attribute grammars, he observed that although \oriented primarily towards programming languages, the same methods appear to be relevant also in the study of natural languages". We demonstrate that his intuition is computationally justiiable, based on the algebraic equivalence of attribute grammars and Montague's theory of Universal Grammar. We discuss the relationship betw...
متن کاملOn Attribute Grammars Without Atribute Synthesis
We characterize precisely the power of attribute grammars when all functions are identities (such attribute grammars are known to simulate functionless logic programs). In the general case, the problem of deciding whether a given grammar generates a given string is complete for exponential time. Even in the absence of recursion, the problem is complete for polynomial space. In grammars with bou...
متن کاملStrictness Analysis for Attribute Grammars
Attribute grammars may be seen as a (rather specialised) lazy or demand-driven programming language. The “programs” in this language take text or parse trees as input and return values of the synthesised attributes to the root as output. From this observation we establish a framework for abstract interpretation of attribute grammars. The framework is used to construct a strictness analysis for ...
متن کاملLogic grammars and XML Schema
This document describes some possible applications of logic grammars to schema processing as described in the XML Schema specification. The term logic grammar is used to denote grammars written in logic-programming systems; the best known logic grammars are probably definite-clause grammars (DCGs), which are a built-in part of most Prolog systems. This paper works with definite-clause translati...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- ITA
دوره 25 شماره
صفحات -
تاریخ انتشار 1991