1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref.

Slides:



Advertisements
Similar presentations
The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Advertisements

Exploiting SAT solvers in unbounded model checking
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Completeness and Expressiveness
Auto-Generation of Test Cases for Infinite States Reactive Systems Based on Symbolic Execution and Formula Rewriting Donghuo Chen School of Computer Science.
Semantics Static semantics Dynamic semantics attribute grammars
Introduction to Formal Methods for SW and HW Development 09: SAT Based Abstraction/Refinement in Model-Checking Roberto Sebastiani Based on work and slides.
SAT Based Abstraction/Refinement in Model-Checking Based on work by E. Clarke, A. Gupta, J. Kukula, O. Strichman (CAV’02)
ECE Synthesis & Verification - L271 ECE 697B (667) Spring 2006 Synthesis and Verification of Digital Systems Model Checking basics.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Department of Computer Science & Engineering
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
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.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
1 Basic abstract interpretation theory. 2 The general idea §a semantics l any definition style, from a denotational definition to a detailed interpreter.
1 Model Checking, Abstraction- Refinement, and Their Implementation Based on slides by: Orna Grumberg Presented by: Yael Meller June 2008.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Beyond Vacuity: Towards the Strongest Passing Formula Hana ChocklerArie Gurfinkel Ofer Strichman Technion - Israel Institute of Technology IBM Research.
CS 536 Spring Global Optimizations Lecture 23.
White Box Testing and Symbolic Execution Written by Michael Beder.
Validating Streaming XML Documents Luc Segoufin & Victor Vianu Presented by Harel Paz.
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
Data Flow Analysis Compiler Design Nov. 8, 2005.
Prof. Fateman CS 164 Lecture 221 Global Optimization Lecture 22.
ESE601: Hybrid Systems Introduction to verification Spring 2006.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
Outline Chapter 1 Hardware, Software, Programming, Web surfing, … Chapter Goals –Describe the layers of a computer system –Describe the concept.
Describing Syntax and Semantics
Data Flow Analysis Compiler Design Nov. 8, 2005.
Programming Language Semantics Denotational Semantics Chapter 5 Part III Based on a lecture by Martin Abadi.
CS 267: Automated Verification Lecture 13: Bounded Model Checking Instructor: Tevfik Bultan.
Cardinality & Sorting Networks. Cardinality constraint Appears in many practical problems: scheduling, timetabling etc’. Also takes place in the Max-Sat.
Prof. Bodik CS 164 Lecture 16, Fall Global Optimization Lecture 16.
1/25 Pointer Logic Changki PSWLAB Pointer Logic Daniel Kroening and Ofer Strichman Decision Procedure.
Regular Model Checking Ahmed Bouajjani,Benget Jonsson, Marcus Nillson and Tayssir Touili Moran Ben Tulila
7/13/2003BMC A SAT-Based Approach to Abstraction Refinement in Model Checking Bing Li, Chao Wang and Fabio Somenzi University of Colorado at Boulder.
Automatic Abstraction Refinement for GSTE Yan Chen, Yujing He, and Fei Xie Portland State University Jin Yang Intel Nov 13, 2007.
Binary Decision Diagrams (BDDs)
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Scalable Statistical Bug Isolation Authors: B. Liblit, M. Naik, A.X. Zheng, A. Aiken, M. I. Jordan Presented by S. Li.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
On Reducing the Global State Graph for Verification of Distributed Computations Vijay K. Garg, Arindam Chakraborty Parallel and Distributed Systems Laboratory.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Verification & Validation By: Amir Masoud Gharehbaghi
SAT-Based Model Checking Without Unrolling Aaron R. Bradley.
Condition Testing. Condition testing is a test case design method that exercises the logical conditions contained in a program module. A simple condition.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
Unit1: Modeling & Simulation Module5: Logic Simulation Topic: Unknown Logic Value.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
CHARME’03 Predicate abstraction with Minimum Predicates Sagar Chaki*, Ed Clarke*, Alex Groce*, Ofer Strichman** * Carnegie Mellon University ** Technion.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
1 Design and Analysis of Algorithms Yoram Moses Lecture 13 June 17, 2010
On the Relation Between Simulation-based and SAT-based Diagnosis CMPE 58Q Giray Kömürcü Boğaziçi University.
Counterexample-Guided Abstraction Refinement By Edmund Clarke, Orna Grumberg, Somesh Jha, Yuan Lu, and Helmut Veith Presented by Yunho Kim Provable Software.
1 Advanced course on: Parallel and Distributed Model Checking Lecture 1 – Lecturers: Orna Grumberg, Computer Science Dept, Technion Karen Yorav,
P & NP.
Hybrid BDD and All-SAT Method for Model Checking
Condition Testing.
NP-Completeness Yin Tat Lee
Propositional Calculus: Boolean Algebra and Simplification
Edward Smith University of Oxford
Over-Approximating Boolean Programs with Unbounded Thread Creation
Introduction to verification
Presentation transcript:

1 Automatic Refinement and Vacuity Detection for Symbolic Trajectory Evaluation Orna Grumberg Technion Haifa, Israel Joint work with Rachel Tzoref

2 Symbolic Trajectory Evaluation (STE) A powerful technique for hardware model checking that can handle much larger hardware designs relatively simple specification language Widely used in industry, e.g., Intel, Motorola

3 STE is given A circuit M A specification A  C, where –Antecedent A imposes constraints on M –Consequent C imposes requirements on M A and C are formulas in a restricted temporal logic (called TEL)

4 Current STE Automatically constructs an abstract model for M, based on A (M £ A) Checks whether M £ A ² C Return: –Pass: M ² A  C –Fail + counterexample –Undecided: refinement is needed This is a form of 3-valued abstraction Manually refines A (and thus also M £ A)

5 Our work Suggests heuristics for automatic refinement of A, resulting in A new such that M |= A  C  M |= A new  C

6 Our work (cont.) Defines and detects vacuity in STE: If no execution of M satisfies A then –Pass is vacuous –Counterexample is spurious

7 Modeling a circuit A Circuit M is described as a graph whose nodes n are inputs, gates, and latches We refer to node n at different times t In fact, we look at an unwinding of the circuit for k times k is determined by A  C

8 Modeling a circuit (cont.) The value of an input node at time t is nondeterministic: 0 or 1 The value of a gate node at time t depends on the values of its source nodes at time t The value of a latch node at time t depends on the values of its source nodes at time t and t-1

9 1 1 Time= Time=1 Example: a circuit in 1 in 2 n1n1 n2n2 n3n3 0 0

10 STE is based on Abstraction Symbolic execution

11 Abstraction: 4-valued lattice To describe values of nodes, STE uses: 0,1, X, and  (n,t) has value X when the value of n at time t is unknown (n,t) has value  when the value of n at time t is over-constrained 0 X  1 0  x 1  x   0   1

12 Operations on lattice elements Meet: a  b is the greatest lower bound of a and b X  1=1 X  0=0 0  1=  … Join: a  b is the least upper bound 0 X  1

13 Lattice Semantics X is used to obtain abstraction  is used to denote a contradiction between a circuit behavior and the constraints imposed by the antecedent A Note: the concrete circuit node values are only 0 and 1.

14 Quaternary operations X  1 = 1 X  0 = X X  X = X X  1 = X X  0 = 0 X  X = X : X = X Any Boolean expression containing  has the value 

15 Symbolic execution STE combines abstraction with symbolic simulation to represent multiple executions at once Given a set of symbolic variables V, the nodes of the circuit are mapped to symbolic expressions over V  {0,1,X,  }

16 v 2 ?1:X Time=0Time=1 Timein 1 in 2 n1n1 n2n2 n3n3 0 1 Example: symbolic abstract execution in 1 in 2 n1n1 n2n2 n3n3 v 1 X v 1 ?1:X X X X v 2 v 2 ?1:X v 1 ?1:X v1v1 X v 1 ?1:X X X X v2v2 v 1  v 2 ?1:X

17 The difference between X and v  V X  : X = X v  : v = false Different occurrences of X do not necessarily represent the same value (“don’t know”) All occurrences of v represent the same value

18 Trajectory Evaluation Logic (TEL) Defined recursively over V, where p is a Boolean expression over V n is a node f, f 1, f 2 are TEL formulas N is the next-time operator (n is p) (p  f) (f 1  f 2 ) (N f)

19 Example: TEL formula f = (in1 is v 1 )  N (in 2 is v 2 )  N 2 (v 1  v 2  (n3 is 0))

20 3-valued semantics of TEL formulas TEL formulas are interpreted over symbolic execution  over V, and assignment  : V  {0,1} [ ,  ² f ] 2 {1, 0, X} Note: ( ,  ) represents an (abstract) execution, i.e., a series of expressions over {0,1,X,  } For simplicity: assume no  in ( ,  )

21 Timein 1 in 2 n1n1 n2n2 n3n3 0 V1V1 Xv 1 ?1:XXX 1X V2V2 v 2 ?1:Xv 1 ?1:Xv 1  v 2 ?1:X The same  is applied to f and to  f = N (v 1  v 2  (n 3 is 1)) Example: TEL semantics For every , [ ,  ² f ] = 1

22 Timein 1 in 2 n1n1 n2n2 n3n3 0 V1V1 Xv 1 ?1:XXX 1X V2V2 v 2 ?1:Xv 1 ?1:Xv 1  v 2 ?1:X f = N (n 3 is (v 1  v 2 ?1:0)) Example: TEL semantics For  ( v 1  v 2 )=0, [ ,  ² f ] = X

23 3-valued semantics for TEL (cont.) Note:  (p)  {0,1} [ ,  ² (n is p)] = 1 iff  (  )(0)(n) =  (p) [ ,  ² (n is p)] = 0 iff  (  )(0)(n)  {0,1} and  (  )(0)(n)   (p) [ ,  ² (n is p)] = X iff  (  )(0)(n) = X

24 3-valued semantics for TEL (cont.) [ ,  ² (f 1  f 2 ) ] = [ ,  ² f 1 ]  [ ,  ² f 2 ] [ ,  ² (p  f) ] =  ( : p)  [ ,  ² f] [ ,  ² (N f) ] = [ ,  1 ² f ]

25 3-valued semantics for TEL (cont.) [  ² f ] = 0 iff for some , [ ,  ² f]=0 [  ² f ] = X iff for all , [ ,  ² f]  0 and for some , [ ,  ² f]=X [  ² f ] = 1 iff for all ,[ ,  ² f]=1

26 Back to STE… Recall that our goal is to check whether M ² A  C where A imposes constraints on M and C imposes requirements

27 M £ A: Abstraction of M derived by A The defining trajectory of M and A, denoted M £ A, is defined as follows: M £ A is a symbolic execution of M that satisfies A For every symbolic execution  of M [  ² A]=1    M £ A

28 M £ A (cont.) [Seger&Bryant] show that every circuit M and TEL formula f has such M £ f M £ A is the abstraction of all executions of M that satisfy A and therefore should also satisfy C If M £ A satisfies C then all executions that satisfy A also satisfy C

29 Checking M ² A  C STE Checks M ² A  C by: Computing the defining trajectory M £ A of M and A Computing the truth value of [M £ A ² C] –[M £ A ² C] = 1 ! Pass –[M £ A ² C] = 0 ! Fail –[M £ A ² C] = X ! Undecided The size of M £ A is proportional to A, not to M !

30 Timein 1 in 2 n1n1 n2n2 n3n3 0 1 Example: M £ A A =(in 1 is v 1 )  N (in 2 is v 2 ) C = N (n 3 is 1) in 1 in 2 n1n1 n2n2 n3n3 v1v1 X v 1 X v 1 ?1:X X X XX X v 2 v2v2 X v 2 ?1:X v 1 ?1:X v 2 ?1:X v 1  v 2 ?1:X

31 Undecided results A = (in 1 is v1)  N (in 2 is v2) C = N (n 3 is 1) In M £ A the value of (n 3,1) is v 1  v 2 ?1:X C requires (n 3,1) to be 1 For  (v1  v2)=0, [ , M £ A ² C ] = X When v 1  v 2 is 0, STE results in “undecided” for (n 3,1) and thus refinement of A is needed

32 Our Automatic Refinement Methodology Choose for refinement a set Iref of inputs at specific times that do not appear in A For each (n,t)  Iref, v n,t is a fresh variable, not in V The refined antecedent is: A new = A   (n,t)  Iref N t (n is v n,t )

33 Refinement (cont.) A new has the property that: M ² A  C  M ² A new  C

34 Goal: Add a small number of constraints to A, keeping M £ A relatively small, while eliminating as many undecided results as possible Remark: Eliminating only some of the undecided results may still reveal “fail”. For “pass”, all of them need to be eliminated

35 Choose a refinement goal We choose one refinement goal (root,tt) A node that appears in the consequent C Truth value is X Has minimal t and depends on minimal number of inputs We will examine at once all executions in which (root,tt) is undecided

36 Choosing Iref for (root,tt) Naïve (syntactic) solution: Choose all (n,t) from which (root,tt) is reachable in the unwound graph of the circuit Will guarantee elimination of all undecided results for (root,tt)

37 X X X X X 1

38 Better (semantic) solution Identify those (n,t) that for some assignment are on a path to (root,tt) along which all nodes are X Iref is the subset of the above, where n is an input Will still guarantee elimination of all undecided results for (root,tt)

39 Heuristics for smaller Iref Choose a subset of Iref based on circuit topology and functionality, such as: Prefer inputs that influence (root,tt) along several paths Give priority to control nodes over data nodes And more

40 Experimental Results for Automatic Refinement We ran automatic refinement on two nontrivial different circuits: Intel’s Content Addressable Memory (CAM) –1152 latches, 83 inputs and 5064 gates IBM’s Calculator design –2781 latches, 157 inputs and gates We limited the number of added constraints at each refinement iteration to 1

41 Vacuous Results in 1 in 2 n1n1 n2n2 in 3 n3n3 n6n6 A = in 1 is 0  in 3 is v  n 3 is 1 C = N(n 6 is 1) n4n4 spurious counterexample for v=0 n5n5 0 v X X X  1=1 1 v v v?1:X

42 Vacuous Results - Refined in 1 in 2 n1n1 n2n2 in 3 n3n3 n6n6 A = in 1 is 0  in 3 is 0  in 2 is u  n 3 is 1 C = N(n 6 is 1) n4n4 If refinement had been performed, the spurious counterexample would have been replaced by a ? truth value n5n5 0 0 u u uu 0  1=   

43 Observation Vacuity can only occur when A contains constraints on internal nodes (gates, latches) Constraints on inputs can always be satisfied by M since input values are nondeterministic

44 Detecting (non-)vacuity Given a circuit M, an STE assertion A  C and an STE result (either fail or pass), our purpose is to find an assignment  to V and an execution of M that satisfies all the constraints in  (A)

45 Detecting (non-)vacuity In case of pass,  should also impose requirements in C In case of fail, the execution should constitute a counterexample

46 Detecting (non-)vacuity We developed two different algorithms for detecting vacuity / non-vacuity: An algorithm that uses BMC and runs on the concrete circuit. An algorithm that uses STE and automatic refinement.

47 Conclusion and future work We implemented our automated refinement and tested it on several circuits and specifications Generalized STE (GSTE) extends STE by providing a specification language which is as expressive as  -regular languages. A non-trivial future work is to suggest an automatic refinement for GSTE

48 Conclusion and future work We defined the vacuity problem for STE and proposed methods for vacuity detection Vacuity definition and detection is also required for GSTE

49 THE END