State variable filter: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
 
en>Krishnavedala
 
Line 1: Line 1:
In [[computer science]], a '''linear grammar''' is a [[context-free grammar]] that has at most one nonterminal in the [[Left-hand side and right-hand side of an equation|right hand side]] of its productions.


A '''linear language''' is a language generated by some linear grammar.


==Example==
I woke up another day and realised - I've been single for a little while at the moment and after much intimidation from buddies I now find myself registered for web dating. They guaranteed me that there are lots of pleasant, regular and fun people to fulfill, so the pitch is gone by here!<br>My pals  [http://www.ladyhawkshockey.org luke bryan vip tickets for sale] and household are awe-inspiring and spending some time together at tavern gigabytes or dinners  [http://lukebryantickets.citizenswebcasting.com where is the luke bryan concert] is always vital. As I find you could not own a nice dialogue together with the sound I have never been  [http://www.cinemaudiosociety.org upcoming luke bryan concerts] in to nightclubs. Additionally, I have two definitely cheeky and quite cute canines that are almost always ready to meet up new folks.<br>I attempt to keep as physically healthy as potential staying at the [http://search.about.com/?q=gymnasium gymnasium] several times a week. I love my sports and strive to play or see while many a potential. Being wintertime I am going to frequently at Hawthorn fits. Note: In case that you will considered purchasing an athletics I do not brain, I have observed the carnage of wrestling matches at stocktake sales.<br><br>Here is my weblog; luke bryan tickets tampa ([http://lukebryantickets.omarfoundation.org this])
A simple linear grammar is ''G'' with ''N'' = {S}, Σ = {a, b}, ''P'' with start symbol ''S'' and rules
: S &rarr; aSb
: S &rarr; &epsilon;
It generates the language <math>\{ a^ib^i \; | \; i \geq 0\}</math>.
 
==Relationship with regular grammars==
Two special types of linear grammars are the following:
* the '''left-linear''' or [[Regular grammar|left regular grammars]], in which '''all nonterminals''' in right hand sides are '''at the left ends''';
* the '''right-linear''' or right regular grammars, in which '''all nonterminals''' in right hand sides are '''at the right ends'''.
Collectively, these two special types of linear grammars are known as the [[regular grammar]]s; both can describe exactly the [[regular language]]s.
 
Another special type of linear grammar is the following:
* linear grammars in which all nonterminals in right hand sides are at the left or right ends, but not necessarily all at the same end.
 
By inserting new nonterminals, every linear grammar can be brought into this form without affecting the language generated.
For instance, the rules of ''G'' above can be replaced with
: S &rarr; aA
: A &rarr; Sb
: S &rarr; &epsilon;
 
Hence, linear grammars of this special form can generate all [[linear language]]s.
 
==Expressive power==
We have seen that all regular languages are linear; the example gave a linear, non-regular language.
All linear languages are [[context-free language|context-free]] by definition; a simple example of a context-free, non-linear language is the [[Dyck language]] of well-balanced bracket pairs. Hence, the regular languages are a [[proper subset]] of the linear ones, which in turn are a proper subset of the context-free languages.
 
While the linear languages that are regular languages are deterministic, there exist linear languages that are nondeterministic. For example, the language of even-length [[palindrome]]s on the alphabet of 0 and 1 has the linear grammar S → 0S0 | 1S1 | ε.  An arbitrary string of this language cannot be parsed without reading all its letters first which means that a pushdown automaton has to try alternative state transitions to accommodate for the different possible lengths of a semi-parsed string.<ref>{{cite book | last = [[John Hopcroft|Hopcroft]] | first = John | coauthors = [[Rajeev Motwani]] & [[Jeffrey Ullman]] | title = [[Introduction to automata theory, languages, and computation]] 2nd edition | year = 2001 | publisher = Addison-Wesley | pages = 249–253 }}</ref> This language is nondeterministic. Since nondeterministic context-free languages cannot be accepted in linear time, linear languages cannot be accepted in linear time in the general case. Furthermore, it is undecidable whether a given context-free language is a linear context-free language.<ref>{{cite journal | last=Greibach | first=Sheila | title=The Unsolvability of the Recognition of Linear Context-Free Languages |date=October 1966 | work=Journal of the ACM | volume=13 | issue=4}}</ref>
 
==Closure properties==
If ''L'' is a linear language and ''M'' is a regular language, then the intersection <math>L \cap M</math> is again a linear language; in other words, the linear languages are closed under intersection with regular sets. Furthermore, the linear languages are closed under [[String_operations#String_homomorphism|homomorphism]] and [[String_operations#String_homomorphism|inverse homomorphism]].<ref>John E. Hopcroft and Jeffrey D. Ullman, ''[[Introduction to Automata Theory, Languages, and Computation]]'', Addison-Wesley Publishing, Reading Massachusetts, 1979. ISBN 0-201-02988-X., Ex. 11.1, pp. 282f</ref> These three closure properties show that the linear languages form a [[cone (formal languages)|full trio]]. Full trios in general are language families that enjoy a couple of other desirable mathematical properties.
 
==References==
<references/>
 
{{Formal languages and grammars}}
 
{{DEFAULTSORT:Linear Grammar}}
[[Category:Formal languages]]

Latest revision as of 18:23, 28 October 2014


I woke up another day and realised - I've been single for a little while at the moment and after much intimidation from buddies I now find myself registered for web dating. They guaranteed me that there are lots of pleasant, regular and fun people to fulfill, so the pitch is gone by here!
My pals luke bryan vip tickets for sale and household are awe-inspiring and spending some time together at tavern gigabytes or dinners where is the luke bryan concert is always vital. As I find you could not own a nice dialogue together with the sound I have never been upcoming luke bryan concerts in to nightclubs. Additionally, I have two definitely cheeky and quite cute canines that are almost always ready to meet up new folks.
I attempt to keep as physically healthy as potential staying at the gymnasium several times a week. I love my sports and strive to play or see while many a potential. Being wintertime I am going to frequently at Hawthorn fits. Note: In case that you will considered purchasing an athletics I do not brain, I have observed the carnage of wrestling matches at stocktake sales.

Here is my weblog; luke bryan tickets tampa (this)