Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, 2010 6.884 Final Project Presentation.

Slides:



Advertisements
Similar presentations
Exploiting SAT solvers in unbounded model checking
Advertisements

Boolean Satisfiability
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:
Introduction to MiniSat v1.14 Presented by Yunho Kim Provable Software Lab, KAIST.
UIUC CS 497: Section EA Lecture #2 Reasoning in Artificial Intelligence Professor: Eyal Amir Spring Semester 2004.
Propositional and First Order Reasoning. Terminology Propositional variable: boolean variable (p) Literal: propositional variable or its negation p 
Proofs from SAT Solvers Yeting Ge ACSys NYU Nov
Data Structures for SAT Solvers The 2-Literal Representation Gábor Kusper Eszterházy Károly College Eger, Hungary.
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.
Best-First Search: Agendas
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.
Building Structure into Local Search for SAT 1 Chris Reeson Advanced Constraint Processing Fall 2009 By Duc Nghia Pham, John Thornton, and Abdul Sattar,
Plan for today Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search.
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.
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:
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.
1 Abstraction Refinement for Bounded Model Checking Anubhav Gupta, CMU Ofer Strichman, Technion Highly Jet Lagged.
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.
Satisfiability Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
Boolean Satisfiability and SAT Solvers
Large-scale Hybrid Parallel SAT Solving Nishant Totla, Aditya Devarakonda, Sanjit Seshia.
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.
Incremental formal verification of hardware Hana Chockler Alexander Ivrii Arie Matsliah Shiri Moran Ziv Nevo IBM Research - Haifa.
Notes on assembly verification in the aTAM Days 22, 24 and 25 of Comp Sci 480.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
Maximum Density Still Life Symmetries and Lazy Clause Generation Geoffrey Chu, Maria Garcia de la Banda, Chris Mears, Peter J. Stuckey.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Planning as Satisfiability (SAT-Plan). SAT-Plan Translate the planning problem into a satisfiability problem for length n of Plan garb 0 (proposition)present.
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.
© R.A. Rutenbar 2009 Slide 1 Carnegie Mellon (Lec 06) Boolean Satisfiability: SAT Solvers (Pt 1) What you know  Representation and manipulation via BDDs,
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Satisfiability Modulo Theories and DPLL(T) Andrew Reynolds March 18, 2015.
Heuristics for Efficient SAT Solving As implemented in GRASP, Chaff and GSAT.
CS137: Electronic Design Automation
On the Power of Clause-Learning SAT Solvers with Restarts
Parallelism in SAT Solvers
A theory-based decision heuristic for DPLL(T)
First-Order Logic and Inductive Logic Programming
Simple Circuit-Based SAT Solver
SAT-Based Area Recovery in Technology Mapping
Introduction to the Boolean Satisfiability Problem
ECE 667 Synthesis and Verification of Digital Circuits
Unit Propagation and Variable Ordering in MiniSAT
Decision Procedures An Algorithmic Point of View
Unit Propagation and Variable Ordering in MiniSAT
Introduction to the Boolean Satisfiability Problem
Instructor: Aaron Roth
GRASP-an efficient SAT solver
Presentation transcript:

Parallelizing MiniSat I-Ting Angelina Lee Justin Zhang May 05, Final Project Presentation

Bottomline Ok, so we parallelized MiniSat … Final Project Presentation  Parallel MiniSat executing on single worker seems to exhibit the same behavior as the original MiniSat.  Paralell MiniSat running on single worker runs 3~4 times slower than the original MiniSat.  Parallel MiniSat running on multiple workers is still buggy.  But regardless, we manage to collect some data …

Normalized “Speedup” Final Project Presentation

Normalized #Inspects / Second Final Project Presentation

e.g. ( x 1 ∨ x 2 ∨ ¬ x 3 ) ∧ ( y 1 ∨ y 2 ) What Is A SAT Solver? SAT Solver f SAT / UNSAT f : Boolean formula written in Conjunctive Normal Form (CNF) Variables: x 1, x 2, x 3, y 1, y 2 Literals: a variable or negation of a variable Clauses: Literals OR-ed together Final Project Presentation A SAT Solver solves the Boolean satisfiability (SAT) problem.

Terminology f : Boolean formula written in Conjunctive Normal Form (CNF) e.g. ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( y 1 ∨ y 2 ) Variables: x 1, x 2, x 3, y 1, y 2 Literals: a variable or negation of a variable A literal can be either true, false, or free. Clauses: Literals OR-ed together A clause is true if it contains a least one true literal. A clause is false if it contains all false literals. A clause is asserting if it contains one free literal, and the rest of its literals are false. A clause is free if it is not true, not false, and not asserting Final Project Presentation

MiniSat Overview  MiniSat uses the following two strategies:  Conflict-driven backtracking  Dynamic variable ordering

Assume VS. Propagate x7x7 x3x3 x 15 T F trail Clause DB F assume x 7 x 4 x 77 x 2, ¬x 1 x 8, x 4 x 7 ¬x 3 x 9 ¬x 17 ¬x 4 x 8 x 77 x4x4 T F ¬x 3,x 9,¬x 17 F x8x8

Conflict-Driven Backtracking x7x7 x3x3 x 15 T F trail X Clause DB reasons ¬x 7 x 2 ¬x 1 ¬x 3 x 8 x 4 x 15 F assume ¬x 7 ¬x 3 x 15 x 2, ¬x 1 x 8, x 4 ¬x 2

Conflict-Driven Backtracking x7x7 trail Clause DB reasons ¬x 7 x 2 ¬x 1 ¬x 23 F assume ¬x 7 ¬x 23, x 2, ¬x 1

Dynamic Variable Ordering x7x7 trail Clause DB reasons ¬x 7 x 2 ¬x 1 ¬x 23 F assume ¬x 7 ¬x 23, x 2, ¬x 1 activities order ?

Parallelizing MiniSat x3x3 x7x7 x2x2 x5x5 x4x4 x 11 x8x8 F T F FF F F TT TT T T F X abort

How to Handle Various Data  MiniSat uses the following two strategies:  Conflict-driven backtracking  Assume: list of assumptions in chronological order  Clause DB: input constraints + learned clauses  Watch literals: used to quickly figure out which clauses are asserting.  Reasons: remembers why a variable assignment is made  Dynamic variable ordering  Activities: scores on how often variables are involved in conflicts  Order: variable ordering array sorted based on activity

How to Handle Various Data Clause DB trail reasons activities order assume Context Copy upon successful steal Local copy per worker Gets updated by replaying assumes upon successful steal Generate watch list

MiniSat Overview while(no result yet) confl = propagate(); if(confl) then if( at root level ) then /* nothing to backtrack */ return UNSAT; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); else /*no conflict*/ if( all vars assigned ) then return SAT; var = select_next(); assume( ~var ); Final Project Presentation

Recursive MiniSat Overview while(no result yet) confl = propagate(); if(confl) then if(at root level) then set_result(UNSAT); blevel = -1; break; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); break; Final Project Presentation else /*no conflict*/ if(all vars assigned) then set_result(SAT); blevel = -1; break; var = select_next(); assume(~var); blevel = search(depth+1); if(blevel<depth) break; /*end of while*/ return blevel; int search (int depth); /*returns blevel*/

Parallel MiniSat Overview while(no results yet) confl = propagate(); if(confl) then if( at root level ) then set_result(UNSAT); blevel = -1; break; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); if(blevel > depth) break; else /*no conflict*/ if( all vars assigned ) then set_result(SAT); blevel = -1; break; Final Project Presentation var = select_next(); assume(~var, assumes); catch( spawn search(assumes) ); if(stolen and !aborting) then blevel = replay(assumes, new_assumes); if(blevel == depth) then assume(var, new_assumes); catch( spawn search(new_assumes) ); sync; if(blevel<depth) break; blevel = replay(assumes, new_assumes);

var = select_next(); assume(~var, assumes); catch( spawn search(assumes) ); if(stolen and !aborting) then blevel = replay(assumes, new_assumes); if(blevel == depth) then assume(var, new_assumes); catch( spawn search(new_assumes) ); sync; if(blevel<depth) break; blevel = replay(assumes, new_assumes); Parallel MiniSat Overview while(no results yet) fetch_from_globalDB(); process_fetch_clauses(); confl = propagate(); if(confl) then if( at root level ) then set_result(UNSAT); blevel = -1; break; (blevel, learnt) = analyze(confl); update_DB(learnt); cancel_assignmts(blevel); if(blevel > depth) break; else /*no conflict*/ if( all vars assigned ) then … … Final Project Presentation

Conclusion Our design is nondeterministic and worker- aware An alternative design that is worker oblivious: – snapshot at every level – ignore learned clause from other worker It seems challenging to make a deterministic parallel solver with the learning Final Project Presentation

MiniSat Overview At each recursion level: constraint_propagate(); if no conflict then if all variables assigned then return SAT; else decide(); else analyze(); if at top level then return UNSAT; else backtrack(); pick a new variable to assign value analyze conflict: add a learnt conflict clause undo assignments until conflict is resolved conflict: UNSAT clause exists propagate unit clause Final Project Presentation

Data Structures Used  trail: a log of variable assignments (in their assigning order)  learnt: the learnt conflict clauses  assign: the current assignment of variables, the reason for each assignment, and the “level” at which each variable is assigned.  order: order of variables sorted by a heuristic “activity” value  stats: statistics on the search, such as the number of decisions and inference propagations Final Project Presentation

Goal #1: Parallelize a SAT Solver  Parallelization: explore both assignments to a given variable in parallel  trail  learnt  assign  order  stats Final Project Presentation

Goal #1: Parallelize a SAT Solver  Parallelization: explore both assignments to a given variable in parallel  trail: store on the frame  learnt: shared data structure protected with locks  assign: splitter – values must be restored when backtrack  order: worker-local copies, may effect the quality of ordering but not the correctness of the program.  stats: reducer – each worker can accumulate stats independently and combine later Final Project Presentation

Goal #1: Parallelize a SAT Solver  Parallelization: explore both assignments to a given variable in parallel  trail: store on the frame  learnt: shared data structure protected with locks  assign: splitter – values must be restored when backtrack  order: worker-local copies, may effect the quality of ordering but not the correctness of the program.  stats: reducer – each worker can accumulate stats independently and combine later Need better understanding of the use and implementation of a splitter Final Project Presentation

Goal #2: Enable Parallelizd SAT Solver In Cilk-M  Understand splitter better  Implement hyperobjects necessary in Cilk-M  Port the parallelized SAT solver to Cilk-M Final Project Presentation

Plan Of Execution  Parallelize MiniSat (or something like it) in MIT Cilk-5.  a crude implementation for splitters exists  manually simulate reducer, or forfeit the stats data structure all together.  Implement hyperobjects in Cilk-M  focus on the implementation for splitters  Port the parallelized SAT solver to Cilk-M Final Project Presentation