QuteSat. A Robust Circuit-Based SAT Solver for Complex Circuit Structure. Chung-Yang (Ric) Huang National Taiwan University

Similar documents
EECS 219C: Formal Methods Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley

EECS 219C: Computer-Aided Verification Boolean Satisfiability Solving. Sanjit A. Seshia EECS, UC Berkeley

Combinational Equivalence Checking

Zchaff: A fast SAT solver. Zchaff: A fast SAT solver

Deductive Methods, Bounded Model Checking

SAT/SMT Solvers and Applications

ABC basics (compilation from different articles)

A Novel SAT All-Solutions Solver for Efficient Preimage Computation

Circuit versus CNF Reasoning for Equivalence Checking

Boolean Representations and Combinatorial Equivalence

CDCL SAT Solvers. Joao Marques-Silva. Theory and Practice of SAT Solving Dagstuhl Workshop. April INESC-ID, IST, ULisbon, Portugal

ESE535: Electronic Design Automation CNF. Today CNF. 3-SAT Universal. Problem (A+B+/C)*(/B+D)*(C+/A+/E)

Normal Forms for Boolean Expressions

Yices 1.0: An Efficient SMT Solver

Learning Techniques for Pseudo-Boolean Solving and Optimization

NP-Completeness. Algorithms

SAT Solver. CS 680 Formal Methods Jeremy Johnson

Combinational Equivalence Checking Using Incremental SAT Solving, Output Ordering, and Resets

Boolean Satisfiability Solving Part II: DLL-based Solvers. Announcements

Boolean Satisfiability: From Theoretical Hardness to Practical Success. Sharad Malik Princeton University

Boolean Functions (Formulas) and Propositional Logic

On Computing Minimum Size Prime Implicants

DPLL(T ):Fast Decision Procedures

PBS: A Pseudo-Boolean Solver and Optimizer

An Experimental Evaluation of Conflict Diagnosis and Recursive Learning in Boolean Satisfiability

Solving 3-SAT. Radboud University Nijmegen. Bachelor Thesis. Supervisors: Henk Barendregt Alexandra Silva. Author: Peter Maandag s

MajorSat: A SAT Solver to Majority Logic

Restoring Circuit Structure From SAT Instances. Jarrod A. Roy, Igor L. Markov, and Valeria Bertacco University of Michigan at Ann Arbor

Full CNF Encoding: The Counting Constraints Case

Formally Certified Satisfiability Solving

Integrating a SAT Solver with Isabelle/HOL

SAT Solvers. Ranjit Jhala, UC San Diego. April 9, 2013

Chaff: Engineering an Efficient SAT Solver

Introduction to Computer Architecture

Minimum Satisfying Assignments for SMT. Işıl Dillig, Tom Dillig Ken McMillan Alex Aiken College of William & Mary Microsoft Research Stanford U.

EE292: Fundamentals of ECE

CS-E3200 Discrete Models and Search

Conflict Driven Learning and Non-chronological Backtracking

SAT Solvers: A Condensed History. Sharad Malik Princeton University COS 598d 3/1/2010

Practical SAT Solving

Unrestricted Nogood Recording in CSP search

Study of efficient techniques for implementing a Pseudo-Boolean solver based on cutting planes

QUESTION BANK FOR TEST

SAT and Termination. Nao Hirokawa. Japan Advanced Institute of Science and Technology. SAT and Termination 1/41

Constraint Satisfaction Problems

SAT Solver Heuristics

On Resolution Proofs for Combinational Equivalence Checking

On the Relation between SAT and BDDs for Equivalence Checking

CS-E3220 Declarative Programming

1 Inference for Boolean theories

Satisfiability Solvers

Modern SAT Solvers. Part B. Vienna Winter School on Verification. 9 February TU Vienna, Austria

Lingeling Essentials POS 2014

VLSI Test Technology and Reliability (ET4076)

Validating SAT Solvers Using an Independent Resolution-Based Checker: Practical Implementations and Other Applications

SAT, SMT and QBF Solving in a Multi-Core Environment

Evaluation of SAT like Proof Techniques for Formal Verification of Word Level Circuits

Learning Techniques for Pseudo-Boolean Solving

4.1 Review - the DPLL procedure

An Introduction to SAT Solvers

EXTENDING SAT SOLVER WITH PARITY CONSTRAINTS

Review. EECS Components and Design Techniques for Digital Systems. Lec 05 Boolean Logic 9/4-04. Seq. Circuit Behavior. Outline.

W4231: Analysis of Algorithms

SAT Based Efficient Directed Test Generation Techniques

(Refer Slide Time 3:31)

Chapter 8. NP-complete problems

1 Model checking and equivalence checking

Integrating an AIG Package, Simulator, and SAT Solver

Provably Optimal Test Cube Generation using Quantified Boolean Formula Solving

Efficient satisfiability solver

New Encodings of Pseudo-Boolean Constraints into CNF

CafeSat: A Modern SAT Solver for Scala

versat: A Verified Modern SAT Solver

Preprocessing in Pseudo-Boolean Optimization: An Experimental Evaluation

Part 1-2. Translation of Netlist to CNF

Computability Theory

CSE507. Practical Applications of SAT. Computer-Aided Reasoning for Software. Emina Torlak

Constraint Programming

A Scalable Algorithm for Minimal Unsatisfiable Core Extraction

Chapter 3. Gate-Level Minimization. Outlines

Satisfiability (SAT) Applications. Extensions/Related Problems. An Aside: Example Proof by Machine. Annual Competitions 12/3/2008

Constraint Satisfaction Problems

Minion: Fast, Scalable Constraint Solving. Ian Gent, Chris Jefferson, Ian Miguel

On Resolution Proofs for Combinational Equivalence

Using Synthesis Techniques in SAT Solvers

1/28/2013. Synthesis. The Y-diagram Revisited. Structural Behavioral. More abstract designs Physical. CAD for VLSI 2

Seminar decision procedures: Certification of SAT and unsat proofs

NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

Combinational Equivalence Checking Using Satisfiability and Recursive Learning

Propositional Calculus: Boolean Algebra and Simplification. CS 270: Mathematical Foundations of Computer Science Jeremy Johnson

SAT-Based Area Recovery in Technology Mapping

Hybrid Constraint Solvers

Chapter 2. Boolean Expressions:

Checking Satisfiability of a Conjunction of BDDs

CAV Verification Mentoring Workshop 2017 SMT Solving

What's the difference between the entailment symbol with the equals vs the entailment symbol with one line? Single turnstile meaning

Efficient SAT-based Boolean Matching for FPGA Technology Mapping

GRASP A New Search Algorithm for Satisfiability

HySAT. what you can use it for how it works example from application domain final remarks. Christian Herde /12

Better test results for the graph coloring and the Pigeonhole Problems using DPLL with k-literal representation

Transcription:

QuteSat A Robust Circuit-Based SAT Solver for Complex Circuit Structure Chung-Yang (Ric) Huang National Taiwan University To appear: DATE 27 2/1/27

Fact Sheet (Background) Boolean Satisfiability (SAT) Given a Boolean network F: B n B, find an input assignment A: { x 1 = a 1, x 2 = a 2,..., x n = a n a i B } such that F = 1. First proven NP complete problem (Cook 1971) Well researched problems in AI, OR, EDA... Widely used in many EDA areas Verification, Testing, Logic optimization, Physical implementation, etc

Yet Another SAT engine? Yaya, but with two missions... 1. Generalized for general constraint satisfiability and optimization problems 2. Specialized for EDA specific applications Tegus Grasp Nemesis zchaff MiniSat SATO Nimo

Large vs. Little Engines Much of the focus in automated deduction has been on finding uniform procedures for large classes of theorems For example, the resolution method is a simple, sound and complete inference procedure for first-order logic Resolution-based methods have had signicant successes solving open problems in diverse branches of mathematics However, big engines are not always predictable enough for serious applications --- they do a poor job of exploiting domain knowledge The little engines ideology is based on composing small theory-specific engines. Little Engines of Proof, Lec Notes, Dr. Shankar, SRI et. al.

Examples of Little Engines Propositional satisability solvers Binary Decision Diagrams Congruence Closure for Equality Propagation Real and Integer linear arithmetic solvers Decision procedures for lists, arrays, bit-vectors. Presburger arithmetic Monadic Second Order Logic Little Engines of Proof, Lec Notes, Dr. Shankar, SRI et. al.

Large vs. Little Engines Tuned for specific problems Little Engines QuteSat target Sharing between engines Large Engines Flexibility for new algorithms Uniformity of data structure and interface

What to expect in this talk... Background: Fact sheet, large vs. little engines Review: CNF-based SAT 2-literal watch for Boolean Constraint Propagation (BCP) Antecedent clause for efficient conflict-driven learning Proposed: QuteSat (Circuit SAT) Generic watch scheme Implicit implication graph Experimental results Future work

Conjunctive Normal Form (CNF) SAT Most modern Boolean SAT solvers are in CNF Product of sum (PoS) format (a+b+c)(a +b +c)(a +b+c )(a+b +c ) Variables Literals Clauses 1. Efficient Boolean Constraint Propagation (BCP) 2. Conflict-driven learning with non-chronological backtracking 3. Decision variable heuristics 4. Clause database reduction The simpler, the better.

From CNF to Circuit SAT However, most of the EDA problems are not naturally in CNF format Operators ( ±...) ( ) Loss of implicability Structural info (direction, locality,...) N/A Can we implement SAT on circuit structure? (This is not new e.g. ATPG) Pros: flexibility, structural info Cons: complex implementation, slower BCP

BCP in CNF SAT Boolean implication e.g. (a 1 = 1) && (a 2 = ) &&... (a n-1 = 1) (a n = 1) BCP algorithms (a 1 + a 2 +... + a n-1 + a n ) value: x x 1 1. while (a i gets a value), check if only one x is left O(n 2 ) 2. Count num of x O(n), but overhead in maintaining x count 3. Watch 2 literals in a clause. Only when watched literal changes, then we check the clause Amortized O(C)

Can circuit SAT do 2-watch? 1 1 1 111 11 111 Forward 11 1 1 Backward 111 Watch 2 fanins? What s the watch value? How about gate output? omni-directional implications How about OR, NOR, NAND,.. gates? How about XOR, MUX,... complex gates?

A Closer Look 1 1 11 1 11 1 11 1 1 ( a i + f ) ( a 1 + a 2 +... + a n + f ) Different implications on circuit-based SAT actually map to the same implication on CNF SAT

Direct vs. Indirect Implications 1 11 1 1. Direct implication Corresponding n 2-literal clauses in CNF SAT Single implication source No need to watch

Direct Implication 1. Single source for each implication 2. Only depends on netlist structure; has nothing to do with the proving process (e.g. decisions, etc) 3. Should never encounter CONFLICT during the proof process

Direct Implication Construct a direct implication graph in the preprocessing step Apply direct implications whenever a gate is implied to a value a b c _DirImps: { b,... } _1DirImps: {... } _DirImps: {... } _1DirImps: { a, c,... } _DirImps: { b,... } _1DirImps: {... }

Direct vs. Indirect Implications 1 1 11 1 11 1 11 11 1. Direct implication Corresponding n 2-literal clauses in CNF SAT Single implication source No need to watch 2. Indirect implication Corresponding to the same (n+1)-literal clause Only the last implied pin has different value 2 watches: among all fanins and the gate itself

Indirect Implication (AND gate) Select 2 pins (fanins or the gate itself) in a gate to watch Almost the same as CNF SAT For each gate, a list of watching gates When a gate gets a value, perform direct implication and/or update watch for the gates on the watching list watching-: { a } watching-1: { } a c watching-: { } watching-1: { } watched pins b watching-: { } watching-1: { a, b }

Watch Scheme for XOR Gate n-input XOR gate 2 n (n+1)-literal clauses e.g. (a + b + f) (a + b + f) (a + b + f) (a + b + f) Implication occurs only when n variables become known 2-watch; watch-known watching-: { a } watching-1: { } watching-known: { } a c watching-: { } watching-1: { } watching-known: { } b watching-: { } watching-1: { b } watching-known: { a }

Watch Scheme for MUX Gate MUX function: f = s a + s b Implication s (f = a) s (f = b) (a = b) (f = a) 2-watch; watch-known? CNF clauses (s + f + a)(s + f + a) ( s + f + b)( s + f + b) ( f + a + b)(f + a + b) No. If watching { f, s }, when { a=1, b=1 }, we miss the implication { f=1 } 3-watch; watch known!! Compared: CNF (6 clauses; 12 watch literals)

Watch Scheme for PB Gates PB Constraint: C p + C 1 p 1 +... + C n-1 p 1 C n, where C i Z +, p i B e.g. 4x 1 + 3x 2 + 2x 3 + x 4 >= 3 How many watches? 2-watch? All-watch? Note: min #watches depends on the value assignments Dynamic #watches? Too complicated... Our approach combinations of assignments triggering implications max (min (#watches) )

Generic Watch Scheme 1. Watch candidate set Output and input pins of the gate 2. Watched value v for each pin If v on this pin may eventually lead to an indirect implication on other pin(s), then v is the watched value of this pin 3. Find a minimum subset of watched candidates (a) Assigning watched values on all the variables of the subset will produce an indirect implication (b) Removing any of these assignments will void the implication Let k be the size of this subset. 4. We will need (n k + 1) watched pointers.

Generic Watch Scheme 5. Update of the watched pointer Called only when there is a watched-value assignment on the watched pin Other cases: Whenever there are assignments on the nonwatched pins Non-watched value assignments on the watched pins Do nothing

CNF vs. Circuit SAT 2-literal watch scheme Antecedent ptr + UIP cut CNF SAT Influenceguided + restart OK conflict BCP learned Conflict Analysis Branch on a Variable Sol. Found No Sol. successful all variables assigned Topological scheduling Imp Graph + UIP cut Influence & structure-guided + restart Circuit SAT

2-literal watch scheme CNF vs. Circuit SAT BCP conflict learned Antecedent ptr OK Imp Graph + Conflict Analysis No Sol. + UIP cut UIP cut Influenceguided + restart CNF SAT Branch on a Variable Sol. Found successful all variables assigned Generic watch scheme Influence & structure-guided + restart Circuit SAT

Conflict-Driven Learning (a + b + c) (a + c + d) (a + c + d ) (a + c + d) (a + c + d ) c b a Backtrack Conflict source (b + c + d) (a + b + c ) (a + b + c) (a + c) Learned clause a= c= Implication Graph (a + c + d) (a + c + d ) d=1 d= Conflict!

Conflict-Driven Learning Does CNF SAT record the imp graph? No!! Clauses: (a +b+c)(a+c+d)(a+c+d )(a+c +d)(a+c +d )(b +c +d)(a +b+c )(a +b +c) antecedent clause variables: a b c d a= (a + c + d) d=1 c=

Can circuit SAT do antecedent gate? CNF SAT Variable Literal Clause Circuit SAT Gate Gate + value Gate 1 1 1 g 1 g 1 1 Who is g s antecedent gate?

Implicit Implication Graph If the implication type is DIRECT, then the antecedent pointer is the single implication source. If the implication type is INDIRECT, then the implication sources are the watched candidates of the antecedent gate that are (a) non-watched variables, and (b) watched variables with watched values, excluding the implied pin.

Implicit Implication Graph Example g f g Imp type: DIRECT Antecedent: f impsrc: { f } g g 1 1 a b f Imp type: INDIRECT Antecedent: f impsrc: { f, a, b}

Implicit Implication Graph Example PB gate C: 4x 1 + 3x 2 + 2x 3 + x 4 >= 3 Implication order: { x 1 =, x 2 = } Watched pins: { x 2, x 3, x 4 } Indirect implications: x 3 = 1, x 4 = 1 x 3 Imp type: INDIRECT Antecedent: C impsrc: { x 1, x 2 } x 4 Imp type: INDIRECT Antecedent: C impsrc: { x 1, x 2 }

CNF vs. Circuit SAT 2-literal watch scheme Antecedent ptr + UIP cut Influenceguided + restart CNF SAT OK conflict BCP learned Conflict Analysis Branch on a Variable Sol. Found No Sol. successful all variables assigned Generic watch scheme Implicit Imp Graph + UIP cut Influence & structure-guided + restart Circuit SAT

Experimental Results Time: seconds C354 C7552 S35932 S38417 S38584 B15 B17 B2 ave rank Table 1. Equivalence checking (EC) experiments without circuit info with circuit info QuteSAT zchaff minisat QuteSAT -J NIMO 8.36 7.2 6.49.38.1 3.71 7.55 22.5.39.5 25.4 29.24 21.5.67.16 36.2 85.59 3.9 3.14.45 29.8 48.46 33.9 2.8.78 116 168.8 83. 15.9 2.37 737 >36 666 54.4 14.4 >36 >36 3185 76.6 2.17 1.69 2.69 1.39 N/R N/R

Our Contributions 1. A generic watch scheme that can seamlessly work on all kinds of circuit gates (simple or complex gates) 2. An implicit implication graph that enables efficient conflict-driven learning 3. Careful engineering work to implement most of the advanced SAT algorithm on the circuit data structure

Future Work More experiments!! Make sure the robustness of our engine for Boolean SAT Mission is not yet completed... 1. Generalized for general constraint satisfiability and optimization problems 2. Specialized for EDA specific applications (PB, ILP, SMT,...)