On Bridging Simulation and Formal Verification Eugene Goldberg Cadence Research Labs (USA) VMCAI-2008, San Francisco, USA.

Slides:



Advertisements
Similar presentations
Model Checking Base on Interoplation
Advertisements

SMELS: Sat Modulo Equality with Lazy Superposition Christopher Lynch – Clarkson Duc-Khanh Tran - MPI.
The behavior of SAT solvers in model checking applications K. L. McMillan Cadence Berkeley Labs.
Exploiting SAT solvers in unbounded model checking
Exploiting SAT solvers in unbounded model checking K. L. McMillan Cadence Berkeley Labs.
Completeness and Expressiveness
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Lecture 23. Subset Sum is NPC
ECE Synthesis & Verification 1 ECE 667 Synthesis and Verification of Digital Systems Formal Verification Combinational Equivalence Checking.
Logic Concepts Lecture Module 11.
Properties of SLUR Formulae Ondřej Čepek, Petr Kučera, Václav Vlček Charles University in Prague SOFSEM 2012 January 23, 2012.
SAT and Model Checking. Bounded Model Checking (BMC) A.I. Planning problems: can we reach a desired state in k steps? Verification of safety properties:
1 Applied Computer Science II Resolution in FOL Luc De Raedt.
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
1 Introduction to Computability Theory Lecture12: Decidable Languages Prof. Amos Israeli.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Complexity 19-1 Complexity Andrei Bulatov More Probabilistic Algorithms.
Methods of Proof Chapter 7, second half.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Formal Verification Group © Copyright IBM Corporation 2008 IBM Haifa Labs SAT-based unbounded model checking using interpolation Based on a paper “Interpolation.
Knoweldge Representation & Reasoning
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
Computability and Complexity 24-1 Computability and Complexity Andrei Bulatov Approximation.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Boolean Satisfiability and SAT Solvers
Lecture 22 More NPC problems
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
Computational Complexity Theory Lecture 2: Reductions, NP-completeness, Cook-Levin theorem Indian Institute of Science.
Theory of Computing Lecture 17 MAS 714 Hartmut Klauck.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Unification Algorithm Input: a finite set Σ of simple expressions Output: a mgu for Σ (if Σ is unifiable) 1. Set k = 0 and  0 = . 2. If Σ  k is a singleton,
1 Combinatorial Algorithms Local Search. A local search algorithm starts with an arbitrary feasible solution to the problem, and then check if some small,
Lazy Annotation for Program Testing and Verification Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang November 26,
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
CS6133 Software Specification and Verification
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
First-Order Logic and Inductive Logic Programming.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Finding Models for Blocked 3-SAT Problems in Linear Time by Systematical Refinement of a Sub- Model Gábor Kusper Eszterházy Károly.
Generating High-Quality Tests for Boolean Circuits by Treating Tests as Proof Encoding Eugene Goldberg, Pete Manolios Northeastern University, USA TAP-2010,
AN INTERPOLATING THEOREM PROVER K.L. McMillan Cadence Berkley Labs.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
Proof Methods for Propositional Logic CIS 391 – Intro to Artificial Intelligence.
1 A framework for eager encoding Daniel Kroening ETH, Switzerland Ofer Strichman Technion, Israel (Executive summary) (submitted to: Formal Aspects of.
A Decision-Making Procedure for Resolution-Based SAT-solvers Eugene Goldberg Cadence Research Labs (USA) SAT-2008, Guangzhou, P.R. China.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Gábor Kusper University of Linz RISC Austria
Computability and Complexity
The Propositional Calculus
First-Order Logic and Inductive Logic Programming
Directional Resolution: The Davis-Putnam Procedure, Revisited
Complexity 6-1 The Class P Complexity Andrei Bulatov.
Robert Brayton UC Berkeley
Resolution Proofs for Combinational Equivalence
Faster Extraction of High-Level Minimal Unsatisfiable Cores
Presentation transcript:

On Bridging Simulation and Formal Verification Eugene Goldberg Cadence Research Labs (USA) VMCAI-2008, San Francisco, USA

Summary Introduction –motivation –main idea Stable sets of points (SSPs) and proofs –checking if a set of points contains an SSP –simulation based proof system –extraction of sufficient test sets from proofs Generation of practical tests –test generation for design change/manufacturing faults –theoretical and experimental justification of our approach Conclusion

Motivation Simulation is still the main workhorse of verification. It works surprisingly well taking into account that only negligible part of the search space is sampled!! Given a design, formal verification is to check if property  holds at all points of the search space. Simulation is to “informally” check if property  holds by testing it for a (relatively small) set of points. In this paper, we study this phenomenon by the example of the satisfiability problem. As an application, we consider testing combinational circuits.

Simulation in Terms of SAT Simulation: Given a CNF formula F, find a set of points T s.t. if F(T) = 0, then F is (most likely) unsatisfiable. Satisfiability problem (SAT): Given F, find an assignment p such that F(p)=1 or prove that F(all_space)=0. In other words, find T such that F(T)=0 implies F(all_space) = 0 Let F be a CNF formula (i.e. conjunction of disjunctions also called clauses).

Interpretation of Points as Tests Let CNF formula F N (X,Y,z) specify N. Checking satisfiability of N reduces to checking the satisfiability of F N  z. Let N be a circuit. Let X,Y describe the input and internal variables of N. Let z describe the output variable of N. …. N Y z A point p is a complete assignment to the variables X  Y  {z}. The corresponding test t is the projection of p to X. So p consists of a test t and a computation vector (y,z). Since p falsifies clauses of F N it is computation with a fault. X

Main Idea We formulate simulation as a proof system. In contrast to “regular” simulation, we use points not only for sampling search space but for derivation. In this derivation we employ the machinery of Stable Sets of Points. Instead of proving one “big” theorem (F implies an empty clause), we deduce a sequence of simpler lemmas (F implies a clause L). Each derived clause is added to F.

Summary Introduction –motivation –main idea Stable sets of points (SSPs) and proofs –checking if a set of points contains an SSP –simulation based proof system –extraction of sufficient test sets from proofs Generation of practical tests –test generation for design change/manufacturing faults –theoretical and experimental justification of our approach Conclusion

A Stable Set of Points (SSP) Example of 1-neighborhood of point p w.r.t a clause C (written Nbhd(p,C)) such that C(p)=0. C = x  z, p=(x=0,y=0,z=0). Nbhd(p,C) = {p 1,p 2 }, where p 1 =(x=1,y=0,z=0) and p 2 =(x=0,y=0,z=1). A complete assignment  a point. Let F be a CNF formula and T be a set of points. T is called an SSP if  p  T,  clause C of F such that Nbhd(p,C)  T. A CNF formula F is unsatisfiable iff there is a set of points that is an SSP.

Testing if a Set of Points Contains SSP Let F be a CNF formula and T be a set of points. To check if T is an SSP : For every point p of T, check if there is a clause C of F s.t. Nbhd(p,C)  T. This procedure is linear both in T and F. Even if T is not an SSP, a subset T* of T may be an SSP. To check if T contains an SSP : For every point p of T, check if there is a clause C of F s.t. Nbhd(p,C)  T. If C does not exist, remove p from T and restart this procedure. This procedure is quadratic in T and linear in F.

Simulation as a Proof System We formulate simulation as a proof system with two derivation rules. Rule 1: Generate a point p i and derive the value of F(p i ). Rule 2: Let T={p 1,…,p k } be the current set of points. Derive a clause C such that F implies C and add it to F. Derivation of C is valid only if T contains an SSP of the CNF formula F  ~C (and so F  C holds).

A Sufficient Test Set Given a CNF formula F, a set of points T is called sufficient if there is a set of lemma clauses L 1,…,L k (L k =  ) such that all k derivations F  L 1, F  L 1  L 2, …. F  L 1  …  L k-1  L k are valid (i.e. they can be proved by “simulation” using T) In other words, T is a sufficient test set if the set of valid derivations is sufficient to prove that F is unsatisfiable by applying only the second rule (no new points are needed).

Extracting a Sufficient Test Set from a Resolution Proof Let L={L 1,..,L k } be the set of resolvents of a resolution proof R that F is unsatisfiable. We assume that resolvents L i are numbered in their derivation order (so L k =  ). Then there is always a sufficient test set whose size is  2  k (proving that F  L 1  …  L i-1  L i needs only two points of T). Sufficient test sets can be very small even for very large formulas!!!!

“Proving” Resolvent by Building a Stable Set of Two Points Let C be the resolvent of C and C . One can prove that C  C   C by building an SSP of only two points. Example: Let C = ~x  y  z, C  = x  w. The resolvent C is y  z  w. To prove C  C   C it suffices to show the CNF formula C  C   ~C is unsatisfiable. (Here ~C= ~y  ~z  ~w). After making assignments y=0,z=0,w=0, the formula C  C   ~C turns into ~x  x. Any two points p and p  with y=0,z=0,w=0, that are different only in the value of variable x is an SSP for C  C   ~C.

Summary Introduction –motivation –main idea Stable sets of points (SSPs) and proofs –checking if a set of points contains an SSP –simulation based proof system –extraction of sufficient test sets from proofs Generation of practical tests –test generation for design change/manufacturing faults –theoretical and experimental justification of our approach Conclusion

Applying Our Theory to (design change/manufacturing testing) We cannot apply our theory directly to checking if F is unsatisfiable. (To prove that a set of points is sufficient we need a set of lemma clauses i.e. another proof) However, there are numerous indirect ways to apply our theory. One application is to detect incorrect design changes/ manufacturing faults. Let F be a CNF formula. Let R be a proof that F is unsatisfiable. Find a set of points such that most likely detect satisfiable variations of F. (These variations describe tech. faults/design changes.) Such a test set can be extracted from a sufficient set of points specified by R.

Tight Sufficient Tests Let T be a sufficient test set for F. Informally, T is tight if every point p  T falsifies as few clauses as possible. Given a resolution proof L 1,..,L k, a sufficient test set T is built as T 1  …  T k. Here T i is a two point SSP that proves that C  C   L i where C  C  are the parents of resolvent L i. When building T i one can arbitrarily assign variables that are not in C or C . To build a tight sufficient test, free variables are assigned so as to minimize the number of falsified clauses.

Big Picture Let F be an unsatisfiable formula. To detect satisfiable variations (“faults” in F) we generate a tight sufficient test set T. Such a set can be extracted, for example, from a resolution proof that F is unsatisfiable. The sufficiency of T guarantees its “completeness”. The tightness of T increases the probability of detec- ting small satisfiable variations. Suppose, for example, that a point p of T falsifies only one clause C of F. Then if F* is a variation of F consisting of disappearance of C (along with some other changes) it is likely that F*(p) = 1. Hence p detects that F* is satisfiable.

“Theoretical” Justification of Our Approach Let N 1 and N 2 be identical copies of circuit N. Let R nat be a “natural” resolution proof that their miter is unsatisfiable. Let T={p 1,..,p m } be a tight sufficient test set specified by R nat. We show that the set inp(T)= {inp(p 1 ),…,inp(p m )} detects all (testable) stuck-at faults of N. So, in a sense, our theory “predicts” the high quality of the stuck-at fault model for circuit testing.

Experimental Justification We experimentally compared quality of random test sets and test sets extracted from resolution proofs that two copies of a circuit were identical. Resolution proofs were generated by a state-of-the-art SAT- solver. We used MCNC benchmark circuits. Experiments show that tests extracted from resolution proofs significantly outperform random tests. We applied these two kinds of test sets (of the same size) to detecting literal appearance faults. Such faults are more “subtle” than stuck-at faults and so are harder to detect.

Conclusion We use SAT to show that there is a close relation between high quality test sets and formal proofs. We show how high quality tests can be extracted from proofs of unsatisfiability represented as a sequence of lemma clauses. Our approach answers (at least in principle) two important questions. a)When does one stop simulation? (When the set of generated points “encrypts” a formal proof). b)What is an “ideal” metric in functional verification? (A formal proof.)