Recursive language: Difference between revisions

Content deleted Content added
m See also: Recursion is a function who calls itself
m Reverted edits by Programinfo (talk) to last revision by OAbot: addition of unnecessary/inappropriate external links
Line 3:
In [[mathematics]], [[logic]] and [[computer science]], a [[formal language]] (a [[set (mathematics)|set]] of finite sequences of [[symbol (formal)|symbol]]s taken from a fixed [[alphabet (computer science)|alphabet]]) is called '''recursive''' if it is a [[recursive set|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 (complexity)|R]]''', although this name is also used for the class [[RP (complexity)|RP]].
Line 25:
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 [[First-order_logic#Formulas|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 <math>2^{2^{cn}}</math>, 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 <math>c^n</math> for some constant ''c'' <ref>{{Citecitation webneeded|date=2020-04-21|title=CMarch Programming {{!}} C Tutorial {{!}} C {{!}} C Programming basics|url=https://www.chlopadhe.com/what-is-c-programming-c-tutorials/|access-date=2020-09-08|website=𝖈𝖍𝖑𝖔𝖕𝖆𝖉𝖍𝖊|language=en-US2015}}</ref>, 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 properties ==
Line 43:
*[[Recursively enumerable language]]
*[[Recursion]]
 
* [https://www.chlopadhe.com/recursion-in-c/ Recursion in C]
 
== References ==