Content deleted Content added
m →String homomorphism: math environment (except the last part to keep it consistent with the other section) |
|||
Line 78:
==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 character is replaced by a single string. That is,
String homomorphisms are [[monoid morphism]]s on the [[free monoid]], preserving the empty string and the [[binary operation]] of [[string concatenation]]. Given a language
while the inverse homomorphic image of a language
In general,
<math>f(f^{-1}(L)) \subseteq L</math>
and
<math>L \subseteq f^{-1}(f(L))</math>
for any language
The class of regular languages is closed under homomorphisms and inverse homomorphisms.<ref>Hopcroft, Ullman (1979), Sect.3.2, Theorem 3.5, p.61</ref>
Similarly, the context-free languages are closed under homomorphisms<ref group="note">This follows from the [[#String substitution|above-mentioned]] closure under arbitrary substitutions.</ref> and inverse homomorphisms.<ref>Hopcroft, Ullman (1979), Sect.6.2, Theorem 6.3, p.132</ref>
A string homomorphism is said to be ε-free (or e-free) if
An example string homomorphism ''g''<sub>uc</sub> can also be obtained by defining similar to the [[#String_substitution|above]] substitution: ''g''<sub>uc</sub>(‹a›) = ‹A›, ..., ''g''<sub>uc</sub>(‹0›) = ε, but letting ''g''<sub>uc</sub> undefined on punctuation chars.
|