Content deleted Content added
→Right quotient: ce: grammar |
|||
Line 44:
for string ''s'' ∈ ''L'' and character ''a'' ∈ Σ. String substitutions may be extended to entire languages as <ref>Hopcroft, Ullman (1979), Sect.3.2, p.60</ref>
:<math>f(L)=\bigcup_{s\in L} f(s)</math>
[[Regular language]]s are closed under string substitution. That is, if each character in the alphabet of a regular language is substituted by another regular language, the result is still a regular language.<ref>Hopcroft, Ullman (1979), Sect.3.2, Theorem 3.4, p.60</ref>
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 ''L'', the set ''f''(''L'') is called the '''homomorphic image''' of ''L''. The '''inverse homomorphic image''' of a string ''s'' is defined as
:''f''<sup>−1</sup>(''s'') = { ''w'' | ''f''(''w'') = ''s'' }
while the inverse homomorphic image of a language ''L'' is defined as
:''f''<sup>−1</sup>(''L'') = { ''s'' | ''f''(''s'') ∈ ''L'' }
In general, ''f''(''f''<sup>−1</sup>(''L'')) ≠ ''L'', while one does have
:''f''(''f''<sup>−1</sup>(''L'')) ⊆ ''L''
and
:''L'' ⊆ ''f''<sup>−1</sup>(''f''(''L''))
Line 124:
\end{cases}</math>
Here <math>\varepsilon</math> denotes the [[empty string]]. The projection of a string is essentially the same as a [[projection in relational algebra]].
String projection may be promoted to the '''projection of a language'''. Given a [[formal language]] ''L'', its projection is given by
:<math>\pi_\Sigma (L)=\{\pi_\Sigma(s)\ \vert\ s\in L \}</math>{{
==Right quotient==
Line 143:
:<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.{{
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 ''L''<sub>1</sub>/''L''<sub>2</sub> = { ''s'' | ∃''t''∈''L''<sub>2</sub>. ''st''∈''L''<sub>1</sub> }.<ref>Hopcroft, Ullman (1979), Sect.3.2, p.62</ref>
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 {''sa''} / {''b''} yielding {}, rather than { ε }.
The left quotient (when definied 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=
==Syntactic relation==
Line 163:
:<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 state automaton]]. This is discussed in greater detail in the article on [[syntactic monoid]]s.{{
==Right cancellation==
Line 179:
Clearly, right cancellation and projection [[Commutative property|commute]]:
:<math>\pi_\Sigma(s)\div a = \pi_\Sigma(s \div a )</math>{{
==Prefixes==
Line 186:
:<math>\operatorname{Pref}_L(s) = \{t\ \vert\ s=tu \mbox { for } t,u\in \operatorname{Alph}(L)^*\}</math>
where <math>s\in L</math>.
The '''prefix closure of a language''' is
:<math>\operatorname{Pref} (L) = \bigcup_{s\in L} \operatorname{Pref}_L(s) = \left\{ t\ \vert\ s=tu; s\in L; t,u\in \operatorname{Alph}(L)^* \right\}</math>
Line 195:
<math>L=\left\{abc\right\}\mbox{ then } \operatorname{Pref}(L)=\left\{\varepsilon, a, ab, abc\right\}</math>
A language is called '''prefix closed''' if <math>\operatorname{Pref} (L) = L</math>.
The prefix closure operator is [[idempotent]]:
Line 201:
:<math>\operatorname{Pref} (\operatorname{Pref} (L)) =\operatorname{Pref} (L)</math>
The '''prefix relation''' is a [[binary relation]] <math>\sqsubseteq</math> such that <math>s\sqsubseteq t </math> if and only if <math>s \in \operatorname{Pref}_L(t)</math>. This relation is a particular example of a [[prefix order]].{{
==See also ==
|