1.3 regular expressions
Properties of Regular Language
Unions, intersections, differences and complements of regular languages are regular.
Formal Def of a Regular Expression
Say that R is a regular expression if R is: - a for some a in the alphabet Σ - ε - ∅ - (R1∪R2) - (R1∘R2) - (R∗1)
(R1R2) are regualr expressions(inductive def)
some conclusions
- L(R): the language of R
- concatenating the empty set to any set yields the empty set, so 1∗∅=∅
- ∅∗={ε}
- R∪∅=R
- R∘ε=R
Equivalence with Finite Automata
- hint: regular language is one that is recognized by some finite automation
- a language is regular iff some regular expression describes it
- prove see textbook p67 p70
- GNFA: generalized nondeterministic finite automation, its transition arrows may have any regular expression as labels
DFA to regular expression
Rkij=Rk−1ik(Rk−1kk)∗Rk−1kj
Write a table out.
Colum: k=0,1,...n-1
Row: all combination of two states
Base Case: when k=0, if there is a transition(including this state and itself, in this case is ε), then is the combination(or+transitions if more than one); if there is not, then it is empty.
Then fill the table using formula.
The result should be Rnstart+accept
Pumping Lemma
Suppose it is regular. Let p be its pumping constant.
Consider the string w=xxx, which is a string in this language with length greater than p.
There must be a pumping decomposition of w: w=xyz, where |xy|≤p and |y|>0.
Prove this compositions variants is not in the language.
Then this violates the pumping lemma.
So it is not regular.