300 likes | 470 Views
Regular Expressions and Non-regular Languages. http://cis.k.hosei.ac.jp/~yukita/. Expressions and their values. Definition 1.26. The values of atomic expressions. Example 1.27. Units for the binary operations. Theorem 1.28.
E N D
Regular Expressions and Non-regular Languages http://cis.k.hosei.ac.jp/~yukita/
Theorem 1.28 • A language is regular if and only if some regular expression describes it. We break down this theorem as follows. • Lemma 1.29 • If a language is described by a regular expression, then it is regular. • Lemma 1.32 • If a langulage is regular, then it is described by a regular expression.
Proof of Lemma 1.29 a Next three slides Proof of Lemma 1.29
Case 4: Let N1, N2, and N correspond to R1, R2, and R, respectively. N N1 e e N2 Proof of Lemma 1.29
N2 N1 Case 5: Let N1, N2, and N correspond to R1, R2, and R, respectively. N e e Proof of Lemma 1.29
N1 Case 6: Let N1 and N correspond to R1 and R, respectively. N e e e Proof of Lemma 1.29
Generalized Nondeterministic Finite Automaton • is roughly a NFA in which the transition arrows may have regular expressions as labels. • We assume the following standard form for convenience, which can always be attained with an easy modification. • There is only one accept state and different from the start state. • The start state has transition arrows going to every other state but no arrows coming in from any other state. • There is only a single accept state, and it has arrows coming in from any other state but no arrows going to any other state. • Except for the start and accept states, one arrow goes from every state to every other state and also from each state to itself.
Equivalent GNFA with one fewer state R4 qi qj qi qj R1 R3 qrip R2
Problem 1.41 Differential Encoding 0 1 1 0xx1 0xx0 0 0 qstart 0 1xx0 1 1xx1 1 1 0