The Reactive Turing Machine 2IT70 Finite Automata and Process Theory - - PowerPoint PPT Presentation

the reactive turing machine 2it70 finite automata and
SMART_READER_LITE
LIVE PREVIEW

The Reactive Turing Machine 2IT70 Finite Automata and Process Theory - - PowerPoint PPT Presentation

The Reactive Turing Machine 2IT70 Finite Automata and Process Theory Technische Universiteit Eindhoven May 12, 2014 Reactive Turing machine architecture Input yes/no Automaton Tape Tape 2 IT70 (2014) The Reactive Turing Machine 2 / 20 A


slide-1
SLIDE 1

The Reactive Turing Machine 2IT70 Finite Automata and Process Theory

Technische Universiteit Eindhoven May 12, 2014

slide-2
SLIDE 2

Reactive Turing machine architecture

Automaton Input yes/no Tape Tape

2 IT70 (2014) The Reactive Turing Machine 2 / 20

slide-3
SLIDE 3

A simple reactive Turing machine

q0 q1 τ[◻/◻,L] a[◻/1,R] b[1/◻,L] (q0,aab,⟨◻⟩) ⊢ M (q0,ab,1⟨◻⟩) ⊢ M (q0,b,11⟨◻⟩) ⊢ M (q1,b,1⟨1⟩) ⊢ M (q1,ε,⟨1⟩) (q0,abb,⟨◻⟩) ⊢ M (q0,bb,1⟨◻⟩) ⊢ M (q1,bb,⟨1⟩) ⊢ M (q1,b,⟨◻⟩) (q0,aa,⟨◻⟩) ⊢ M (q0,a,1⟨◻⟩) ⊢ M (q0,ε,11⟨◻⟩) ⊢ M (q1,ε,1⟨1⟩)

2 IT70 (2014) The Reactive Turing Machine 3 / 20

slide-4
SLIDE 4

Definition reactive Turing machine

reactive Turing machine M = (Q, Σ, ∆, ◻, →, q0, F ) Q finite set of states Σ finite alphabet, τ ∉ Σ ∆ finite tape alphabet, blank ◻ ∉ ∆ → ⊆ Q × Στ × ∆◻ × ∆◻ × {L,R} × Q transition relation where Στ = Σ ∪ {τ} and ∆◻ = ∆ ∪ {◻} q0 ∈ Q is the initial state F ⊆ Q is the set of final states transitions q

a[e/e′,µ]

  • → q′ and q

τ[e/e′,µ]

  • → q′

2 IT70 (2014) The Reactive Turing Machine 4 / 20

slide-5
SLIDE 5

Configurations

reactive Turing machine M = (Q, Σ, ∆, ◻, →, q0, F ) configuration (q,w,z) of M control is in state q string w not read from input yet z current tape content tape content z ∈ Z = {x⟨e⟩y ∣ x ∈ ∆∗

◻ ∶ x = ε ∨ first(x) ≠ ◻,

e ∈ ∆◻, y ∈ ∆∗

◻ ∶ y = ε ∨ last(y) ≠ ◻}

2 IT70 (2014) The Reactive Turing Machine 5 / 20

slide-6
SLIDE 6

Clicker question L51

(i) tape

a b bb yields tape content a ◻b⟨◻⟩bb (ii) tape ab bb yields tape content ab⟨◻⟩bb (iii) tape ab b yields tape content ab⟨◻⟩b (iv) tape abbba yields tape content ab⟨b⟩ba

Which of the statements (i) to (iv) above does not hold?

  • A. Statement (i)
  • B. Statement (ii)
  • C. Statement (iii)
  • D. Statement (iv)

2 IT70 (2014) The Reactive Turing Machine 6 / 20

slide-7
SLIDE 7

Execution steps

(q,w,x⟨e⟩y) ⊢ M (q′,w′,z′) if ∃a ∈ Σ ∃e,e′ ∈ ∆◻ ∃µ ∈ {L,R} ∶ w = aw′ ∧ q

a[e/e′,µ]

  • →M q′ ∧ z[e/e′,µ] = z′

where x⟨e⟩dy [e/e′,R] = xe′⟨d⟩y xd⟨e⟩y [e/e′,L] = x⟨d⟩e′y x⟨e⟩ε[e/e′,R] = xe′⟨◻⟩ε ε⟨e⟩y [e/e′,L] = ε⟨◻⟩e′y

2 IT70 (2014) The Reactive Turing Machine 7 / 20

slide-8
SLIDE 8

Execution steps (cont.)

if q

a[e/e′,L]

  • →M q′ then (q,aw,xd⟨e⟩y) ⊢ M (q′,w,x⟨d⟩e′y)

if q

a[e/e′,L]

  • →M q′ then (q,aw,ε⟨e⟩y) ⊢ M (q′,w,ε⟨◻⟩e′y)

if q

τ[e/e′,L]

  • →M q′ then (q,w,xd⟨e⟩y) ⊢ M (q′,w,x⟨d⟩e′y)

if q

τ[e/e′,L]

  • →M q′ then (q,w,ε⟨e⟩y) ⊢ M (q′,w,ε⟨◻⟩e′y)

2 IT70 (2014) The Reactive Turing Machine 8 / 20

slide-9
SLIDE 9

Clicker question L52

Suppose q

τ[e/e′,R]

  • →M q′

(i) (q,aw,x⟨e⟩dy) ⊢ M (q′,w,x⟨e′⟩y) (ii) (q,aw,x⟨e⟩dy) ⊢ M (q′,aw,x⟨e′⟩y) (iii) (q,aw,x⟨d⟩ey) ⊢ M (q′,w,xd⟨e′⟩y) (iv) (q,aw,x⟨e⟩ε) ⊢ M (q′,aw,xe′⟨◻⟩ε) Only one of the statements above is true. Which one is it?

  • A. Statement (i)
  • B. Statement (ii)
  • C. Statement (iii)
  • D. Statement (iv)
  • E. Can’t tell

2 IT70 (2014) The Reactive Turing Machine 9 / 20

slide-10
SLIDE 10

Another example Turing machine

q0 q1 q2 τ[◻/◻,L] τ[◻/◻,R] a[◻/1,R] b[1/◻,L]

accepting computation for aaabbb (q0,aaabbb,⟨◻⟩) ⊢ M (q0,aabbb,1⟨◻⟩) ⊢ M (q0,abbb,11⟨◻⟩) ⊢ M (q0,bbb,111⟨◻⟩) ⊢ M (q1,bbb,11⟨1⟩) ⊢ M (q1,bb,1⟨1⟩) ⊢ M (q1,b,⟨1⟩) ⊢ M (q1,ε,⟨◻⟩) ⊢ M (q2,ε,⟨◻⟩)

2 IT70 (2014) The Reactive Turing Machine 10 / 20

slide-11
SLIDE 11

Another example Turing machine (cont.)

q0 q1 q2 τ[◻/◻,L] τ[◻/◻,R] a[◻/1,R] b[1/◻,L]

non-accepting computation for aaabbb (q0,aaabbb,⟨◻⟩) ⊢ M (q0,aabbb,1⟨◻⟩) ⊢ M (q0,abbb,11⟨◻⟩) ⊢ M (q1,abbb,1⟨1⟩) / ⊢ M

2 IT70 (2014) The Reactive Turing Machine 11 / 20

slide-12
SLIDE 12

Language accepted by a reactive Turing machine

reactive Turing machine M = (Q, Σ, ∆, ◻, →, q0, F ) L(M) = {w ∈ Σ∗ ∣ ∃q ∈ F∃z ∈ Z∶(q0,w,⟨◻⟩) ⊢ ∗

M (q,ε,z)}

q0 q1 τ[◻/◻,L] a[◻/1,R] b[1/◻,L] L(M) = {anbm ∣ n ⩾ m ⩾ 0 }

reactive Turing machines accept recursively enumerable languages

⊢ ∗

M reflexive and transitive closure of ⊢M 2 IT70 (2014) The Reactive Turing Machine 12 / 20

slide-13
SLIDE 13

Language accepted by a reactive Turing machine (cont.)

reactive Turing machine M = (Q, Σ, ∆, ◻, →, q0, F ) L(M) = {w ∈ Σ∗ ∣ ∃q ∈ F∃z ∈ Z∶(q0,w,⟨◻⟩) ⊢ ∗

M (q,ε,z)}

q0 q1 q2 τ[◻/◻,L] τ[◻/◻,R] a[◻/1,R] b[1/◻,L] L(M) = {anbn ∣ n ⩾ 0 }

⊢ ∗

M reflexive and transitive closure of ⊢M 2 IT70 (2014) The Reactive Turing Machine 13 / 20

slide-14
SLIDE 14

Accepting a non-context-free language

q0 q1 q2 q3 τ[◻/◻,L] a[◻/1,R] b[1/1,L] τ[◻/◻,R] c[1/◻,R] τ[◻/◻,L] L(M) = {anbnc n ∣ n ⩾ 0 }

2 IT70 (2014) The Reactive Turing Machine 14 / 20

slide-15
SLIDE 15

Accepting a non-context-free language (cont.)

q0 q1 q2 q3 τ[◻/◻,L] a[◻/1,R] b[1/1,L] τ[◻/◻,R] c[1/◻,R] τ[◻/◻,L]

q0 aaabbbccc # ˇ #### q0 aabbbccc # 1 ˇ ### q0 abbbccc # 1 1 ˇ ## q0 bbbccc # 1 1 1 ˇ # q1 bbbccc # 1 1 ˇ 1 # q1 bbccc # 1 ˇ 1 1 # q1 bccc # ˇ 1 1 1 # q1 ccc ˇ # 1 1 1 # q2 ccc # ˇ 1 1 1 # q2 cc ## ˇ 1 1 # q2 c ### ˇ 1 # q2 ε #### ˇ # q3 ε ### ˇ ## ACCEPT q0 aaabbbccc # ˇ #### q0 aabbbccc # 1 ˇ ### q0 abbbccc # 1 1 ˇ ## q1 abbbccc # 1 ˇ 1 ## REJECT

2 IT70 (2014) The Reactive Turing Machine 15 / 20

slide-16
SLIDE 16

Clicker question L53

q0 q1 q2 with d ∈ {a,b} d[◻/◻,L] τ[◻/◻,R] d[◻/d,R] d[d/◻,L]

Which language is accepted by the Turing machine above?

  • A. L(M) = {w ∈ {a,b}∗ ∣ #a(w) ≠ #b(w)}
  • B. L(M) = {w ∈ {a,b}∗ ∣ w = wR }
  • C. L(M) = {w ∈ {a,b}∗ ∣ ∣w ∣ is odd}
  • D. L(M) = {w ∈ {a,b}∗ ∣ ∣w ∣ is odd ∧ w = wR }
  • E. Can’t tell

2 IT70 (2014) The Reactive Turing Machine 16 / 20

slide-17
SLIDE 17

A Turing machine accepting odd palindromes

q0 q1 q2 with d ∈ {a,b} d[◻/◻,L] τ[◻/◻,R] d[◻/d,R] d[d/◻,L] q0 baabaab # ˇ #### q0 aabaab # b ˇ ### q0 abaab # b a ˇ ## q0 baab # b a a ˇ # q1 aab # b a ˇ a # q1 ab # b ˇ a ## q1 b # ˇ b ### q1 ε ˇ ##### q2 ε # ˇ #### ACCEPT q0 baababb # ˇ #### q0 aababb # b ˇ ### q0 ababb # b a ˇ ## q0 babb # b a a ˇ # q1 abb # b a ˇ a # q1 bb # b ˇ a ## REJECT

2 IT70 (2014) The Reactive Turing Machine 17 / 20

slide-18
SLIDE 18

A Turing machine accepting all palindromes

q0 q1 q2 with d ∈ {a,b} d[◻/◻,L] τ[◻/◻,R] d[◻/d,R] d[d/◻,L] τ[◻/◻,L] q0 baaaab # ˇ #### q0 aaaab # b ˇ ### q0 aaab # b a ˇ ## q0 aab # b a a ˇ # q1 aab # b a ˇ a # q1 ab # b ˇ a ## q1 b # ˇ b ### q1 ε ˇ ##### q2 ε # ˇ #### ACCEPT q0 bbbaaa # ˇ #### q0 bbaaa # b ˇ ### q0 baaa # b b ˇ ## q0 aaa # b b b ˇ # q1 aaa # b b ˇ b # . . . REJECT

2 IT70 (2014) The Reactive Turing Machine 18 / 20

slide-19
SLIDE 19

Simulating a DFA

q0 q1 q2 q3 a b a b b a a,b

q0 a[#/#,R] q1 q0 b[#/#,R] q3 q1 a[#/#,R] q1 q1 b[#/#,R] q2 q2 a[#/#,R] q1 q2 b[#/#,R] q2 q3 a[#/#,R] q3 q3 b[#/#,R] q3

q0 abaaab ˇ ####### q1 baaab # ˇ ###### q2 aaab ## ˇ ##### q1 aab ### ˇ #### q1 ab #### ˇ ### q1 b ##### ˇ ## q2 ε ###### ˇ # ACCEPT

2 IT70 (2014) The Reactive Turing Machine 19 / 20

slide-20
SLIDE 20

Regular languages are recursively enumerable

theorem if L = L(D) for a DFA D then L = L(M) for a reactive TM M proof suppose D = (Q, Σ, δ, q0, F ) put M = (Q, Σ, ∅, ◻, →, q0, F ) transitions q

a[◻/◻,R]

  • → δ(q,a) for q ∈ Q, a ∈ Σ

then (q,w) ⊢D (q′,w′) iff (q,w,⟨◻⟩) ⊢M (q′,w′,⟨◻⟩) hence (q0,w) ⊢∗

D (q,ε) iff (q0,w,⟨◻⟩) ⊢∗ M (q,ε,⟨◻⟩)

therefore L(D) = L(M)

2 IT70 (2014) The Reactive Turing Machine 20 / 20