Riemann zeta function: Difference between revisions

From formulasearchengine
Jump to navigation Jump to search
en>Gutworth
en>David Eppstein
m Reverted edits by 63.152.62.24 (talk) to last version by David Eppstein
Line 1: Line 1:
{{Refimprove|date=July 2013}}
Name: Lizette Pelloe<br>Age: 32<br>Country: Poland<br>City: Jaworzno <br>Postal code: 43-600<br>Address: Ul. Chrzanowska 96<br><br>My webpage [https://divinityoriginalsincrack1.wordpress.com Divinity Original Sin Cracked]
 
In [[theoretical computer science]] and [[formal language theory]], a '''regular grammar''' is a [[formal grammar]] that describes a [[regular language]].
 
== Strictly regular grammars ==
A '''right regular grammar''' (also called [[Linear Grammar#Right-Linear Grammars|right linear grammar]]) is a [[formal grammar]] (''N'', Σ, ''P'', ''S'') such that all the production rules in ''P'' are of one of the following forms:
# ''B'' → ''a''  - where ''B'' is a [[Terminal and nonterminal symbols|non-terminal]] in ''N'' and ''a'' is a terminal in Σ
# ''B'' → ''aC''  - where ''B'' and ''C'' are in ''N'' and ''a'' is in Σ
# ''B'' → ε  - where ''B'' is in ''N'' and ε denotes the [[empty string]], i.e. the string of length 0.
 
In a  '''left regular grammar''' (also called [[Linear Grammar#Left-Linear Grammars|left linear grammar]]), all rules obey the forms
# ''A'' → ''a''  - where ''A'' is a non-terminal in ''N'' and ''a'' is a terminal in Σ
# ''A'' → ''Ba''  - where ''A'' and ''B'' are in ''N'' and ''a'' is in Σ
# ''A'' → ε  - where ''A'' is in ''N'' and ε is the empty string.
 
An example of a right regular grammar ''G'' with ''N'' = {S, A}, Σ = {a, b, c}, ''P'' consists of the following rules
: S &rarr; aS
: S &rarr; bA
: A &rarr; &epsilon;
: A &rarr; cA
and S is the start symbol. This grammar describes the same language as the [[regular expression]] a*bc*, viz. the set of all strings consisting of arbitrary many "''a''"s, followed by a single "''b''", followed by arbitrary many "''c''"s.
 
A somewhat longer but more explicit right regular grammar ''G'' for the same regular expression is given by ''N'' = {S, A, B, C}, Σ = {a, b, c}, where ''P'' consists of the following rules:
: S &rarr; A
: A &rarr; aA
: A &rarr; B
: B &rarr; bC
: C &rarr; &epsilon;
: C &rarr; cC
…where each uppercase letter corresponds to phrases starting at the next position in the regular expression.
 
As an example from the area of programming languages, the set of all strings denoting a floating point number can be described by a right regular grammar ''G'' with ''N'' = {S, A,B,C,D,E,F}, Σ = {0,1,2,3,4,5,6,7,8,9,+,-,.,e}, where S is the start symbol, and ''P'' consists of the following rules:
 
:{|
|-
|| S &rarr; +A &nbsp; &nbsp; &nbsp; || A &rarr; 0A &nbsp; &nbsp; &nbsp; || B &rarr; 0C &nbsp; &nbsp; &nbsp; || C &rarr; 0C &nbsp; &nbsp; &nbsp; || D &rarr; +E &nbsp; &nbsp; &nbsp; || E &rarr; 0F &nbsp; &nbsp; &nbsp; || F &rarr; 0F
|-
|| S &rarr; -A || A &rarr; 1A || B &rarr; 1C || C &rarr; 1C || D &rarr; -E || E &rarr; 1F || F &rarr; 1F
|-
|| S &rarr;  A || A &rarr; 2A || B &rarr; 2C || C &rarr; 2C || D &rarr;  E || E &rarr; 2F || F &rarr; 2F
|-
||            || A &rarr; 3A || B &rarr; 3C || C &rarr; 3C ||            || E &rarr; 3F || F &rarr; 3F
|-
||            || A &rarr; 4A || B &rarr; 4C || C &rarr; 4C ||            || E &rarr; 4F || F &rarr; 4F
|-
||            || A &rarr; 5A || B &rarr; 5C || C &rarr; 5C ||            || E &rarr; 5F || F &rarr; 5F
|-
||            || A &rarr; 6A || B &rarr; 6C || C &rarr; 6C ||            || E &rarr; 6F || F &rarr; 6F
|-
||            || A &rarr; 7A || B &rarr; 7C || C &rarr; 7C ||            || E &rarr; 7F || F &rarr; 7F
|-
||            || A &rarr; 8A || B &rarr; 8C || C &rarr; 8C ||            || E &rarr; 8F || F &rarr; 8F
|-
||            || A &rarr; 9A || B &rarr; 9C || C &rarr; 9C ||            || E &rarr; 9F || F &rarr; 9F
|-
||            || A &rarr; .B ||            || C &rarr; eD ||            ||            || F &rarr; &epsilon;
|-
||            || A &rarr;  B ||            || C &rarr; &epsilon; ||      ||            ||
|}
 
A '''regular grammar''' is a left or right regular grammar.
 
Some textbooks and articles disallow empty production rules, and assume that the empty string is not present in languages.
 
==Extended regular grammars==
An ''extended right regular grammar'' is one in which all rules obey one of
# ''B'' → ''a''  - where ''B'' is a non-terminal in ''N'' and ''a'' is a terminal in Σ
# ''A'' → ''wB''  - where ''A'' and ''B'' are in ''N'' and ''w'' is in Σ<sup>*</sup>
# ''A'' → ε  - where ''A'' is in ''N'' and ε is the empty string.
Some authors call this type of grammar a ''right regular grammar'' (or ''right linear grammar'') and the type above a ''strictly right regular grammar'' (or ''strictly right linear grammar'').
 
An ''extended left regular grammar'' is one in which all rules obey one of
# ''A'' → ''a''  - where ''A'' is a non-terminal in ''N'' and ''a'' is a terminal in Σ
# ''A'' → ''Bw''  - where ''A'' and ''B'' are in ''N'' and ''w'' is in Σ<sup>*</sup>
# ''A'' → ε  - where ''A'' is in ''N'' and ε is the empty string.
 
==Expressive power==
There is a direct one-to-one correspondence between the rules of a (strictly) left regular grammar and those of a [[nondeterministic finite automaton]], such that the grammar generates exactly the language the automaton accepts.  Hence, the left regular grammars generate exactly all [[regular language]]s.  The right regular grammars describe the reverses of all such languages, that is, exactly the regular languages as well.
 
Every strict right regular grammar is extended right regular, while every extended right regular grammar can be made strict by inserting new nonterminals, such that the result generates the same language; hence, extended right regular grammars generate the regular languages as well.  Analogously, so do the extended left regular grammars.
 
If empty productions are disallowed, only all regular languages that do not include the empty string can be generated.
 
The [[pumping lemma for regular languages]] describes an essential property of all regular languages. Informally, it says that all sufficiently long words in a regular language may be pumped — that is, have a middle section of the word repeated an arbitrary number of times — to produce a new word which also lies within the same language. Referring to the above floating-point syntax example, in the derivation of a floating-point number longer than 7 characters,<ref>e.g. S &rarr; +A &rarr; +.B &rarr; +.1C &rarr; +.14C &rarr; +.14eD &rarr; +.14e+E &rarr; +.14e0F &rarr; +.14e+0</ref> one non-terminal symbol must occur twice; hence one of the rules "A &rarr; 0A", "C &rarr; 0C", ..., "F &rarr; 9F" must have been applied; repeating that rule over and over again instead of just once always results in a valid floating-point number.<ref>e.g. S &rarr; +A &rarr; +.B &rarr; +.1C &rarr; +.14C &rarr; +.144C &rarr; +.1444C &rarr; +.14444C &rarr; +.14444eD &rarr; +.14444e+E &rarr; +.14444e0F &rarr; +.14444e+0</ref>
 
==Mixing left and right regular rules==
If mixing of left-regular and right-regular rules is allowed, we still have a [[linear grammar]], but not necessarily a regular one.
What is more, such a grammar need not generate a regular language: all linear grammars can be easily brought into this form, and hence, such grammars can generate exactly all [[linear grammar|linear language]]s, including nonregular ones.
 
For instance, the grammar ''G'' with ''N'' = {S, A}, Σ = {a, b}, ''P'' with start symbol ''S'' and rules
: S &rarr; aA
: A &rarr; Sb
: S &rarr; &epsilon;
generates <math>\{ a^ib^i : i \geq 0\}</math>, the paradigmatic non-regular linear language.
 
==See also==
* [[Regular expression]], a compact notation for regular grammars
* [[Regular tree grammar]], a generalization from strings to trees
* [[Prefix grammar]]
* [[Chomsky hierarchy]]
* {{citation|first1=Dominique|last1=Perrin|contribution=Finite Automata|pages=1–58|editor1-first=Jan van|editor1-last=Leeuwen|title=Formal Models and Semantics|publisher=Elsevier|series=Handbook of Theoretical Computer Science|volume=B|year=1990}}
* {{cite book|first1=Jean-Éric|last1=Pin|title=Mathematical Foundations of Automata Theory|url=http://www.liafa.jussieu.fr/~jep/PDF/MPRI/MPRI.pdf|date=Oct 2012}}, chapter III
 
{{Reflist}}
 
{{Formal languages and grammars}}
 
{{DEFAULTSORT:Regular Grammar}}
[[Category:Formal languages]]

Revision as of 07:53, 27 February 2014

Name: Lizette Pelloe
Age: 32
Country: Poland
City: Jaworzno
Postal code: 43-600
Address: Ul. Chrzanowska 96

My webpage Divinity Original Sin Cracked