Pushdown Systems Koushik Sen EECS, UC Berkeley Slide Source: Sanjit A. Seshia.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 3. Specification Automata Syntax, given a set A of atomic observations: Sfinite set of states S 0 Sset of initial states S S transition.
Advertisements

Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2005.
1 1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 3 School of Innovation, Design and Engineering Mälardalen University 2012.
CS 267: Automated Verification Lecture 10: Nested Depth First Search, Counter- Example Generation Revisited, Bit-State Hashing, On-The-Fly Model Checking.
Chapter Two: Finite Automata
1 Languages. 2 A language is a set of strings String: A sequence of letters Examples: “cat”, “dog”, “house”, … Defined over an alphabet: Languages.
CS21 Decidability and Tractability
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
Model Checking Lecture 5. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
1 Finite Automata. 2 Finite Automaton Input “Accept” or “Reject” String Finite Automaton Output.
1 Languages and Finite Automata or how to talk to machines...
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Finite Automata Costas Busch - RPI.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
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.
1 CSCI 2400 section 3 Models of Computation Instructor: Costas Busch.
Algorithmic Software Verification IV. Regularity of configs of a PDA; modeling programs using PDA.
CSCI 2670 Introduction to Theory of Computing September 21, 2005.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
 Computability Theory Turing Machines Professor MSc. Ivan A. Escobar
CS 461 – Sept. 26 CFG correctness Section 2.2 – Pushdown Automata.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
Lazy Abstraction Jinseong Jeon ARCS, KAIST CS750b, KAIST2/26 References Lazy Abstraction –Thomas A. Henzinger et al., POPL ’02 Software verification.
Lecture # 28 Theory Of Automata By Dr. MM Alam 1.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 3 Mälardalen University 2010.
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 #2 Rina Zviel-Girshin Leah Epstein Winter
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
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.
Recognising Languages We will tackle the problem of defining languages by considering how we could recognise them. Problem: Is there a method of recognising.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
Formal Languages Finite Automata Dr.Hamed Alrjoub 1FA1.
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.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.
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.
Pushdown Automata - like NFA-  but also has a stack - transition takes the current state, the current input symbol, and the top-of-the-stack symbol (which.
  An alphabet is any finite set of symbols.  Examples: ASCII, Unicode, {0,1} ( binary alphabet ), {a,b,c}. Alphabets.
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.
Fall 2004COMP 3351 Finite Automata. Fall 2004COMP 3352 Finite Automaton Input String Output String Finite Automaton.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Languages.
Non Deterministic Automata
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Chapter 7 PUSHDOWN AUTOMATA.
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Chapter Two: Finite Automata
Non-Deterministic Finite Automata
Non Deterministic Automata
Finite Automata.
Chapter Five: Nondeterministic Finite Automata
Pushdown automata a_introduction.htm.
CSCI-2400 Models of Computation.
Widening Automata.
Principles of Computing – UFCFA3-30-1
Linear Time Properties
Some Graph Algorithms.
Presentation transcript:

Pushdown Systems Koushik Sen EECS, UC Berkeley Slide Source: Sanjit A. Seshia

2 Beyond Finite-State Systems Need to handle procedure calls and recursion

Flow Graph 3

Transitions 4

5

6

7

8

9

10 Pushdown Automaton Finite set of states plus one stack –Stack can grow unbounded Instead of states, we talk of configurations –Configuration = (State, Stack contents) (P, , , c 0 ) – P  finite set of states (control locations) –   finite stack alphabet  denotes empty stack, other symbols:  1,  2, … –  µ (P x  ) x (P x  *)  transition relation – c 0 2 P x  *  initial configuration

11 Representation Issues In finite state model checking, we needed to represent (finite sets of) states and transitions For pushdown model checking, we need to represent –Configurations –Transitions –(potentially infinite) Sets of them

12 Need for Symbolic Repn. Pushdown model checking inherently needs to be symbolic –to be complete (i.e., find all bugs) Representing infinitely many configs. Observation: The part that’s infinite is the stack –View the stack as a word in the language of some finite automaton –The set of possible stacks is the language (but we need to define the role of P, too)

13 Recap of Finite Automata A Finite Automaton is a 5-tuple M = (S, , R, S 0, F) – S  set of states –   finite alphabet – R µ S x  x S  transition relation – S 0  set of initial states – F  set of accepting (final) states A word w 2   is accepted by M if there’s a path s 0 f with s 0 2 S 0 and f 2 F w

14 Symbolic Representation Given pushdown system (P, , , c 0 ) A set of configurations is represented by a finite automaton (S, , R, S 0, F) where –S 0 = P – S ¶ P –  =  –Stack configuration (p, w) is represented as a path from initial state p to a final state f with edges labeled with the sequence of symbols in w

15 Reachability Analysis Start with (set of) initial / error state(s) Repeatedly compute set of next states, going either –Forward (next state operation = “post”) Post(S) = set of states reachable from S in one step of the transition relation –Backward (next state operation = “pre”) Pre(S) = set of states that can reach S in one step

16 Backward Reachability C = set of configurations –Identified with its finite automaton repn. Pre(C) = set of configs that can reach C by applying one rule in transition relation R We want to compute Pre*(C) –Iteratively compute Pre(C) until no new configurations added –Then check if the initial configuration is in Pre*(C) Example: C = err config {p, lock() z* lock() z*}

17 Backward Reachability for Pushdown Systems One step of Pre(C) : –Given Rule (p,  )  (p’, w) Path p’ q in C –Add an edge p q to C Intuition: –If config c 1 = (p’, ww’) is in C, then given above rule, c 2 = (p,  w’) is c 1 ’s predecessor and should be in C w 

18 Backward Reachability for Pushdown Systems One step of Pre(C) : –Given Rule (p,  )  (p’, w) Path p’ q in C –Add an edge p q to C Observe: no new states are added! –Apart from initial states which are states of the pushdown system (and possibly some other pre-existing states) w 

19 Example: C = {p 0,  0  0 }

20 Pre*(C) for the Example

21 Rules in pre* computation 3 kinds of rules: –(p,  )  (q,  ) Add edge (p, , q) –(p,  )  (q,  ’) Add edge (p, , q’) for each (q,  ’, q’) –(p,  )  (q,  1  2 ) Add edge (p, , q’’) for each {(q,  1, q’), (q’,  2, q’’)} How many times do we need to process each kind of rule?

22 Complexity of Pre*(C) N = number of states in C K = size of stack alphabet M = number of rules for pushdown system Assume we cycle through the rules on each iteration, adding edges if any match What’s the asymptotic running time of the Pre*(C) computation?