Content deleted Content added
replace 'letter' (too narrow) --> 'character'; move ebcdic/ascii example to 'string homomorphism' where it fits better |
|||
Line 34:
==String substitution==
Let ''L'' be a [[language (computer science)|language]], and let Σ be its alphabet. A '''string substitution''' or simply a '''substitution''' is a mapping ''f'' that maps
:''f''(ε)=ε
Line 42:
:''f''(''sa'')=''f''(''s'')''f''(''a'')
for string ''s'' ∈ ''L'' and
:<math>f(L)=\bigcup_{s\in L} f(s)</math>
[[Regular language]]s are closed under string substitution. That is, if each
Similarly, [[context-free language]]s are closed under string substitution.<ref>Hopcroft, Ullman (1979), Sect.6.2, Theorem 6.2, p.131</ref><ref group="note">Although every regular language is also context-free, the previous theorem is not implied by the current one, since the former yields a shaper result for regular languages.</ref>
Line 53:
{| class="wikitable"
|-
!
|-
! ''x'' !! ''f''<sub>uc</sub>(''x'') !!
Line 76:
For the extension of ''f''<sub>uc</sub> to languages, we have e.g.
* ''f''<sub>uc</sub>({ ‹Straße›, ‹u2›, ‹Go!› }) = { ‹STRASSE› } ∪ { ‹U› } ∪ { } = { ‹STRASSE›, ‹U› }.
Another example is the conversion of an [[EBCDIC]]-encoded string to [[ASCII]].▼
==String homomorphism==
A '''string homomorphism''' (often referred to simply as a [[Homomorphism#Homomorphisms_and_e-free_homomorphisms_in_formal_language_theory|homomorphism]] in [[formal language theory]]) is a string substitution such that each
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
Line 114 ⟶ 112:
For the latter language, ''g''<sub>uc</sub>(''g''<sub>uc</sub><sup>−1</sup>({ ‹A›, ‹bb› })) = ''g''<sub>uc</sub>({ ‹a› }) = { ‹A› } ≠ { ‹A›, ‹bb› }.
The homomorphism ''g''<sub>uc</sub> is not ε-free, since it maps e.g. ‹0› to ε.
▲
==String projection==
If ''s'' is a string, and <math>\Sigma</math> is an alphabet, the '''string projection''' of ''s'' is the string that results by removing all
:<math>\pi_\Sigma(s) = \begin{cases}
Line 131:
==Right quotient==
The '''right quotient''' of a
:<math>(sa)/ b = \begin{cases}
Line 160:
==Right cancellation==
The '''right cancellation''' of a
:<math>(sa)\div b = \begin{cases}
|