Download presentation
Presentation is loading. Please wait.
1
Constructing Complex Turing Machines
Idea: Use a modular approach similar to the one use to construct complex programs Example (programming): Given two nn matrixes A and B to compute ABT we: Construct a procedure to compute BT, transverse(B,C) Construct a procedure to multiply two matrices, multiply(B,C,D) Call transverse(B,C) and then multiply(A,C,D). D contains the answer
2
Graphical Conventions
We will use a convention similar to a flow chart to indicate how to put together Turing machines (TMs). Convention. Let A and B be 2 TMs, and a be a character in then: A a B A; if a then B Means that: If A halts in a configuration of the form (h,w1aw2), where w1or w2 are any words Then B starts with the configuration (s,w1aw2), where s is the initial state in B
3
Graphical Conventions (2)
M a a M; If a then A else B A B Means that: If M halts in a configuration of the form (h,w1aw2), then A starts with the configuration (s,w1aw2), where s is the initial state of A If M halts in a configuration of the form (h,w1w2) with a, then B starts with the configuration (s’,w1 w2), where s’ is the initial state in B
4
Graphical Conventions (3)
while (not a) do A a A Means that: If the initial configuration has the form (s,w1w2), then A starts with this configuration if a, where s is the initial state in A If A halts in a configuration of the form (h,w1w2) with a, then A starts with the configuration (s,w1 w2)
5
Basic Turing Machines a Denotes “write a on the current cell” (a is a character in ) Denotes “move to the right of the current cell” (the book uses “R” instead of “”) Denotes “move to the left of the current cell” (the book uses “L” instead of “”)
6
Other Simple Turing Machines
What it does a “if current cell has an a, then replace it with a b” b a “if current cell has a character a different than , then move once to the right and write that a”
7
The Turing Machine – – What it does?
Move to the right until if finds
8
The Turing Machine Draw diagram for –
9
and – – – Move to the left until the first non-blank space cell is found – Move to the right until the first non-blank space cell is found
10
The Conventions 2 simple rules: Rule # 1: Rule # 2: R
“move to the right until you find “ R “move to the right until you find a symbol other than “ Note: first check. Then move (think of a “while”) “Never forget Rule # 1” (Mr Miogi, The Karate Kid)
11
Example: The (ab)* Turing Machine
1 ? a b a b a b a a
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.