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

Parallelizing MiniSat

Feb 24, 2016

Download

Documents

kioshi

Parallelizing MiniSat. I-Ting Angelina Lee Justin Zhang May 05, 2010 6.884 Final Project Presentation. Bottomline. Ok, so we parallelized MiniSat …. Parallel MiniSat executing on single worker seems to exhibit the same behavior as the original MiniSat . - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Parallelizing  MiniSat

Parallelizing MiniSat

I-Ting Angelina Lee Justin Zhang

May 05, 20106.884 Final Project Presentation

Page 2: Parallelizing  MiniSat

6.884 Final Project Presentation

Bottomline

Ok, so we parallelized MiniSat … 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 …

Page 3: Parallelizing  MiniSat

6.884 Final Project Presentation

Normalized “Speedup”

Page 4: Parallelizing  MiniSat

6.884 Final Project Presentation

Normalized #Inspects / Second

Page 5: Parallelizing  MiniSat

e.g. ( x1 x∨ 2∨¬x3 ) ( y∧ 1 y∨ 2)

What Is A SAT Solver?

SAT Solver

f

SAT / UNSAT

f: Boolean formula written in Conjunctive Normal Form (CNF)

Variables: x1, x2, x3, y1, y2 Literals: a variable or

negation of a variable Clauses: Literals OR-ed together

6.884 Final Project Presentation

A SAT Solver solves the Boolean satisfiability (SAT) problem.

Page 6: Parallelizing  MiniSat

Terminology

f: Boolean formula written in Conjunctive Normal Form (CNF)e.g. ( x1 x∨ 2 x∨ 3 ) ( y∧ 1 y∨ 2)

Variables: x1, x2, x3, y1, y2 Literals: a variable or negation of a variable

A literal can be either true, false, or free.

Clauses: Literals OR-ed togetherA 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.

6.884 Final Project Presentation

Page 7: Parallelizing  MiniSat

MiniSat Overview

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

Page 8: Parallelizing  MiniSat

Assume VS. Propagate

x7

x3

x15 T

F

trail

Clause DBF

assumex7

x4

x77

x 2, ¬x 1

x 8, x4

x7

¬x3

x9

¬x17

¬x4

x8

x77

x4

x77

T

F

¬x3,x9,¬x17

Fx 8

Page 9: Parallelizing  MiniSat

Conflict-Driven Backtracking

x7

x3

x15 T

F

trail

X

Clause DB

reasons

¬x7

x2

¬x1

¬x3

x8

x4

x15

F

assume¬x7

¬x3

x15

x 2, ¬x 1

x 8, x 4

¬x2

Page 10: Parallelizing  MiniSat

Conflict-Driven Backtracking

x7

trailClause DB

reasons

¬x7

x2

¬x1

¬x23

F

assume

¬x7

¬x 23, x 2, ¬x 1

Page 11: Parallelizing  MiniSat

Dynamic Variable Ordering

x7

trailClause DB

reasons

¬x7

x2

¬x1

¬x23

F

assume

¬x7

¬x 23, x 2, ¬x 1

activities

order

?

Page 12: Parallelizing  MiniSat

Parallelizing MiniSat

x3

x7

x2

x5 x4x11 x8

F T

F

F F F F

T T

T T T T

F

Xabort

Page 13: Parallelizing  MiniSat

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

Page 14: Parallelizing  MiniSat

How to Handle Various Data

Clause DB

trail reasons

activities

order

assume

Context

Copy upon successful steal

Local copy per worker

Local copy per workerGets updated by replaying assumes upon successful steal

Generate

watch list

Page 15: Parallelizing  MiniSat

MiniSat Overviewwhile(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 );

6.884 Final Project Presentation

Page 16: Parallelizing  MiniSat

Recursive MiniSat Overviewwhile(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;

6.884 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*/

Page 17: Parallelizing  MiniSat

Parallel MiniSat Overviewwhile(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;

6.884 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);

Page 18: Parallelizing  MiniSat

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 Overviewwhile(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

… …6.884 Final Project Presentation

Page 19: Parallelizing  MiniSat

6.884 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.