Rail transport: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>StephenTX
m metricated
en>Nick Number
m sp etc. WP:TYPO
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{for|natural language that is regulated|List of language regulators}}
{{Cleanup|date=December 2008}}
In [[theoretical computer science]] and [[formal language theory]], a '''regular language''' is a [[formal language]] that can be expressed using a [[regular expression]]. (Note that the "regular expression" features provided with many programming languages are [[Regular_expression#Patterns_for_non-regular_languages|augmented with features]] that make them capable of recognizing languages that  can not be expressed by the formal regular expressions (''as formally defined below'').)


Alternatively, a regular language can be defined as a language recognized by a [[finite automaton]].


In the [[Chomsky hierarchy]], regular languages are defined to be the languages that are generated by Type-3 grammars ([[regular grammar]]s).
California Beers And Regional Breweries<br><br>Just to be distinct, I'm no reporter. I'm an average citizen, taking a search at the information headlines. And, I've just acquired to say some thing about what's likely on. This isn't gossip. I'm not making an attempt to smear anyone's graphic here. Really feel free to Google every thing in this article. You ought to locate almost everything created below is in fact legit. I just threw in my two cents and ideally, held this report from Link Schwartz acquiring unexciting.<br><br>I guess, now that the bag is out, the Bush administration's secrets on interrogation, [http://www.barryschwartzonline.com/ Link K Schwartz] President Obama is leaving the door open up for possible felony expenses against people officials who drew up the legal basis to interrogate folks in techniques that could be regarded as torture. Barack prefers to appear forward. But, he doesn't brain leaving his personal faithful countrymen powering for the wolves, so to talk. I see how it is.<br><br>The movie, 17 Once more, launched on Friday was the box-business office champ this weekend, drawing in just over $24 million. I know a single factor for certain. I didn't pay out them a dime.<br><br>Just prior to my departure for Link Schwartz, I arrived throughout this spoon-bending performer at a pals' marriage ceremony. He naturally tricked absolutely everyone. I filmed him, watched him like a hawk; identified an additional trick; he had to be a fraud, though I also filmed a spoon that moved right in entrance of the digicam, without him touching it.<br><br>Link Schwartz The national fee for the jobless was eight.nine%twenty five. We saw a fall in the jobless in Missouri and it fell by .six%twenty five and that gave an total rate of Link Schwartz 8.one%25 for April. "But some states had a increase in the jobless charge except Alaska which had a decline of .four%twenty five to eight%twenty five West Virginia has skilled climbing costs in jobless figures heading up to .seven%twenty five compared to .seventy five%25 in April. Rhodie island also knowledgeable a rise from .5%25 to 11.1%twenty five and Ohio followed with 10.two%25. On top of the rising unemployment the states that have felt the increase can't preserve going like this because as far more people appear out of perform the considerably less spending their is and the less tax revenue that is coming in.<br><br>Three score and 10. As a child boomer I grew up becoming instructed that this was the age I would reside to... perhaps a couple of several years significantly less, possibly a number of several years a lot more, however 70 was the regular age that I was taught to feel in. All of my pals believed the identical point, right after all, again then our mother and father definitely seemed aged, and our grandparents, well, don't even go there.. positively ancient. Anti getting older wasn't on the radar.<br><br>They needed far more details. They desired a piece of the motion. Alright. I pointed the direction and quietly led them down the route to the doorway that opened to their future. The potential that incorporated good health and a desire they could attain.<br><br>A number of many years later on we experienced Link Schwartz a neighbor up in the mountains who was a hunter. He hunted mountain lion and even bear and really ate it. His name was B.J, but that's all I keep in mind about him. He reminded me of Jeremiah Johnson or ? We moved.<br><br>If that statement is true, then it has eternal repercussions for every person. If it's false, then Christians are tragically misinformed and they must be disregarded.
 
Regular languages are very useful in input [[parsing]] and [[programming language]] design.
 
==Formal definition==
The collection of regular languages over an alphabet Σ is defined recursively as follows:
* The empty language Ø is a regular language.
* For each ''a'' ∈ Σ (''a'' belongs to Σ), the [[Singleton (mathematics)|singleton]] language {''a''} is a regular language.
* If ''A'' and ''B'' are regular languages, then ''A'' ∪ ''B'' (union), ''A'' • ''B'' (concatenation), and ''A''* ([[Kleene star]]) are regular languages.
* No other languages over Σ are regular.
 
See [[Regular_expression#Formal_language_theory|regular expression]] for its syntax and semantics. Note that the above cases are in effect the defining rules of regular expression.
 
;Examples
All finite languages are regular; in particular the [[empty string]] language {ε} = Ø* is regular. Other typical examples include the language consisting of all strings over the alphabet {''a'', ''b''} which contain an even number of ''a''s, or the language consisting of all strings of the form: several ''a''s followed by several ''b''s.
 
A simple example of a language that is not regular is the set of strings <math>\{a^nb^n\,\vert\; n\ge 0\}</math>.<ref>Eilenberg (1974), p. 16 (Example II, 2.8) and p. 25 (Example II, 5.2).</ref> Intuitively, it cannot be recognized with a finite automaton, since a finite automaton has finite memory and it cannot remember the exact number of a's. Techniques to prove this fact rigorously are given below.
 
==Equivalence to other formalisms==
A regular language satisfies the following equivalent properties:
* it is the language accepted by a [[nondeterministic finite automaton]]
* it is the language accepted by a [[deterministic finite automaton]]
* it is the language accepted by an [[alternating finite automaton]]
* it can be generated by a [[regular grammar]]
* it can be generated by a [[prefix grammar]]
* it can be accepted by a read-only [[Turing machine]]
* it can be defined in [[monadic predicate calculus|monadic]] [[second-order logic]] ([[Büchi-Elgot-Trakhtenbrot theorem]]<ref>M. Weyer: Chapter 12 - Decidability of S1S and S2S, p. 219, Theorem 12.26. In: Erich Grädel, Wolfgang Thomas, Thomas Wilke (Eds.): Automata, Logics, and Infinite Games: A Guide to Current Research. Lecture Notes in Computer Science 2500, Springer 2002.</ref>)
* it is recognized by some finite [[monoid]], meaning it is the [[preimage]] of a subset of a finite monoid under a homomorphism from the free monoid on its alphabet (see [[Myhill–Nerode theorem]]).
 
The above properties are sometimes used as alternative definition of regular languages.
 
== Closure properties ==
The regular languages are [[closure (mathematics)|closed]] under the various operations, that is, if the languages ''K'' and ''L'' are regular, so is the result of the following operations:
 
* the set theoretic Boolean operations: [[union (set theory)|union]] <math>K \cup L</math>, [[intersection (set theory)|intersection]] <math>K \cap L</math>, and [[complement (set theory)|complement]] <math>\bar{L}</math>. From this also [[relative complement]] <math>K-L</math> follows.<ref name=Sal28>Salomaa (1981) p.28</ref>
* the regular operations: [[union (set theory)|union]] <math>K \cup L</math>, [[concatenation]] <math>K\circ L</math>, and [[Kleene star]] <math>L^*</math>.<ref name=Sal27>Salomaa (1981) p.27</ref>
* the [[abstract family of languages|trio]] operations: [[string homomorphism]], inverse string homomorphism, and intersection with regular languages. As a consequence they are closed under arbitrary [[finite state transducer|finite state transductions]], like [[right quotient|quotient]] <math>K / L</math>  with a regular language. Even more, regular languages are closed under quotients with ''arbitrary'' languages: If L is regular then L/K is regular for any K.
* the reverse (or mirror image) <math>L^R</math>.
 
==Deciding whether a language is regular==
[[Image:Chomsky-hierarchy.svg|thumb|250px|Regular language in classes of Chomsky hierarchy.]]
 
To locate the regular languages in the [[Chomsky hierarchy]], one notices that every regular language is [[Context free language|context-free]]. The converse is not true: for example the language consisting of all strings having the same number of ''a''<nowiki>'</nowiki>s as ''b''<nowiki>'</nowiki>s is context-free but not regular. To prove that a language such as this is not regular, one often uses the [[Myhill–Nerode theorem]] or the [[pumping lemma]] among other methods.<ref>[http://cs.stackexchange.com/questions/1031/how-to-prove-that-a-language-is-not-regular How to prove that a language is not regular?]</ref>
 
There are two purely algebraic approaches to define regular languages. If:
* Σ is a finite alphabet,
* Σ* denotes the [[free monoid]] over Σ consisting of all strings over Σ,
* ''f'' : Σ* → ''M'' is a [[monoid homomorphism]] where ''M'' is a ''finite'' monoid,
* ''S'' is a subset of ''M''
then the set <math>\{ w \in \Sigma^* \, | \, f(w) \in S \}</math> is regular. Every regular language arises in this fashion.
 
If ''L'' is any subset of Σ*, one defines an [[equivalence relation]] ~ (called the [[syntactic relation]]) on Σ* as follows: ''u'' ~ ''v'' is defined to mean
:''uw'' &isin; ''L'' if and only if ''vw'' &isin; ''L'' for all ''w'' &isin; &Sigma;*
The language ''L'' is regular if and only if the number of equivalence classes of ~ is finite (A proof of this is provided in the article on the [[syntactic monoid]]). When a language is regular, then the number of equivalence classes is equal to the number of states of the [[DFA minimization|minimal deterministic finite automaton]] accepting ''L''.
 
A similar set of statements can be formulated for a monoid <math>M\subset\Sigma^*</math>. In this case, equivalence over ''M'' leads to the concept of a [[recognizable language]].
 
== Complexity results ==
 
In [[computational complexity theory]], the [[complexity class]] of all regular languages is sometimes referred to as '''REGULAR''' or '''REG''' and equals [[DSPACE]](O(1)), the [[decision problem]]s that can be solved in constant space (the space used is independent of the input size). '''REGULAR''' ≠ [[AC0|'''AC'''<sup>0</sup>]], since it (trivially) contains the parity problem of determining whether the number of 1 bits in the input is even or odd and this problem is not in '''AC'''<sup>0</sup>.<ref>M. Furst, J. B. Saxe, and M. Sipser. Parity, circuits, and the polynomial-time hierarchy. Math. Systems Theory, 17:13–27, 1984.</ref> On the other hand, '''REGULAR''' does not contain '''AC'''<sup>0</sup>, because the nonregular language of [[palindrome]]s, or the nonregular language <math>\{0^n 1^n : n \in \mathbb N\}</math> can both be recognized in '''AC'''<sup>0</sup>.<ref>{{cite book|last1=Cook|first1=Stephen|last2=Nguyen|first2=Phuong|title=Logical foundations of proof complexity|year=2010|publisher=Association for Symbolic Logic|location=Ithaca, NY|isbn=0-521-51729-X|pages=75|edition=1. publ.}}</ref>
 
If a language is ''not'' regular, it requires a machine with at least [[Big O notation|&Omega;]](log log ''n'') space to recognize (where ''n'' is the input size).<ref>J. Hartmanis, P. L. Lewis II, and R. E. Stearns. Hierarchies of memory-limited computations. ''Proceedings of the 6th Annual IEEE Symposium on Switching Circuit Theory and Logic Design'', pp. 179&ndash;190. 1965.</ref> In other words, DSPACE([[Big O notation|o]](log log ''n'')) equals the class of regular languages. In practice, most nonregular problems are solved by machines taking at least [[logarithmic space]].
 
==Subclasses==
Important subclasses of regular languages include
* Finite languages - those containing only a finite number of words. These are regular languages, as one can create a [[regular expression]] that is the [[Union (set theory)|union]] of every word in the language.
* [[Star-free language]]s, those that can be described by a regular expression constructed from the empty symbol, letters, concatenation and all [[boolean operators]] including [[Complement (set theory)|complementation]] but not the [[Kleene star]]: this class includes all finite languages.<ref>{{cite book|editor=Jörg Flum, Erich Grädel, Thomas Wilke|title=Logic and automata: history and perspectives|year=2008|publisher=Amsterdam University Press|isbn=978-90-5356-576-6|url=http://www.lsv.ens-cachan.fr/Publis/PAPERS/PDF/DG-WT08.pdf|chapter=First-order definable languages|author=Volker Diekert, Paul Gastin|unused_data=chapter}}</ref>
* '''Cyclic languages''', satisfying the conditions <math>uv \in L \Leftrightarrow vu \in L</math> and <math>w \in L \Leftrightarrow w^n \in L</math>.<ref name=Honkala>{{cite journal | zbl=0675.68034 | last=Honkala | first=Juha | title=A necessary condition for the rationality of the zeta function of a regular language | journal=Theor. Comput. Sci. | volume=66 | number=3 | pages=341–347 | year=1989 }}</ref>
 
==The number of words in a regular language==
Let <math>s_L(n)</math> denote the number of words of length <math>n</math> in <math>L</math>. The [[ordinary generating function]] for ''L'' is the [[formal power series]]
 
:<math>S_L(z) = \sum_{n \ge 0} s_L(n) z^n \ . </math>
 
The generating function of a language ''L'' is a [[rational function]] if ''L'' is regular.<ref name=Honkala/>  Hence for any regular language <math>L</math> there exist an integer constant <math>n_0</math>, complex constants <math>\lambda_1,\,\ldots,\,\lambda_k</math> and complex polynomials <math>p_1(x),\,\ldots,\,p_k(x)</math>
such that for every <math>n \geq n_0</math> the number <math>s_L(n)</math> of words of length <math>n</math> in <math>L</math> is
<math>s_L(n)=p_1(n)\lambda_1^n+\dotsb+p_k(n)\lambda_k^n</math>.<ref>Flajolet & Sedgweick, section V.3.1, equation (13).</ref><ref>[http://cs.stackexchange.com/a/1048/55 Proof of theorem for irreducible DFAs]</ref><ref>http://cs.stackexchange.com/a/11333/683 Proof of theorem for arbitrary DFAs</ref><ref>[http://cs.stackexchange.com/q/1045/55 Number of words of a given length in a regular language]</ref>
 
Thus, non-regularity of certain languages <math>L'</math> can be proved by counting the words of a given length in
<math>L'</math>. Consider, for example, the [[Dyck language]] of strings of balanced parentheses. The number of words of length <math>2n</math>
in the Dyck language is equal to the [[Catalan number]] <math>C_n\sim\frac{4^n}{n^{3/2}\sqrt{\pi}}</math>, which is not of the form <math>p(n)\lambda^n</math>,
witnessing the non-regularity of the Dyck language. Care must be taken since some of the eigenvalues <math>\lambda_i</math> could have the same magnitude. For example, the number of words of length <math>n</math> in the language of all even binary words is not of the form <math>p(n)\lambda^n</math>, but the number of words of even or odd length are of this form; the corresponding eigenvalues are <math>2,-2</math>. In general, for every regular language there exists a constant <math>d</math> such that for all <math>a</math>, the number of words of length <math>dm+a</math> is asymptotically <math>C_a m^{p_a} \lambda_a^m</math>.<ref>Flajolet & Sedgewick (2002, Theorem V.3)</ref>
 
The ''zeta function'' of a language ''L'' is<ref name=Honkala/>
 
:<math>\zeta_L(z) = \exp \left({ \sum_{n \ge 0} s_L(n) \frac{z^n}{n} }\right) \ . </math>
 
The zeta function of a regular language is not in general rational, but that of a cyclic language is.<ref>{{cite journal | zbl=0797.68092 | last1=Berstel | first1=Jean | last2=Reutenauer | first1=Christophe | title=Zeta functions of formal languages | journal=Trans. Am. Math. Soc. | volume=321 | number=2 | pages=533–546 | year=1990 }}</ref>
 
==Generalizations==
The notion of a regular language has been generalized to infinite words (see [[ω-automaton|ω-automata]]) and to trees (see [[tree automaton]]).
 
==See also==
* [[Pumping lemma for regular languages]]
* [[Union of two regular languages]]
* [[Rational language]]
 
== References ==
 
{{Refbegin}}
 
* {{cite book |last1=Eilenberg |first1=Samuel |authorlink1=Samuel Eilenberg |title=Automata, Languages, and Machines. Volume A |url= |edition= |series=Pure and Applied Mathematics |volume=58 |year=1974 |publisher=Academic Press |location=New York |isbn= |zbl=0317.94045 }}
* {{cite book | first=Arto | last=Salomaa | authorlink=Arto Salomaa | title=Jewels of Formal Language Theory | publisher=Pitman Publishing | isbn=0-273-08522-0 | year=1981 | zbl=0487.68064 }}
* {{cite book | first=Michael | last=Sipser | authorlink = Michael Sipser | year = 1997 | title = [[Introduction to the Theory of Computation]] | publisher = PWS Publishing | isbn = 0-534-94728-X | zbl=1169.68300 }} Chapter 1: Regular Languages, pp.&nbsp;31&ndash;90. Subsection "Decidable Problems Concerning Regular Languages" of section 4.1: Decidable Languages, pp.&nbsp;152&ndash;155.
* Philippe Flajolet and Robert Sedgewick, ''[http://algo.inria.fr/flajolet/Publications/FlSe02.ps.gz Analytic Combinatorics: Symbolic Combinatorics.]''  Online book, 2002.
 
{{Refend}}
{{Reflist}}
 
==External links==
* {{CZoo|Class REG|R#reg}}
 
{{Formal languages and grammars}}
 
[[Category:Formal languages]]
[[Category:Automata theory]]

Latest revision as of 22:14, 6 January 2015


California Beers And Regional Breweries

Just to be distinct, I'm no reporter. I'm an average citizen, taking a search at the information headlines. And, I've just acquired to say some thing about what's likely on. This isn't gossip. I'm not making an attempt to smear anyone's graphic here. Really feel free to Google every thing in this article. You ought to locate almost everything created below is in fact legit. I just threw in my two cents and ideally, held this report from Link Schwartz acquiring unexciting.

I guess, now that the bag is out, the Bush administration's secrets on interrogation, Link K Schwartz President Obama is leaving the door open up for possible felony expenses against people officials who drew up the legal basis to interrogate folks in techniques that could be regarded as torture. Barack prefers to appear forward. But, he doesn't brain leaving his personal faithful countrymen powering for the wolves, so to talk. I see how it is.

The movie, 17 Once more, launched on Friday was the box-business office champ this weekend, drawing in just over $24 million. I know a single factor for certain. I didn't pay out them a dime.

Just prior to my departure for Link Schwartz, I arrived throughout this spoon-bending performer at a pals' marriage ceremony. He naturally tricked absolutely everyone. I filmed him, watched him like a hawk; identified an additional trick; he had to be a fraud, though I also filmed a spoon that moved right in entrance of the digicam, without him touching it.

Link Schwartz The national fee for the jobless was eight.nine%twenty five. We saw a fall in the jobless in Missouri and it fell by .six%twenty five and that gave an total rate of Link Schwartz 8.one%25 for April. "But some states had a increase in the jobless charge except Alaska which had a decline of .four%twenty five to eight%twenty five West Virginia has skilled climbing costs in jobless figures heading up to .seven%twenty five compared to .seventy five%25 in April. Rhodie island also knowledgeable a rise from .5%25 to 11.1%twenty five and Ohio followed with 10.two%25. On top of the rising unemployment the states that have felt the increase can't preserve going like this because as far more people appear out of perform the considerably less spending their is and the less tax revenue that is coming in.

Three score and 10. As a child boomer I grew up becoming instructed that this was the age I would reside to... perhaps a couple of several years significantly less, possibly a number of several years a lot more, however 70 was the regular age that I was taught to feel in. All of my pals believed the identical point, right after all, again then our mother and father definitely seemed aged, and our grandparents, well, don't even go there.. positively ancient. Anti getting older wasn't on the radar.

They needed far more details. They desired a piece of the motion. Alright. I pointed the direction and quietly led them down the route to the doorway that opened to their future. The potential that incorporated good health and a desire they could attain.

A number of many years later on we experienced Link Schwartz a neighbor up in the mountains who was a hunter. He hunted mountain lion and even bear and really ate it. His name was B.J, but that's all I keep in mind about him. He reminded me of Jeremiah Johnson or ? We moved.

If that statement is true, then it has eternal repercussions for every person. If it's false, then Christians are tragically misinformed and they must be disregarded.