patternMinor
Proving regularity via equivalence classes
Viewed 0 times
provingregularityviaclassesequivalence
Problem
Given two regular languages $L_1$ and $L_2$, we define a new language
$$L=\{w_1w_2\mid \text{ there exist two words } x,y \text{ such that } xw_1\in L_1, w_2y\in L2\}$$
How do I show that $L$ is regular with equivalence classes?
My assignment allows the use of closure properties that all regular languages hold, but I cannot use $\text{rank} (L)$, as in show a limit to the number of equivalence class.
Can someone lead me in the right direction?
$$L=\{w_1w_2\mid \text{ there exist two words } x,y \text{ such that } xw_1\in L_1, w_2y\in L2\}$$
How do I show that $L$ is regular with equivalence classes?
My assignment allows the use of closure properties that all regular languages hold, but I cannot use $\text{rank} (L)$, as in show a limit to the number of equivalence class.
Can someone lead me in the right direction?
Solution
If you are allowed to use closure properties (as the formulation in the question suggests) then $xw_1\in L_1$ so $w_1$ is a suffix of $L_1$, similarly $w_2$ is a prefix of $L_2$. Taking suffixes and prefixes is a closure property of regular languages, and so is concatenation. That solves the regularity.
At what level do you want/need equivalence classes for your answer?
(added) For language $K$ its set of prefixes is defined as
$$\mbox{pref}(K) = \{ w \mid \mbox{there exists string $y$ such that } wy\in K \}$$
precisely as used for $L_2$ in the operation in the question.
Given a finite state automaton for $K$ we get a FSA for $\mbox{pref}(K)$ by making all states final that have a path leading to a final state.
Also $\mbox{suff}(K) = \{ w \mid \mbox{there exists string $x$ such that } xw\in K \}$.
Similarly one proves closure under suffix by making all states initial. As that is not commonly allowed for FSA that is solved by adding $\varepsilon$-transitions to all other states.
Your language $L$ based on $L_1,L_2$ equals $\mbox{suff}(L_1)\mbox{pref}(L_2)$, the concatenation of a suffix and a prefix language.
I could not find a reference to a question in this forum that dealt with the prefix/suffix operations, perhaps someone can help. Closure under prefix is a special case of closure under quotient.
At what level do you want/need equivalence classes for your answer?
(added) For language $K$ its set of prefixes is defined as
$$\mbox{pref}(K) = \{ w \mid \mbox{there exists string $y$ such that } wy\in K \}$$
precisely as used for $L_2$ in the operation in the question.
Given a finite state automaton for $K$ we get a FSA for $\mbox{pref}(K)$ by making all states final that have a path leading to a final state.
Also $\mbox{suff}(K) = \{ w \mid \mbox{there exists string $x$ such that } xw\in K \}$.
Similarly one proves closure under suffix by making all states initial. As that is not commonly allowed for FSA that is solved by adding $\varepsilon$-transitions to all other states.
Your language $L$ based on $L_1,L_2$ equals $\mbox{suff}(L_1)\mbox{pref}(L_2)$, the concatenation of a suffix and a prefix language.
I could not find a reference to a question in this forum that dealt with the prefix/suffix operations, perhaps someone can help. Closure under prefix is a special case of closure under quotient.
Context
StackExchange Computer Science Q#7419, answer score: 4
Revisions (0)
No revisions yet.