Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST.

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Modified.
Presented by Monissa Mohan 1.  A highly optimized BCP algorithm  Two watched literals  Fast Backtracking  Efficient Decision Heuristic  Focused on.
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting:
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
“Using Weighted MAX-SAT Engines to Solve MPE” -- by James D. Park Shuo (Olivia) Yang.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View SAT.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
1/30 SAT Solver Changki PSWLAB SAT Solver Daniel Kroening, Ofer Strichman.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
ULTIMATELY INCREMENTAL SAT Alexander Nadel 1, Vadim Ryvchin 1,2, and Ofer Strichman 2 1 – Intel, Haifa, Israel 2 – Technion, Haifa, Israel SAT’14, Vienna,
ECE 667 Synthesis & Verification - SAT 1 ECE 667 ECE 667 Synthesis and Verification of Digital Systems Boolean SAT CNF Representation Slides adopted (with.
ECE 647 TERM PROJECT MiniSAT parallelization Shahadat Hossain Saud Wasly.
Hrinking hrinking A signment tack tack. Agenda Introduction Algorithm Description Heuristics Experimental Results Conclusions.
Boolean Satisfiability Solvers Wonhong Nam
1 Boolean Satisfiability in Electronic Design Automation (EDA ) By Kunal P. Ganeshpure.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 6: February 4, 2009 Modern SAT Solvers ({z}Chaff, GRASP,miniSAT)
Presented by Ed Clarke Slides borrowed from P. Chauhan and C. Bartzis
Chaff: Engineering an Efficient SAT Solver Matthew W.Moskewicz, Concor F. Madigan, Ying Zhao, Lintao Zhang, Sharad Malik Princeton University Presenting:
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.
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.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
MiniSAT: World fastest SAT solver (2005 and 2006) Niklas Sorensson, Niklas Een and Armin Biere Some slides are from Niklas Sorensson presentation Presented.
ENGG3190 Logic Synthesis “Boolean Satisfiability” Winter 2014 S. Areibi School of Engineering University of Guelph.
GRASP: A Search Algorithm for Propositional Satisfiability EE878C Homework #2 2002/11/1 KAIST, EECS ICS Lab Lee, Dongsoo.
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.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 21: April 21, 2008 Modern SAT Solvers ({z}Chaff, GRASP,miniSAT)
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Boolean Satisfiability and SAT Solvers
SAT and SMT solvers Ayrat Khalimov (based on Georg Hofferek‘s slides) AKDV 2014.
MBSat Satisfiability Program and Heuristics Brief Overview VLSI Testing B Marc Boulé April 2001 McGill University Electrical and Computer Engineering.
INTRODUCTION TO ARTIFICIAL INTELLIGENCE COS302 MICHAEL L. LITTMAN FALL 2001 Satisfiability.
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.
1 Agenda Modeling problems in Propositional Logic SAT basics Decision heuristics Non-chronological Backtracking Learning with Conflict Clauses SAT and.
Penn ESE 535 Spring DeHon 1 ESE535: Electronic Design Automation Day 18: April 1, 2015 Modern SAT Solvers ({z}Chaff, GRASP, miniSAT)
Predicate Abstraction of ANSI-C Programs Using SAT By Edmund Clarke, Daniel Kroening, Natalia Sharygina, Karen Yorav Presented by Yunho Kim Provable Software.
Heavy-Tailed Phenomena in Satisfiability and Constraint Satisfaction Problems by Carla P. Gomes, Bart Selman, Nuno Crato and henry Kautz Presented by Yunho.
Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation.
On the Relation between SAT and BDDs for Equivalence Checking Sherief Reda Rolf Drechsler Alex Orailoglu Computer Science & Engineering Dept. University.
Solving Non-linear Arithmetic Dejan Jovanovic and Leonadro de Moura Presented by Boris Trayvas.
Boolean Satisfiability Present and Future
SAT Solver Heuristics. SAT-solver History Started with David-Putnam-Logemann-Loveland (DPLL) (1962) –Able to solve variable problems Satz (Chu Min.
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
1 Boolean Satisfiability (SAT) Class Presentation By Girish Paladugu.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Dynamic Backtracking for SAT Presented by: Phil Oertel April 6, 2004.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
SAT for Software Model Checking Introduction to SAT-problem for newbie
CS137: Electronic Design Automation
Clause Learning in a SAT-Solver
Inference and search for the propositional satisfiability problem
Bounded Model Checking
Introduction to Software Verification
Simple Circuit-Based SAT Solver
ESE535: Electronic Design Automation
ECE 667 Synthesis and Verification of Digital Circuits
Decision Procedures An Algorithmic Point of View
A Progressive Approach for Satisfiability Modulo Theories
Canonical Computation without Canonical Data Structure
Canonical Computation without Canonical Data Structure
Stronger learning and higher backjumping
GRASP-an efficient SAT solver
Presentation transcript:

Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST

Contents Overview VSIDS Decision Heuristic Conflict Clause Analysis Example MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST2/33

Overview MiniSat is a fast SAT solver developed by Niklas Eén a nd Niklas Sörensson – MiniSat won all industrial categories in SAT 2005 competition – MiniSat won SAT-Race 2006 MiniSat is simple and well-documented – Well-defined interface for general use – Helpful implementation documents and comments – Minimal but efficient heuristic MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST3/33

Overview CNF is a logical AND of one or more clauses Clause is a logical OR of one or more literals Literal is either the positive or the negative variable MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST4/33 (x 2 ∨x 4 ∨x 5 ∨x 6 ) ∧ (x 0 ∨-x 1 ∨x 6 ) ∧ (-x 2 ∨-x 3 ∨-x 4 ) (x 2 ∨x 4 ∨x 5 ∨x 6 ), (x 0 ∨-x 1 ∨x 6 ), (-x 2 ∨-x 3 ∨-x 4 ) Variables: x 0, x 1, x 2, x 3, x 4, x 5, x 6 Literals: x 0, -x 1, x 2, -x 2, -x 3, x 4, -x 4, x 5, x 6 Definition from Lintao Zhang and Sharad malik “The Quest for Efficient Boolean Satisfiability Solvers”

Overview Unit clause is a clause in which all but one of literals is assigned to False Unit literal is the unassigned literal in a unit clause – (x 0 ) is a unit clause and ‘x 0 ’ is a unit literal – (-x 0 ∨x 1 ) is a unit clause since x 0 has to be True – (-x 2 ∨-x 3 ∨-x 4 ) can be a unit clause if the current assignment is that x 3 and x 4 are True Boolean Constrain Propagation(BCP) is the process of assigning the True value to all unit literals MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST5/33 …… (x 0 )∧ (-x 0 ∨x 1 )∧ (-x 2 ∨-x 3 ∨-x 4 )∧ ……

Overview /* overall structure of Minisat solve procedure */ Solve(){ while(true){ boolean_constraint_propagation(); if(no_conflict){ if(no_unassigned_variable) return SAT; decision_level++; make_decision(); }else{ if (no_dicisions_made) return UNSAT; analyze_conflict(); undo_assignments(); add_conflict_clause(); } MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST6/33

VSIDS Decision Heuristic Variable State Independent Decaying Sum(VSIDS) – decision heuristic to determine what variable will be assigned next – decision is independent from the current assignment of each variable VSIDS makes decisions based on activity – Activity is a literal occurrence count with higher weight on the more recently added clauses MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST7/33 activity description from Lintao Zhang and Sharad malik “The Quest for Efficient Boolean Satisfiability Solvers”

VSIDS Decision Heuristic VSIDS is proposed by chaff first. Initially, the score for each literal is the occurrence on the given input CNF instance MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST8/33 Initial constraints (x 1 ∨x 4 ) ∧ (x 1 ∨-x 3 ∨-x 5 ) ∧ (x 1 ∨x 5 ∨x 7 ) ∧ (x 2 ∨x 8 ) ∧ (-x 7 ∨-x 3 ∨x 6 ) ∧ (-x 7 ∨x 5 ∨-x 6 ) ∧ (x 7 ∨x 5 ∨-x 9 ) ScoreLiteral 3x 1, x 5 2-x 3, x 7, -x 7 1x 2, x 4, -x 5, x 6, -x 6, x 8, -x 9

VSIDS Decision Heuristic When a clause is added to DB, the related counters are incremented – Conflict analysis adds a new learnt clause to DB MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST9/33 (x 1 ∨x 4 ) ∧ (x 1 ∨-x 3 ∨-x 5 ) ∧ (x 1 ∨x 5 ∨x 7 ) ∧ (x 2 ∨x 8 ) ∧ (-x 7 ∨-x 3 ∨x 6 ) ∧ (-x 7 ∨x 5 ∨-x 6 ) ∧ (x 7 ∨x 5 ∨-x 9 ) ∧ (x 7 ∨x 6 ∨-x 9 ) ScoreLiteral 3x 1, x 5, x 7 2-x 3, x 7, -x 7, x 6, -x 9 1x 2, x 4, -x 5, x 6, -x 6, x 8, -x 9

VSIDS Decision Heuristic Periodically, the scores are divided by a constant factor – In this example, a constant factor is 2 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST10/33 (x 1 ∨x 4 ) ∧ (x 1 ∨-x 3 ∨-x 5 ) ∧ (x 1 ∨x 5 ∨x 7 ) ∧ (x 2 ∨x 8 ) ∧ (-x 7 ∨-x 3 ∨x 6 ) ∧ (-x 7 ∨x 5 ∨-x 6 ) ∧ (x 7 ∨x 5 ∨-x 9 ) ∧ (x 7 ∨x 6 ∨-x 9 ) ScoreLiteral 1.5x 1, x 5, x 7 1-x 3, -x 7, x 6, -x 9 0.5x 2, x 4, -x 5, -x 6, x 8

VSIDS Decision Heuristic Literals on more recently added clause have higher weighted scores MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST11/33 (x 1 ∨x 4 ) ∧ (x 1 ∨-x 3 ∨-x 5 ) ∧ (x 1 ∨x 5 ∨x 7 ) ∧ (x 2 ∨x 8 ) ∧ (-x 7 ∨-x 3 ∨x 6 ) ∧ (-x 7 ∨x 5 ∨-x 6 ) ∧ (x 7 ∨x 5 ∨-x 9 ) ∧ (x 7 ∨x 6 ∨-x 9 ) ∧ (-x 9 ∨x 8 ) ScoreLiteral 2-x 9 1.5x 1, x 5, x 7, x 8 1-x 3, -x 7, x 6, -x 9 0.5x 2, x 4, -x 5, -x 6, x 8

VSIDS Decision Heuristic VSIDS in MiniSat is slightly different from chaff – MiniSat does not consider polarity – Before adding the first learnt clause, all the scores are 0 – All the scores are decaying by 5% when a conflict occurs – The activities of all variables occurring in some clause used in the conflict analysis are increased MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST12/33

Conflict Clause Analysis A conflict happens when one clause is falsified by unit propagation Analyze the conflicting clause to infer a clause – (-x 3 ∨-x 2 ∨-x 1 ) is conflicting clause The inferred clause is a new knowledge – A new learnt clause is added to constraints Assume x 4 is False (x 1 ∨x 4 ) ∧ (-x 1 ∨x 2 ) ∧ (-x 2 ∨x 3 ) ∧ (-x 3 ∨-x 2 ∨-x 1 ) Falsified! Omitted clauses MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST13/33

Conflict Clause Analysis Learnt clauses are inferred by conflict analysis They help prune future parts of the search space – Assigning False to x 4 is the casual of conflict – Adding (x4) to constraints prohibit conflict from –x 4 Learnt clauses actually drive backtracking (x 1 ∨x 4 ) ∧ (-x 1 ∨x 2 ) ∧ (-x 2 ∨x 3 ) ∧ (-x 3 ∨-x 2 ∨-x 1 ) ∧ omitted clauses ∧ (x 4 ) learnt clause MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST14/33

Conflict Clause Analysis /* conflict analysis algorithm */ Analyze_conflict(){ cl = find_confclicting_clause(); /* Loop until cl is falsified and zero or one propagated literals in current decision level are remained */ While(!stop_criterion_met(cl)){ lit = choose_literal(cl); /* select the last propagated literal */ Var = variable_of_literal(lit); ante = antecedent(var); cl = resolve(cl, ante, var); } add_clause_to_database(cl); /* backtrack level is the lowest decision level for which the learnt clause is unit clause */ back_dl = clause_asserting_level(cl); return back_dl; } Algorithm from Lintao Zhang and Sharad malik “The Quest for Efficient Boolean Satisfiability Solvers” MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST15/33

Conflict Clause Analysis Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=T assumption b=T b∨-a∨e c=T c∨e∨f∨-b d=T d∨-b∨h e=F a=T -b∨-c∨-d Conflict DLevel=2 DLevel=1 Example slides are from CMU course ppt MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST16/33

Conflict Clause Analysis e=F a=T -b∨-c∨-d Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=T assumption b=T b∨-a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST17/33

Conflict Clause Analysis e=F a=T -b∨-c∨-d -b∨-c∨h Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=T assumption b=T b∨-a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST18/33

Conflict Clause Analysis e=F a=T -b∨-c∨-d -b∨-c∨h Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=T assumption b=T b∨-a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST19/33

Conflict Clause Analysis e=F a=T -b∨-c∨-d -b∨e∨f∨h learnt clause -b∨-c∨h Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g a=T assumption b=T b∨-a∨e c=T c∨e∨f∨-b d=T d∨-b∨h DLevel=2 DLevel=1 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST20/33

Conflict Clause Analysis e=F a=T -b∨-c∨-d -b∨-c∨h b=F -b∨e∨f∨h Assignmentsantecedent e=F assumption f=F -f∨e g=F -g∨f h=F -h∨g b=F -b∨e∨f∨h … … DLevel=1 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST21/33

Example Left side shows status of clauses Green literals are True, reds are False and yellows are Undefined MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST22/33

Example Right-up side shows variable data Reason indicates what clause the variable propagated from Level is a decision level MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST23/33

Example Right-down shows trail, that is an assignment stack MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST24/33

Example First assign False to x7 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST25/33

Example BCP from –x7 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST26/33

Example Second assign False to x3 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST27/33

Example C0 is a conflicting clause. Analyze it MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST28/33

Example First resolve last propagated literal c0 and c2 are resolved w.r.t x0 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST29/33 Activity is changed

Example A new learnt clause is (-x2∨x4∨x6∨x7) MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST30/33

Example Adds a learnt clause to DB and go on search MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST31/33 Activities are decayed for next added clause

Example Finally we find a model, that is, satisfying assignment MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST32/33

References An Extensible SAT-solver by Niklas Een and Niklas Sörensson in SAT 2003 MiniSat v1.14, Yunho Kim, Provable Software Lab, KAIST33/33