<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/index.php?action=history&amp;feed=atom&amp;title=Context-sensitive_language</id>
	<title>Context-sensitive language - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/index.php?action=history&amp;feed=atom&amp;title=Context-sensitive_language"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;action=history"/>
	<updated>2026-07-08T23:08:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;diff=284121&amp;oldid=prev</id>
		<title>en&gt;Download: /* Examples */cleanup and gen fixes using AWB</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;diff=284121&amp;oldid=prev"/>
		<updated>2014-12-01T08:06:22Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Examples: &lt;/span&gt;cleanup and gen fixes using &lt;a href=&quot;/w/index.php?title=Testwiki:AWB&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Testwiki:AWB (page does not exist)&quot;&gt;AWB&lt;/a&gt;&lt;/p&gt;
&lt;a href=&quot;https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;amp;diff=284121&amp;amp;oldid=284120&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>en&gt;Download</name></author>
	</entry>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;diff=284120&amp;oldid=prev</id>
		<title>en&gt;Jochen Burghardt: moved ref.s to central ((cite doi)) template pages, where possible</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;diff=284120&amp;oldid=prev"/>
		<updated>2014-02-15T12:18:07Z</updated>

		<summary type="html">&lt;p&gt;moved ref.s to central ((cite doi)) template pages, where possible&lt;/p&gt;
&lt;a href=&quot;https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;amp;diff=284120&amp;amp;oldid=191&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>en&gt;Jochen Burghardt</name></author>
	</entry>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;diff=191&amp;oldid=prev</id>
		<title>en&gt;David Eppstein: /* Computational properties */ supply requested citations</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Context-sensitive_language&amp;diff=191&amp;oldid=prev"/>
		<updated>2014-01-23T01:45:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Computational properties: &lt;/span&gt; supply requested citations&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;In [[theoretical computer science]], a &amp;#039;&amp;#039;&amp;#039;context-sensitive language&amp;#039;&amp;#039;&amp;#039; is a [[formal language]] that can be defined by a [[context-sensitive grammar]].  That is one of the four types of grammars in the [[Chomsky hierarchy]].&lt;br /&gt;
&lt;br /&gt;
== Computational properties ==&lt;br /&gt;
&lt;br /&gt;
Computationally, a context-sensitive language is equivalent with a linear bounded [[nondeterministic Turing machine]], also called a [[linear bounded automaton]]. That is a non-deterministic Turing machine with a tape of only &amp;#039;&amp;#039;kn&amp;#039;&amp;#039; cells, where &amp;#039;&amp;#039;n&amp;#039;&amp;#039; is the size of the input and &amp;#039;&amp;#039;k&amp;#039;&amp;#039; is a constant associated with the machine. This means that every formal language that can be decided by such a machine is a context-sensitive language, and every context-sensitive language can be decided by such a machine.&lt;br /&gt;
&lt;br /&gt;
This set of languages is also known as &amp;#039;&amp;#039;&amp;#039;NLINSPACE&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;NSPACE&amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;O&amp;#039;&amp;#039;(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;)), because they can be accepted using linear space on a non-deterministic Turing machine.&amp;lt;ref&amp;gt;{{citation&lt;br /&gt;
 | last = Rothe | first = Jörg&lt;br /&gt;
 | isbn = 978-3-540-22147-0&lt;br /&gt;
 | location = Berlin&lt;br /&gt;
 | mr = 2164257&lt;br /&gt;
 | page = 77&lt;br /&gt;
 | publisher = Springer-Verlag&lt;br /&gt;
 | series = Texts in Theoretical Computer Science. An EATCS Series&lt;br /&gt;
 | title = Complexity theory and cryptology&lt;br /&gt;
 | year = 2005}}.&amp;lt;/ref&amp;gt;  The class &amp;#039;&amp;#039;&amp;#039;LINSPACE&amp;#039;&amp;#039;&amp;#039; (or &amp;#039;&amp;#039;&amp;#039;DSPACE&amp;#039;&amp;#039;&amp;#039;(&amp;#039;&amp;#039;O&amp;#039;&amp;#039;(&amp;#039;&amp;#039;n&amp;#039;&amp;#039;))) is defined the same, except using a [[Deterministic automaton|deterministic]] Turing machine.  Clearly &amp;#039;&amp;#039;&amp;#039;LINSPACE&amp;#039;&amp;#039;&amp;#039; is a subset of &amp;#039;&amp;#039;&amp;#039;NLINSPACE&amp;#039;&amp;#039;&amp;#039;, but it is not known whether &amp;#039;&amp;#039;&amp;#039;LINSPACE&amp;#039;&amp;#039;&amp;#039;=&amp;#039;&amp;#039;&amp;#039;NLINSPACE&amp;#039;&amp;#039;&amp;#039;.&amp;lt;ref&amp;gt;{{citation&lt;br /&gt;
 | last = Odifreddi | first = P. G.&lt;br /&gt;
 | isbn = 0-444-50205-X&lt;br /&gt;
 | location = Amsterdam&lt;br /&gt;
 | mr = 1718169&lt;br /&gt;
 | page = 236&lt;br /&gt;
 | publisher = North-Holland Publishing Co.&lt;br /&gt;
 | series = Studies in Logic and the Foundations of Mathematics&lt;br /&gt;
 | title = Classical recursion theory. Vol. II&lt;br /&gt;
 | volume = 143&lt;br /&gt;
 | year = 1999}}.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
One of the simplest context-sensitive languages is &amp;lt;math&amp;gt;L = \{ a^nb^nc^n : n \ge 1 \}&amp;lt;/math&amp;gt;: the language of all strings consisting of &amp;#039;&amp;#039;n&amp;#039;&amp;#039; occurrences of the symbol &amp;quot;a&amp;quot;, then &amp;#039;&amp;#039;n&amp;#039;&amp;#039; &amp;quot;b&amp;quot;&amp;#039;s, then &amp;#039;&amp;#039;n&amp;#039;&amp;#039; &amp;quot;c&amp;quot;&amp;#039;s (abc, aabbcc, aaabbbccc, etc.). A superset of this language, called the Bach language,&amp;lt;ref&amp;gt;{{cite conference |last=Pullum |first=Geoffrey K. |year=1983 |title=Context-freeness and the computer processing of human languages |conference=Proc. 21st Annual Meeting of the [[Association for Computational Linguistics|ACL]] |date=1983}}&amp;lt;/ref&amp;gt; is defined as the set of all strings where &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot; and &amp;quot;c&amp;quot; (or any other set of three symbols) occurs equally often (aabccb, baabcaccb, etc.) and is also context-sensitive.&amp;lt;ref&amp;gt;Bach, E. (1981). [http://people.umass.edu/ebach/papers/nels11.htm &amp;quot;Discontinuous constituents in generalized categorial grammars&amp;quot;]. &amp;#039;&amp;#039;NELS&amp;#039;&amp;#039;, vol. 11, pp.&amp;amp;nbsp;1&amp;amp;ndash;12.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;Joshi, A.; Vijay-Shanker, K.; and Weir, D. (1991). &amp;quot;The convergence of mildly context-sensitive grammar formalisms&amp;quot;. In: Sells, P., Shieber, S.M. and Wasow, T. (Editors). &amp;#039;&amp;#039;Foundational Issues in Natural Language Processing&amp;#039;&amp;#039;. Cambridge MA: Bradford.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Another example of a context-sensitive language that is not context-free is &amp;#039;&amp;#039;L&amp;#039;&amp;#039; = { &amp;#039;&amp;#039;a&amp;lt;sup&amp;gt;p&amp;lt;/sup&amp;gt;&amp;#039;&amp;#039; : &amp;#039;&amp;#039;p&amp;#039;&amp;#039; is a [[prime number]] }. &amp;#039;&amp;#039;L&amp;#039;&amp;#039; can be shown to be a context-sensitive language by constructing a linear bounded automaton which accepts &amp;#039;&amp;#039;L&amp;#039;&amp;#039;. The language can easily be shown to be neither [[regular language|regular]] nor [[context-free language|context free]] by applying the respective [[pumping lemma]]s for each of the language classes to &amp;#039;&amp;#039;L&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
An example of [[recursive language]] that is not context-sensitive is any recursive language whose decision is an [[EXPSPACE]]-hard problem, say, the set of pairs of equivalent [[regular expression]]s with exponentiation.&lt;br /&gt;
&lt;br /&gt;
== Properties of context-sensitive languages ==&lt;br /&gt;
&lt;br /&gt;
* The union, intersection, concatenation and [[Kleene star]] of two context-sensitive languages is context-sensitive.&amp;lt;ref&amp;gt;{{cite book|authors=John E. Hopcroft, Jeffrey D. Ullman|title=Introduction to Automata Theory, Languages, and Computation|publisher=Addison-Wesley|year=1979}}; Exercise 9.10, p.230. In the 2003 edition, the chapter on CSL has been omitted.&amp;lt;/ref&amp;gt;&lt;br /&gt;
* The complement of a context-sensitive language is itself context-sensitive&amp;lt;ref&amp;gt;{{cite journal | last = Immerman | first = Neil | year = 1988 | title =Nondeterministic space is closed under complementation | journal = SIAM J. Comput. | issue = 5 | pages = 935–938 | doi = 10.1137/0217058 | volume = 17 | url=http://www.cs.umass.edu/~immerman/pub/space.pdf }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Every [[context-free grammar|context-free]] language not containing the empty string is context-sensitive.&amp;lt;ref&amp;gt;(Hopcroft, Ullman, 1979); Theorem 9.9 b, p.228&amp;lt;/ref&amp;gt;&lt;br /&gt;
* Membership of a string in a language defined by an arbitrary context-sensitive grammar, or by an arbitrary deterministic context-sensitive grammar, is a [[PSPACE-complete]] problem.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Linear bounded automaton]]&lt;br /&gt;
* [[Chomsky hierarchy]]&lt;br /&gt;
* [[Noncontracting grammar]]s – generate exactly the context-sensitive languages&lt;br /&gt;
* [[Indexed language]]s – a strict subset of the context-sensitive languages&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
* Sipser, M. (1996), &amp;#039;&amp;#039;Introduction to the Theory of Computation&amp;#039;&amp;#039;, PWS Publishing Co.&lt;br /&gt;
&lt;br /&gt;
{{Formal languages and grammars}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Context-Sensitive Language}}&lt;br /&gt;
[[Category:Formal languages]]&lt;/div&gt;</summary>
		<author><name>en&gt;David Eppstein</name></author>
	</entry>
</feed>