Greibach's Theorem
   HOME

TheInfoList



OR:

In
theoretical computer science Theoretical computer science is a subfield of computer science and mathematics that focuses on the Abstraction, abstract and mathematical foundations of computation. It is difficult to circumscribe the theoretical areas precisely. The Associati ...
, in particular in
formal language theory In logic, mathematics, computer science, and linguistics, a formal language is a set of string (computer science), strings whose symbols are taken from a set called "#Definition, alphabet". The alphabet of a formal language consists of symbol ...
, Greibach's theorem states that certain properties of
formal language In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet". The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
classes are undecidable. It is named after the computer scientist
Sheila Greibach Sheila Adele Greibach (born 6 October 1939 in New York City) is an American researcher in formal languages in computing, automata, compiler theory and computer science. She is an Emeritus Professor of Computer Science at the University of Calif ...
, who first proved it in 1963.


Definitions

Given a set Σ, often called "alphabet", the (infinite) set of all strings built from members of Σ is denoted by Σ *. A
formal language In logic, mathematics, computer science, and linguistics, a formal language is a set of strings whose symbols are taken from a set called "alphabet". The alphabet of a formal language consists of symbols that concatenate into strings (also c ...
is a subset of Σ*. If ''L''1 and ''L''2 are formal languages, their product ''L''1''L''2 is defined as the set of all concatenations of a string ''w''1 from ''L''1 with a string ''w''2 from ''L''2. If ''L'' is a formal language and ''a'' is a symbol from Σ, their quotient ''L''/''a'' is defined as the set of all strings that can be made members of ''L'' by appending an ''a''. Various approaches are known from formal language theory to denote a formal language by a finite description, such as a
formal grammar A formal grammar is a set of Terminal and nonterminal symbols, symbols and the Production (computer science), production rules for rewriting some of them into every possible string of a formal language over an Alphabet (formal languages), alphabe ...
or a
finite-state machine A finite-state machine (FSM) or finite-state automaton (FSA, plural: ''automata''), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number o ...
. For example, using an alphabet Σ = , the set Σ* consists of all (decimal representations of) natural numbers, with leading zeroes allowed, and the empty string, denoted as ε. The set ''L''div3 of all naturals divisible by 3 is an infinite formal language over Σ; it can be finitely described by the following
regular grammar In theoretical computer science and formal language theory, a regular grammar is a grammar that is ''right-regular'' or ''left-regular''. While their exact definition varies from textbook to textbook, they all require that * all production rules ...
with start symbol ''S''0: : Examples for finite languages are and ; their product yields the even numbers up to 28. The quotient of the set of prime numbers up to 100 by the symbol 7, 4, and 2 yields the language , , and , respectively.


Formal statement of the theorem

Greibach's theorem is independent of a particular approach to describe a formal language. It just considers a set ''C'' of formal languages over an alphabet Σ∪ such that * each language in ''C'' has a finite description, * each regular language over Σ∪ is in ''C'',This is left implicit in Hopcroft, Ullman, 1979: ''P'' ⊆ ''C'' needs to contain all these regular languages. * given descriptions of languages ''L''1, ''L''2 ∈ ''C'' and of a regular language ''R'' ∈ ''C'', a description of the products ''L''1''R'' and ''RL''1, and of the union ''L''1∪''L''2 can be effectively computed, and * it is undecidable for any member language ''L'' ∈ ''C'' with ''L'' ⊆ Σ* whether ''L'' = Σ*. Let ''P'' be any nontrivial subset of ''C'' that contains all regular sets over Σ∪ and is closed under
quotient In arithmetic, a quotient (from 'how many times', pronounced ) is a quantity produced by the division of two numbers. The quotient has widespread use throughout mathematics. It has two definitions: either the integer part of a division (in th ...
by each single symbol in Σ∪.That is, if ''L'' ∈ ''P'', then ''L''/''a'' ∈ ''P'' for each ''a'' ∈ Σ∪. Then the question whether ''L'' ∈ ''P'' for a given description of a language ''L'' ∈ ''C'' is undecidable.


Proof

Let ''M'' ⊆ Σ*, such that ''M'' ∈ ''C'', but ''M'' ∉ ''P''.The existence of such an ''M'' is required by the above somewhat vague requirement of ''P'' being "nontrivial". For any ''L'' ∈ ''C'' with ''L'' ⊆ Σ*, define φ(''L'') = (''M''#Σ*) ∪ (Σ*#''L''). From a description of ''L'', a description of φ(''L'') can be effectively computed. Then ''L'' = Σ* if and only if φ(''L'') ∈ ''P'': *If ''L'' = Σ*, then φ(''L'') = Σ** is a regular language, and hence in ''P''. *Else, some ''w'' ∈ Σ* \ ''L'' exists, and the quotient φ(''L'')/(#''w'') equals ''M''. Therefore, by repeated application of the quotient-closure property, φ(''L'') ∈ ''P'' would imply ''M'' = φ(''L'')/(#''w'') ∈ ''P'', contradicting the definition of ''M''. Hence, if membership in ''P'' would be decidable for φ(''L'') from its description, so would be ''L''’s equality to Σ* from its description, which contradicts the definition of ''C''.


Applications

Using Greibach's theorem, it can be shown that the following problems are undecidable: * Given a
context-free grammar In formal language theory, a context-free grammar (CFG) is a formal grammar whose production rules can be applied to a nonterminal symbol regardless of its context. In particular, in a context-free grammar, each production rule is of the fo ...
, does it describe a
regular language In theoretical computer science and formal language theory, a regular language (also called a rational language) is a formal language that can be defined by a regular expression, in the strict sense in theoretical computer science (as opposed to ...
? : Proof: The class of context-free languages, and the set of regular languages, satisfies the above properties of ''C'', and ''P'', respectively.Regular languages are context-free: Context-free grammar#Subclasses; context-free languages are closed with respect to union and (even general) concatenation: Context-free grammar#Closure properties; equality to Σ* is undecidable for context-free languages: Context-free grammar#Universality; regular languages are closed under (even general) quotients: Regular language#Closure properties. * Given a
context-free language In formal language theory, a context-free language (CFL), also called a Chomsky type-2 language, is a language generated by a context-free grammar (CFG). Context-free languages have many applications in programming languages, in particular, mos ...
, is it inherently ambiguous? : Proof: The class of context-free languages, and the set of context-free languages that aren't inherently ambiguous, satisfies the above properties of ''C'', and ''P'', respectively.Hopcroft, Ullman, 1979, p.206, Theorem 8.16 * Given a
context-sensitive grammar A context-sensitive grammar (CSG) is a formal grammar in which the left-hand sides and right-hand sides of any Production (computer science), production rules may be surrounded by a context of terminal symbol, terminal and nonterminal symbols. Cont ...
, does it describe a
context-free language In formal language theory, a context-free language (CFL), also called a Chomsky type-2 language, is a language generated by a context-free grammar (CFG). Context-free languages have many applications in programming languages, in particular, mos ...
? See also Context-free grammar#Being in a lower or higher level of the Chomsky hierarchy.


Notes


References

{{reflist Formal languages Mathematical theorems