Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture Note of 9/29 jinnjy. Outline Remark of “Central Concepts of Automata Theory” (Page 1 of handout) The properties of DFA, NFA,  -NFA.

Similar presentations


Presentation on theme: "Lecture Note of 9/29 jinnjy. Outline Remark of “Central Concepts of Automata Theory” (Page 1 of handout) The properties of DFA, NFA,  -NFA."— Presentation transcript:

1 Lecture Note of 9/29 jinnjy

2 Outline Remark of “Central Concepts of Automata Theory” (Page 1 of handout) The properties of DFA, NFA,  -NFA

3 The Main Points on Page 1. Just give yourself a try to remember the notations and terminologies.

4 DFA Notation: A=(Q, , ,q 0,F) Extended transition function: (Recursive fashion of definition) 沒讀到 input 所以 state 不改變 Assume w = xa (the same as handout) 在讀整串 w 時, A 會先讀 x 的那個部份然後變 成某個 state ,最後再看在那個 state 時讀到 a 應該去哪個 state 。

5 DFA Usage: Identify some keywords or number formats. e.g. Identify the conserved keywords in C language. (if, while, case, for,…,etc.) 讀到 w 後會變到 final state 的這類的 w 形成的 set.

6 DFA 大概的用來 accept 小數的 DFA A=(Q, , ,q 1,F) q1q1 +,- q4q4 0~9 q2q2. q3q3 E q5q5. q6q6 +,-,. +,- +,-,. 0~9,+,-,. Q={q 1, q 2, q 3, q 4, q 5, q 6, E} F={q 2, q 3, q 5, q 6 }  ={0~9,+,-,.} 

7 Typical Errors When Specifying a DFA Just draw a diagram to indicate the DFA. DFA (deterministic) is a specialized version of NFA (nondeterministic), but NFA is not a DFA.

8 NFA Allows some non-determinism A representation with the number of states (transitions) less than DFA. q1q1 q4q4 q2q2 q3q3 a,b a b

9 Example 1.21 (Page 43) A DFA A={Q, , ,q,F} accepts strings containing 001 qq0q0 0 q 00 0,1 q 001 0 Q={q, q 0, q 00, q 001 } F={q 001 }  ={0,1}  1 10 1

10 Example 1.21 (Page 43) A NFA N={Q, , ,q,F} accepts strings containing 001 qq0q0 0 q 00 0,1 q 001 0 Q={q, q 0, q 00, q 001 } F={q 001 }  ={0,1}  0,1 1

11 NFA Notation: A=(Q, , ,q 0,F) Extended transition function: (Recursive fashion of definition) 注意這邊是 set 的形式 Assume w = xa (the same as handout) 在處理整串 w 時, A 會先讀 x 的那個部份然後走到某些 state 形成的集合,最後再看在那集合中的 state 時讀到 a 應 該去哪些 state 。

12 NFA 1. 可以把 A 想成一個會把計算分成很多個 branch 的 Machine, 如果某個 branch 到達 final states 的其中一個 就是可以 accept 我們給 A 的 input 2.  -NFA 的 L(A) 形式也是一樣

13  -NFA ( 不需要讀 input 就可到一 些 state) q1q1 q4q4 q2q2 q3q3  a b  a q5q5 q6q6 q7q7 q9q9    q8q8 ( 僅列出 transition 的部份, 非正式的  -NFA) ECLOSE(q 1 )={q 1,q 3 } ECLOSE(q 3 )={q 3 } ECLOSE(q 4 )={q 4,q 6,q 9 } ECLOSE(q 2 )={q 2,q 7,q 8 } ECLOSE(q 6 )={q 6,q 8 }

14  -NFA Notation: A=(Q, , ,q 0,F) Extended transition function: (Recursive fashion of definition) 這邊還是一個 set Assume w = xa (the same as handout) 差不多的形式, 只不過有  -closure 的概念

15 講義 Thm. 2.11 & 2.22 的 keypoints 1. Subset Construction: DFA 的 states 為原 NFA(  -NFA) 中的 state 的所有可能的 subset. ( 應付 non-determinism) 2. 做完 subset construction, 原本 NFA(  -NFA) 的 transition 就可以改一改拿來用  記得  -NFA 的 case 要做  -closure 的考量

16 Demonstrations Exercise 1.6c Exercise 1.7c Importance: Low (in exam)


Download ppt "Lecture Note of 9/29 jinnjy. Outline Remark of “Central Concepts of Automata Theory” (Page 1 of handout) The properties of DFA, NFA,  -NFA."

Similar presentations


Ads by Google