Carnegie Mellon University Boolean Satisfiability with Transitivity Constraints Boolean Satisfiability with Transitivity Constraints

Slides:



Advertisements
Similar presentations
Copyright 2000 Cadence Design Systems. Permission is granted to reproduce without modification. Introduction An overview of formal methods for hardware.
Advertisements

Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
NP-Hard Nattee Niparnan.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Representing Boolean Functions for Symbolic Model Checking Supratik Chakraborty IIT Bombay.
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
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.
Panel on Decision Procedures Panel on Decision Procedures Randal E. Bryant Lintao Zhang Nils Klarlund Harald Ruess Sergey Berezin Rajeev Joshi.
Reduction of Interpolants for Logic Synthesis John Backes Marc Riedel University of Minnesota Dept.
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:
Weizmann Institute Deciding equality formulas by small domain instantiations O. Shtrichman The Weizmann Institute Joint work with A.Pnueli, Y.Rodeh, M.Siegel.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Solving Partial Order Constraints for LPO termination.
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part III – Decision Procedures for Equality Logic and Uninterpreted Functions.
1 Deciding separation formulas with SAT Ofer Strichman Sanjit A. Seshia Randal E. Bryant School of Computer Science, Carnegie Mellon University.
SAT-Based Decision Procedures for Subsets of First-Order Logic
The Theory of NP-Completeness
NP-Complete Problems Problems in Computer Science are classified into
Sanjit A. Seshia and Randal E. Bryant Computer Science Department
Analysis of Algorithms CS 477/677
Technion 1 Generating minimum transitivity constraints in P-time for deciding Equality Logic Ofer Strichman and Mirron Rozanov Technion, Haifa, Israel.
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
Carnegie Mellon University SAT-Based Decision Procedures for Subsets of First-Order Logic Randal E. Bryant Part I: Equality.
Computing Over­Approximations with Bounded Model Checking Daniel Kroening ETH Zürich.
1 A propositional world Ofer Strichman School of Computer Science, Carnegie Mellon University.
Knowledge Representation II (Inference in Propositional Logic) CSE 473 Continued…
Ofer Strichman, Technion 1 Decision Procedures in First Order Logic Part II – Equality Logic and Uninterpreted Functions.
Carnegie Mellon University SAT-Based Decision Procedures for Linear Arithmetic and Uninterpreted Functions SAT-Based Decision Procedures for Linear Arithmetic.
*Carnegie Mellon University † IBM Exploiting Positive Equality in a Logic of Equality with Uninterpreted Functions Exploiting Positive Equality in a Logic.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 4: SMT-based Bounded Model Checking of Concurrent Software.
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
Binary Decision Diagrams (BDDs)
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.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic Range Allocation.
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
Theory of Computation, Feodor F. Dragan, Kent State University 1 NP-Completeness P: is the set of decision problems (or languages) that are solvable in.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
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.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Controller Synthesis for Pipelined Circuits Using Uninterpreted Functions Georg Hofferek and Roderick Bloem. MEMOCODE 2011.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
NP-Complete problems.
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
Strings Basic data type in computational biology A string is an ordered succession of characters or symbols from a finite set called an alphabet Sequence.
Controller Synthesis for Pipelined Circuits Using Uninterpreted Functions Georg Hofferek and Roderick Bloem. MEMOCODE 2011.
Chapter 11 Introduction to Computational Complexity Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
CSCI 2670 Introduction to Theory of Computing December 2, 2004.
2009/6/30 CAV Quantifier Elimination via Functional Composition Jie-Hong Roland Jiang Dept. of Electrical Eng. / Grad. Inst. of Electronics Eng.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
Complexity of Compositional Model Checking of Computation Tree Logic on Simple Structures Krishnendu Chatterjee Pallab Dasgupta P.P. Chakrabarti IWDC 2004,
The NP class. NP-completeness
Decision Procedures in Equality Logic
Inference in Propositional Logic (and Intro to SAT)
Hybrid BDD and All-SAT Method for Model Checking
Computability and Complexity
Propositional Calculus: Boolean Algebra and Simplification
Complexity 6-1 The Class P Complexity Andrei Bulatov.
Chapter 11 Limitations of Algorithm Power
Instructor: Aaron Roth
Presentation transcript:

Carnegie Mellon University Boolean Satisfiability with Transitivity Constraints Boolean Satisfiability with Transitivity Constraints Randal E. Bryant Miroslav N. Velev

– 2 – Outline Application Domain Verify correctness of a pipelined processor Based on Burch-Dill correspondence checking Burch & Dill, CAV ‘94 Verification Task Decide validity of formula in logic of equality with uninterpreted functions Translate into equational logic Propositional logic with equations of form v i = v j Bryant, German & Velev, CAV ’99 Goel, Sahid, Zhou, Aziz, & Singhal, CAV ‘98 New Contribution Efficient handling of transitivity constraints

– 3 – Decision Problem Logic of Equality with Uninterpreted Functions (EUF) Truth Values Dashed Lines Model control signals Domain Values Solid lines Model data wordsTask Determine whether formula is universally valid True for all interpretations of variables and function symbols

– 4 – Eliminating Function Applications Verification Task Prove: x = f(f(x))  x = f(f(f(x)))  x = f(x) Instance of: x = y  x = f(y)  x = f(x) Ackermann’s Method Replace: f(x)  f 1 f( f(x))  f 2 f(f( f(x)))  f 3 Gives: x = f 2  x = f 3  x = f 1 Functional Consistency Constraints x = f 1  f 1 = f 2 f 1 = f 2  f 2 = f 3 x = f 2  f 1 = f 3

– 5 – Eliminating Funct. Apps. (cont.) Equational Formula Complement of substituted formula + consistency constraints ClausesOrigin x = f 2  x = f 3  x  f 1  [x = f 2  x = f 3  x = f 1 ]  ( x  f 1  f 1 = f 2 ) x = f 1  f 1 = f 2  ( f 1  f 2  f 2 = f 3 ) f 1 = f 2  f 2 = f 3  ( x  f 2  f 1 = f 3 ) x = f 2  f 1 = f 3 Verification Task Prove that equational formula is not satisfiable x = f 2  x = f 3  x  f 1  ( x  f 1  f 1 = f 2 )  ( f 1  f 2  f 2 = f 3 )  ( x  f 2  f 1 = f 3 )

– 6 – Solving Equational Formulas Historically E.g., Nelson & Oppen ‘80 Create special purpose search engine Davis-Putnam search Data structure to maintain equivalence classesQuestion Can we translate problem into pure propositional logic? Would enable use of BDDs or SAT checkers

– 7 – Replacing Equations by Variables Relational Variables Goel, Sahid, Zhou, Aziz, & Singhal, CAV ‘98 Replace v i = v j by propositional variable e i,j Propositional Formula F sat Relabeling: x  v 1 f 1  v 2 f 2  v 3 f 3  v 4 ClausesOrigin e 13  e 14   e 12 x = f 2  x = f 3  x  f 1  (  e 12  e 23 )  ( x  f 1  f 1 = f 2 )  (  e 23  e 34 )  ( f 1  f 2  f 2 = f 3 )  (  e 13  e 24 )  ( x  f 2  f 1 = f 3 ) e 13  e 14   e 12  (  e 12  e 23 )  (  e 23  e 34 )  (  e 13  e 24 )

– 8 – Need for Transitivity Constraints Propositional Formula F sat e 13  e 14   e 12  (  e 12  e 23 )  (  e 23  e 34 )  (  e 13  e 24 )Solution e 13 = true e 14 = true e 12 = false e 23 = true e 34 = true e 24 = true Transitivity Violation in Solution e 13 = true e 23 = true e 12 = false Corresponds to x = f 2 and f 2 = f 1 but x  f 1

– 9 – Handling Transitivity Constraints: Goel, et al., CAV ’98 Complexity Finding solution to F sat that satisfies transitivity constraints is NP-Hard Even when F sat represented as OBDD Their method Enumerate implicants of F sat from OBDD representation Discard any implicant that contains transitivity violation Eventually find solution or run out of implicants Our Experiments Works well for small benchmarks Far too many implicants for larger benchmarks

– 10 – Handling Transitivity Constraints: Our Method Idea Generate propositional formula F trans expressing transitivity constraints Satisfy formula F sat  F trans Using OBDDs or SAT checker Sources of Efficiency Equational structure very sparse Far fewer than n(n-1)/2 relational variables Only need to enforce limited set of transitivity constraints With OBDDs, can reduce set of relational variables Only those in true support of F sat

– 11 – Benchmark Circuits Single Issue Pipeline: 1xDLX-C Analogous to DLX model in Hennessy & Patterson Verified in ‘94 by Burch & Dill Dual Issue Pipeline #1: 2xDLX-CA Second pipeline can only handle R-R and R-I instructions Burch (DAC ‘96) required 28 manual case splits, 3 commutative diagrams, and 1800s. Dual Issue Pipeline #2: 2xDLX-CC Second pipeline can also handle all instructions

– 12 – Verifying Original Benchmarks None Require Transitivity Constraints F sat is unsatisfiable in every case Circuits don’t make use of transitivity in forwarding or stall decisionsPerformance CircuitOBDD Secs.FGRASP Secs. 1xDLX-C0.23 2xDLX-CA xDLX-CC29.5,035

– 13 – Transitivity Benchmarks Modified, but Correct Circuits Modify forwarding logic ESrc1 = MDest  ESrc1 = MDest  ( ESrc1 = ESrc2  ESrc2 = MDest ) Equivalent under transitivity Circuit names 1xDLX-Ct, 2xDLX-CAt, 2xDLX-CCt Buggy Circuits 100 buggy versions of 2xDLX-CC Each contains single modification of control logic Must ensure that counterexample satisfies transitivity constraints

– 14 – 1xDLX-C Equation Structure Vertices For each v i 13 different register identifiersEdges For each equation Control stalling and forwarding logic 27 relational variables Out of 78 possible

– 15 – 2DLX-CCt Equation Structure Equations Between 25 different register identifiers 143 relational variables Out of 300 possible

– 16 – Graph Interpretation of Transitivity Transitivity Violation Cycle in graph Exactly one edge has e i,j = false  === = == =

– 17 – Exploiting Chords Chord Edge connecting two non- adjacent vertices in cycle Property Sufficient to enforce transitivity constraints for all chord-free cycles If transitivity holds for all chord-free cycles, then holds for arbitrary cycles   

– 18 – Enumerating Chord-Free Cycles Strategy Enumerate chord-free cycles in graph Each cycle of length k yields k transitivity constraints 1 2k Problem Potentially exponential number of chord-free cycles 2 k +k chord-free cycles

– 19 – Adding Chords Strategy Add edges to graph to reduce number of chord-free cycles 1 2k 2 k +k chord-free cycles 2k+1 chord-free cycles Trade-Off Reduces formula size Increases number of relational variables

– 20 – Chordal Graph Definition Every cycle of length > 3 has a chordGoal Add minimum number of edges to make graph chordal Relation to Sparse Gaussian Elimination Choose pivot ordering that minimizes fill-in NP-hard Simple heuristics effective

– 21 – Adding Chordal Edges to 1xDLX-C Original 27 relational variables 286 cycles 858 clauses Augmented 33 relational variables 40 cycles 120 clauses

– 22 – Adding Chordal Edges to 2xDLX-CCt Original 143 relational variables 2,136 cycles 8,364 clauses Augmented 193 relational variables 858 cycles 2,574 clauses

– 23 – SAT Checker on Good Circuits Strategy Run on clauses encoding F sat and F trans FGRASP Performance (Secs.) Circuit F sat F sat  F trans 1xDLX-C34 1xDLX-Ct---9 2xDLX-CA1761,275 2xDLX-CAt xDLX-CC5,0359,932 2xDLX-CCt---15,003Observation Much more challenging with transitivity constraints imposed

– 24 – SAT Checker on Buggy Circuits Performance Penalty with Transitivity Constraints Geometric average slowdown = 2.3X

– 25 – Using OBDDs Possible Strategy Build OBDDs for F sat and F trans Compute F sat  F trans Find satisfying solution

– 26 – Limitation of OBDDs OBDD for F trans can be of exponential size Regardless of variable ordering Formal result Relational variables forming k X k mesh OBDD representation has  (2 k/4 ) nodes Experimental Results Unable to build OBDD of F trans for large benchmarks 6 X 6 mesh

– 27 – Better Use of OBDDs Strategy Build OBDD for F sat Determine relational variables in true support Easy with OBDD Generate F trans for these variables Compute conjunction and find satisfying solutionPerformance When F sat unsatisfiable, no further steps required For other benchmarks, yields tractable F trans

– 28 – 2DLX-CCt Reduced Constraints Relational variables 46 original 6 chordal OBDD Representation 7,168 nodes

– 29 – Reduced Constraints: Average-Case Buggy Circuit Relational Variables 17 original 3 chordal OBDD Representation 70 nodes

– 30 – Reduced Constraints: Worst-Case Buggy Circuit Relational variables 52 original 16 chordal OBDD Representation 93,937 nodes

– 31 – OBDDs on Good Circuits CUDD Performance (Secs.) Circuit Time 1xDLX-C0.2 1xDLX-Ct2 2xDLX-CA11 2xDLX-CAt109 2xDLX-CC29 2xDLX-CCt441Observation Significantly more effort with transitivity constraints Better performance than FGRASP

– 32 – OBDDs on Buggy Circuits Performance Penalty with Transitivity Constraints Geometric average slowdown = 1.01X

– 33 – Conclusion Equational Formulas can be Solved by Propositional Methods Exploit sparse structure of equations Reduces number of variables Reduces formula size With OBDDs, can identify essential relational variables In true support of F sat Can use either SAT checker or OBDDs OBDDs do best for unsatisfiable formulas

– 34 – Extension Formulas with Ordering Constraints Constraints of form v i  v j Symbolic Solution Introduce variables a i,j and a j,i for each constraint v i rel v j a i,j true when v i  v j Solution defines partial orderingApplication Scheduling problems