Conjunctive grammar

1

Conjunctive grammars are a class of formal grammars studied in formal language theory. They extend the basic type of grammars, the context-free grammars, with a conjunction operation. Besides explicit conjunction, conjunctive grammars allow implicit disjunction represented by multiple rules for a single nonterminal symbol, which is the only logical connective expressible in context-free grammars. Conjunction can be used, in particular, to specify intersection of languages. A further extension of conjunctive grammars known as Boolean grammars additionally allows explicit negation. The rules of a conjunctive grammar are of the form where A is a nonterminal and \alpha_1, ..., \alpha_m are strings formed of symbols in \Sigma and V (finite sets of terminal and nonterminal symbols respectively). Informally, such a rule asserts that every string w over \Sigma that satisfies each of the syntactical conditions represented by \alpha_1, ..., \alpha_m therefore satisfies the condition defined by A.

Formal definition

A conjunctive grammar G is defined by the 4-tuple where Σ is a finite set of terminals, disjoint from V, which make up the actual content of the sentence. The set of terminals is the alphabet of the language defined by the grammar G. It is common to list all right-hand sides for the same left-hand side on the same line, using | (the pipe symbol) to separate them. Rules and can hence be written as. Two equivalent formal definitions of the language specified by a conjunctive grammar exist. One definition is based upon representing the grammar as a system of language equations with union, intersection and concatenation and considering its least solution. The other definition generalizes Chomsky's generative definition of the context-free grammars using rewriting of terms over conjunction and concatenation.

Definition by derivation

For any strings, we say u directly yields v, written as , if For any string we say G generates w, written as, if such that. The language of a grammar is the set of all strings it generates.

Example

The grammar, with productions is conjunctive. A typical derivation is It can be shown that. The language is not context-free, proved by the pumping lemma for context-free languages.

Parsing algorithms

Though the expressive power of conjunctive grammars is greater than those of context-free grammars, conjunctive grammars retain some of the latter. Most importantly, there are generalizations of the main context-free parsing algorithms, including the linear-time recursive descent, the cubic-time generalized LR, the cubic-time Cocke-Kasami-Younger, as well as Valiant's algorithm running as fast as matrix multiplication.

Theoretical properties

A property that is undecidable already for context-free languages or finite intersections of them, must be undecidable also for conjunctive grammars; these include: emptiness, finiteness, regularity, context-freeness, The family of conjunctive languages is closed under union, intersection, concatenation and Kleene star, but not under string homomorphism, prefix, suffix, and substring. Closure under complement and under ε-free string homomorphism are still open problems (as of 2001). The expressive power of grammars over a one-letter alphabet has been researched. This work provided a basis for the study of language equations of a more general form.

Synchronized alternating pushdown automata

Aizikowitz and Kaminski introduced a new class of pushdown automata (PDA) called synchronized alternating pushdown automata (SAPDA). They proved it to be equivalent to conjunctive grammars in the same way as nondeterministic PDAs are equivalent to context-free grammars.

This article is derived from Wikipedia and licensed under CC BY-SA 4.0. View the original article.

Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc.
Bliptext is not affiliated with or endorsed by Wikipedia or the Wikimedia Foundation.

View original