Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
lfa:prop [2018/07/23 14:15] pdmatei |
lfa:prop [2019/10/31 13:56] (current) pdmatei |
||
---|---|---|---|
Line 11: | Line 11: | ||
Consider the following NFA built (with respect to $math[M_a]) to accept words of the above language: | Consider the following NFA built (with respect to $math[M_a]) to accept words of the above language: | ||
- | {{:lfa:arithmetic_fin.jpg?600|}} | + | {{:lfa:parenexpr.jpg?600|}} |
One can easily observe that the above automaton can only accept words of the following forms: | One can easily observe that the above automaton can only accept words of the following forms: | ||
Line 38: | Line 38: | ||
$theorem[Pumping Lemma] | $theorem[Pumping Lemma] | ||
- | Let $math[L] be a regular language. Then there exists $math[n] (dependent on $math[L]) such that for every word $math[w\in L] satisfying $math[|w|\leq n] has the following form: | + | Let $math[L] be a regular language. Then there exists $math[n] (dependent on $math[L]) such that for every word $math[w\in L] of length larger than $math[n] has the following form: |
* $math[w = xyz] where | * $math[w = xyz] where | ||
* $math[\mid xy \mid \leq n] | * $math[\mid xy \mid \leq n] | ||
Line 125: | Line 125: | ||
$proof | $proof | ||
- | Let $math[M_A = (K,\Sigma,\delta,q_0,F)] be a DFA which accepts $math[A]. We build the DFA $math[\overline{M_A} = (K,\Sigma,\delta,q_0,K\setminus F)]. $math[\overline{M_A}] only differs from $math[M_A] in the accepting (or final) states: each **final** state in $math[M_A] is **non-final** in $math[\overline{M_A}] and vice-versa. It follows immediately that, for all words $math[w], w is accepted by $math[M_A] iff $math[w] is not accepted by $math[\overline{M_A}]. Thus, $math[M_A] accepts any word not in $math[A], i.e. the language $math[\overline{A}]. | + | Let $math[M_A = (K,\Sigma,\delta,q_0,F)] be a DFA which accepts $math[A]. We build the DFA $math[\overline{M_A} = (K,\Sigma,\delta,q_0,K\setminus F)]. $math[\overline{M_A}] only differs from $math[M_A] in the accepting (or final) states: each **final** state in $math[M_A] is **non-final** in $math[\overline{M_A}] and vice-versa. It follows immediately that, for a |
+ | ll words $math[w], w is accepted by $math[M_A] iff $math[w] is not accepted by $math[\overline{M_A}]. Thus, $math[M_A] accepts any word not in $math[A], i.e. the language $math[\overline{A}]. | ||
$end | $end | ||
Line 138: | Line 139: | ||
$end | $end | ||
- | An alternative and more useful proof is to construct, starting from DFAs $math[M_A=(K_A,\Sigma,q_A,F_A)] and $math[M_B==(K_B,\Sigma,q_B,F_B)] which accept languages $math[A] and $math[B], respectively, a DFA for $math[A\cap B]. The construction is called **product automaton** (written $math[M_A\times M_B]), and is as follows: | + | An alternative and more useful proof is to construct, starting from DFAs $math[M_A=(K_A,\Sigma,q_A,F_A)] and $math[M_B=(K_B,\Sigma,q_B,F_B)] which accept languages $math[A] and $math[B], respectively, a DFA for $math[A\cap B]. The construction is called **product automaton** (written $math[M_A\times M_B]), and is as follows: |
* the set of states is $math[K_A\times K_B] - each state in the product automaton is a pair of states; | * the set of states is $math[K_A\times K_B] - each state in the product automaton is a pair of states; | ||
Line 145: | Line 146: | ||
* the set of final states is $math[F_A \times F_B] | * the set of final states is $math[F_A \times F_B] | ||
- | It is easy to prove by induction that for each word $math[w] such that $math[(q_A,w)\vdash_{M_A}^*(p,\epsilon)] and | + | It is easy to prove by induction that for each word $math[w] such that $math[(q_A,w)\ |
+ | vdash_{M_A}^*(p,\epsilon)] and | ||
$math[(q_B,w)\vdash_{M_B}^*(r,\epsilon)], with $math[p\in F_A] and $math[r\in F_B], we also have in the product automaton $math[((q_A,q_B),w)\vdash^*_{M_{A\times B}}(p,r),\epsilon]. | $math[(q_B,w)\vdash_{M_B}^*(r,\epsilon)], with $math[p\in F_A] and $math[r\in F_B], we also have in the product automaton $math[((q_A,q_B),w)\vdash^*_{M_{A\times B}}(p,r),\epsilon]. | ||