Pushdown Automata (PDA) Reading: Chapter 6
|
|
- Alice Smith
- 7 years ago
- Views:
Transcription
1 Pushdown Automata (PDA) Reading: Chapter 6 1
2 PDA - the automata for CFLs What is? FA to Reg Lang, PDA is to CFL PDA == [ -NFA + a stack ] Why a stack? Input string -NFA Accept/reject A stack filled with stack symbols 2
3 Pushdown Automata - Definition A PDA P := ( Q,,, δ,q 0,Z 0,F ): Q: states of the -NFA : input alphabet : stack symbols δ: transition function q 0 : start state Z 0 : Initial stack top symbol F: Final/accepting states 3
4 old state input symb. Stack top δ : Q x x => Q x new state(s)new Stack top(s) δ : The Transition Function δ(q,a,x) = {(p,y), } 1. state transition from q to p 2. a is the next input symbol 3. X is the current stack top symbol 4. Y is the replacement for X; it is in * (a string of stack symbols) i. Set Y = for: Pop(X) ii. If Y=X: stack top is unchanged iii. If Y=Z 1 Z 2 Z k : X is popped and is replaced by Yin reverse order (i.e., Z 1 will be the new stack top) q a p X Y=? Action i) Y= Pop(X) ii) Y=X Pop(X) Push(X) iii) Y=Z 1 Z 2..Z k Pop(X) Push(Z k ) Push(Z k-1 ) Push(Z 2 ) Push(Z 1 ) Y 4
5 Example Let L wwr = {ww R w is in (0+1)*} CFG for L wwr : S==> 0S0 1S1 PDA for L wwr : P := ( Q,,, δ,q 0,Z 0,F ) = ( {q 0, q 1, q 2 },{0,1},{0,1,Z 0 },δ,q 0,Z 0,{q 2 }) 5
6 Initial state of the PDA: Stack top PDA for L wwr Z 0 q 0 1. δ(q 0,0, Z 0 )={(q 0,0Z 0 )} 2. δ(q 0,1, Z 0 )={(q 0,1Z 0 )} 3. δ(q 0,0, 0)={(q 0,00)} 4. δ(q 0,0, 1)={(q 0,01)} 5. δ(q 0,1, 0)={(q 0,10)} 6. δ(q 0,1, 1)={(q 0,11)} 7. δ(q 0,, 0)={(q 1, 0)} 8. δ(q 0,, 1)={(q 1, 1)} 9. δ(q 0,, Z 0 )={(q 1, Z 0 )} 10. δ(q 1,0, 0)={(q 1, )} 11. δ(q 1,1, 1)={(q 1, )} 12. δ(q 1,, Z 0 )={(q 2, Z 0 )} First symbol push on stack Grow the stack by pushing new symbols on top of old (w-part) Switch to popping mode, nondeterministically (boundary between w and w R ) Shrink the stack by popping matching symbols (w R -part) Enter acceptance state 6
7 PDA as a state diagram δ(q i,a, X)={(q j,y)} Current state Next input symbol q i Current stack top Stack Top Replacement (w/ string Y) a, X / Y Next q j state 7
8 PDA for L wwr : Transition Diagram Grow stack 0, Z 0 /0Z 0 1, Z 0 /1Z 0 0, 0/00 0, 1/01 1, 0/10 1, 1/11 Pop stack for matching symbols 0, 0/ 1, 1/ = {0, 1} = {Z 0, 0, 1} Q={q 0,q 1,q 2 }, Z 0 /Z 0 q 0 q 1 q 2, Z 0 /Z 0, 0/0, 1/1 Switch to popping mode, Z 0 /Z 0 Go to acceptance This would be a non-deterministic PDA 8
9 Example 2: language g of balanced paranthesis Pop stack for = { (, ) } matching symbols = {Z Grow stack 0, ( } Q={q 0,q 1,q 2 } (, Z 0 / ( Z 0 (, ( / ( ( ), ( / q 0 q 1 q 2, Z 0 / Z 0 ), ( /, Z Z0 /Z Z0 Switch to popping mode (, ( / ( ( (, Z 0 / ( Z 0, Z 0 / Z 0 Go to acceptance (by final state) when you see the stack bottom symbo To allow adjacent blocks of nested paranthesis 9
10 Example 2: language of balanced paranthesis (another design) (,Z 0 / ( Z 0 (,( / ( ( ), ( / = { (, ) } = {Z 0, ( } Q={q 0,q 1 } start,z 0 / Z 0,Z 0 / Z 0 q 0 q 1 10
11 PDA s Instantaneous Description (ID) A PDA has a configuration at any given instance: (q,w,y) q - current state w - remainder of the input (i.e., unconsumed part) y - current stack contents as a string from top to bottom of stack If δ(q,a, X)={(p, A)} is a transition, then the following are also true: (q, a, X ) --- (p,,a) (q, aw, XB ) --- (p,w,ab) --- sign is called a turnstile notation and represents one move ---* sign represents a sequence of moves 11
12 How does the PDA for L wwr work on input 1111? (q 0,1111,Z 0 ) All moves made by the non-deterministic PDA (q 0,111,1Z 0 ) (q 1,1111,Z 0 ) Path dies (q 0,11,11Z 11Z 0 ) (q 1,111,1Z 1Z 0 ) Path dies (q 0,1,111Z 0 ) (q 1,11,11Z 0 ) (q 0,,1111Z 0 ) (q 1,1,111Z 0 ) (q 1,1,1Z 0 ) Acceptance by final state: (q Z 1,,1111Z 0 ) (q 1,,11Z 0 ) (q 1,,Z 0 ) Path dies Path dies (q 2,,Z 0 ) = empty input AND final state 12
13 Principles about IDs Theorem 1: If for a PDA, (q, x, A) ---* (p, y, B), then for any string w * and *, it is also true that: t (q, x w, A ) ---* (p, y w, B ) Theorem 2: If for a PDA, (q, x w, A) ) ---* (p, y w, B), then it is also true that: (q, x, A) ---* (p, y, B) 13
14 There are two types of PDAs that one can design: those that accept by final state or by empty stack Acceptance by PDAs that accept by final state: For a PDA P, the language accepted by P, denoted d by L(P) by final state, t is: {w (q 0,w,Z 0 ) ---* (q,, A) }, s.t., q F Checklist: - input exhausted? - in a final state? PDAs that accept by empty stack: For a PDA P, the language accepted by P, denoted by N(P) by empty stack, is: {w (q 0,w,Z, 0 0) ---* (q,,, ) )}, for any q Q. Q) Does a PDA that accepts by empty stack need any final state specified in the design? Checklist: - input exhausted? - is the stack empty? 14
15 Example: L of balanced parenthesis PDA that accepts by final state P F : P N : (,Z 0 / ( Z 0 (,( / ( ( ), ( / An equivalent PDA that accepts by empty stack (Z (,Z 0 /(Z 0 (, ( / ( ( ), ( /,Z 0 / start q 0,Z 0 / Z 0 q 1 start q 0,ZZ 0 /Z 0,ZZ 0 /Z 0 How will these two PDAs work on the input: ( ( ( ) ) ( ) ) ( ) 15
16 PDA for L wwr : Proof of wwr correctness Theorem: The PDA for L wwr accepts a string x by final state if and only if x is of the form ww R. Proof: (if-part) If the string is of the form ww R then there exists a sequence of IDs that leads to a final state: (q 0,ww R,Z 0 ) ---* (q 0,w R,wZ 0 ) ---* (q 1,w R,wZ 0 ) ---* (q 1,,ZZ 0 ) --- * (q 2,,ZZ 0 ) (only-if part) Proof by induction on x 16
17 PDAs accepting by final state and empty stack are equivalent P F <= PDA accepting by final state P F = (Q F,,, δ F,q 0,Z 0,F) P N <= PDA accepting by empty stack P N = (Q N,,, δ N,q 0,Z 0 ) Theorem: (P N ==> P F ) For every P N, there exists a P F s.t. L(P F )=L(P N ) (P F ==> P N ) For every P F, there exists a P N s.t. L(P F )=L(P N ) 17
18 How to convert an empty stack PDA into a final state PDA? P N ==> P F construction Whenever P N s stack becomes empty, make P F go to a final state without consuming any addition symbol To detect empty stack in P N : P F pushes a new stack symbol X 0 (not in of P N ) initially before simultating P N P P : F : N New start, X 0 / X 0 p 0, X 0 /Z 0 X 0 q 0, X 0 / X 0, X 0 / X 0, X 0 / X 0, X 0 /X 0 p f P P F = (Q N U {p 0,p f },, N U {X 0 }, δ F, p 0, X 0, {p f }) 18
19 Example: Matching parenthesis ( ) P N : ( {q 0 }, {(,)}, {Z 0,Z 1 }, δ N, q 0, Z 0 ) δ N : δ N (q 0,(,Z 0 ) = { (q 0,Z 1 Z 0 ) } δ N (q 0,(,Z (Z)={(q 1 (q 0, Z 1 Z 1 )} δ N (q 0,),Z 1 ) = { (q 0, ) } δ N (q 0,,Z 0 ) = { (q 0, ) } P f : ( {p 0,q 0,p f }, {(,)}, {X 0,Z 0,Z 1 }, δ f, p 0, X 0, p f ) δ f : δ f (p 0,,X 0 ) = { (q 0,Z 0 ) } δ f (q 0,(,Z (Z)={(q 0 (q 0,Z 1 Z 0 )} δ f (q 0,(,Z 1 ) = { (q 0, Z 1 Z 1 ) } δ f (q 0,),Z 1 ) = { (q 0, ) } δ f (q 0,,Z 0 ) = { (q 0, ) } δ f (p 0,,X 0 ) = { (p f, X 0 ) } (,Z 0 /Z 1 Z 0 (,Z 1 /Z 1 Z 1 ),Z 1 /,Z 0 / 0 (,Z 0 /Z 1 Z 0 (,Z 1 /Z 1 Z 1 ),Z 1 /,Z 0 / start q 0 start p 0,X 0 /Z 0 X 0,X 0 / X 0 q 0 p f Accept by empty stack Accept by final state 19
20 How to convert an final state PDA into an empty stack PDA? P F ==> P N construction Main idea: Whenever P F reaches a final state, just make an -transition into a new end state, clear out the stack and accept Danger: What if P F design is such that it clears the stack midway without entering a final state? to address this, add a new start symbol X 0 (not in of P F F) P N = (Q U {p 0,p e },, U {X 0 }, δ N, p 0, X 0 ) P N : New start p 0, X 0 /Z 0 X 0 q 0, any/, any/ p e, any/, any/ P F 20
21 Equivalence of PDAs and CFGs 21
22 CFGs == PDAs ==> CFLs PDA by final state PDA by empty stack? CFG 22
23 This is same as: implementing a CFG using a PDA Converting CFG to PDA Main idea: The PDA simulates the leftmost derivation on a given w, and upon consuming it fully it either arrives at acceptance (by empty stack) or non-acceptance. INPU UT w PDA (acceptance by empty stack) accept reject OUTP PUT implements CFG 23
24 This is same as: implementing a CFG using a PDA Converting a CFG into a PDA Main idea: The PDA simulates the leftmost derivation on a given w, and upon consuming it fully it either arrives at acceptance (by empty py stack) or non-acceptance. Steps: 1. Push the right hand side of the production onto the stack, with leftmost symbol at the stack top 2. If stack top is the leftmost variable, then replace it by all its productions (each possible substitution will represent a distinct path taken by the non-deterministic PDA) 3. If stack top has a terminal symbol, and if it matches with the next symbol in the input string, then pop it State is inconsequential (only one state is needed) 24
25 Before: A Before: a a Formal construction of PDA from CFG Given: G= (V,T,P,S) Note: Initial stack symbol (S) same as the start variable in the grammar Output: P N = ({q}, T, V U T, δ, q, S) δ: For all A V, add the following transition(s) in the PDA: δ(q,,a) A)={(q (q, ) A ==> P} For all a T, add the following transition(s) in the PDA: δ(q,a,a)= { (q, ) } After: After: a a pop 25
26 Example: CFG to PDA G = ( {S,A}, {0,1}, P, S) P: S ==> AS A ==> 0A1 A1 01 PDA = ({q}, {0,1}, {0,1,A,S}, δ, q, S) δ: δ(q,, S) = { (q, AS), (q, )},S / S 1,1 / 0,0 /,A / 01,A / A1,A / 0A1,S S /,S / AS δ(q,, A) = { (q,0a1), (q,a1), (q,01) } δ(q, 0, 0) = { (q, ) } δ(q, 1, 1) = { (q, ) } How will this new PDA work? Lets simulate string 0011 q 26
27 Simulating string 0011 on the new PDA Leftmost deriv.: PDA (δ): δ(q,, S) = { (q, AS), (q, )} δ(q,, A) = { (q,0a1), (q,a1), (q,01) } δ(q, 0, 0) = { (q, ) } δ(q, 1, 1) = { (q, ) } Stack moves (shows only the successful path):,s / S 11/ 1,1 0,0 /,A / 01,A / A1,A / 0A1,S, /,S / AS q S => AS => 0A1S => 0011S => 0011 S A S 0 A 1 S 0 A S S S 0 1 S 1 S 1 Accept by empty stack S =>AS =>0A1S =>0011S =>
28 Proof of correctness for CFG ==> PDA construction Claim: A string is accepted by G iff it is accepted (by empty stack) by the PDA Proof: (only-if part) Prove by induction on the number of derivation steps (if part) If (q, wx, S) -- * (q,x,b) then S => * lm wb 28
29 Converting a PDA into a CFG Main idea: Reverse engineer the productions from transitions If δ(q,a,z) => (p, Y 1 Y 2 Y 3 Y k ): 1. State is changed from q to p; 2. Terminal a is consumed; 3. Stack top symbol Z is popped and replaced with a sequence of k variables. Action: Create a grammar variable called [qzp] which includes the following production: [qzp] => a[py 1 q 1 ][qy 1 2 q 2 ][qy 2 3 q 3 ] [q k-1 Y k q k ] Proof discussion (in the book) 29
30 Example: Bracket matching To avoid confusion, we will use b= ( and e= ) P N : ( {q 0 }, {b,e}, {Z 0,Z 1 }, δ, q 0, Z 0 ) 1. δ(q 0,b,Z 0 ) = { (q 0,Z 1 Z 0 ) } 2. δ(q 0,b,Z 1 ) = { (q 0,Z 1 Z 1 ) } 3. δ(q 0,e,Z 1 ) = { (q 0, ) } 4. δ(q 0,,Z 0 0) = { (q 0, )} If you were to directly write a CFG: S => b S e S 0. S => [q 0 Z 0 q 0 ] 1. [q 0 Z 0 q 0 ]=>b[qz 0 1 q 0 ][qz 0 0 q 0 ] 2. [q 0 Z 1 q 0 ] => b [q 0 Z 1 q 0 ] [q 0 Z 1 q 0 ] 3. [q 0 Z 1 q 0 ] => e 4. [q 0 Z 0 q 0 ] => Let A=[q 0 Z 0 q 0 ] Let B=[q 0 Z 1 q 0 ] 0. S => A 1. A => b B A 2. B => b B B 3. B => e 4. A => Simplifying, 0. S => b B S 1. B => bbb e B 30
31 Two ways to build a CFG Build a PDA Construct CFG from PDA (indirect) Derive CFG directly (direct) Similarly Two ways to build a PDA Derive a CFG Construct PDA from CFG (indirect) Design a PDA directly (direct) 31
32 Deterministic PDAs 32
33 This PDA for L wwr is non-deterministic Grow stack 0, Z 0 /0Z 0 1, Z 0 /1Z 0 0, 0/00 0, 1/01 1, 0/10 1, 1/11 Pop stack for matching symbols 0, 0/ 1, 1/ Why does it have to be nondeterministic? q 0 q 1 q 2, Z 0 /Z 0, 0/0, 1/1 Switch to popping mode, Z 0 /Z 0 Accepts by final state To remove guessing, impose the user to insert c in the middle 33
34 Example shows that: Nondeterministic PDAs D-PDAs D-PDA for L = R wcwr {wcw cissome some special symbol not in w} Grow stack 0, Z 0 /0Z 0 1, Z 0 /1Z 0 0, 0/00 0, 1/01 1, 0/10 1, 1/11 Pop stack for matching symbols 0, 0/ 1, 1/ Note: all transitions have become deterministic q 0 q 1 q 2 c, Z 0 /Z 0 c, 0/0 c, 1/1 Switch to popping mode, Z 0 /Z 0 Accepts by final state 34
35 Deterministic PDA: Definition A PDA is deterministic if and only if: 1. δ(qax)hasat δ(q,a,x) at most one member for any a U { } If δ(q,a,x) is non-empty for some a, then δ(q,,x) must be empty. 35
36 PDA vs DPDA vs Regular languages L wcwr L wwr Regular languages D-PDA non-deterministic PDA 36
37 Summary PDAs for CFLs and CFGs Non-deterministic Deterministic PDA acceptance types 1. By final state 2. By empty stack PDA IDs, Transition diagram Equivalence of CFG and PDA CFG => PDA construction PDA => CFG construction 37
Pushdown automata. Informatics 2A: Lecture 9. Alex Simpson. 3 October, 2014. School of Informatics University of Edinburgh als@inf.ed.ac.
Pushdown automata Informatics 2A: Lecture 9 Alex Simpson School of Informatics University of Edinburgh als@inf.ed.ac.uk 3 October, 2014 1 / 17 Recap of lecture 8 Context-free languages are defined by context-free
More informationAutomata and Computability. Solutions to Exercises
Automata and Computability Solutions to Exercises Fall 25 Alexis Maciel Department of Computer Science Clarkson University Copyright c 25 Alexis Maciel ii Contents Preface vii Introduction 2 Finite Automata
More informationPushdown Automata. place the input head on the leftmost input symbol. while symbol read = b and pile contains discs advance head remove disc from pile
Pushdown Automata In the last section we found that restricting the computational power of computing devices produced solvable decision problems for the class of sets accepted by finite automata. But along
More informationFormal Languages and Automata Theory - Regular Expressions and Finite Automata -
Formal Languages and Automata Theory - Regular Expressions and Finite Automata - Samarjit Chakraborty Computer Engineering and Networks Laboratory Swiss Federal Institute of Technology (ETH) Zürich March
More informationFinite Automata. Reading: Chapter 2
Finite Automata Reading: Chapter 2 1 Finite Automaton (FA) Informally, a state diagram that comprehensively captures all possible states and transitions that a machine can take while responding to a stream
More informationThe Halting Problem is Undecidable
185 Corollary G = { M, w w L(M) } is not Turing-recognizable. Proof. = ERR, where ERR is the easy to decide language: ERR = { x { 0, 1 }* x does not have a prefix that is a valid code for a Turing machine
More information3515ICT Theory of Computation Turing Machines
Griffith University 3515ICT Theory of Computation Turing Machines (Based loosely on slides by Harald Søndergaard of The University of Melbourne) 9-0 Overview Turing machines: a general model of computation
More informationSRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN
Course Code : CS0355 SRM UNIVERSITY FACULTY OF ENGINEERING & TECHNOLOGY SCHOOL OF COMPUTING DEPARTMENT OF SOFTWARE ENGINEERING COURSE PLAN Course Title : THEORY OF COMPUTATION Semester : VI Course : June
More informationCS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.
CS54 Turing Machines Turing Machine q 0 AI N P U T IN TAPE read write move read write move Language = {0} q This Turing machine recognizes the language {0} Turing Machines versus DFAs TM can both write
More informationFinite Automata. Reading: Chapter 2
Finite Automata Reading: Chapter 2 1 Finite Automata Informally, a state machine that comprehensively captures all possible states and transitions that a machine can take while responding to a stream (or
More informationTuring Machines: An Introduction
CIT 596 Theory of Computation 1 We have seen several abstract models of computing devices: Deterministic Finite Automata, Nondeterministic Finite Automata, Nondeterministic Finite Automata with ɛ-transitions,
More information(IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems.
3130CIT: Theory of Computation Turing machines and undecidability (IALC, Chapters 8 and 9) Introduction to Turing s life, Turing machines, universal machines, unsolvable problems. An undecidable problem
More informationChapter 7 Uncomputability
Chapter 7 Uncomputability 190 7.1 Introduction Undecidability of concrete problems. First undecidable problem obtained by diagonalisation. Other undecidable problems obtained by means of the reduction
More informationAutomata on Infinite Words and Trees
Automata on Infinite Words and Trees Course notes for the course Automata on Infinite Words and Trees given by Dr. Meghyn Bienvenu at Universität Bremen in the 2009-2010 winter semester Last modified:
More information6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010. Class 4 Nancy Lynch
6.045: Automata, Computability, and Complexity Or, Great Ideas in Theoretical Computer Science Spring, 2010 Class 4 Nancy Lynch Today Two more models of computation: Nondeterministic Finite Automata (NFAs)
More informationOn Winning Conditions of High Borel Complexity in Pushdown Games
Fundamenta Informaticae (2005) 1 22 1 IOS Press On Winning Conditions of High Borel Complexity in Pushdown Games Olivier Finkel Equipe de Logique Mathématique U.F.R. de Mathématiques, Université Paris
More informationAutomata and Formal Languages. Push Down Automata. Sipser pages 109-114. Lecture 13. Tim Sheard 1
Automata and Formal Languages Push Down Automata Sipser pages 109-114 Lecture 13 Tim Sheard 1 Push Down Automata Push Down Automata (PDAs) are ε-nfas with stack memory. Transitions are labeled by an input
More informationModel 2.4 Faculty member + student
Model 2.4 Faculty member + student Course syllabus for Formal languages and Automata Theory. Faculty member information: Name of faculty member responsible for the course Office Hours Office Number Email
More informationAutomata and Formal Languages
Automata and Formal Languages Winter 2009-2010 Yacov Hel-Or 1 What this course is all about This course is about mathematical models of computation We ll study different machine models (finite automata,
More informationÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK. 15 april 2003. Master Edition
ÖVNINGSUPPGIFTER I SAMMANHANGSFRIA SPRÅK 5 april 23 Master Edition CONTEXT FREE LANGUAGES & PUSH-DOWN AUTOMATA CONTEXT-FREE GRAMMARS, CFG Problems Sudkamp Problem. (3.2.) Which language generates the grammar
More informationCSC4510 AUTOMATA 2.1 Finite Automata: Examples and D efinitions Definitions
CSC45 AUTOMATA 2. Finite Automata: Examples and Definitions Finite Automata: Examples and Definitions A finite automaton is a simple type of computer. Itsoutputislimitedto yes to or no. It has very primitive
More informationHow To Compare A Markov Algorithm To A Turing Machine
Markov Algorithm CHEN Yuanmi December 18, 2007 1 Abstract Markov Algorithm can be understood as a priority string rewriting system. In this short paper we give the definition of Markov algorithm and also
More informationHonors Class (Foundations of) Informatics. Tom Verhoeff. Department of Mathematics & Computer Science Software Engineering & Technology
Honors Class (Foundations of) Informatics Tom Verhoeff Department of Mathematics & Computer Science Software Engineering & Technology www.win.tue.nl/~wstomv/edu/hci c 2011, T. Verhoeff @ TUE.NL 1/20 Information
More informationIntroduction to Automata Theory. Reading: Chapter 1
Introduction to Automata Theory Reading: Chapter 1 1 What is Automata Theory? Study of abstract computing devices, or machines Automaton = an abstract computing device Note: A device need not even be a
More informationOverview of E0222: Automata and Computability
Overview of E0222: Automata and Computability Deepak D Souza Department of Computer Science and Automation Indian Institute of Science, Bangalore. August 3, 2011 What this course is about What we study
More informationCSE 135: Introduction to Theory of Computation Decidability and Recognizability
CSE 135: Introduction to Theory of Computation Decidability and Recognizability Sungjin Im University of California, Merced 04-28, 30-2014 High-Level Descriptions of Computation Instead of giving a Turing
More informationTheoretical Computer Science (Bridging Course) Complexity
Theoretical Computer Science (Bridging Course) Complexity Gian Diego Tipaldi A scenario You are a programmer working for a logistics company Your boss asks you to implement a program that optimizes the
More informationC H A P T E R Regular Expressions regular expression
7 CHAPTER Regular Expressions Most programmers and other power-users of computer systems have used tools that match text patterns. You may have used a Web search engine with a pattern like travel cancun
More informationT-79.186 Reactive Systems: Introduction and Finite State Automata
T-79.186 Reactive Systems: Introduction and Finite State Automata Timo Latvala 14.1.2004 Reactive Systems: Introduction and Finite State Automata 1-1 Reactive Systems Reactive systems are a class of software
More informationRegular Languages and Finite State Machines
Regular Languages and Finite State Machines Plan for the Day: Mathematical preliminaries - some review One application formal definition of finite automata Examples 1 Sets A set is an unordered collection
More informationTuring Machines, Part I
Turing Machines, Part I Languages The $64,000 Question What is a language? What is a class of languages? Computer Science Theory 2 1 Now our picture looks like Context Free Languages Deterministic Context
More informationLecture Notes on Polynomials
Lecture Notes on Polynomials Arne Jensen Department of Mathematical Sciences Aalborg University c 008 Introduction These lecture notes give a very short introduction to polynomials with real and complex
More informationScanner. tokens scanner parser IR. source code. errors
Scanner source code tokens scanner parser IR errors maps characters into tokens the basic unit of syntax x = x + y; becomes = + ; character string value for a token is a lexeme
More informationSect 6.1 - Greatest Common Factor and Factoring by Grouping
Sect 6.1 - Greatest Common Factor and Factoring by Grouping Our goal in this chapter is to solve non-linear equations by breaking them down into a series of linear equations that we can solve. To do this,
More informationComputability Theory
CSC 438F/2404F Notes (S. Cook and T. Pitassi) Fall, 2014 Computability Theory This section is partly inspired by the material in A Course in Mathematical Logic by Bell and Machover, Chap 6, sections 1-10.
More information24 Uses of Turing Machines
Formal Language and Automata Theory: CS2004 24 Uses of Turing Machines 24 Introduction We have previously covered the application of Turing Machine as a recognizer and decider In this lecture we will discuss
More informationLecture summary for Theory of Computation
Lecture summary for Theory of Computation Sandeep Sen 1 January 8, 2015 1 Department of Computer Science and Engineering, IIT Delhi, New Delhi 110016, India. E- mail:ssen@cse.iitd.ernet.in Contents 1 The
More informationPush-down Automata and Context-free Grammars
14 Push-down Automata and Context-free Grammars This chapter details the design of push-down automata (PDA) for various languages, the conversion of CFGs to PDAs, and vice versa. In particular, after formally
More informationIntroduction to Turing Machines
Automata Theory, Languages and Computation - Mírian Halfeld-Ferrari p. 1/2 Introduction to Turing Machines SITE : http://www.sir.blois.univ-tours.fr/ mirian/ Automata Theory, Languages and Computation
More informationBoolean Algebra Part 1
Boolean Algebra Part 1 Page 1 Boolean Algebra Objectives Understand Basic Boolean Algebra Relate Boolean Algebra to Logic Networks Prove Laws using Truth Tables Understand and Use First Basic Theorems
More informationComputational Models Lecture 8, Spring 2009
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown Univ. p. 1 Computational Models Lecture 8, Spring 2009 Encoding of TMs Universal Turing Machines The Halting/Acceptance
More informationComposability of Infinite-State Activity Automata*
Composability of Infinite-State Activity Automata* Zhe Dang 1, Oscar H. Ibarra 2, Jianwen Su 2 1 Washington State University, Pullman 2 University of California, Santa Barbara Presented by Prof. Hsu-Chun
More informationThe Optimum One-Pass Strategy for Juliet
Master s Thesis One-Pass Strategies for Context-Free Games Christian Cöster August 2015 Examiners: Prof. Dr. Thomas Schwentick Prof. Dr. Christoph Buchheim Technische Universität Dortmund Fakultät für
More informationMathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson
Mathematics for Computer Science/Software Engineering Notes for the course MSM1F3 Dr. R. A. Wilson October 1996 Chapter 1 Logic Lecture no. 1. We introduce the concept of a proposition, which is a statement
More informationProperties of Stabilizing Computations
Theory and Applications of Mathematics & Computer Science 5 (1) (2015) 71 93 Properties of Stabilizing Computations Mark Burgin a a University of California, Los Angeles 405 Hilgard Ave. Los Angeles, CA
More informationRegular Expressions and Automata using Haskell
Regular Expressions and Automata using Haskell Simon Thompson Computing Laboratory University of Kent at Canterbury January 2000 Contents 1 Introduction 2 2 Regular Expressions 2 3 Matching regular expressions
More informationLecture 2: Universality
CS 710: Complexity Theory 1/21/2010 Lecture 2: Universality Instructor: Dieter van Melkebeek Scribe: Tyson Williams In this lecture, we introduce the notion of a universal machine, develop efficient universal
More informationAutomata Theory. Şubat 2006 Tuğrul Yılmaz Ankara Üniversitesi
Automata Theory Automata theory is the study of abstract computing devices. A. M. Turing studied an abstract machine that had all the capabilities of today s computers. Turing s goal was to describe the
More informationPushdown Automata. International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain
Pushdown Automata transparencies made for a course at the International PhD School in Formal Languages and Applications Rovira i Virgili University Tarragona, Spain Hendrik Jan Hoogeboom, Leiden http://www.liacs.nl/
More informationElectrical Symbols and Line Diagrams
Electrical Symbols and Line Diagrams Chapter 3 Material taken from Chapter 3 of One-Line Diagrams One-line diagram a diagram that uses single lines and graphic symbols to indicate the path and components
More informationIncreasing Interaction and Support in the Formal Languages and Automata Theory Course
Increasing Interaction and Support in the Formal Languages and Automata Theory Course [Extended Abstract] Susan H. Rodger rodger@cs.duke.edu Jinghui Lim Stephen Reading ABSTRACT The introduction of educational
More informationInformatique Fondamentale IMA S8
Informatique Fondamentale IMA S8 Cours 1 - Intro + schedule + finite state machines Laure Gonnord http://laure.gonnord.org/pro/teaching/ Laure.Gonnord@polytech-lille.fr Université Lille 1 - Polytech Lille
More informationWelcome to... Problem Analysis and Complexity Theory 716.054, 3 VU
Welcome to... Problem Analysis and Complexity Theory 716.054, 3 VU Birgit Vogtenhuber Institute for Software Technology email: bvogt@ist.tugraz.at office hour: Tuesday 10:30 11:30 slides: http://www.ist.tugraz.at/pact.html
More informationTwo Way F finite Automata and Three Ways to Solve Them
An Exponential Gap between LasVegas and Deterministic Sweeping Finite Automata Christos Kapoutsis, Richard Královič, and Tobias Mömke Department of Computer Science, ETH Zürich Abstract. A two-way finite
More informationIntrusion Detection via Static Analysis
Intrusion Detection via Static Analysis IEEE Symposium on Security & Privacy 01 David Wagner Drew Dean Presented by Yongjian Hu Outline Introduction Motivation Models Trivial model Callgraph model Abstract
More informationCartesian Products and Relations
Cartesian Products and Relations Definition (Cartesian product) If A and B are sets, the Cartesian product of A and B is the set A B = {(a, b) :(a A) and (b B)}. The following points are worth special
More informationComputer Architecture Syllabus of Qualifying Examination
Computer Architecture Syllabus of Qualifying Examination PhD in Engineering with a focus in Computer Science Reference course: CS 5200 Computer Architecture, College of EAS, UCCS Created by Prof. Xiaobo
More informationPhiladelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008.
Philadelphia University Faculty of Information Technology Department of Computer Science First Semester, 2007/2008 Course Syllabus Course Title: Theory of Computation Course Level: 3 Lecture Time: Course
More informationLogic in Computer Science: Logic Gates
Logic in Computer Science: Logic Gates Lila Kari The University of Western Ontario Logic in Computer Science: Logic Gates CS2209, Applied Logic for Computer Science 1 / 49 Logic and bit operations Computers
More informationUsing Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses
Using Hands-On Visualizations to Teach Computer Science from Beginning Courses to Advanced Courses Susan H. Rodger Department of Computer Science Duke University Durham, NC 27705 rodger@cs.duke.edu Abstract
More informationReading 13 : Finite State Automata and Regular Expressions
CS/Math 24: Introduction to Discrete Mathematics Fall 25 Reading 3 : Finite State Automata and Regular Expressions Instructors: Beck Hasti, Gautam Prakriya In this reading we study a mathematical model
More informationIntroduction to NP-Completeness Written and copyright c by Jie Wang 1
91.502 Foundations of Comuter Science 1 Introduction to Written and coyright c by Jie Wang 1 We use time-bounded (deterministic and nondeterministic) Turing machines to study comutational comlexity of
More informationCS5236 Advanced Automata Theory
CS5236 Advanced Automata Theory Frank Stephan Semester I, Academic Year 2012-2013 Advanced Automata Theory is a lecture which will first review the basics of formal languages and automata theory and then
More informationCS 301 Course Information
CS 301: Languages and Automata January 9, 2009 CS 301 Course Information Prof. Robert H. Sloan Handout 1 Lecture: Tuesday Thursday, 2:00 3:15, LC A5 Weekly Problem Session: Wednesday, 4:00 4:50 p.m., LC
More informationCS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015
CS 341: Foundations of Computer Science II elearning Section Syllabus, Spring 2015 Course Info Instructor: Prof. Marvin K. Nakayama Office: GITC 4312 Phone: 973-596-3398 E-mail: marvin@njit.edu (Be sure
More informationIncreasing Interaction and Support in the Formal Languages and Automata Theory Course
Increasing Interaction and Support in the Formal Languages and Automata Theory Course Susan H. Rodger Duke University ITiCSE 2007 June 25, 2007 Supported by NSF Grant DUE 0442513. Outline Overview of JFLAP
More informationThe Trip Scheduling Problem
The Trip Scheduling Problem Claudia Archetti Department of Quantitative Methods, University of Brescia Contrada Santa Chiara 50, 25122 Brescia, Italy Martin Savelsbergh School of Industrial and Systems
More informationSimulation-Based Security with Inexhaustible Interactive Turing Machines
Simulation-Based Security with Inexhaustible Interactive Turing Machines Ralf Küsters Institut für Informatik Christian-Albrechts-Universität zu Kiel 24098 Kiel, Germany kuesters@ti.informatik.uni-kiel.de
More informationDeterministic Finite Automata
1 Deterministic Finite Automata Definition: A deterministic finite automaton (DFA) consists of 1. a finite set of states (often denoted Q) 2. a finite set Σ of symbols (alphabet) 3. a transition function
More informationBottom-Up Parsing. An Introductory Example
Bottom-Up Parsing Bottom-up parsing is more general than top-down parsing Just as efficient Builds on ideas in top-down parsing Bottom-up is the preferred method in practice Reading: Section 4.5 An Introductory
More informationComplexity Theory. Jörg Kreiker. Summer term 2010. Chair for Theoretical Computer Science Prof. Esparza TU München
Complexity Theory Jörg Kreiker Chair for Theoretical Computer Science Prof. Esparza TU München Summer term 2010 Lecture 8 PSPACE 3 Intro Agenda Wrap-up Ladner proof and time vs. space succinctness QBF
More information6.080/6.089 GITCS Feb 12, 2008. Lecture 3
6.8/6.89 GITCS Feb 2, 28 Lecturer: Scott Aaronson Lecture 3 Scribe: Adam Rogal Administrivia. Scribe notes The purpose of scribe notes is to transcribe our lectures. Although I have formal notes of my
More information4.3 TABLE 3 TABLE 4. 1342 five 1 125 3 25 4 5 2 1 125 75 20 2 222.
.3 Conversion Between Number Bases 169.3 Conversion Between Number Bases Although the numeration systems discussed in the opening section were all base ten, other bases have occurred historically. For
More informationImplementation of Recursively Enumerable Languages using Universal Turing Machine in JFLAP
International Journal of Information and Computation Technology. ISSN 0974-2239 Volume 4, Number 1 (2014), pp. 79-84 International Research Publications House http://www. irphouse.com /ijict.htm Implementation
More informationCSEE 3827: Fundamentals of Computer Systems. Standard Forms and Simplification with Karnaugh Maps
CSEE 3827: Fundamentals of Computer Systems Standard Forms and Simplification with Karnaugh Maps Agenda (M&K 2.3-2.5) Standard Forms Product-of-Sums (PoS) Sum-of-Products (SoP) converting between Min-terms
More informationCS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing
CS143 Handout 08 Summer 2008 July 02, 2007 Bottom-Up Parsing Handout written by Maggie Johnson and revised by Julie Zelenski. Bottom-up parsing As the name suggests, bottom-up parsing works in the opposite
More informationModeling of Graph and Automaton in Database
1, 2 Modeling of Graph and Automaton in Database Shoji Miyanaga 1, 2 Table scheme that relational database provides can model the structure of graph which consists of vertices and edges. Recent database
More informationRow Echelon Form and Reduced Row Echelon Form
These notes closely follow the presentation of the material given in David C Lay s textbook Linear Algebra and its Applications (3rd edition) These notes are intended primarily for in-class presentation
More informationMACM 101 Discrete Mathematics I
MACM 101 Discrete Mathematics I Exercises on Combinatorics, Probability, Languages and Integers. Due: Tuesday, November 2th (at the beginning of the class) Reminder: the work you submit must be your own.
More informationComputationally Complete Spiking Neural P Systems Without Delay: Two Types of Neurons Are Enough
Computationally Complete Spiking Neural P Systems Without Delay: Two Types of Neurons Are Enough Rudolf Freund 1 and Marian Kogler 1,2 1 Faculty of Informatics, Vienna University of Technology Favoritenstr.
More informationFast nondeterministic recognition of context-free languages using two queues
Fast nondeterministic recognition of context-free languages using two queues Burton Rosenberg University of Miami Abstract We show how to accept a context-free language nondeterministically in O( n log
More informationTwo-dimensional Languages
Charles University Faculty of Mathematics and Physics Mgr. Daniel Průša Two-dimensional Languages Doctoral Thesis Supervisor: Martin Plátek, CSc. Prague, 2004 Acknowledgements The results presented in
More informationHint 1. Answer (b) first. Make the set as simple as possible and try to generalize the phenomena it exhibits. [Caution: the next hint is an answer to
Problem. Consider the collection of all subsets A of the topological space X. The operations of osure A Ā and ementation A X A are functions from this collection to itself. (a) Show that starting with
More informationPredicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.
Predicate Logic Example: All men are mortal. Socrates is a man. Socrates is mortal. Note: We need logic laws that work for statements involving quantities like some and all. In English, the predicate is
More informationFinite Automata and Regular Languages
CHAPTER 3 Finite Automata and Regular Languages 3. Introduction 3.. States and Automata A finite-state machine or finite automaton (the noun comes from the Greek; the singular is automaton, the Greek-derived
More informationRegular Languages and Finite Automata
Regular Languages and Finite Automata 1 Introduction Hing Leung Department of Computer Science New Mexico State University Sep 16, 2010 In 1943, McCulloch and Pitts [4] published a pioneering work on a
More informationFundamentele Informatica II
Fundamentele Informatica II Answer to selected exercises 1 John C Martin: Introduction to Languages and the Theory of Computation M.M. Bonsangue (and J. Kleijn) Fall 2011 Let L be a language. It is clear
More informationDiagonalization. Ahto Buldas. Lecture 3 of Complexity Theory October 8, 2009. Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach.
Diagonalization Slides based on S.Aurora, B.Barak. Complexity Theory: A Modern Approach. Ahto Buldas Ahto.Buldas@ut.ee Background One basic goal in complexity theory is to separate interesting complexity
More information6.3 Conditional Probability and Independence
222 CHAPTER 6. PROBABILITY 6.3 Conditional Probability and Independence Conditional Probability Two cubical dice each have a triangle painted on one side, a circle painted on two sides and a square painted
More informationFormal Grammars and Languages
Formal Grammars and Languages Tao Jiang Department of Computer Science McMaster University Hamilton, Ontario L8S 4K1, Canada Bala Ravikumar Department of Computer Science University of Rhode Island Kingston,
More informationSection 4.2: The Division Algorithm and Greatest Common Divisors
Section 4.2: The Division Algorithm and Greatest Common Divisors The Division Algorithm The Division Algorithm is merely long division restated as an equation. For example, the division 29 r. 20 32 948
More informationLecture 1: Oracle Turing Machines
Computational Complexity Theory, Fall 2008 September 10 Lecture 1: Oracle Turing Machines Lecturer: Kristoffer Arnsfelt Hansen Scribe: Casper Kejlberg-Rasmussen Oracle TM Definition 1 Let A Σ. Then a Oracle
More informationω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear:
ω-automata ω-automata Automata that accept (or reject) words of infinite length. Languages of infinite words appear: in verification, as encodings of non-terminating executions of a program. in arithmetic,
More informationAutomata, languages, and grammars
Automata, languages, and grammars Cristopher Moore January 24, 2015 Abstract These lecture notes are intended as a supplement to Moore and Mertens The Nature of Computation, and are available to anyone
More informationa 1 x + a 0 =0. (3) ax 2 + bx + c =0. (4)
ROOTS OF POLYNOMIAL EQUATIONS In this unit we discuss polynomial equations. A polynomial in x of degree n, where n 0 is an integer, is an expression of the form P n (x) =a n x n + a n 1 x n 1 + + a 1 x
More informationNotes on Complexity Theory Last updated: August, 2011. Lecture 1
Notes on Complexity Theory Last updated: August, 2011 Jonathan Katz Lecture 1 1 Turing Machines I assume that most students have encountered Turing machines before. (Students who have not may want to look
More information4.6 The Primitive Recursive Functions
4.6. THE PRIMITIVE RECURSIVE FUNCTIONS 309 4.6 The Primitive Recursive Functions The class of primitive recursive functions is defined in terms of base functions and closure operations. Definition 4.6.1
More informationS on n elements. A good way to think about permutations is the following. Consider the A = 1,2,3, 4 whose elements we permute with the P =
Section 6. 1 Section 6. Groups of Permutations: : The Symmetric Group Purpose of Section: To introduce the idea of a permutation and show how the set of all permutations of a set of n elements, equipped
More informationLast not not Last Last Next! Next! Line Line Forms Forms Here Here Last In, First Out Last In, First Out not Last Next! Call stack: Worst line ever!
ECE 551 C++ Programming, Data structures, and Algorithms Abstract Data Type: Stack Last In First Out (LIFO) 1 2 2 1 4 3 1 3 4 Stacks in Programming Worst line ever! 5 3 1 5 Stacks are not useful for waiting
More informationPreventing Denial of Service Attacks in a Calculus of Mobile Resources
Preventing Denial of Service Attacks in a Calculus of Mobile Resources Bilge Hösükoǧlu, David Sánchez Hernández, Julian Driver June 1, 2006 Abstract In this paper we introduce membranes for the calculus
More information