Boolean grammars: expressive power and parsing algorithms
Kai Salomaa, Alexander Okhotin
Abstract
Kai Salomaa, Alexander Okhotin
Abstract
Context-free grammars are extended with Boolean operations, yielding a new language specification formalism named Boolean grammars. By virtue of having been produced out of two intuitively clear fundamental concepts, Boolean grammars retain some of their genuine clarity, at the same time allowing to express more than could be expressed using the context-free grammars. The semantics of the formalism is defined using language equations. As a by-product of this definition, the fundamentals of the theory of language equations with Boolean operations are established. Various sample grammars are given, ranging from the descriptions of the standard examples of non-context-free languages to a complete specification of the syntax of a simple imperative programming language. This shows Boolean grammars to be a sufficiently potent tool for language specification. At the same time, the major context-free parsing techniques, such as recursive descent, generalized LR and the Cocke-Kasami-Younger tabular algorithm, are demonstrated to have extensions for Boolean grammars. Several practically usable parsing algorithms for Boolean grammars are constructed and implemented in a research-oriented parser generator. It is shown that the increased expressive power of Boolean grammars does not demand sacrifices in terms of parsing complexity. It is proved that the languages generated by Boolean grammars are context-sensitive. One more class of grammars, called dual concatenation grammars, is introduced and shown to be equivalent to Boolean grammars. A subclass of Boolean grammars, the linear Boolean grammars, is shown to be computationally equivalent to trellis automata and to linear conjunctive grammars.
A significance statement is not available in the OpenAlex record.
A contribution statement is not available in the OpenAlex record.
Method details are not available in the OpenAlex metadata.
Findings are not separately available in the OpenAlex metadata.
Limitations are not available in the OpenAlex metadata.
Application details are not available in the OpenAlex metadata.
Context-free grammars are extended with Boolean operations, yielding a new language specification formalism named Boolean grammars. By virtue of having been produced out of two intuitively clear fundamental concepts, Boolean grammars retain some of their genuine clarity, at the same time allowing to express more than could be expressed using the context-free grammars. The semantics of the formalism is defined using language equations. As a by-product of this definition, the fundamentals of the theory of language equations with Boolean operations are established. Various sample grammars are given, ranging from the descriptions of the standard examples of non-context-free languages to a complete specification of the syntax of a simple imperative programming language. This shows Boolean grammars to be a sufficiently potent tool for language specification. At the same time, the major context-free parsing techniques, such as recursive descent, generalized LR and the Cocke-Kasami-Younger tabular algorithm, are demonstrated to have extensions for Boolean grammars. Several practically usable parsing algorithms for Boolean grammars are constructed and implemented in a research-oriented parser generator. It is shown that the increased expressive power of Boolean grammars does not demand sacrifices in terms of parsing complexity. It is proved that the languages generated by Boolean grammars are context-sensitive. One more class of grammars, called dual concatenation grammars, is introduced and shown to be equivalent to Boolean grammars. A subclass of Boolean grammars, the linear Boolean grammars, is shown to be computationally equivalent to trellis automata and to linear conjunctive grammars.
Key concepts: Indexed grammar, Phrase structure grammar, Context-sensitive grammar, Tree-adjoining grammar, Definite clause grammar, Computer science, L-attributed grammar, Context-free grammar