Misplaced Pages

Boolean grammar

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

Boolean grammars, introduced by Okhotin [Wikidata], are a class of formal grammars studied in formal language theory. They extend the basic type of grammars, the context-free grammars, with conjunction and negation operations. Besides these explicit operations, Boolean 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 and negation can be used, in particular, to specify intersection and complement of languages. An intermediate class of grammars known as conjunctive grammars allows conjunction and disjunction, but not negation.

The rules of a Boolean grammar are of the form

A α 1 & & α m & ¬ β 1 & & ¬ β n {\displaystyle A\to \alpha _{1}\And \ldots \And \alpha _{m}\And \lnot \beta _{1}\And \ldots \And \lnot \beta _{n}}

where A {\displaystyle A} is a nonterminal, m + n 1 {\displaystyle m+n\geq 1} and α 1 {\displaystyle \alpha _{1}} , ..., α m {\displaystyle \alpha _{m}} , β 1 {\displaystyle \beta _{1}} , ..., β n {\displaystyle \beta _{n}} are strings formed of symbols in Σ {\displaystyle \Sigma } and N {\displaystyle N} . Informally, such a rule asserts that every string w {\displaystyle w} over Σ {\displaystyle \Sigma } that satisfies each of the syntactical conditions represented by α 1 {\displaystyle \alpha _{1}} , ..., α m {\displaystyle \alpha _{m}} and none of the syntactical conditions represented by β 1 {\displaystyle \beta _{1}} , ..., β n {\displaystyle \beta _{n}} therefore satisfies the condition defined by A {\displaystyle A} .

There exist several formal definitions of the language generated by a Boolean grammar. They have one thing in common: if the grammar is represented as a system of language equations with union, intersection, complementation and concatenation, the languages generated by the grammar must be the solution of this system. The semantics differ in details, some define the languages using language equations, some draw upon ideas from the field of logic programming. However, these nontrivial issues of formal definition are mostly irrelevant for practical considerations, and one can construct grammars according to the given informal semantics. The practical properties of the model are similar to those of conjunctive grammars, while the descriptional capabilities are further improved. In particular, some practically useful properties inherited from context-free grammars, such as efficient parsing algorithms, are retained, see Okhotin (2010).

References

External links

Stub icon

This formal methods-related article is a stub. You can help Misplaced Pages by expanding it.

Categories: