five lectures on ca 2 simulations
play

Five Lectures on CA 2. Simulations Thomas Worsch Department of - PowerPoint PPT Presentation

Five Lectures on CA 2. Simulations Thomas Worsch Department of Informatics Karlsruhe Institute of Technology http://liinwww.ira.uka.de/~thw/vl-hiroshima/ at Hiroshima University, January 2012 Outline Turing machines Simulation of TM by CA


  1. Five Lectures on CA 2. Simulations Thomas Worsch Department of Informatics Karlsruhe Institute of Technology http://liinwww.ira.uka.de/~thw/vl-hiroshima/ at Hiroshima University, January 2012

  2. Outline Turing machines Simulation of TM by CA Simulation of CA by TM

  3. Turing machines Simulation of TM by CA Simulation of CA by TM

  4. Definition Turing machine, one head, one tape (1)

  5. Definition Turing machine, one head, one tape (1) Basics: ◮ finite set of states Q ◮ finite tape alphabet S ◮ move function δ : Q × S → Q × S × D ◮ D = {− 1 , 0 , 1 } : directions for head move − 1 for moving left, 1 for moving right and 0 for no move ◮ let’s assume that δ is a total function in this lecture ◮ a blank symbol ✷ ◮ an initial state

  6. Definition Turing machine, one head, one tape (2) derived notions ◮ configuration of a TM ◮ c = ( q , b , p ) ∈ Q × S Z × Z ◮ write the move function as three separate functions: ◮ δ q : Q × S → Q ◮ δ s : Q × S → S ◮ δ d : Q × S → D ◮ one step of a TM: ∆ : Q × S Z × Z → Q × S Z × Z ◮ For c = ( q , b , p ) the succesor configuration ∆( c ) = ( q ′ , b ′ , p ′ ) is defined as q ′ = δ q ( q , b ( p )), ◮ � b ( x ) if x � = p ∀ x ∈ Z holds b ′ ( x ) = ◮ δ s ( q , b ( p )) if x = p p ′ = p + δ d ( q , b ( p )) ◮

  7. Turing machines: recent developments :-) ◮ http://www.youtube.com/watch?v=E3keLeMwfHY ◮ Steam-Powered Turing Machine ◮ http://www.cs.washington.edu/general/sptm-caption.html ◮ http://www.cs.washington.edu/homes/ruzzo/ ”[. . . ] principal research project involves the construction and programming of a vaguely parallel computer, consisting of 32 steam-powered Turing machines installed in the basement [. . . ] Graduate students have played an important role in the construction and operation of the engine, [...] Originally intended as a general computing engine, restrictions imposed by the Pollution Control and Noise Abatement Boards require that only algorithms running in polynomial time may be used. [. . . ] one of [the] students slipped on a mouldering stack of ungraded homework exercises and fell under the write head of one of the machines. Now permanently embossed with a series of 1’s and 0’s, the student is suing to have the machine dismantled.“

  8. Turing machines Simulation of TM by CA Simulation of CA by TM

  9. Theorem For each TM T = ( Q T , S T , δ T ) there is a CA C = ( Z , Q C , {− 1 , 0 , 1 } , f C , ) simulating T without loss of time step by step.

  10. Sketch of proof: idea ∆ T a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3 q q ′

  11. Sketch of proof: idea ∆ T a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3 q q ′ F C

  12. Sketch of proof: idea ∆ T a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3 q q ′ F C

  13. Sketch of proof: idea ∆ T a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3 q q ′ F C a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3

  14. Sketch of proof: idea ∆ T a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3 q q ′ q q ′ F C a 1 a 2 a 3 a 4 a 5 a 1 a 2 a ′ a 4 a 5 3

  15. Sketch of proof: idea ◮ let Q C = ( Q T ˙ ∪{ } ) × S T ◮ represent c T = ( q , b , p ) by c C : → Q C Z � ( q , b ( p )) if x = p x �→ ( , b ( x )) if x � = p

  16. Sketch of proof: local transition function for the simulation to work define f C (( , a l ) , ( , a m ) , ( , a r )) = ( , a m )

  17. Sketch of proof: local transition function for the simulation to work define f C (( , a l ) , ( , a m ) , ( , a r )) = ( , a m ) � ( q ′ , a m ) if δ T ( q , a l ) = ( q ′ , a ′ l , 1) f C (( q , a l ) , ( , a m ) , ( , a r )) = ( , a m ) otherwise

  18. Sketch of proof: local transition function for the simulation to work define f C (( , a l ) , ( , a m ) , ( , a r )) = ( , a m ) � ( q ′ , a m ) if δ T ( q , a l ) = ( q ′ , a ′ l , 1) f C (( q , a l ) , ( , a m ) , ( , a r )) = ( , a m ) otherwise � ( q ′ , a ′ m ) if δ T ( q , a m ) = ( q ′ , a ′ m , 0) f C (( , a l ) , ( q , a m ) , ( , a r )) = ( , a ′ m ) if δ T ( q , a m ) = ( q ′ , a ′ m , ± 1)

  19. Sketch of proof: local transition function for the simulation to work define f C (( , a l ) , ( , a m ) , ( , a r )) = ( , a m ) � ( q ′ , a m ) if δ T ( q , a l ) = ( q ′ , a ′ l , 1) f C (( q , a l ) , ( , a m ) , ( , a r )) = ( , a m ) otherwise � ( q ′ , a ′ m ) if δ T ( q , a m ) = ( q ′ , a ′ m , 0) f C (( , a l ) , ( q , a m ) , ( , a r )) = ( , a ′ m ) if δ T ( q , a m ) = ( q ′ , a ′ m , ± 1) � ( q ′ , a m ) if δ T ( q , a r ) = ( q ′ , a ′ r , − 1) f C (( , a l ) , ( , a m ) , ( q , a r )) = ( , a m ) otherwise This does not yet completely specify f . The rest is not important here.

  20. Generalization: more tapes and heads more complicated: ◮ TM with two tapes and one head on each of them ◮ TM with two heads on one tape ◮ TM with arbitrary numbers of tapes and heads problem: ◮ heads can be “far away” from each other, e. g. copying data from one head to the other ◮ still we want to simulate that in one (or two) steps

  21. Generalization: more tapes and heads (2) basic idea for a solution:

  22. Generalization: more tapes and heads (2) basic idea for a solution: ◮ always keep the important information in one cell i. e. the information needed for the simulation of the next step

  23. Generalization: more tapes and heads (2) basic idea for a solution: ◮ always keep the important information in one cell i. e. the information needed for the simulation of the next step ◮ like this:

  24. Generalization: more tapes and heads (2) basic idea for a solution: ◮ always keep the important information in one cell i. e. the information needed for the simulation of the next step ◮ like this: ◮ don’t move the head(s) but the tape contents

  25. Generalization: more tapes and heads (2) basic idea for a solution: ◮ always keep the important information in one cell i. e. the information needed for the simulation of the next step ◮ like this: ◮ don’t move the head(s) but the tape contents ◮ don’t wait until everything has been shifted . . .

  26. Generalization: more tapes and heads (2) basic idea for a solution: ◮ always keep the important information in one cell i. e. the information needed for the simulation of the next step ◮ like this: ◮ don’t move the head(s) but the tape contents ◮ don’t wait until everything has been shifted . . . ◮ . . . start simulating the next step as soon as all necessary informations are available

  27. Shifting one tape (1)

  28. Shifting one tape (1) . . . q . . . . . . a b c d e f g h . . . δ T ( q , d ) = . . . . . . ( q ′ , x , − 1) . . . q ′ . . . ← . . . . . . a b c e f g h ✷ → . . . . . . x . . . q ′ . . . ← . . . . . . a b c x f g h ✷ → . . . e . . . . . . q ′ . . . ← . . . . . . a ✷ b c x e g h → . . . f . . . . . . q ′ . . . ← . . . a b c x e f h . . . ✷ → . . . . . . g

  29. Shifting one tape (2) . . . q . . . . . . a b c d e f g h . . . δ T ( q , d ) = . . . . . . ( q ′ , x , − 1) . . . q ′ . . . ← . . . . . . a b c e f g h ✷ → . . . . . . x . . . q ′ . . . ← . . . . . . a b c x f g h ✷ → δ T ( q ′ , c ) = . . . e . . . ( q ′′ , y , − 1) . . . q ′′ . . . ← ← . . . . . . a ✷ b ✷ x e g h → → . . . y f . . . . . . q ′′ . . . ← ← . . . a b y e f h . . . ✷ ✷ → → . . . . . . x g

  30. Shifting more ◮ the same technique works for more tapes and one head on each tape ◮ if one has k heads on the same tape:

  31. Shifting more ◮ the same technique works for more tapes and one head on each tape ◮ if one has k heads on the same tape: ◮ simulate it by k tapes with only 1 head on each without loss of time (Stoß, 1970) or

  32. Shifting more ◮ the same technique works for more tapes and one head on each tape ◮ if one has k heads on the same tape: ◮ simulate it by k tapes with only 1 head on each without loss of time (Stoß, 1970) or ◮ use the same idea as before: store all currently visited tapes squares in one cell . . .

  33. Shifting more ◮ the same technique works for more tapes and one head on each tape ◮ if one has k heads on the same tape: ◮ simulate it by k tapes with only 1 head on each without loss of time (Stoß, 1970) or ◮ use the same idea as before: store all currently visited tapes squares in one cell . . . ◮ as just described, this simulation now needs two CA steps for one TM step ◮ there are techniques to save a factor of 2 “most of the time” ◮ but we will not go into details here . . .

  34. Turing machines Simulation of TM by CA Simulation of CA by TM

  35. Definition Given a CA with quiescent state q 0 and a configuration c ∈ Q R the support supp ( c ) of c is supp ( c ) = { x ∈ R | c ( x ) � = q 0 }

  36. Lemma If c is a CA configuration with finite support, then F ( c ) also has finite support. Proof

Recommend


More recommend