Clause Learning and Intelligent Backtracking in MiniSAT

Slides:



Advertisements
Similar presentations
Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Advertisements

Appendix: Other ATPG algorithms 1. TOPS – Dominators Kirkland and Mercer (1987) n Dominator of g – all paths from g to PO must pass through the dominator.
Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST.
State Machine Design Procedure
Automatic Verification Book: Chapter 6. What is verification? Traditionally, verification means proof of correctness automatic: model checking deductive:
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
Abstract Answer Set Solver. Todolist Print the rules of Fig 1.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
(a = 0)  (c = 0)  (f = 0)  (  = 0)  = (a + b)(¬b + c + d) (¬b + e)(¬d + ¬e + f)  Clause Recording During backtrack search, for each conflict create.
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Constraint Satisfaction and the Davis-Putnam-Logeman-Loveland Procedure Henry Kautz.
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
Constraint Satisfaction Problems
GRASP-an efficient SAT solver Pankaj Chauhan. 6/19/ : GRASP and Chaff2 What is SAT? Given a propositional formula in CNF, find an assignment.
Efficient SAT Solving for Non- clausal Formulas using DPLL, Graphs, and Watched-cuts Himanshu Jain Edmund M. Clarke.
1 Satisfiability Checking of Non-clausal Formulas using General Matings Himanshu Jain Constantinos Bartzis Edmund Clarke Carnegie Mellon University.
State-of-the-art in SAT solvers
GRASP SAT solver Presented by Constantinos Bartzis Slides borrowed from Pankaj Chauhan J. Marques-Silva and K. Sakallah.
Chapter 5 Outline Formal definition of CSP CSP Examples
SAT Solving Presented by Avi Yadgar. The SAT Problem Given a Boolean formula, look for assignment A for such that.  A is a solution for. A partial assignment.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Digitaalsüsteemide verifitseerimise kursus1 Formal verification: SAT SAT applied in equivalence checking.
Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011 TexPoint fonts used in EMF. Read the TexPoint manual before you.
Motivation & Goal SAT and Constraint Processing (CP) are fundamental areas of Computer Science that address the same computational questions. Compare SAT.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation.
Solving Non-linear Arithmetic Dejan Jovanovic and Leonadro de Moura Presented by Boris Trayvas.
Accelerating Random Walks Wei Wei and Bart Selman.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Satisfiability and SAT Solvers CS 270 Math Foundations of CS Jeremy Johnson.
SAT Solving As implemented in - DPLL solvers: GRASP, Chaff and
Lecture 8CSE Intro to Cognitive Science1 Interpreting Line Drawings II.
Expanding Brackets Multiply the contents of the bracket by what is immediately outside it E.g. 3(a+4) 3a3a x a + 3 x 4.
COMPSCI 102 Introduction to Discrete Mathematics.
Honors Track: Competitive Programming & Problem Solving 2-Satisfiability José Kuiper.
1 3/21/2016 MATH 224 – Discrete Mathematics First we determine if a graph is connected.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Hybrid BDD and All-SAT Method for Model Checking
Clause Learning in a SAT-Solver
Inference and search for the propositional satisfiability problem
Introduction to MiniSAT
Introduction to Software Verification
Logic Synthesis CNF Satisfiability.
Rationale & Strategies Foundations of Constraint Processing
Clause Learning and Intelligent Backtracking in MiniSAT
Watched Literals and Restarts in MiniSAT
Intro to Theory of Computation
Order Pairs An introduction.
Modeling Sudoku as a CNF Formula
Introduction to the Boolean Satisfiability Problem
ECE 667 Synthesis and Verification of Digital Circuits
CSP Search Techniques Backtracking Forward checking
Unit Propagation and Variable Ordering in MiniSAT
Decision Procedures An Algorithmic Point of View
A Progressive Approach for Satisfiability Modulo Theories
Clause Learning and Intelligent Backtracking in MiniSAT
Modeling Sudoku as a CNF Formula
Rationale & Strategies Foundations of Constraint Processing
Unit Propagation and Variable Ordering in MiniSAT
Introduction to the Boolean Satisfiability Problem
Introduction to MiniSAT
STATE SPACE REPRESENTATION
Rationale & Strategies Foundations of Constraint Processing
Watched Literals and Restarts in MiniSAT
Modeling Sudoku as a CNF Formula
Stronger learning and higher backjumping
GRASP-an efficient SAT solver
Rationale & Strategies Foundations of Constraint Processing
Presentation transcript:

Clause Learning and Intelligent Backtracking in MiniSAT CSCE 235H Introduction to Discrete Structures (Honors) Spring 2019 URL: cse.unl.edu/~cse235h All questions: Piazza

Clause Learning At every conflict, determine the cause of the conflict Create a new clause to prevent the conflict from being reached in the future Tools Implication graph to determine cause of conflicts Added clause is a “learnt” no-good

Search and Unit Propagation \begin{array}{l} (\neg x_2 \vee \neg x_4) \wedge\\ (x_4 \vee \neg x_5 \vee \neg x_8) \wedge\\ (x_4 \vee \neg x_7) \wedge\\ (x_3 \vee \neg x_6) \wedge\\ (\neg x_2 \vee x_5) \wedge \end{array} (\neg x_4) \wedge\\ (x_5)\\ Decisions: Propagations:

Search and Unit Propagation \begin{array}{l} (\neg x_2 \vee \neg x_4) \wedge\\ (x_4 \vee \neg x_5 \vee \neg x_8) \wedge\\ (x_4 \vee \neg x_7) \wedge\\ (x_3 \vee \neg x_6) \wedge\\ (\neg x_2 \vee x_5) \wedge \end{array} (\neg x_4) \wedge\\ (x_5)\\ Decisions: Propagations:

Search and Unit Propagation \begin{array}{l} (\neg x_2 \vee \neg x_4) \wedge\\ (x_4 \vee \neg x_5 \vee \neg x_8) \wedge\\ (x_4 \vee \neg x_7) \wedge\\ (x_3 \vee \neg x_6) \wedge\\ (\neg x_2 \vee x_5) \wedge \end{array} (\neg x_4) \wedge\\ (x_5)\\ (\neg x_8) \wedge\\ (\neg x_7) \wedge\\ (x_3 \vee \neg x_6)  Decisions: Propagations:

Search and Unit Propagation Decisions: Propagations: \begin{array}{l} (\neg x_2 \vee \neg x_4) \wedge\\ (x_4 \vee \neg x_5 \vee \neg x_8) \wedge\\ (x_4 \vee \neg x_7) \wedge\\ (x_3 \vee \neg x_6) \wedge\\ (\neg x_2 \vee x_5) \wedge \end{array} (\neg x_4) \wedge\\ (x_5)\\ (\neg x_8) \wedge\\ (\neg x_7) \wedge\\ (x_3 \vee \neg x_6) 

Search and Unit Propagation Decisions: Propagations: \begin{array}{l} (\neg x_2 \vee \neg x_4) \wedge\\ (x_4 \vee \neg x_5 \vee \neg x_8) \wedge\\ (x_4 \vee \neg x_7) \wedge\\ (x_3 \vee \neg x_6) \wedge\\ (\neg x_2 \vee x_5) \wedge \end{array} (\neg x_4) \wedge\\ (x_5)\\ (\neg x_8) \wedge\\ (\neg x_7) \wedge\\ (x_3 \vee \neg x_6) 

Implication Graph (1) Nodes correspond to assignments Nodes with no incoming edges are decision variables (assignments) Nodes with incoming edges were assigned through propagation Decisions: Propagations:

aa Implication Graph (2) x1 = 0 x7 = 0 x4= 0 x8 = 0 x2 = 1 x5 = 1 Decisions: Propagations: aa x8 = 0 x2 = 1 x5 = 1 x6 = 0 x3 = 0

Implication Graph (3) A node and its immediate predecessors correspond to the propagating clause x1 = 0 x7 = 0 x4= 0 x8 = 0 x2 = 1 x5 = 1 Note: transitive links are required to show which clause caused propagation x6 = 0 x3 = 0

Trail Series of assignments made up to current point in search Broken up by ‘decision levels’ Each decision level includes propagations Decision level Assignment 1 x1 = 0 2 x2 = 1 x4 = 0 x5 = 1 x7 = 0 x8 = 0 3 x3 = 0 x6 = 0

Clause Learning Example (1) DL Assignment 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 5 x10 = 0 x11 = 1 x12 = 0 \begin{eqnarray*} &&(x_5 \vee x_6 \vee x_{10} \vee \neg x_{12}) \wedge \\ &&(\neg x_3 \vee x_5 \vee \neg x_{11} \vee x_{12}) \wedge \\ &&(\neg x_3 \vee x_6 \vee \neg x_{10} \vee \neg x_{11}) \wedge \\ &&(x_1 \vee \neg x_2 \vee x_3) \wedge \\ &&(\neg x_7 \vee x_9) \wedge \\ &&(\neg x_7 \vee \neg x_8) \wedge \\ &&(x_4 \vee \neg x_5) \wedge \\ &&(x_4 \vee \neg x_6) \wedge \\ &&(x_{10} \vee x_{11}) \wedge \\ &&(\neg x_{10} \vee x_{11}) \end{eqnarray*}

Clause Learning Example (2) DL Assignment 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 5 x10 = 0 x11 = 1 x12 = 0 x9 = 1 x7 =1 x8 = 0 x1 = 0 x3 = 1 Conflict x2 = 1 x5 = 0 x4 = 0 x6 = 0 x10 = 0 x12 = 0 x11 = 1

Clause Learning Example (3) Decision variables Conflict discovered in clause x7 =1 x8 = 0 Conflict caused by assignment So, we negate it .. and add the clause to the formula to prevent this conflict in the future x1 = 0 x3 = 1 Conflict x2 = 1 x5 = 0 x4 = 0 x6 = 0 x10 = 0 x12 = 0 x11 = 1

Intelligent Backtracking When reaching a conflict, we Consider conflicted clauses Draw the implication graph Identify the decision variables Generate the learnt no-good Add learned clause to the formula Undo assignments until the learned clause becomes a unit clause

Intelligent Backtracking Example (1) DL Assignment 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 5 x10 = 0 x11 = 1 x12 = 0 x10 deepest decision variable

Intelligent Backtracking Example (2) DL Assgn 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 5 x10 = 0 x11 = 1 x12 = 0 DL Assgn 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 x10 = 1 x9 = 1 x7 =1 x8 = 0 x1 = 0 x3 = 1 x2 = 1 x5 = 0 x4 = 0 x6 = 0 x10 = 1

Intelligent Backtracking Example (3) Conflict discovered in clause Conflict caused by these decision variables x7 =1 x8 = 0 x1 = 0 x3 = 1 Conflict x2 = 1 .. and add the clause to the formula to prevent this conflict in the future x5 = 0 x4 = 0 x6 = 0 x10 = 1 x11 = 1

Intelligent Backtracking Example (4) DL Assgn 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 x10 = 1

Intelligent Backtracking Example (5) DL Assgn 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 = 0 x5 = 0 x6 = 0 4 x7 = 1 x8 = 0 x9 = 1 x10 = 1 DL Assgn 1 x1 = 0 2 x2 = 1 x3 = 1 3 x4 =1

Summary Search Intelligent backtracking Assign variable, Propagate Detect conflict? Intelligent backtracking Intelligent backtracking Identify decision variables source of conflict Add no-good clause so conflict cannot arise in the future Backtrack the deepest variables in the learnt clause Flip assignment of deepest variable in learnt clause Proceed Do you see any problem in this strategy? Problem: too many learned clauses, blows memory. There are strategies for reducing learned clauses (subsumption) and forgetting unused learned clauses