scispace - formally typeset
Search or ask a question

Showing papers on "Tree-adjoining grammar published in 1981"


Journal ArticleDOI
TL;DR: The class of output languages of 1V (or L) attribute grammars is the image of the class of IO macro tree languages under all deterministic top-down tree transductions.
Abstract: An attribute grammar is one-visit if the attributes can be evaluated by walking through the derivation tree in such a way that each subtree is visited at most once. One-visit (1V) attribute grammars are compared with one-pass left-to-right (L) attribute grammars and with attribute grammars having only one synthesized attribute (1S). Every 1S attribute grammar can be made one-visit. One-visit attribute grammars are simply permutations of L attribute grammars; thus the classes of output sets of 1V and L attribute grammars coincide, and similarly for 1S and L-1S attribute grammars. In case all attribute values are trees, the translation realized by a 1V attribute grammar is the composition of the translation realized by a 1S attribute grammar with a deterministic top-down tree transduction, and vice versa; thus, using a result of Duske e.a., the class of output languages of 1V (or L) attribute grammars is the image of the class of IO macro tree languages under all deterministic top-down tree transductions.

57 citations


Proceedings ArticleDOI
28 Oct 1981
TL;DR: Deterministic polynomial time algorithms are presented for the equivalence and containment problems for the unambiguous regular and for the linear context-free grammars and simple extensions of the grammar classes are shown to yield problems that are NP-hard or undecidable.
Abstract: The known proofs that the equivalence and containment problems for the regular and for the linear context-free grammars are PSPACE-complete and undecidable, respecitvely, depend upon consideration of ambiguous grammars. We prove that this dependence is inherent. Deterministic polynomial time algorithms are presented for; (1) the equivalence and containment problems for the unambiguous regular grammars; (2) for all k ≥ 2, the equivalence and containment problems for the regular grammars of degree of ambiguity ≤ k; and (3) the problems of determining if an unambiguous linear context-free grammar is equivalent to or contains an arbitrary regular set. Simple extensions of the grammar classes in (1), (2), and (3) are shown to yield problems that are NP-hard or undecidable. Several new results on the relative economy of description of ambiguous versus unambiguous regular and linear contextfree grammars are also obtained. These results depend upon several observations on the solutions of systems of homogeneous linear difference equations and their relationship with the number of strings of a given length generated by an unambiguous regular or linear context-free grammar.

43 citations


Journal ArticleDOI
TL;DR: This paper shows that any attribute grammar G has a reformulation MS (G) within mathematical semantics, and shows that for a grammar G with one of these properties both MS ( G) and the compiler for G can be simplified.
Abstract: Attribute grammars and mathematical semantics are rival language definition methods. We show that any attribute grammar G has a reformulation MS (G) within mathematical semantics. Most attribute grammars have properties that discipline the sets of equations the grammar gives to derivation trees. We list six such properties, and show that for a grammar G with one of these properties both MS (G) and the compiler for G can be simplified. Because these compiler-friendly properties are of independent interest, the paper is written in such a way that the first and last sections do not depend on the other sections.

43 citations


Book
01 Jan 1981
TL;DR: I would like to thank my friends for all the authors shared during my years at Stanford, and if not for Randy Gellerman, this work would have been completed much sooner.
Abstract: Acknowledgements For the past three years, John Hennessy has assisted my study of programming languages. He suggested that I investigate semantics, and later noted that the compiler generator might be feasible. As the research progressed, John helped me t o focus on the most important problems. He made extensive comments on numerous drafts of this thesis and other papers. Zohar Manna and Gio Wiederhold have taken an interest in my career ever since I came to Stanford. Zohar introduced me to denotational semantics; recently, he got me several job offers. Sue Owicki made several insightful comments about the dissertation; Jeff Ullman pointed out that I had omitted some important material. Wolf Polak informed me of people who were doing related work; Ole L. Madsen sent a wealth of research reports. Of Stanford's capable and underpaid staff, Carolyn Tajnai kept me posted on all the deadlines and requirements, and was the friendliest person in the Department. Betty Scott resolved the quarterly funding emergencies. I would like to thank my friends for all we shared during my years at Stanford. Special thanks to Bob and Anne.. If not for Randy Gellerman, this work would have been completed much sooner.

33 citations


Journal ArticleDOI
TL;DR: The effect of various conditions on selectors, which define the way that rewriting is performed, are studied to formalize the notion of ‘using information about the context’ during the rewriting process.

31 citations


Journal ArticleDOI
TL;DR: This work provides a characterization of the class of context-free string languages in terms of DNLC grammars, and studies the use of those Grammars to define string languages.
Abstract: Directed node-label controlled graph grammars (DNLC grammars) are sequential graph rewriting systems. In a direct derivation step of a DNLC grammar a single node is rewritten. Both the rewriting of a node and the embedding of a "daughter graph" in a "host graph" are controlled by the labels of nodes only. We study the use of those grammars to define string languages. In particular we provide a characterization of the class of context-free string languages in terms of DNLC grammars.

28 citations


Journal ArticleDOI
TL;DR: In this paper, the authors explore the implications of taking the answer to be negative and derive an explanation for a range of coordination facts that have remained quite mysterious since they were discovered by J. R. Ross some 15 years ago.
Abstract: A traditional concern of grammarians has been the question of whether the members of given pairs of expressions belong to the same or different syntactic categories. Consider the following example sentences. ( a ) I think Fido destroyed the kennel . ( b ) The kennel, I think Fido destroyed . Are the two underlined expressions members of the same syntactic category or not? The generative grammarians of the last quarter century have, almost without exception, taken the answer to be affirmative. In the present paper I explore the implications of taking the answer to be negative. The changes consequent upon this negative answer turn out to be very far-reaching: (i) it becomes as simple to state rules for constructions of the general type exemplified in ( b ) as it is for the canonical NP VP construction in ( a ); (ii) we immediately derive an explanation for a range of coordination facts that have remained quite mysterious since they were discovered by J. R. Ross some 15 years ago; (iii) our grammars can entirely dispense with the class of rules known as transformations; (iv) our grammars can be shown to be formally equivalent to what are known as the context-free phrase structure grammars; (v) this latter consequence has the effect of making potentially relevant to natural language grammars a whole literature of mathematical results on the parsability and learnability of context-free phrase structure grammars.

26 citations


Journal ArticleDOI
TL;DR: A simple portable interpreter for testing the specifications of problems is presented and specificiations are supposed to be expressed in the formalism of attribute grammars, so that the parsing can be directed by the semantics.
Abstract: A simple portable interpreter for testing the specifications of problems is presented in this paper. These specificiations are supposed to be expressed in the formalism of attribute grammars. The parsing and the semantics evaluation are carried out simultaneously, so that the parsing can be directed by the semantics. This increases the power of the grammars and context sensitive characteristics of a language can be described.

21 citations


Journal ArticleDOI
TL;DR: It is shown that any deterministic algorithm which solves the circularity problem for a grammar must for infinitely many cases use an exponential amount of time.
Abstract: Attribute grammars are an extension of contextfree grammars devised by Knuth as a mechanism for including the semantics of a context-free language with the syntax of the language. The circularity problem for a grammar is to determine whether the semantics for all possible sentences (programs) in fact will be well defined. It is proved that this problem is, in general, computationally intractable. Specifically, it is shown that any deterministic algorithm which solves the problem must for infinitely many cases use an exponential amount of time. An improved version of Knuth's circularity testing algorithm is also given, which actually solves the problem within exponential time.

19 citations


Journal ArticleDOI
TL;DR: It is shown that every “recursively enumerable tree language” can be obtained from a recognizable dag language by such a transduction, and tree languages obtained from some subsets of recognizable dag languages by these transductions are investigated.
Abstract: Directed acyclic graphs (dags) model derivations of phrasestructure grammars analogously to the way that trees model derivations of context-free grammars.

17 citations


Journal ArticleDOI
TL;DR: Sequential and parallel ways of rewriting are investigated and compared in the framework of selective substitution grammars, and several new characterizations of known classes of languages are obtained.
Abstract: Sequential and parallel ways of rewriting are investigated and compared in the framework of selective substitution grammars. New aspects of the notion of generative determinism of a grammar and of the notion of symmetric context are studied. Several new characterizations of known classes of languages are obtained.

Journal ArticleDOI
TL;DR: The proofs are based on a characterization of pure multi-pass attribute grammars in terms of paths through their dependency graphs, and it is shown that the problem of determining whether an arbitrary attribute grammar is pure multipass, is of inherently exponential time complexity.
Abstract: An attribute grammar is pure (left-to-right) multi-pass if a bounded number of left-to-right passes over the derivation tree suffice to compute all its attributes. There is no requirement, as for the usual multi-pass attribute grammars, that all occurrences of the same attribute are computed in the same pass. It is shown that the problem of determining whether an arbitrary attribute grammar is pure multipass, is of inherently exponential time complexity. For fixed k > 0, it can be decided in polynomial time whether an attribute grammar is pure k-pass. The proofs are based on a characterization of pure multi-pass attribute grammars in terms of paths through their dependency graphs. A general result on dependency paths of attribute grammars relates them to (finite-copying) top-down tree transducers. The formal power of k-pass attribute grammars increases with increasing k. Formally, multi-pass attribute grammars are less powerful than arbitrary attribute grammars.

Journal ArticleDOI
TL;DR: It is shown that any well-defined attribute grammar isk-visit for somek and that given a well- defined grammarG and an integerk, it is decidable whetherG isk -visit.
Abstract: It is shown that any well-defined attribute grammar isk-visit for somek. Furthermore it is shown that given a well-defined grammarG and an integerk, it is decidable whetherG isk-visit. Finally we show that thek-visit grammars specify a proper hierarchy with respect to translations.

Book ChapterDOI
19 Apr 1981
TL;DR: This paper is intended to provide a introduction to attribute grammars, a discussion of open problems with a (highly subjective) selection of relevant references and a brief account on the author and P. FRANCHI-ZANNETTACCI's contribution to the subject.
Abstract: This paper is intended to provide a introduction to attribute grammars, a discussion of open problems with a (highly subjective) selection of relevant references and a brief account on the author and P. FRANCHI-ZANNETTACCI's contribution to the subject.

Journal ArticleDOI
TL;DR: An LR parsing technique based on an underlying transformation of the grammar into an equivalent context-free one is presented, which is suitable for inclusion in one-pass compilers and is compared with other proposals appeared in the literature.

Journal ArticleDOI
TL;DR: Selective substitution array grammars are introduced, which abstract the notions of rewriting rules, direct derivation steps, derivations and rewriting in a sequential or parallel way to provide a unified framework for many of the two-dimensional array Grammars in the literature.

Journal ArticleDOI
01 Jun 1981
TL;DR: Two new formalisms are introduced: extended attribute Grammars, which are capable of defining completely the syntax of programming languages, and extended attributed trans!ation grammars which are additionally capable of defines their semantics by translation.
Abstract: Two new formalisms are introduced: extended attribute grammars, which are capable of defining completely the syntax of programming languages, and extended attributed trans!ation grammars, which are additionally capable of defining their semantics by translation. These grammars are concise and readable, and their suitability for language definition is demonstrated by a realistic example. The suitability of a large class of these grammars for compiler construction is also established, by borrowing the techniques already developed for attribute grammars and affix grammars. Revised version of Glasgow Report No.10

Book ChapterDOI
31 Aug 1981
TL;DR: After the introduction of context-free grammars and the use of BNF rules, compilers have been built in which compilers can distinguish methods of syntax-analysis and each of these methods can be shown to be suitable for a certain subclass of the context- free grammARS.
Abstract: After the introduction of context-free grammars and the use of BNF rules, compilers have been built in which we can distinguish methods of syntax-analysis. While initially sometimes many different ideas were used to do syntax-analysis for a given programming language and grammar, later formalizations of these ideas have led to many different parsing methods. Each of these methods can be shown to be suitable for a certain subclass of the context-free grammars.

Journal ArticleDOI
TL;DR: Algorithms are presented for constructing sets of equivalent nonterminals for an expansive tree grammar, for reducing the grammar, and for determining whether two grammars generate the same language.
Abstract: The equivalence of nonterminals of an expansive tree grammar is considered. Algorithms are presented for constructing sets of equivalent nonterminals for an expansive tree grammar, for reducing the grammar, and for determining whether two grammars generate the same language.


Journal ArticleDOI
01 Nov 1981
TL;DR: By requiring that each derivation tree has a computation sequence with a certain property, it is possible to give simple characterizations of well-known subclasses of attribute grammars.
Abstract: A computation sequence for a derivation tree specifies a way of walking through the tree evaluating all the attributes of all nodes. By requiring that each derivation tree has a computation sequence with a certain property, it is possible to give simple characterizations of well-known subclasses of attribute grammars. Especially the absolutely well-defined attribute grammars are considered.

Book ChapterDOI
24 Aug 1981
TL;DR: It is shown that the equivalence problem for LL-regular grammars is decidable by reducing it to the equivalences problem for real-time strict deterministic Grammars.
Abstract: The equivalence problem for context-free grammars is "given two arbitrary grammars, do they generate the same language?" Since this is undecidable in general, attention has been restricted to decidable subclasses of the context-free grammars. For example, the classes of LL(k) grammars and real-time strict deterministic grammars. In this paper it is shown that the equivalence problem for LL-regular grammars is decidable by reducing it to the equivalence problem for real-time strict deterministic grammars. Moreover, we show that the LL-regular equivalence problem is a special case of a more general equivalence problem which is also decidable. Our techniques can also be used to show that the equivalence problem for LR-regular grammars is decidable if and only if the equivalence problem for LR(0) grammars is decidable.

Journal ArticleDOI
TL;DR: Two new grammatical characterizations for the family of LLP( k ) grammars introduced by Lomet are presented, showing that any strict deterministic grammar is an LLP(0) one and proving this class to be a natural cross between LL and LR languages.

Book ChapterDOI
31 Aug 1981
TL;DR: Structural complexity of context-free languages is studied for the description of context -free languages by position restricted grammars.
Abstract: Structural complexity of context-free languages is studied for the description of context-free languages by position restricted grammars.

Journal ArticleDOI
TL;DR: A class of LR parsers is obtained that can perform finite state recognition locally without associated stack manipulations and is examined in detail along with some potential application areas.
Abstract: Although determinisitic pushdown automata and LR(k) parsers are formally equivalent, the latter (unlike the former) stack one symbol for each input symbol read. By relaxing this requirement, we obtain a class of LR parsers that can perform finite state recognition locally without associated stack manipulations. The definition and construction of such stack-controlling LR parsers is examined in detail along with some potential application areas.

Proceedings ArticleDOI
11 May 1981
TL;DR: The problem of testing whether or not an arbitrary context-free grammar is LALR(k) for a fixed integer k ≥ 1 is shown to be PSPACE-complete and the PSPace-hardness of the problem is proved using a transformation from the finite state automaton non-universality problem.
Abstract: The problem of testing whether or not an arbitrary context-free grammar is LALR(k) for a fixed integer k ≥ 1 (i.e. only the subject grammar is a problem parameter) is shown to be PSPACE-complete. The result is in contrast with testing the membership in several other easily parsed classes of grammars, such as LR(k), SLR(k), LC(k) and LL(k) grammars, for which deterministic polynomial time membership tests are known. The PSPACE-hardness of the problem is proved using a transformation from the finite state automaton non-universality problem. A nondeterministic algorithm for constructing sets of LR(k) items leads to a polynomially space bounded algorithm for LALR(k) testing.

Journal ArticleDOI
TL;DR: There exist two distinct infinite hierarchies of AFG which exhaust the derivation bounded AFG and are shown to be strongly incomparable to the other; that is, the first member of each generates some language not generated by a fixed but arbitrary member of the other.
Abstract: An abstract family of grammars (AFG) may be defined as a class of grammars for which the corresponding class of languages forms an abstract family of languages (AFL) as defined by Ginsburg and Greibach. The derivation bounded grammars of Ginsburg and Spanier is an example of an AFG which is properly included in the class of all context-free grammars (also AFG). The main result is that there exist two distinct infinite hierarchies of AFG which exhaust the derivation bounded AFG such that the AFL associated with the kth member of one of these AFG hierarchies is properly included in the AFL associated with the k-lst member of that same hierarchy. Each hierarchy is shown to be strongly incomparable to the other; that is, the first member of each generates some language not generated by a fixed but arbitrary member of the other. We designate these hierarchies as the hierarchies of left and right dominant grammars (languages)

Journal ArticleDOI
Richard A. Upton1
TL;DR: Two major results concerning extended tree adjunct grammars are the primary focus of this article, namely that any recognizable set can be realized as the tree set of such a grammar and that a special form of automaton is sufficient to recognize this new class of tree adjunct Grammars.
Abstract: A new class of tree adjunct grammars is examined which was first introduced in (Joshi et al., 1975). Termed extended tree adjunct grammars, they provide for a more flexible, localized notion of adjunction than is possible within the context of standard tree adjunct grammars. In fact, this new class is more powerful than that of standard tree adjunct grammars since the latter is properly included in the former. The study of extended tree adjunct grammars is motivated by several linguistic considerations relating to weaknesses in the power of standard tree adjunct grammars. First, standard tree adjunct grammars, which can be used to compose the phrase structure grammar of the base component of a Chomsky-like transformational grammar, are not well suited to account for certain aspects of language structure such as the establishment and confirmation of selectional restrictions. Second, since the relational and categorical aspects of structure are simultaneously entailed by the process of adjunction in standard tree adjunct grammars, it is difficult to study each separately. Finally, standard tree adjunct grammars by their very nature do not admit a satisfactory description of the concept of the center of a constituent. Two major results concerning extended tree adjunct grammars are the primary focus of this article. The first and foremost is that any recognizable set can be realized as the tree set of such a grammar. The second is that a special form of automaton, called a deterministic linear bounded tree automaton, is sufficient to recognize this new class of tree adjunct grammars.

Book ChapterDOI
24 Aug 1981

Proceedings Article
01 Jan 1981