Algorithmic Software Verification IV. Regularity of configs of a PDA; modeling programs using PDA.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Pushdown Systems Koushik Sen EECS, UC Berkeley Slide Source: Sanjit A. Seshia.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Introduction to Computability Theory
CFG => PDA Sipser 2 (pages ).
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
CFG => PDA Sipser 2 (pages ). CS 311 Fall Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
Transparency No. 4-1 Formal Language and Automata Theory Chapter 4 Patterns, Regular Expressions and Finite Automata (include lecture 7,8,9) Transparency.
Fall 2004COMP 3351 Pushdown Automata PDAs. Fall 2004COMP 3352 Pushdown Automaton -- PDA Input String Stack States.
Pushdown Automaton (PDA)
Fall 2005Costas Busch - RPI1 Pushdown Automata PDAs.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Today Chapter 2: (Pushdown automata) Non-CF languages CFL pumping lemma Closure properties of CFL.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
Nathan Brunelle Department of Computer Science University of Virginia Theory of Computation CS3102 – Spring 2014 A tale.
Complexity and Computability Theory I Lecture #13 Instructor: Rina Zviel-Girshin Lea Epstein Yael Moses.
CSCI 2670 Introduction to Theory of Computing September 21, 2005.
Chapter 7 PDA and CFLs.
Basics of automata theory
Languages of nested trees Swarat Chaudhuri University of Pennsylvania (with Rajeev Alur and P. Madhusudan)
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
Algorithmic Software Verification III. Finite state games and pushdown automata.
Cs3102: Theory of Computation Class 6: Pushdown Automata Spring 2010 University of Virginia David Evans TexPoint fonts used in EMF. Read the TexPoint manual.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
Kleene’s Theorem Group No. 3 Presented To Mam Amina Presented By Roll No Roll No Roll No Roll No Group No. 3 Presented To Mam.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
Models of Computation. Computation: Computation is a general term for any type of information processing information processing CPU memory.
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.
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
Algorithms for hard problems Automata and tree automata Juris Viksna, 2015.
THE CONVENTIONS 2 simple rules: Rule # 1: Rule # 2: RR “move to the right until you find  “ Note: first check. Then move (think of a “while”) “Never.
Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.
1.Draw a parse tree for the following derivation: S  C A C  C A b b  b b A b b  b b B b b  b b a A a a b b  b b a b a a b b 2. Show on your parse.
1.Draw a parse tree for the following derivation: S  C A C  C A b b  b b A b b  b b B b b  b b a A a a b b  b b a b a a b b 2. Show on your parse.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
Complexity and Computability Theory I Lecture #5 Rina Zviel-Girshin Leah Epstein Winter
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
CIS Automata and Formal Languages – Pei Wang
Pushdown Automata PDAs
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata.
PUSHDOWN AUTOMATA. PUSHDOWN AUTOMATA Hierarchy of languages Regular Languages  Finite State Machines, Regular Expression Context Free Languages 
Push-down Automata.
Chapter 7 PUSHDOWN AUTOMATA.
AUTOMATA THEORY VI.
Pushdown Automata.
Intro to Theory of Computation
Jaya Krishna, M.Tech, Assistant Professor
Non-Determinism 12CS45 Finite Automata.
CSCI-2400 Models of Computation Costas Busch - RPI.
Intro to Data Structures
Finite Automata State Transition Graph (Non)deterministic FA: DFA, NFA
Pushdown automata a_introduction.htm.
Pushdown Automaton (PDA)
Principles of Computing – UFCFA3-30-1
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
Pushdown automata The Chinese University of Hong Kong Fall 2011
Recap lecture 37 New format for FAs, input TAPE, START, ACCEPT , REJECT, READ states Examples of New Format of FAs, PUSHDOWN STACK , PUSH and POP states,
Presentation transcript:

Algorithmic Software Verification IV. Regularity of configs of a PDA; modeling programs using PDA

Pushdown automata ( , Q, q_in, E, F) Q – finite set of states q_in -- initial state  -- stack alphabet E: { q –a, push d  q’ a  , e   q –a, pop d  q’ q –a  q’ }

Configurations A = ( , Q, q_in, E, F) Configuration of A: (q, w) -- q  Q, w   * Configuration graph of A: (q, w)  (q’, w) if there is a trans q –a  q’ (q, w)  (q’, w d) if there is a trans q –a,push d  q’ (q, w d)  (q’, w) if there is a trans q –a,pop d  q’ Note that this is an infinite graph. A config (q,w) is reachable if there is a path from (q_in, ε) in the config graph.

Configurations A = ( , Q, q_in, E, F) Let C A = { wq | (q,w) is a reachable config } We want to show that C A is regular. Also, the size of the automaton accepting C A is cubic in |A|.

Automaton accepting C A A = ( , Q, q_in, E, F) We will construct automaton B accepting C A Let states of C A be Q. Alphabet of C A is  ; initial state is q_in; final states: Q Edges: The smallest set of edges such that: If q –a  q’ then q – ε  q’ must belong to B If q –a,push d  q’ then q –d  q’ must belong to B If q –a, pop d  q’ and q’’ --a  * q then q’’ – ε  q’ must belong to B

Constructing B in O(n^3) time A = ( , Q, q_in, E, F) stack:= emptyset; hash:= emptyset; for every q in Q, put (q,q) on stack for every q,q’, set (q, q’).c-direct := emptyset; (q, q’).c-trans := emptyset; for every transitions u –push a  q, q –pop a  v put (u,v) on (q,q’).c-direct for every q, q’ in Q, q diff from q’, for every t in Q, put [ (q’, t)  (q, t) ] and [ (t, q)  (t, q’) ] in (q,q’).c-trans while stack is not empty e:= pop(stack) put e in hash (if e is not already in hash) transfer e.c-direct into stack for every [ f  g ] in e.c-trans if f is in hash, then put g on stack else put g on f.c-direct

Constructing B in O(n^3) time Stack – unprocessed epsilon edges Hash -- processed epsilon edges (q,q’).c-direct has (u,v): if (q, q’) is an eps edge, then (u,v) is an eps edge too. (q,q’).c-trans has (u1, v1)  (u2, v2): Given eps transition (q,q’), if (u1, v1) is an epsilon edge, then (u2, v2) is also an epsilon edge.

Emptiness L(A) is nonempty if and only if there is some reachable configuration of the form (q_f, w), q_f in F if and only if q_f is reachable from q_in Hence L(A) emptiness can be decided in O(n^3) time

Homework II 1. Take the translation of PDA emptiness to finite state games. This works only if emptiness of PDA is with respect to empty stack: i.e. PDA must read a word and at the end have an empty stack in order to accept the word. Modify the translation such that it works for PDA that accept by finite state. [ You are not allowed to transform the PDA into one accepting by empty stack ]

Homework II 2. Take any reasonable non-empty PDA. Translate the PDA emptiness problem into a game, solve the game and find the winning strategy. Then, give the word(s) that are accepted by the PDA which correspond to the winning strategy you have chosen. (PDA should be reasonable – should not be regular!)