Slides:



Advertisements
Similar presentations
CS2303-THEORY OF COMPUTATION
Advertisements

Chapter 5 Pushdown Automata
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Pushdown Automata CPSC 388 Ellen Walker Hiram College.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
YES-NO machines Finite State Automata as language recognizers.
Pushdown Automata Part II: PDAs and CFG Chapter 12.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
Turing Machines New capabilities: –infinite tape –can read OR write to tape –read/write head can move left and right q0q0 input tape.
P, NP, PS, and NPS By Muhannad Harrim. Class P P is the complexity class containing decision problems which can be solved by a Deterministic Turing machine.
Theory of Computation What types of things are computable? How can we demonstrate what things are computable?
61 Nondeterminism and Nodeterministic Automata. 62 The computational machine models that we learned in the class are deterministic in the sense that the.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Turing Machines.
56 Rumination on the Formal Definition of DPDA In the definition of DPDA, there are some parts that do not agree with our intuition. Let M = (Q, , ,
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Chapter 9 Turing Machine (TMs).
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Turing Machines A more powerful computation model than a PDA ?
CSE202: Introduction to Formal Languages and Automata Theory Chapter 9 The Turing Machine These class notes are based on material from our textbook, An.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Pushdown Automata (PDAs)
Cs3102: Theory of Computation Class 6: Pushdown Automata Spring 2010 University of Virginia David Evans TexPoint fonts used in EMF. Read the TexPoint manual.
Lecture Pushdown Automata. stack stack head finite control tape head tape.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
1 1. Let A ={r, p, i } and B = { w, o, r, l, d }. What does each of the following (a), (b) and (c) denote? Briefly explain in plain English. (a) A * B.
Turing Machine Finite state automaton –Limitation: finite amount of memory –Prevents recognizing languages that are not regular {0 n 1 n |n = 0,1,2,…}
1 Design a PDA which accepts: L= { a n b m : n ≠ m }
Chapter 7 Pushdown Automata
PushDown Automata. What is a stack? A stack is a Last In First Out data structure where I only have access to the last element inserted in the stack.
September1999 CMSC 203 / 0201 Fall 2002 Week #15 – 2/4/6 December 2002 Prof. Marie desJardins.
Lecture 9  2010 SDU Lecture9: Turing Machine.  2010 SDU 2 Historical Note Proposed by Alan Turing in 1936 in: On Computable Numbers, with an application.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
1 Section 13.1 Turing Machines A Turing machine (TM) is a simple computer that has an infinite amount of storage in the form of cells on an infinite tape.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
1 Turing Machines - Chap 8 Turing Machines Recursive and Recursively Enumerable Languages.
Lecture 16b Turing Machines Topics: Closure Properties of Context Free Languages Cocke-Younger-Kasimi Parsing Algorithm June 23, 2015 CSCE 355 Foundations.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
CS 154 Formal Languages and Computability March 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Theory of Languages and Automata By: Mojtaba Khezrian.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
1 Key to Homework #3 (Models of Computation, Spring, 2001) Finite state control with a 4-way read/write head Figure (a)Figure (b) (over)
Formal Languages, Automata and Models of Computation
8. Introduction to Turing Machines
Theory of Computation Pushdown Automata pda Lecture #10.
Busch Complexity Lectures: Turing Machines
Turing Machines.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Turing Machines (TM) Deterministic Turing Machine (DTM)
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Intro to Data Structures
8. Introduction to Turing Machines
Pushdown automata a_introduction.htm.
CS21 Decidability and Tractability
Decidability and Tractability
Presentation transcript:

What is it about? . . . . acba aaba M G Models of Language Recognition Reminder What is it about? M aaba acba . . . . G Models of Language Recognition Models of Language Generation

Machine Models: Automata, that recognize (understand) the languages

Deterministic Turing Machines b Read/write tape q0 Two-way read/write head Finite State Control The Turing machine (TM) is a computational model which has a tape of infinite length divided into cells and a finite control unit with a two-way read/write head. In a move (i.e, a computational step) the TM, depending upon the symbol scanned by the head and current state of the control, does the following: (1) Writes a symbol on the tape cell under the head, replacing what was written, (2) changes the state of its control, and (3) moves the head to the left, right or does not move.

Deterministic Turing Machines Formally a TM is defined as a 6-tuple M = ( Q,  ,  ,  , q0 , F ), where Q is the finite set of states,  is the set of tape symbols (alphabet) including the blank symbol, usually denoted by B (a square box in the text),  is the set of input symbols, which is a subset of  , q0 is the start state, F is the set of accepting states (F  Q ), and  is the transition function which maps Q    Q    {L, N, R},

Deterministic Turing Machines where L, N, and R denote a move to the left, no move, and a move to the right, respectively. The transition function  may be undefined for some arguments. In this case we assume that the machine halts. It is assumed that initially an input string x   * is written on the tape and the machine is reading the leftmost symbol in the start state q0. Definition : We say a string x is accepted by a TM M if M, given x on the tape, enters an accepting state after some finite number of moves. Definition : The language recognized (or accepted) by a TM M, denoted by L(M), is the set of strings accepted by the machine, i.e., L(M) = { x | M accepts x}.

Example : Construct a deterministic Turing Machine which accepts {0n1n | n  1}. 1 q0 An idea : Traveling back and forth replace "1" by Y for each "0" replaced by X. The transition function  is defined as follows.

Transition Fuction (q0, 0) = (q1, X, R) In q0 , reading 0, change it to X, (q1, 0) = (q1, 0, R) move to the right searching 1 in q1. (q1, 1) = (q2, Y, L) Reading 1, replace it by Y, and (q2, 0) = (q2, 0, L) move to the left in q2 searching X. (q2, X) = (q3, X, R) Reading X, back up in q3 , and (q3, 0) = (q1, X, R) reading 0 repalce it by X. (q1, Y) = (q1, Y, R) In q1 , move over Y to the right. (q2, Y) = (q2, Y, L) In q2 , move over Y to the left. (q3, Y) = (q4, Y, R) Reading Y, instead of 0, enter q4, (q4, Y) = (q4, Y, R) and move over Y to the right, till (q4, B) = (q5, B, N) there appears blank, and accept in q5. X Y 1 q1 q2 q3 X Y q4 q5

Transition Table

Transition Graph (0,0,L) (Y,Y,L) (0,0,R) (Y,Y,R) (Y,Y,R) (1,Y,L) q2 q1 (X,X,R) (0,X,R) q4 (0,X,R) (B,B,N) q0 (Y,Y,R) start q3 q5 Now, the machine is formally defined as follows: M = ( Q,  ,  ,  , q0 , F ), where Q = {q0, q1, q2, q3, q4, q5},  = {0, 1},  = {0, 1, X, Y, B}, F = {q5}, and  is given in terms of one of the above forms, i.e, state transition function, state transition table or state transition graph.

Restricted Turing Machines (cont’ed) (1) Deterministic linear bounded automata (DLBA): [ a q0 b ] Two-way read/write The head cannot cross the left and right boundary markers ([ and ]), i.e., the computation must be done within the range of the input string. Other operations are the same as in the standard TM. Formally a DLBA is defined as a tuple M = (Q,  ,  ,  , q0, [, ], F), where, excepts for the boundary markers `[' and `]', all the elements of the tuple are defined the same way as for the Turing machines.

Restricted Turing Machines (cont’ed) (2) Deterministic pushdown automata (DPDA): a b Z0 q0 One-way read only Stack M = ( Q,  ,  ,  , q0 , Z0, F )  : Q  (   { } )    Q  *

Restricted Turing Machines (cont’ed) Formally a DPDA is a tuple M = ( Q,  ,  ,  , q0 , Z0, F ), where Q,  ,  ,  , q0 , Z0 and F are the set of states, the input alphabet, the stack alphabet, the start state, the bottom of stack symbol and the set of accepting states, respectively. The transition function  is a mapping  : Q  (   { } )    Q  * For example  ( q , a, Z ) = ( p,  ), where q , p  Q, a  , Z   , and  is a string of stack symbols written on top of the stack replacing Z. Conventionally, we assume that either || = 0, i.e.,  =  , means the machine pops the stack top symbol, || = 1, i.e., rewrites the stack top symbol, or || = 2, i.e., pushes a symbol on top of the stack.

Restricted Turing Machines (cont’ed) Example: Two transitions  ( p , a, Z ) = ( q,YX ) and  ( q, b, Y ) = ( r,  ) in sequence implies the following. …… Z a b c … p …… X Y a b c … q …… X a b c … r

Examples (a) Construct a DPDA which recognizes {aibi | i > 0 } (input symbol, current stack top/stack top changed) a b Z0 q0 One-way read only Stack start (a, Z0/aZ0) (a, a/aa) (b, a/) (, Z0/Z0)

Examples (cont’ed) (b) Construct a DPDA which recognizes {aibj | i > j > 0 } start (a, Z0/aZ0) (a, a/aa) (b, a/) (, Z0/Z0) start (a, Z0/Z0) (a, a/aa) (b, a/) (a, Z0/aZ0)

Examples (cont’ed) (c) Construct a DPDA which recognizes {aibj | j > i > 0 } start (a, Z0/Z0) (a, a/aa) (b, a/) (a, Z0/aZ0) start (a, Z0/aZ0) (a, a/aa) (b, a/) (b, Z0/Z0)

Examples (cont’ed) (d) Construct a DPDA which recognizes {aibkci | k, i > 0 }  {aibkdk | k, i > 0 } start (a, Z0/aZ0) (a, a/aa) (b, a/ba) (b, b/bb) (c, b/) (, b/) (, a/) (c, a/) (d, b/) (, a/a) (, Z0/ Z0) Notice that this machine needs -move, i.e., takes a step without reading the input.

Restricted Turing Machines (cont’ed) The input head should move to the right when it reads the input. The  in a transition  (q ,  , Z ) = ( p,  ) means the machine does not read the input. We call such transition  -move. The input head does not move when it does not read. An important restriction is that a DPDA cannot have both transitions  (q , a, Z ) and  (q,  ,Z) defined. Otherwise, it is a nondeterministic PDA, which will be discussed later. The language accepted by a DPDA M is defined as L(M)={x | M enters an accepting state some time after reading the last symbol of the input x}. Notice that, for an input string x to be accepted, the PDA should enter an accepting state and the whole string must be read.

Restricted Turing Machines (cont’ed) (3) Deterministic finite state automata (DFA): a b q0 One-way read only One-way DFA a b [ ] q0 Two-way read only Two-way DFA A DFA is defined as a tuple M = ( Q,  ,  ,  , q0 , F ). One-way DFA is a DFA whose head is not allowed to move to the left. The language accepted by a DFA M is defined as L(M) = {x | M enters an accepting state after reading the last symbol of input x}. It is proven that one-way FA's and two-way FA's are equivalent in the sense that they can accept the same languages.

Example Construct a DFA which recognizes the following language; {x | x is a binary number, i.e., x  {0, 1}+, which is divisible by 3 } 1 2 start State id indicates current remainder.