INF2080
- 2. Regular Expressions and Nonregular languages
Daniel Lupp
Universitetet i Oslo
25th January 2018
Department of Informatics University of Oslo
INF2080 Lecture :: 25th January 1 / 39
INF2080 2. Regular Expressions and Nonregular languages Daniel Lupp - - PowerPoint PPT Presentation
INF2080 2. Regular Expressions and Nonregular languages Daniel Lupp Universitetet i Oslo 25th January 2018 Department of University of Informatics Oslo INF2080 Lecture :: 25th January 1 / 39 Last week Deterministic finite automata (DFA)
INF2080 Lecture :: 25th January 1 / 39
start 1
INF2080 Lecture :: 25th January 2 / 39
start 1
INF2080 Lecture :: 25th January 2 / 39
start 1
start 0, 1 1 start 2 3 ε a b a, b a
INF2080 Lecture :: 25th January 2 / 39
start 1
start 0, 1 1 start 2 3 ε a b a, b a
INF2080 Lecture :: 25th January 2 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 3 / 39
INF2080 Lecture :: 25th January 4 / 39
INF2080 Lecture :: 25th January 4 / 39
INF2080 Lecture :: 25th January 4 / 39
INF2080 Lecture :: 25th January 5 / 39
INF2080 Lecture :: 25th January 5 / 39
INF2080 Lecture :: 25th January 5 / 39
INF2080 Lecture :: 25th January 6 / 39
INF2080 Lecture :: 25th January 6 / 39
INF2080 Lecture :: 25th January 7 / 39
INF2080 Lecture :: 25th January 8 / 39
INF2080 Lecture :: 25th January 8 / 39
INF2080 Lecture :: 25th January 8 / 39
INF2080 Lecture :: 25th January 8 / 39
INF2080 Lecture :: 25th January 9 / 39
INF2080 Lecture :: 25th January 9 / 39
INF2080 Lecture :: 25th January 10 / 39
INF2080 Lecture :: 25th January 10 / 39
INF2080 Lecture :: 25th January 11 / 39
INF2080 Lecture :: 25th January 11 / 39
INF2080 Lecture :: 25th January 11 / 39
INF2080 Lecture :: 25th January 11 / 39
INF2080 Lecture :: 25th January 11 / 39
INF2080 Lecture :: 25th January 11 / 39
INF2080 Lecture :: 25th January 12 / 39
INF2080 Lecture :: 25th January 13 / 39
INF2080 Lecture :: 25th January 14 / 39
INF2080 Lecture :: 25th January 14 / 39
1 Q is a finite set of states 2 Σ is the input alphabet 3 δ : (Q \ {qaccept}) × (Q \ {qstart}) → R is the transition function, where R is the set of
4 qstart is the start state, and 5 qaccept is the accept state. INF2080 Lecture :: 25th January 15 / 39
INF2080 Lecture :: 25th January 16 / 39
INF2080 Lecture :: 25th January 16 / 39
INF2080 Lecture :: 25th January 17 / 39
INF2080 Lecture :: 25th January 18 / 39
INF2080 Lecture :: 25th January 18 / 39
3R4) INF2080 Lecture :: 25th January 18 / 39
1 If k = 2 then G only has one start and one accept state, so return the regular expression
INF2080 Lecture :: 25th January 19 / 39
1 If k = 2 then G only has one start and one accept state, so return the regular expression
2 if k > 2 select a state q′ ∈ {qaccept, qstart}. Define G ′ = {Q′, Σ, δ′, qstart, qaccept} with
INF2080 Lecture :: 25th January 19 / 39
1 If k = 2 then G only has one start and one accept state, so return the regular expression
2 if k > 2 select a state q′ ∈ {qaccept, qstart}. Define G ′ = {Q′, Σ, δ′, qstart, qaccept} with
3 Return the result of CONVERT(G ′). INF2080 Lecture :: 25th January 19 / 39
1 If k = 2 then G only has one start and one accept state, so return the regular expression
2 if k > 2 select a state q′ ∈ {qaccept, qstart}. Define G ′ = {Q′, Σ, δ′, qstart, qaccept} with
3 Return the result of CONVERT(G ′). 4 correctness still remains to be shown! See book for details! (Claim 1.65) INF2080 Lecture :: 25th January 19 / 39
INF2080 Lecture :: 25th January 20 / 39
INF2080 Lecture :: 25th January 20 / 39
INF2080 Lecture :: 25th January 21 / 39
INF2080 Lecture :: 25th January 21 / 39
INF2080 Lecture :: 25th January 22 / 39
INF2080 Lecture :: 25th January 22 / 39
INF2080 Lecture :: 25th January 23 / 39
INF2080 Lecture :: 25th January 23 / 39
INF2080 Lecture :: 25th January 23 / 39
INF2080 Lecture :: 25th January 24 / 39
INF2080 Lecture :: 25th January 24 / 39
INF2080 Lecture :: 25th January 24 / 39
INF2080 Lecture :: 25th January 25 / 39
INF2080 Lecture :: 25th January 25 / 39
INF2080 Lecture :: 25th January 25 / 39
INF2080 Lecture :: 25th January 25 / 39
INF2080 Lecture :: 25th January 25 / 39
INF2080 Lecture :: 25th January 26 / 39
INF2080 Lecture :: 25th January 26 / 39
INF2080 Lecture :: 25th January 26 / 39
INF2080 Lecture :: 25th January 26 / 39
INF2080 Lecture :: 25th January 26 / 39
INF2080 Lecture :: 25th January 26 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p. INF2080 Lecture :: 25th January 27 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 28 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 28 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 29 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 29 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 29 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 30 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 30 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 30 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 31 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 31 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 31 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 31 / 39
INF2080 Lecture :: 25th January 32 / 39
INF2080 Lecture :: 25th January 32 / 39
INF2080 Lecture :: 25th January 32 / 39
INF2080 Lecture :: 25th January 32 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 33 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 33 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 33 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 34 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 34 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 34 / 39
INF2080 Lecture :: 25th January 35 / 39
INF2080 Lecture :: 25th January 35 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 36 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 36 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 36 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 37 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 37 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 37 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 37 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 37 / 39
1 xyiz ∈ A for every i ≥ 0, 2 |y| > 0, 3 |xy| ≤ p.
INF2080 Lecture :: 25th January 37 / 39
INF2080 Lecture :: 25th January 38 / 39
INF2080 Lecture :: 25th January 38 / 39
INF2080 Lecture :: 25th January 38 / 39
INF2080 Lecture :: 25th January 38 / 39
INF2080 Lecture :: 25th January 38 / 39
INF2080 Lecture :: 25th January 39 / 39
INF2080 Lecture :: 25th January 39 / 39
INF2080 Lecture :: 25th January 39 / 39
INF2080 Lecture :: 25th January 39 / 39
INF2080 Lecture :: 25th January 39 / 39
INF2080 Lecture :: 25th January 39 / 39