词条 | Recursive language |
释义 |
In mathematics, logic and computer science, a formal language (a set of finite sequences of symbols taken from a fixed alphabet) is called recursive if it is a recursive subset of the set of all possible finite sequences over the alphabet of the language. Equivalently, a formal language is recursive if there exists a total Turing machine (a Turing machine that halts for every given input) that, when given a finite sequence of symbols as input, accepts it if it belongs to the language and rejects it otherwise. Recursive languages are also called decidable. The concept of decidability may be extended to other models of computation. For example one may speak of languages decidable on a non-deterministic Turing machine. Therefore, whenever an ambiguity is possible, the synonym for "recursive language" used is Turing-decidable language, rather than simply decidable. The class of all recursive languages is often called R, although this name is also used for the class RP. This type of language was not defined in the Chomsky hierarchy of {{Harv|Chomsky|1959}}. All recursive languages are also recursively enumerable. All regular, context-free and context-sensitive languages are recursive. DefinitionsThere are two equivalent major definitions for the concept of a recursive language:
By the second definition, any decision problem can be shown to be decidable by exhibiting an algorithm for it that terminates on all inputs. An undecidable problem is a problem that is not decidable. ExamplesAs noted above, every context-sensitive language is recursive. Thus, a simple example of a recursive language is the set L={abc, {{not a typo|aabbcc}}, {{not a typo|aaabbbccc}}, ...}; more formally, the set is context-sensitive and therefore recursive. Examples of decidable languages that are not context-sensitive are more difficult to describe. For one such example, some familiarity with mathematical logic is required: Presburger arithmetic is the first-order theory of the natural numbers with addition (but without multiplication). While the set of well-formed formulas in Presburger arithmetic is context-free, every deterministic Turing machine accepting the set of true statements in Presburger arithmetic has a worst-case runtime of at least , for some constant c>0 {{harv|Fischer|Rabin|1974}}. Here, n denotes the length of the given formula. Since every context-sensitive language can be accepted by a linear bounded automaton, and such an automaton can be simulated by a deterministic Turing machine with worst-case running time at most for some constant c {{citation needed|date=March 2015}}, the set of valid formulas in Presburger arithmetic is not context-sensitive. On positive side, it is known that there is a deterministic Turing machine running in time at most triply exponential in n that decides the set of true formulas in Presburger arithmetic {{harv|Oppen|1978}}. Thus, this is an example of a language that is decidable but not context-sensitive. Closure propertiesRecursive languages are closed under the following operations. That is, if L and P are two recursive languages, then the following languages are recursive as well:
The last property follows from the fact that the set difference can be expressed in terms of intersection and complement. See also
References
4 : Computability theory|Formal languages|Theory of computation|Recursion |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。