Regular a regular expression I Example 1.68 Consider the following - - PowerPoint PPT Presentation

regular a regular expression i
SMART_READER_LITE
LIVE PREVIEW

Regular a regular expression I Example 1.68 Consider the following - - PowerPoint PPT Presentation

Regular a regular expression I Example 1.68 Consider the following DFA b a 1 2 a b a b 3 September 22, 2020 1 / 10 Regular a regular expression II It is not that easy to directly see what the regular expression is We need a


slide-1
SLIDE 1

Regular ⇒ a regular expression I

Example 1.68 Consider the following DFA 1 2 3 a a b b b a

September 22, 2020 1 / 10

slide-2
SLIDE 2

Regular ⇒ a regular expression II

It is not that easy to directly see what the regular expression is We need a procedure shown below First, add a start and an accept states s 1 2 3 a a a b b b a ǫ ǫ ǫ

September 22, 2020 2 / 10

slide-3
SLIDE 3

Regular ⇒ a regular expression III

This generates a generalized NFA (GNFA) Our procedure is DFA → GNFA → regular expression Remove state 1

September 22, 2020 3 / 10

slide-4
SLIDE 4

Regular ⇒ a regular expression IV

s 2 3 a a b ba ∪ a ab aa ∪ b bb ǫ ǫ Example: the link 3 → 2

September 22, 2020 4 / 10

slide-5
SLIDE 5

Regular ⇒ a regular expression V

3 1 2 a b a Thus ba ∪ a Idea: now 1 is removed. Need to check how we can go from 3 to 2 via state 1 Need to check all pairs of states Remove state 2

September 22, 2020 5 / 10

slide-6
SLIDE 6

Regular ⇒ a regular expression VI

s 3 a a(aa ∪ b)∗ a(aa ∪ b)∗ab ∪ b (ba ∪ a)(aa ∪ b)∗ab ∪ bb (ba ∪ a)(aa ∪ b)∗ ∪ ǫ Example: s → 3

September 22, 2020 6 / 10

slide-7
SLIDE 7

Regular ⇒ a regular expression VII

s 2 3 b a ab aa ∪ b Thus a(aa ∪ b)∗ab ∪ b

September 22, 2020 7 / 10

slide-8
SLIDE 8

Regular ⇒ a regular expression VIII

Here we need to handle 2

aa∪b

− − → 2 Thus in the early example of removing state 1, we actually have

September 22, 2020 8 / 10

slide-9
SLIDE 9

Regular ⇒ a regular expression IX

3 1 2 a b a ∅ and b∅∗a ∪ a = bǫa ∪ a = ba ∪ a Remove state 3

September 22, 2020 9 / 10

slide-10
SLIDE 10

Regular ⇒ a regular expression X

s a (a(aa ∪ b)∗ab ∪ b)((ba ∪ a)(aa ∪ b)∗ab ∪ bb)∗ ((ba ∪ a)(aa ∪ b)∗ ∪ ǫ) ∪ a(aa ∪ b)∗ We will formally explain the procedure

September 22, 2020 10 / 10