Content deleted Content added
No edit summary Tags: Mobile edit Mobile web edit |
Reverted good faith edits by Dominus (talk): Not clearly improving |
||
(12 intermediate revisions by 12 users not shown) | |||
Line 1:
In [[
==Strings
A string is a finite sequence of characters.
The [[empty string]] is denoted by <math>\varepsilon</math>.
The concatenation of two string <math>s</math> and <math>t</math> is denoted by <math>s \cdot t</math>, or shorter by <math>s t</math>.
Concatenating with the empty string makes no difference: <math>s \cdot \varepsilon = s = \varepsilon \cdot s</math>.
Concatenation of strings is [[associative]]: <math>s \cdot (t \cdot u) = (s \cdot t) \cdot u</math>.
For example, <math>(\langle b \rangle \cdot \langle l \rangle) \cdot (\varepsilon \cdot \langle ah \rangle) = \langle bl \rangle \cdot \langle ah \rangle = \langle blah \rangle</math>.
Line 78:
==String homomorphism==
A '''string homomorphism''' (often referred to simply as a [[Homomorphism#
String homomorphisms are [[monoid morphism]]s on the [[free monoid]], preserving the empty string and the [[binary operation]] of [[string concatenation]]. Given a language <math>L</math>, the set <math>f(L)</math> is called the '''homomorphic image''' of <math>L</math>. The '''inverse homomorphic image''' of a string <math>s</math> is defined as
<math>f^{-1}(s) = \{ w
while the inverse homomorphic image of a language <math>L</math> is defined as
<math>f^{-1}(L) = \{ s
In general, <math>f(f^{-1}(L)) \neq L</math>, while one does have
Line 130:
:<math>\pi_\Sigma (L)=\{\pi_\Sigma(s)\ \vert\ s\in L \}</math>{{citation needed|date=August 2017}}
== Right and left quotient ==
The '''right quotient''' of a character ''a'' from a string ''s'' is the truncation of the character ''a'' in the string ''s'', from the right hand side. It is denoted as <math>s/a</math>. If the string does not have ''a'' on the right hand side, the result is the empty string. Thus:
<!---This definition deviates from Hopcroft.Ullman.1979, as remarked below. I guess the former doesn't have widespread use, if it has a source at all.--->
: <math>(sa)/ b = \begin{cases} ▼
▲:<math>(sa)/ b = \begin{cases}
s & \mbox{if } a=b \\
\varepsilon & \mbox{if } a \ne b
Line 140 ⟶ 139:
The quotient of the empty string may be taken:
: <math>\varepsilon / a = \varepsilon</math>▼
▲:<math>\varepsilon / a = \varepsilon</math>
Similarly, given a subset <math>S\subset M</math> of a monoid <math>M</math>, one may define the quotient subset as
: <math>S/a=\{s\in M\ \vert\ sa\in S\}</math>▼
'''Left quotients''' may be defined similarly, with operations taking place on the left of a string.{{citation needed|date=August 2017}}▼
▲:<math>S/a=\{s\in M\ \vert\ sa\in S\}</math>
▲Left quotients may be defined similarly, with operations taking place on the left of a string.{{citation needed|date=August 2017}}
Hopcroft and Ullman (1979) define the quotient ''L''<sub>1</sub>/''L''<sub>2</sub> of the languages ''L''<sub>1</sub> and ''L''<sub>2</sub> over the same alphabet as {{nowrap|1=''L''<sub>1</sub>/''L''<sub>2</sub> = {{mset| ''s''
This is not a generalization of the above definition, since, for a string ''s'' and distinct characters ''a'', ''b'', Hopcroft's and Ullman's definition implies {{nowrap||{{mset|''sa''}} / {{mset|''b''}}}} yielding {{mset|}}, rather than {{mset| ε }}.
The left quotient (when defined similar to Hopcroft and Ullman 1979) of a singleton language ''L''<sub>1</sub> and an arbitrary language ''L''<sub>2</sub> is known as [[Brzozowski derivative]]; if ''L''<sub>2</sub> is represented by a [[regular expression]], so can be the left quotient.<ref>{{cite journal| author=Janusz A. Brzozowski| authorlink=Janusz Brzozowski (computer scientist)|title=Derivatives of Regular Expressions| journal=J ACM| year=1964| volume=11| issue=4| pages=481–494| doi=10.1145/321239.321249| s2cid=14126942| doi-access=free}}</ref>
==Syntactic relation==
Line 163 ⟶ 160:
:<math>\{S/m\ \vert\ m\in M\}</math>
is finite. In the case that ''M'' is the monoid of words over some alphabet, ''S'' is then a [[regular language]], that is, a language that can be recognized by a [[finite
==Right cancellation==
Line 215 ⟶ 212:
* {{cite book | first1=John E. | last1=Hopcroft | first2=Jeffrey D. | last2=Ullman | title=Introduction to Automata Theory, Languages and Computation | publisher=Addison-Wesley Publishing | ___location=Reading, Massachusetts | year=1979 | isbn=978-0-201-02988-8 | zbl=0426.68001 | url-access=registration | url=https://archive.org/details/introductiontoau00hopc }} ''(See chapter 3.)''
{{reflist}}
{{Strings}}
[[Category:Formal languages]]
|