Chapter 2: Finite Automata

40 238 0
Chapter 2: Finite Automata

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Chapter 2: Finite Automata Objectives  Mastering the following concepts: – Deterministic Finite Accepter (DFA) – Nondeterministic Finite Accepter (NFA) – DFA and NFA Equivalence Deterministic Finite Accepter (DFA) M = (Q, ∑, δ, q 0 , F) Q: finite set of internal states ∑: finite set of symbols - input alphabet δ: Q × ∑ → Q transition function q 0 ∈Q: initial state F⊆Q: set of final states Operational Mechanism Control unit q 0 Input file yes/no Question: What is the difference between a general automaton and a DFA? Transition Graph M = (Q, ∑, δ, q 0 , F) • |Q| vertices (circles) • Edge (q i , q j ) labelled a for δ(q i , a) = q j • Initial vertice q 0 • Final vertices (double circles) in F Example 2.1 M = ({q 0 , q 1 , q 2 }, {0, 1}, δ, q 0 , {q 1 }) δ(q 0 , 0) = q 0 δ(q 0 , 1) = q 1 δ(q 1 , 0) = q 0 δ(q 1 , 1) = q 2 δ(q 2 , 0) = q 2 δ(q 2 , 1) = q 1 q 0 q 1 1 q 2 1 0 0 0 1 Example 2.2 1 2 3 Letter Digit Letter or Digit Letter or Digit 2 Extended Transition Function δ * (q, λ) = q δ * (q, wa) = δ(δ * (q, w), a) Example 2.2: δ(q 0 , a) = q 1 & δ(q 1 , b) = q 2 ⇒ δ * (q 0 , ab) = q 2 Languages and DFAs M = (Q, ∑, δ, q 0 , F) L(M) = {w∈∑ * | δ * (q 0 , w)∈F} L(M) = {w∈∑ * | δ * (q 0 , w)∉F} Example 2.3 M = ({q 0 , q 1 , q 2 }, {a, b}, δ, q 0 , {q 1 }) L(M) = {a n b} q 0 q 1 q 2 a, b a, b a b [...]... b}*} b b a q0 b trap state q1 a, b q2 a q3 a Example 2.9  L2 = {aw1aaw2a | w1, w2∈{a, b}*} b a q0 b q2 b q1 q3 a trap state a, b b a b q4 a q5 a Nondeterministic Finite Accepter (NFA) M = (Q, ∑, δ, q0, F) Q: finite set of internal states ∑: finite set of symbols - input alphabet δ: Q × (∑ ∪ {λ}) → 2Q transition function q0∈Q: initial state F⊆Q: set of final states Example 2.10 a q1 q0 a q2 a a q4 q5... Λ is the number of λ-edges Equivalent DFAs  Caused by non -finite trap states 1 1 q0 q1 0 q0 q1 0 0 q2 0,1 1 NFA and Languages M = (Q, ∑, δ, q0, F) L(M) = {w∈∑* | δ*(q0, w) ∩ F ≠ ∅} Example 2.14  L(M) = {(10)n | n ≥ 0} 0 q0 1 q1 λ 0, 1 q2 Dead Configuration  δ*(q0, 110) = δ(q2, 0) = ∅ 0 q0 1 q1 λ 0, 1 q2 Equivalence of DFA and NFA   Two automata are equivalent if they accept the same language For . Chapter 2: Finite Automata Objectives  Mastering the following concepts: – Deterministic Finite Accepter (DFA) – Nondeterministic

Ngày đăng: 13/05/2014, 10:21

Từ khóa liên quan

Mục lục

  • Chapter 2: Finite Automata

  • Objectives

  • Deterministic Finite Accepter (DFA)

  • Operational Mechanism

  • Transition Graph

  • Example 2.1

  • Example 2.2

  • Extended Transition Function

  • Languages and DFAs

  • Example 2.3

  • Trap State

  • Example 2.4:

  • Theorem 2.1

  • Transition Table

  • Example 2.5

  • Example 2.6

  • Example 2.7

  • Regular Languages

  • Example 2.8

  • Example 2.9

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan