1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 16, 2003.

Slides:



Advertisements
Similar presentations
Model Checking Lecture 4. Outline 1 Specifications: logic vs. automata, linear vs. branching, safety vs. liveness 2 Graph algorithms for model checking.
Advertisements

Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
M ODEL CHECKING -Vasvi Kakkad University of Sydney.
Partial Order Reduction: Main Idea
BDDs & Theorem Proving Binary Decision Diagrams Dr. Eng. Amr T. Abdel-Hamid NETW 703 Winter 2012 Network Protocols Lectures are based on slides by: K.
Planning based on Model Checking Dept. of Information Systems and Applied CS Bamberg University Seminar Paper Svetlana Balinova.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
CS357 Lecture: BDD basics David Dill 1. 2 BDDs (Boolean/binary decision diagrams) BDDs are a very successful representation for Boolean functions. A BDD.
IT University of Copenhagen Lecture 7: BDD Construction and Manipulation 1. BDD construction 2. Boolean operations on BDDs 3. BDD-Based configuration.
SYMBOLIC MODEL CHECKING: STATES AND BEYOND J.R. Burch E.M. Clarke K.L. McMillan D. L. Dill L. J. Hwang Presented by Rehana Begam.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
© 2011 Carnegie Mellon University Binary Decision Diagrams Part Bug Catching: Automated Program Verification and Testing Sagar Chaki September.
Binary Decision Diagrams. ROBDDs Slide 2 Example Directed acyclic graph non-terminal node terminal node What function is represented by the graph?
1 Huffman Codes. 2 Introduction Huffman codes are a very effective technique for compressing data; savings of 20% to 90% are typical, depending on the.
Spring 07, Feb 13 ELEC 7770: Advanced VLSI Design (Agrawal) 1 ELEC 7770 Advanced VLSI Design Spring 2007 Binary Decision Diagrams Vishwani D. Agrawal James.
3/25  Monday 3/31 st 11:30AM BYENG 210 Talk by Dana Nau Planning for Interactions among Autonomous Agents.
DATE-2002TED1 Taylor Expansion Diagrams: A Compact Canonical Representation for Symbolic Verification M. Ciesielski, P. Kalla, Z. Zeng B. Rouzeyre Electrical.
ECE Synthesis & Verification - Lecture 18 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Word-level.
A New Approach to Structural Analysis and Transformation of Networks Alan Mishchenko November 29, 1999.
Rolf Drechlser’s slides used
A Compressed Breadth-First Search for Satisfiability DoRon B. Motter and Igor L. Markov University of Michigan, Ann Arbor.
ECE Synthesis & Verification - Lecture 10 1 ECE 697B (667) Spring 2006 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Binary.
 2001 CiesielskiBDD Tutorial1 Decision Diagrams Maciej Ciesielski Electrical & Computer Engineering University of Massachusetts, Amherst, USA
ECE 667 Synthesis & Verification - BDD 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Binary Decision Diagrams (BDD)
ECE 667 Synthesis and Verification of Digital Systems
IT University of Copenhagen Lecture 8: Binary Decision Diagrams 1. Classical Boolean expression representations 2. If-then-else Normal Form (INF) 3. Binary.
Fast Spectral Transforms and Logic Synthesis DoRon Motter August 2, 2001.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: BDD BDDs applied in equivalence checking.
1 Introduction to SMV and Model Checking Mostly by: Ken McMillan Cadence Berkeley Labs Small parts by: Brandon Eames ISIS/Vanderbilt.
B. Alizadeh Advanced Logic Design (2008) 1 / 55 Decision Diagrams.
Identifying Reversible Functions From an ROBDD Adam MacDonald.
Binary Decision Diagrams (BDDs)
Model Checking Lecture 4 Tom Henzinger. Model-Checking Problem I |= S System modelSystem property.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.
An ordered n-tuple is a set of n objects with an order associated with them. If n objects are represented by x 1, x 2,..., x n, then we write the ordered.
NP Complexity By Mussie Araya. What is NP Complexity? Formal Definition: NP is the set of decision problems solvable in polynomial time by a non- deterministic.
CS 267: Automated Verification Lecture 6: Binary Decision Diagrams Instructor: Tevfik Bultan.
Algorithmic Software Verification V &VI. Binary decision diagrams.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Mathematical Preliminaries
1 Verification of FSM Equivalence Goal: Verify that two sequential circuit implementations always produce the same sequence of outputs given the same sequence.
1 Symmetry Symmetry Chapter 14 from “Model Checking” by Edmund M. Clarke Jr., Orna Grumberg, and Doron A. Peled presented by Anastasia Braginsky March.
Binary decision diagrams (BDD’s) Compact representation of a logic function ROBDD’s (reduced ordered BDD’s) are a canonical representation: equivalence.
1 Class Presentation on Binary Moment Diagrams by Krishna Chillara Base Paper: “Verification of Arithmetic Circuits with Binary Moment Diagrams” by Randal.
1 Semantically Equivalent Formulas Let Φ and ψ be formulas of propositional logic. We say that Φ and ψ are semantically equivalent iff Φ ╞ ψ ψ ╞ Φ hold.
1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 9, 2003.
BDDs1 Binary Tree Representation The recursive Shannon expansion corresponds to a binary tree Example: Each path from the root to a leaf corresponds to.
Boolean Functions 1 ECE 667 ECE 667 Synthesis and Verification of Digital Circuits Boolean Functions Basics Maciej Ciesielski Univ.
Chapter 5 Finite Automata Finite State Automata n Capable of recognizing numerous symbol patterns, the class of regular languages n Suitable for.
Binary Decision Diagrams Prof. Shobha Vasudevan ECE, UIUC ECE 462.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
IT 60101: Lecture #121 Foundation of Computing Systems Lecture 13 Trees: Part VIII.
How CTL model checking works
CSEP590 – Model Checking and Automated Verification
CTL model checking algorithms
ECE 667 Synthesis and Verification of Digital Systems
Alternating tree Automata and Parity games
CSEP590 – Model Checking and Automated Verification
Binary Decision Diagrams
Formal Methods in software development
CSCI1600: Embedded and Real Time Software
Formal Methods in software development
A logic function f in n inputs x1, x2, ...xn and
NP-Completeness Yin Tat Lee
A logic function f in n inputs x1, x2, ...xn and
Instructor: Aaron Roth
Presentation transcript:

1 CSEP590 – Model Checking and Automated Verification Lecture outline for July 16, 2003

2 -Our Model Checker suffers from state space explosion: -We need a more compact representation of the system -A verification procedure to handle this compact system -Let’s develop this compact representation – will be in terms of Ordered Binary Decision Diagrams (OBDDs) -But first, we need some background on boolean functions -Boolean functions -Composed of boolean variables and operators (like in prop. logic) -Representations: truth tables or prop. formulas. Both very inefficient in size of representation. -Better representation: Binary Decision Diagrams (BDDs) -Simpler form is called a Binary Decision Tree (bdt) -Non-terminal nodes labeled with boolean var, terminals with either 0 or 1. Dashed line and solid line links root node x to 2 children (representing valuation of x of 0 and 1 respectively)

3 -(Example shown in class) -If T is a bdt, then T represents a unique boolean function of the variables representing non-terminals -But, bdt is still inefficient in size, in fact it is ~size of a truth table for representing boolean functions -How improve? Eliminate redundancy! -For example, combine all 0-terminals and all 1-terminals -No longer have a tree, instead it is called a BDD -Defn: a subBDD is part of a BDD below a given node n such that n is the root of the subBDD -3 ways of reducing bdt to its most compact form (called reduced). (Explained in detail via examples in class) -C1) Removal of duplicate terminal nodes -C2) Removal of redundant tests -C3) Removal of duplicate non-terminals -BDDs are actually dags (directed non-acyclic graphs) -We interpret links in BDDs as pointing down

4 -BDDs are dags with a unique initial node -A BDD is reduced if no further C1-C3 optimizations can be applied -Note: BDDs also represent boolean functions just like bdts -BDDs can often be compact representations of boolean functions (due to C1-C3 optimizations) -Checking satisfiability is easy – just look for path to a 1 -How perform operations of AND, NOT, OR on BDDs? -Given B f and B g representing functions f and g, then we can construct a BDD B representing f op g. -Inefficient methods – we’ll see in class. We can improve on these (later in class) -But we still have a problem: how check equivalency between BDDs?? Ouch. -Impose an ordering on the variables occurring along ANY path of a BDD

5 -Then, impose that ordering on all BDDs under consideration -Defn: if [x 1,…x n ] is an ordered list of variables with duplicates and B is a BDD with all these variables, then B has ordering [x 1,…x n ] if all variables of B occur in the list and for every occurrence of x i followed by x j along any path in B, we have i<j -Such BDDs with an ordering are called Ordered Binary Decision Diagrams (OBDDs) -We’ll see some examples in class -To perform operations on 2 BDDs, we’ll require that they have comparable variable orderings (ie, no inversions in their orderings) -Theorem: if 2 reduced OBDDs with comparable variable orderings represent the same boolean function, then they have identical structure! => unique OBDD for every boolean formula -OBDDs can yield exponential savings in space (ex in class)

6 -Note: the variable ordering can make a HUGE difference in the size of the reduced OBDD -Price we pay for advantages of OBDDs -Luckily, good heuristics exist for find good orderings -In-class example of computing reduced OBDD -We now consider some basic algorithms for operating on reduced OBDDs -1) algorithm reduce: transforms OBDD to its reduced form -Start with lowest layer (terminals), and work up to root -Let lo(n) denote dashed child of n, hi(n) as solid child of n -Label nodes with an integer id (node n = id(n)) s.t. subOBDDs with root nodes n and m denote same function iff id(n) = id(m) -Assume we’ve labeled all nodes in layers > i. Given x i -node n in layer i, there are 3 ways to label it -1) if id(lo(n)) = id(hi(n)), id(n) = that label (C2 test)

7 -2) if there exists a node m s.t. n and m have the same variable x i, and id(lo(n)) = id(lo(m)) and id(hi(n)) = id(hi(m)), then id(n) = id(m). (C3 case) -3) Otherwise, id(n) gets next unused integer -Algorithm is efficient in the number of nodes in OBDD -2) algorithm apply: implement operations on boolean functions represented as OBDDs -Given OBDDs B f and B g for functions f and g, apply(op,B f,B g ) returns the reduced OBDD for f op g. -Defn: a restriction of function f is of the form f[0/x] or f[1/x] which denotes f with all instances of x set to 0 (and 1 respectively) -Shannon Expansion (really due to Boole): -Function f  !x*f[0/x] + x*f[1/x] -Allows for recursion on boolean formulas! -Idea: based on Shannon expansion for f op g -f op g  !x i *(f[0/x i ] op g[0/x i ]) + x i *(f[1/x i ] op g[1/x i ]) -Call this equation ‘(SE)’

8 -Algorithm proceeds from root r f of B f and root r g of B g downwards in a recursive manner based on cases of r f and r g : -1) if r f and r g are terminal nodes with labels l f and l g, then compute the value of l f op l g and return the resulting OBDD as B 0 or B 1 (depending on value, either 0 or 1) -2) if both roots are x i -nodes, then create an x i -node n with a dashed line to apply(op,lo(r f ),lo(r g )) and a solid line to apply(op,hi(r f ),hi(r g )). This is precisely what equation (SE) tells us to do! -3) if r f is an x i -node and r g is either a terminal or x j -node with j<i, then no x i -node exists in B g because the 2 OBDDs have a comparable variable ordering and we are proceeding top down. Thus, g is independent of variable x i. Therefore, we create an x i -node n with a dashed line to apply(op,lo(r f ),r g ) and a solid line to apply(op,hi(r f ),r g ) -4) Symmetric case: r f takes the role of r g in 3) and vice versa

9 -There are also 2 other algorithms, restrict and exists. But these are straightforward and are covered in the book. They won’t be necessary to understand for our understanding of symbolic model checking. -Now that we have developed the OBDD representation, we can use it as our basic data structure in model checking. -Recall that our model checking algorithm basically manipulates intermediate sets of states. Operations are performed on these sets. -We now show how to represent sets of states as OBDDs, and how these same operations on sets can be performed on OBDDs. Thus, we can apply our model checker using the compact OBDD representation instead of the huge, transition system representation. -This technique, in its basic form, is called Symbolic Model Checking -Provided a huge breakthrough in the early 1990s

10 -First, we need to encode sets of states as OBDDs and the transition relation from our model as an OBDD -Sets of states encoding: -Each state s is represented by a unique vector of boolean values (v 1,…v n ). A subset T of S is a boolean function f T mapping (v 1,…v n ) onto 1 if s is in T and 0 otherwise. f T is known as the characteristic function. -How do we construct this vector? Use the set of atomic propositions (AP). Let’s assume a fixed ordering on the elements of AP, say x 1,x 2,…,x n. Then s is represented by the vector (v 1,…,v n ) where for each i, v i = 1 if x i  L(s) and 0 otherwise. -We require that vectors are unique, namely that if L(s 1 ) = L(s 2 ), then s 1 = s 2 -If not, we can just add extra, dummy atomic props to our model

11 -We can then represent s as the OBDD for the boolean function l 1 *l 2 *…*l n where l i is x i if x i  L(s) and !x i otherwise -A set of states is then just the disjunction of the formulas for each state in the set! -We’ll see an example in class, it really is pretty straightforward -Now, let’s represent the transition relation of a system as an OBDD -Recall: transition relation  is just a subset of S x S -Think of it as a set of (curr state, next state) pairs -We then represent such pairs using 2 boolean vectors, one for the curr state and one for the next state in the pair -Suppose we have the transition s  s’ -This is represented by the pair of boolean vectors ((v 1,…,v n ),(v 1 ’,…,v n ’)) where v 1 = 1 if p i  L(s) and 0 otherwise, and v i ’ = 1 if p i  L(s’) and 0 otherwise

12 -Then, a transition s  s’ is simply represented as an OBBD of the boolean function (l 1 *l 2 *…*l n )*(l 1 ’*l 2 ’*…*l n ’) -To form the transition relation  for the entire system, it is just the OBDD for the boolean formula that is the disjunction of all such individual transition formulae -Once again, we’ll see an example in class that will make it clear -What does this mean? We can use our apply algorithm to simulate intersection, union, and complementation of sets on OBDD representation of state sets! -One last thing though…our model checking algorithm also had 2 trickier routines that it used, namely pre  (X) which given a set of states X, returns all states that can transition into X, and pre  (X) that returns those states that can transition only into X. These are used in the routines for operators EX and EU, and AF respectively. -How do we do those in terms of our OBDD representation?

13 -We first note that pre  (X) = S - pre  (S-X). Thus, we only need to concern ourselves with pre  (X), which is nice -In short, it can be done, but it is a confusing equation involving our exists and apply algorithms. It is given in the textbook on page The final part of this lecture with examine the model checker SMV (for Symbolic Model Verifier) developed at CMU and widely considered one of the best model checkers out there. I will be handing out a handout in class describing the language used to program SMV, with examples. We will discuss it, and you will use it for your PS4.