implementation of cdcl sat solversssa-school-2016.it.uu.se/wp-content/uploads/2016/06/... ·...

201
introduction CDCL CDCL are complex (systems) Conclusion Implementation of CDCL S T solvers Laurent Simon Labri, Bordeaux, France Libsboa) 2016, June, 22th 1/89

Upload: donguyet

Post on 06-Sep-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

introduction CDCL CDCL are complex (systems) Conclusion

Implementation ofCDCL S T solvers

Laurent Simon Labri, Bordeaux, France

Libsboa) 2016, June, 22th 1/89

introduction CDCL CDCL are complex (systems) Conclusion

Today’s Itinerary

Introduction

CDCL

CDCL are complex (systems)

Conclusion

Libsboa) 2016, June, 22th 2/89

introduction CDCL CDCL are complex (systems) Conclusion

Today’s Itinerary

IntroductionPreliminariesDP-60DPLL-62

CDCL

CDCL are complex (systems)

Conclusion

Libsboa) 2016, June, 22th 3/89

introduction CDCL CDCL are complex (systems) Conclusion

Why studying SAT?

SAT, the canonical NP-Complete problem. A one-million dollarquestion (is NP=P?)

The main open problem of Theoretical Computer ScienceThe easiest of the hard problemsWe must face it in most of real-world problems

S. Aaronson, MIT : « If P = NP, then the world would be a profoundlydifferent place than we usually assume it to be. There would be nospecial value in creative leaps, no fundamental gap between solving aproblem and recognizing the solution once its found. Everyone whocould appreciate a symphony would be Mozart; everyone whocould follow a step-by-step argument would be Gauss. »1

1from [Vardi, 2015]Libsboa) 2016, June, 22th 4/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2002Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2003Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2005Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2007Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2009Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2011Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2014Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

2016Libsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Performances after 2001

���

����

����

����

����

�� �� �� ��� ��� ��� ��� ��� ��� ���

��������������

�������������

������ �� ������ �������� ����� ��� ��� ������ ���� �����

���������� �������������� ������

�������������� ������������� ������

�������� ������������� ������

������������� ������������� ������

���������������� ������������������������� ������

the winnersLibsboa) 2016, June, 22th 5/89

introduction CDCL CDCL are complex (systems) Conclusion

Why bothering on the implementation?

Is it really interesting to study how to implement a CDCL?

The paradigm shift is essentially due toTight data structuresAlgorithms “fitting” in this data struture

Beeing fast is the way computers are not so dumb

Libsboa) 2016, June, 22th 6/89

introduction CDCL CDCL are complex (systems) Conclusion

The firsts SAT steps

1958: Hilary Putnam and Martin Davis look for funding their researcharound propositional logic

« What we’re interested in is good algorithmsfor propositional calculus » (NSA)

Before that, only inefficient methods (truth tables, . . . )

First papersComputational Methods in The Propositional calculus[Davis Putnam 1958]2A Computing Procedure for Quantification Theory[Davis Putnam 1960]

2Rapport interne NSALibsboa) 2016, June, 22th 7/89

introduction CDCL CDCL are complex (systems) Conclusion

1960, already a first (kind of) competition!

« The superiority of the present procedure (i.e. DP) over those previouslyavailable is indicated in part by the fact that a formula on which Gilmoresroutine for the IBM 704 causes the machine to compute for 21minutes without obtaining a result was worked successfully by handcomputation using the present method in 30 minutes »

[Davis et Putnam 1960], page 202.

Libsboa) 2016, June, 22th 8/89

introduction CDCL CDCL are complex (systems) Conclusion

What can be done with a so simple logic?

The facts are propositional variablesThe knowledge is a propositional formula

¬x1 ∨ ¬x2 ∨ x3∧ ¬x3∧ x1 ∨ x2∧ x2 ∨ x3

x1 x2 x3⊥ ⊥

Variables : x1 . . . x3;Literals : x1, ¬x1;Clauses : ¬x1 ∨ ¬x2 ∨ x3;Formula Σ written in CNF(conjonction of clauses);

Big questionsSAT : is there an assignment of variables making the formula true?UNSAT: is the theory contradictory?PI : deduce all you can from Σ

Libsboa) 2016, June, 22th 9/89

introduction CDCL CDCL are complex (systems) Conclusion

What can be done with a so simple logic?

The facts are propositional variablesThe knowledge is a propositional formula

¬x1 ∨ ¬x2 ∨ x3∧ ¬x3∧ x1 ∨ x2∧ x2 ∨ x3

x1 x2 x3⊥ ⊥ ⊥

Variables : x1 . . . x3;Literals : x1, ¬x1;Clauses : ¬x1 ∨ ¬x2 ∨ x3;Formula Σ written in CNF(conjonction of clauses);

Big questionsSAT : is there an assignment of variables making the formula true?UNSAT: is the theory contradictory?PI : deduce all you can from Σ

Libsboa) 2016, June, 22th 9/89

introduction CDCL CDCL are complex (systems) Conclusion

What can be done with a so simple logic?

The facts are propositional variablesThe knowledge is a propositional formula

¬x1 ∨ ¬x2 ∨ x3∧ ¬x3∧ x1 ∨ x2∧ x2 ∨ x3

x1 x2 x3⊥ ⊥ ⊥

Variables : x1 . . . x3;Literals : x1, ¬x1;Clauses : ¬x1 ∨ ¬x2 ∨ x3;Formula Σ written in CNF(conjonction of clauses);

Big questionsSAT : is there an assignment of variables making the formula true?UNSAT: is the theory contradictory?PI : deduce all you can from Σ

Libsboa) 2016, June, 22th 9/89

introduction CDCL CDCL are complex (systems) Conclusion

What can be done with a so simple logic?

The facts are propositional variablesThe knowledge is a propositional formula

¬x1 ∨ ¬x2 ∨ x3∧ ¬x3∧ x1 ∨ x2∧ x2 ∨ x3

x1 x2 x3⊥ ⊤ ⊥

Variables : x1 . . . x3;Literals : x1, ¬x1;Clauses : ¬x1 ∨ ¬x2 ∨ x3;Formula Σ written in CNF(conjonction of clauses);

Big questionsSAT : is there an assignment of variables making the formula true?UNSAT: is the theory contradictory?PI : deduce all you can from Σ

Libsboa) 2016, June, 22th 9/89

introduction CDCL CDCL are complex (systems) Conclusion

What can be done with a so simple logic?

The facts are propositional variablesThe knowledge is a propositional formula

¬x1 ∨ ¬x2 ∨ x3∧ ¬x3∧ x1 ∨ x2∧ x2 ∨ x3

x1 x2 x3⊥ ⊤ ⊥

Variables : x1 . . . x3;Literals : x1, ¬x1;Clauses : ¬x1 ∨ ¬x2 ∨ x3;Formula Σ written in CNF(conjonction of clauses);

Big questionsSAT : is there an assignment of variables making the formula true?UNSAT: is the theory contradictory?PI : deduce all you can from Σ

Libsboa) 2016, June, 22th 9/89

introduction CDCL CDCL are complex (systems) Conclusion

Principles of DP-60

DP-60: forgets variables one after the otherExample : forgets x1.

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x1 ∨ x5 ∨ x9x2 ∨ x11x3 ∨ x7 ∨ x13x3 ∨ x7 ∨ x13 ∨ x9x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 10/89

introduction CDCL CDCL are complex (systems) Conclusion

Principles of DP-60

DP-60: forgets variables one after the otherExample : forgets x1.

x1 ∨ x4x1 ∨ x8 ∨ x12x1 ∨ x5 ∨ x9

x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8

x2 ∨ x11x3 ∨ x7 ∨ x13x3 ∨ x7 ∨ x13 ∨ x9x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 10/89

introduction CDCL CDCL are complex (systems) Conclusion

Principles of DP-60

DP-60: forgets variables one after the otherExample : forgets x1.

x1 ∨

⎝x4x8 ∨ x12x5 ∨ x9

x1 ∨(

x4 ∨ x14x3 ∨ x8

)

x2 ∨ x11x3 ∨ x7 ∨ x13x3 ∨ x7 ∨ x13 ∨ x9x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 10/89

introduction CDCL CDCL are complex (systems) Conclusion

Principles of DP-60

DP-60: forgets variables one after the otherExample : forgets x1.

⎝x4x8 ∨ x12x5 ∨ x9

⎠ ∨(

x4 ∨ x14x3 ∨ x8

)

x2 ∨ x11x3 ∨ x7 ∨ x13x3 ∨ x7 ∨ x13 ∨ x9x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 10/89

introduction CDCL CDCL are complex (systems) Conclusion

Principles of DP-60

DP-60: forgets variables one after the otherExample : forgets x1.

x4 ∨ x14x4 ∨ x3 ∨ x8x8 ∨ x12 ∨ x4 ∨ x14x5 ∨ x9 ∨ x4 ∨ x14x5 ∨ x9 ∨ x3 ∨ x8

x2 ∨ x11x3 ∨ x7 ∨ x13x3 ∨ x7 ∨ x13 ∨ x9x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 10/89

introduction CDCL CDCL are complex (systems) Conclusion

Principles of DP-60

DP-60: forgets variables one after the otherExample : forgets x1.

x4 ∨ x14x4 ∨ x3 ∨ x8x8 ∨ x12 ∨ x4 ∨ x14x5 ∨ x9 ∨ x4 ∨ x14x5 ∨ x9 ∨ x3 ∨ x8x2 ∨ x11x3 ∨ x7 ∨ x13x3 ∨ x7 ∨ x13 ∨ x9x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 10/89

introduction CDCL CDCL are complex (systems) Conclusion

Untractable Space Problems

1 6 11 16 21 26 31 36 410

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

Cut Number (|ψ|=43)

Num

ber

of C

laus

es

3−CNF with 180 Clauses, 43 Variables; 1000 trials

Max. Std. Dev.Mean Min.

Combinatorial explosion, even on very small problems!But possible on some very special cases (SAT pre-processing)

Libsboa) 2016, June, 22th 11/89

introduction CDCL CDCL are complex (systems) Conclusion

Untractable Space Problems

1 6 11 16 21 26 31 36 410

0.2

0.4

0.6

0.8

1

1.2

1.4

1.6

1.8

2x 10

4

Cut Number (|ψ|=43)

Num

ber

of C

laus

es

3−CNF with 180 Clauses, 43 Variables; 1000 trials

Max. Std. Dev.Mean Min.

Combinatorial explosion, even on very small problems!But possible on some very special cases (SAT pre-processing)

Libsboa) 2016, June, 22th 11/89

introduction CDCL CDCL are complex (systems) Conclusion

1962-2001 : DPLL rules the world

Systematically explore the space of partial models (backtrack)

Choose a literalTry to find a solution with this literal set to TrueIf it is not possible:Finds a solution with this literal set to False

Backtrack search on partial modelsSystematic (ordered) exploration ensures completeness

Libsboa) 2016, June, 22th 12/89

introduction CDCL CDCL are complex (systems) Conclusion

1962-2001 : DPLL rules the world

Systematically explore the space of partial models (backtrack)

Choose a literalTry to find a solution with this literal set to TrueIf it is not possible:Finds a solution with this literal set to False

Backtrack search on partial modelsSystematic (ordered) exploration ensures completeness

Libsboa) 2016, June, 22th 12/89

introduction CDCL CDCL are complex (systems) Conclusion

Backtrack searchf

fx

fx ,¬y

fx ,¬y ,¬z

¬z

fx ,¬y ,z

z

¬y

fx ,y

fx ,y ,m

m

y

x

f¬x

f¬x ,z

f¬x ,z,¬t

¬t

f¬x ,z,t

t

z

¬x

How to choose the right literal to branch on?First search for a model or a contradiction?

Libsboa) 2016, June, 22th 13/89

introduction CDCL CDCL are complex (systems) Conclusion

Backtrack searchf

fx

fx ,¬y

fx ,¬y ,¬z

¬z

fx ,¬y ,z

z

¬y

fx ,y

fx ,y ,m

m

y

x

f¬x

f¬x ,z

f¬x ,z,¬t

¬t

f¬x ,z,t

t

z

¬x

How to choose the right literal to branch on?First search for a model or a contradiction?

Libsboa) 2016, June, 22th 13/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?

x1 appears in 4 clauses and 1 binary clause

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)

x4 appears in 1 unary clause

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x4

x3 appears in 3 clauses incl. 1 (new) binary clause

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x42 x3 (d)

x8 appears in one unary clause

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x42 x3 (d)+ x8

x12 appears in 1 unary clause

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x42 x3 (d)+ x8+ x12

x13, x7 appear in unary clauses

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x42 x3 (d)+ x8+ x12+ x13

x7, x7 appear in unary clauses

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x42 x3 (d)+ x8+ x12+ x13+ x7

Conflict! Undo everything until last decision

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

An example of DPLL

Formule

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Simplified Formula

x1 ∨ x4x1 ∨ x4 ∨ x14x1 ∨ x3 ∨ x8x1 ∨ x8 ∨ x12x2 ∨ x12x3 ∨ x12 ∨ x13x3 ∨ x7 ∨ x13x8 ∨ x7 ∨ x12

Partial Model

Lev. Lit. Back?1 x1 (d)+ x4* x3

Now, x3 is not a decision

Libsboa) 2016, June, 22th 14/89

introduction CDCL CDCL are complex (systems) Conclusion

A very simple procedure?

Very simple to write a backtrack search but. . .

Where to branch?Mistakes at the top of the tree are dramatic!(almost) As many nodes where to decide than where toexploreA perfect branching scheme is NP-Hard

Libsboa) 2016, June, 22th 15/89

introduction CDCL CDCL are complex (systems) Conclusion

From LookAhead to Lookback

All solvers are now turned to lazily detect Unit Propagation

No way to maintain counters for “smart” branching

Look ahead heuristics were “easy” to understand

Look back heuristics are very hard to study

Libsboa) 2016, June, 22th 16/89

introduction CDCL CDCL are complex (systems) Conclusion

Today’s Itinerary

Introduction

CDCLZchaffSAT ingredientsOther ingredientsRestartsLiteral Block Distance and glucosePreProcessingParallelizing CDCL

CDCL are complex (systems)

Conclusion

Libsboa) 2016, June, 22th 17/89

introduction CDCL CDCL are complex (systems) Conclusion

1999, on the way to the revolutionHuge problems are coming from the real-world: Planning &Bounded Model Checking

Planning as Satisfiability. [Kautz and Selman, 92]Symbolic Model Checking using SAT procedures instead of BDDs.[Biere & al. 99]SAT solvers can’t cope with those huge formulas without specializeddata structures Quasi-incapacité des solveurs SAT à gérer autant declauses

DPLL extinction. . .GRASP : learning clauses in SAT solversDLIS : very simple heuristicSATO : lazy data structure to detect unary clauses

Algorithms ingredients for the upcoming revolutionBMC, GRASP, DLIS, SATO

Libsboa) 2016, June, 22th 18/89

introduction CDCL CDCL are complex (systems) Conclusion

Huge problems?Generated by the tool : satgraf http://satbench.uwaterloo.ca/site/satgraf

Random formula

Libsboa) 2016, June, 22th 19/89

introduction CDCL CDCL are complex (systems) Conclusion

Huge problems?Generated by the tool : satgraf http://satbench.uwaterloo.ca/site/satgraf

BMC instances

Libsboa) 2016, June, 22th 19/89

introduction CDCL CDCL are complex (systems) Conclusion

Huge problems?Generated by the tool : satgraf http://satbench.uwaterloo.ca/site/satgraf

BMC instances

Libsboa) 2016, June, 22th 19/89

introduction CDCL CDCL are complex (systems) Conclusion

Huge problems?Generated by the tool : satgraf http://satbench.uwaterloo.ca/site/satgraf

BMC instances

Libsboa) 2016, June, 22th 19/89

introduction CDCL CDCL are complex (systems) Conclusion

Huge problems?Generated by the tool : satgraf http://satbench.uwaterloo.ca/site/satgraf

BMC instances

Libsboa) 2016, June, 22th 19/89

introduction CDCL CDCL are complex (systems) Conclusion

Data structures are stronger than algorithms!

Until now:Heuristics were used to mimic what a human will do (when picking avariable to branch on)Data structures were implemented to support algorithms

Seminal paper« Chaff: Engineering an Efficient SAT Solver » [Moskewicz & al. ’01]“Simply” optimize known algorithms

Highest priority: BCP (Boolean Constraint Propagation)

Libsboa) 2016, June, 22th 20/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

6

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

6

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

5

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

4

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

4

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

3

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

3

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

2

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest

Detect when you have only 1 non called card in your hand

1. count the non called cards

Unary Clause!!

Libsboa) 2016, June, 22th 21/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑ ↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2

Detect when you have only 1 non called card in your hand

1. Watch heads and tails

↑↑

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 2Detect when you have only 1 non called card in your hand

1. Watch heads and tails

Unary Clause!!

Libsboa) 2016, June, 22th 22/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Unary Clause!!

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Let’s play. . . to be the laziest – 3

Detect when you have only 1 non called card in your hand

3. Keep only two uncalled cards (witnesses) (Chaff)

Nothing to do if want to replay!!

Libsboa) 2016, June, 22th 23/89

introduction CDCL CDCL are complex (systems) Conclusion

Only 2 watches per clausesHow to update it?

let’s say the current assignement is a, b, c, d

We branch on e

Clauses that can be unary/empty are all the clauses watched by ¬e

¬e ∨ a ∨ f ∨ g¬e ∨ f ∨ bf ∨ ¬e ∨ ¬a ∨ ¬g¬e ∨ f ∨ ¬a ∨ ¬d

Example of a clause containing ¬e but not watched by it:f ∨? ∨ ¬e

Libsboa) 2016, June, 22th 24/89

introduction CDCL CDCL are complex (systems) Conclusion

Show me the code

Let’s look at the propagate function

Libsboa) 2016, June, 22th 25/89

introduction CDCL CDCL are complex (systems) Conclusion

We have to cope with this lazy data structure

The state of the formula is unknown!

How many reduced clauses? how many satisfied clauses?Some variables may be pure?

Only one guarantee: all unary and empty clauses are detected

Find a model? all the variables are assigned without any conflict

Heuristique : How to choose a variable to branch on? We are blind!We need to use the past, not the current state of the formulaThe heuristics will be heavily related to the clause learningmechanism

Libsboa) 2016, June, 22th 26/89

introduction CDCL CDCL are complex (systems) Conclusion

Ingredients of an efficient SAT solverAll ingredients are designed to cope with huge problems

Preprocessing(and inprocessing)

Restarting Branching

Conflict Analysis Clause DatabaseCleaning

Libsboa) 2016, June, 22th 27/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceDecisions – Propagations

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1,x4[φ1]

DL 2 x3 x3,x8[φ2], x12[φ3]

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

Libsboa) 2016, June, 22th 28/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceConflict Analysis

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β1 = res(x9,φ7,φ6) = x3 ∨ x8∨ x7 ∨ x13β = res(x13,β1,φ5) = x3 ∨ x8∨ x7

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 29/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceConflict Analysis

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β1 = res(x9,φ7,φ6) = x3 ∨ x8∨ x7 ∨ x13

β = res(x13,β1,φ5) = x3 ∨ x8∨ x7

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 29/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceConflict Analysis

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β1 = res(x9,φ7,φ6) = x3 ∨ x8∨ x7 ∨ x13β = res(x13,β1,φ5) = x3 ∨ x8∨ x7

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

Libsboa) 2016, June, 22th 29/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceConflict Analysis

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β1 = res(x9,φ7,φ6) = x3 ∨ x8∨ x7 ∨ x13β = res(x13,β1,φ5) = x3 ∨ x8∨ x7

Stops as soon as the resolvant has a unique literal from the lastdecision level (FUIP).β is added to the clauses databases (ensure a systematic search)

Libsboa) 2016, June, 22th 29/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceNon Chronological Backtrackings

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1, x4[φ1]

DL 2 x3 x3, x8[φ2], x12[φ3], x7[β]...

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β = x3 ∨ x8 ∨ x7

Libsboa) 2016, June, 22th 30/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceNon Chronological Backtrackings

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1, x4[φ1]

DL 2 x3 x3, x8[φ2], x12[φ3], x7[β]...

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β = x3 ∨ x8 ∨ x7

Libsboa) 2016, June, 22th 30/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL principles at a glanceNon Chronological Backtrackings

φ1 = x1 ∨ x4φ2 = x1 ∨ x3 ∨ x8φ3 = x1 ∨ x8 ∨ x12φ4 = x2 ∨ x11φ5 = x3 ∨ x7 ∨ x13φ6 = x3 ∨ x7 ∨ x13 ∨ x9φ7 = x8 ∨ x7 ∨ x9

DL 1 x1 x1, x4[φ1]

DL 2 x3 x3, x8[φ2], x12[φ3], x7[β]...

DL 3 x2 x2, x11[φ4]

DL 4 x7 x7, x13[φ5], x9[φ6], x9[φ7]

β = x3 ∨ x8 ∨ x7

Libsboa) 2016, June, 22th 30/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1

x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1

2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4

¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2

3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7

¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9

x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3

4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16

“conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15

¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11

x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

“reason” side

x16

¬x16 “conflict”side

x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

x16

¬x16x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

x16

¬x16x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL Principles, graphical point of view

¬x1 x4 ¬x7 ¬x10

x16

¬x16x2

¬x3

¬x5

x6

¬x8

x9x11

¬x12

x15

x14

¬x13

¬x16 ∨ x16

x13 ∨ ¬x14 ∨ ¬x15¬x6 ∨ x7 ∨ x12

Coupure« FUIP »

¬x6 ∨ x7 ∨ x8 ∨ ¬x11x1 ∨ ¬x4 ∨ x7 ∨ x10

1 2 3 4

x1 ∨ x2¬x2 ∨ ¬x3

¬x2 ∨ ¬x4 ∨ ¬x5x3 ∨ x5 ∨ x6

x7 ∨ ¬x6 ∨ ¬x8¬x4 ∨ x8 ∨ x9

x10 ∨ ¬x9 ∨ x11¬x11 ∨ x8 ∨ ¬x12x12 ∨ ¬x13

x7 ∨ x12 ∨ x14

¬x6 ∨ x12 ∨ x15x13 ∨ ¬x14 ∨ ¬x16¬x15 ∨ ¬x14 ∨ x16

Libsboa) 2016, June, 22th 31/89

introduction CDCL CDCL are complex (systems) Conclusion

Show me the conflict analysis!

Let’s look at the Python code

Libsboa) 2016, June, 22th 32/89

introduction CDCL CDCL are complex (systems) Conclusion

VSIDS : the killing heuristicsVariable State Independant Decaying Sum

Idea : The heuristics is state independant

Award variables (not literals) viewin the most recent learnt clausesduring the last conflict analysis

Well, yes. . . But where to branch at the beginning?

The heuristics is highly dynamic (really, really)in 1/30s (not in Python) a variable can fall from the top to theabysses

Side effect: the solver is very hard to understand/predict

Libsboa) 2016, June, 22th 33/89

introduction CDCL CDCL are complex (systems) Conclusion

VSIDS dynamicityExponential increasing of the increment

��

����

������

������

������

�������

�������

�������

�� ����� ����� ����� ����� ����� ����� ����� ����� ����� ����

������

��������

��������������������������������

��������������������

�����������������

After each conflict, it is multiplied by 1/v (v = 0.95)Libsboa) 2016, June, 22th 34/89

introduction CDCL CDCL are complex (systems) Conclusion

VSIDS and the heap

Let’s look at the code!

Libsboa) 2016, June, 22th 35/89

introduction CDCL CDCL are complex (systems) Conclusion

Conflict Clause Minimization

Introduced in Minisat

Idea: try to further reduce the learnt clause by self-subsumption

x ∨ y x ∨ ¬y ∨ zx ∨ z

Continue to perform resolution above after the FUIP if it does notenlarge the learnt clause

Very important but. . . not yet implemented in my Python solver (verysoon)

Libsboa) 2016, June, 22th 36/89

introduction CDCL CDCL are complex (systems) Conclusion

Phase Saving

A one line hack

Minisat is branching on variables. Which polarity to use?

Simply keep track of the last used polarity. And replay it.

Work very well with very fast restarts

The idea is to prevent the solver to forget how to solve subproblems

Libsboa) 2016, June, 22th 37/89

introduction CDCL CDCL are complex (systems) Conclusion

Restarts, common ideaRestarts are commonly used in local search algorithms.Idea: when the search failed, look at another part of the search space(looking for a solution).

Heavy Tailed Phenomenon Observed on Search TreesHEAVY-TAILED PHENOMENA IN SATISFIABILITY 69

(a)

(b)

Figure 1. Erratic behavior of the sample mean of backtrack search for completing a qua-

sigroup (order 11, 30% pre-assignment) vs. stabilized behavior of the sample mean for a

standard distribution (gamma).

a standard probability distribution (e.g., a gamma distribution; no heavy tails), as

given in Figure 1(b). In this case, we see that the sample mean converges rapidly to

a constant value with increasing sample size. On the other hand, the heavy-tailed

distribution in Figure 1(a) shows a highly erratic behavior of the mean that does

not stabilize with increasing sample size.⋆

Previous authors have discovered the related – and quite surprising – phenom-

enon of so-called exceptionally hard SAT problems in fixed problem distributions

[20, 62]. For these instances, we further observed that when a small amount of

⋆ The median, not shown here, stabilizes rather quickly at the value 1.

Libsboa) 2016, June, 22th 38/89

introduction CDCL CDCL are complex (systems) Conclusion

Restarts, common ideaRestarts are commonly used in local search algorithms.Idea: when the search failed, look at another part of the search space(looking for a solution).

Heavy Tailed Phenomenon Observed on Search Trees

HEAVY-TAILED PHENOMENA IN SATISFIABILITY 69

(a)

(b)

Figure 1. Erratic behavior of the sample mean of backtrack search for completing a qua-

sigroup (order 11, 30% pre-assignment) vs. stabilized behavior of the sample mean for a

standard distribution (gamma).

a standard probability distribution (e.g., a gamma distribution; no heavy tails), as

given in Figure 1(b). In this case, we see that the sample mean converges rapidly to

a constant value with increasing sample size. On the other hand, the heavy-tailed

distribution in Figure 1(a) shows a highly erratic behavior of the mean that does

not stabilize with increasing sample size.⋆

Previous authors have discovered the related – and quite surprising – phenom-

enon of so-called exceptionally hard SAT problems in fixed problem distributions

[20, 62]. For these instances, we further observed that when a small amount of

⋆ The median, not shown here, stabilizes rather quickly at the value 1.

Libsboa) 2016, June, 22th 38/89

introduction CDCL CDCL are complex (systems) Conclusion

Restarts, common idea

Restarts are commonly used in local search algorithms.Idea: when the search failed, look at another part of the search space(looking for a solution).

Restarts are introduced to fight against this phenomenon

Note: Learning allows frequent restarts. The completeness is stillguarantee.

Libsboa) 2016, June, 22th 38/89

introduction CDCL CDCL are complex (systems) Conclusion

Now: Ultra-Rapid Restarts

Last progress Luby-law restarts(1,2,1,2,4,1,2,1,2,4,8,1,2,1,2,4,1,2,1,2,4,8,16,...)Multiplied by a constant (32, 64, 128, 512).

Other strategies decision levels / LBD based / agilityIdea When the solver does not make any progress, restart

Important thing: restart a lot (optimal: Luby 6), use inconjonction with phase-saving

Libsboa) 2016, June, 22th 39/89

introduction CDCL CDCL are complex (systems) Conclusion

Now: Ultra-Rapid Restarts

Last progress Luby-law restarts(1,2,1,2,4,1,2,1,2,4,8,1,2,1,2,4,1,2,1,2,4,8,16,...)Multiplied by a constant (32, 64, 128, 512).

Other strategies decision levels / LBD based / agilityIdea When the solver does not make any progress, restart

Important thing: restart a lot (optimal: Luby 6), use inconjonction with phase-saving

Libsboa) 2016, June, 22th 39/89

introduction CDCL CDCL are complex (systems) Conclusion

Open questions on restarts

Luby’s strategy is optimal...When we blindly exploite/explore a process!

Restarts do not restart search Heuristics are maintained during arestarts. The solver directly goes to the same search space, but with adistinct path.

Open questionsWhen to restart?Relationship with learning (selecting a variable on the top of thesearch tree means that will probably don’t use it during resolutionsteps).What kind of decomposition branching achieves?

Libsboa) 2016, June, 22th 40/89

introduction CDCL CDCL are complex (systems) Conclusion

Clause Database Management

In the early 2000, Chaff was dying because of memory(very quickly)(some) learnt clauses had to be removed

Regularly remove unseen clauses during last conflict analysisExtends the notion of VSIDS to clauses

Keeping as many clauses as possible was believed to be crucialEssential for completeness!Especially if we restart a lot!

Libsboa) 2016, June, 22th 41/89

introduction CDCL CDCL are complex (systems) Conclusion

Glucose: the last SAT surprize

We can remove 95% of the clauses and get better!

Instead of removing clauses when needed, we eagerly remove them veryoften

Remove half of the clause very often

Clause activity is not relevant. Use the notion of LBD instead (definedlatter)

Libsboa) 2016, June, 22th 42/89

introduction CDCL CDCL are complex (systems) Conclusion

Aggressive and flexible

0

20000

40000

60000

80000

100000

120000

0 200000 400000 600000 800000 1e+06 1.2e+06 1.4e+06 1.6e+06

Cla

use

Dat

abas

e si

ze

Number of Conflicts

All goodAll bad

Bad, then goodGood, then Bad

Bad, then change every 100,000

Libsboa) 2016, June, 22th 43/89

introduction CDCL CDCL are complex (systems) Conclusion

Number of decisions before reaching a conflicteen-pico-prop05-50 – UNSAT – 13,000 vars and 65,000 clauses

een-pico-prop05-50 – UNSAT – 13,000 vars and 65,000 clauses

Experimental observation behind glucose (2009):A good CDCL learns clauses that reduces the number of decisions tomake

This observation is also true for most SAT instances!Libsboa) 2016, June, 22th 44/89

introduction CDCL CDCL are complex (systems) Conclusion

Number of decisions before reaching a conflictgrieu-vmpc-s05-25 – sat – 625 vars and 76,000 clauses

grieu-vmpc-s05-25 – SAT – 625 vars and 76,000 clauses

Experimental observation behind glucose (2009):A good CDCL learns clauses that reduces the number of decisions tomake

This observation is also true for most SAT instances!Libsboa) 2016, June, 22th 44/89

introduction CDCL CDCL are complex (systems) Conclusion

Number of decisions before reaching a conflictgrieu-vmpc-s05-25 – sat – 625 vars and 76,000 clauses

grieu-vmpc-s05-25 – SAT – 625 vars and 76,000 clauses

Experimental observation behind glucose (2009):A good CDCL learns clauses that reduces the number of decisions tomake

This observation is also true for most SAT instances!Libsboa) 2016, June, 22th 44/89

introduction CDCL CDCL are complex (systems) Conclusion

Literal Block Distance (LBD) – initial idea (2009)

One decision often creates a lot of propagated literals (“blocks”)Those variables will probably be propagated together again and

againReducing decisions? Adds dependencies between independent blocksHow? Add the strongest possible constraints between them

LBD of a learnt clause: number of prop. blocks of literals

Small LBD scores are betterThe importance of “Glue Clauses” (LBD=2)

Only one literal from the last decision level (the assertiveone)This literal will be glued to the other blockKept forever in glucose

The restart policy is based on LBD tooLibsboa) 2016, June, 22th 45/89

introduction CDCL CDCL are complex (systems) Conclusion

Targetting UNSAT: producing good clauses only

glucose is viewed as a clauses producerIf recent learnt clauses are bad (big LBD) a restart is performedWe use

a bounded queue (of size X) called queueLBDUsed to compute the moving average of the last X scoresthe sum of all LBD clauses sumLBDUsed to compute the average of all the scores so far

// I n ca se o f c o n f l i c tcompute l e a r n t c l a u s e c ;sumLBD+=c . l bd ( ) ;queueLBD . push ( c . l bd ( ) ) ;i f ( queueLBD . i s F u l l ( ) && queueLBD . avg ()∗K>sumLBD/ n b C o n f l i c t s ){

queueLBD . c l e a r ( ) ;r e s t a r t ( ) ;

}

Perform at least X conflicts before restartingAverage over last X LBD becomes too big w.r.t total average

Libsboa) 2016, June, 22th 46/89

introduction CDCL CDCL are complex (systems) Conclusion

Targetting UNSAT: producing good clauses only

glucose is viewed as a clauses producerIf recent learnt clauses are bad (big LBD) a restart is performedWe use

a bounded queue (of size X) called queueLBDUsed to compute the moving average of the last X scoresthe sum of all LBD clauses sumLBDUsed to compute the average of all the scores so far

// I n ca se o f c o n f l i c tcompute l e a r n t c l a u s e c ;sumLBD+=c . l bd ( ) ;queueLBD . push ( c . l bd ( ) ) ;i f ( queueLBD . i s F u l l ( ) && queueLBD . avg ()∗K>sumLBD/ n b C o n f l i c t s ){

queueLBD . c l e a r ( ) ;r e s t a r t ( ) ;

}

Perform at least X conflicts before restartingAverage over last X LBD becomes too big w.r.t total average

Libsboa) 2016, June, 22th 46/89

introduction CDCL CDCL are complex (systems) Conclusion

Targetting UNSAT: producing good clauses only

glucose is viewed as a clauses producerIf recent learnt clauses are bad (big LBD) a restart is performedWe use

a bounded queue (of size X) called queueLBDUsed to compute the moving average of the last X scoresthe sum of all LBD clauses sumLBDUsed to compute the average of all the scores so far

// I n ca se o f c o n f l i c tcompute l e a r n t c l a u s e c ;sumLBD+=c . l bd ( ) ;queueLBD . push ( c . l bd ( ) ) ;i f ( queueLBD . i s F u l l ( ) && queueLBD . avg ()∗K>sumLBD/ n b C o n f l i c t s ){

queueLBD . c l e a r ( ) ;r e s t a r t ( ) ;

}

Perform at least X conflicts before restartingAverage over last X LBD becomes too big w.r.t total average

Libsboa) 2016, June, 22th 46/89

introduction CDCL CDCL are complex (systems) Conclusion

Targetting UNSAT: producing good clauses only

glucose is viewed as a clauses producerIf recent learnt clauses are bad (big LBD) a restart is performedWe use

a bounded queue (of size X) called queueLBDUsed to compute the moving average of the last X scoresthe sum of all LBD clauses sumLBDUsed to compute the average of all the scores so far

// I n ca se o f c o n f l i c tcompute l e a r n t c l a u s e c ;sumLBD+=c . l bd ( ) ;queueLBD . push ( c . l bd ( ) ) ;i f ( queueLBD . i s F u l l ( ) && queueLBD . avg ()∗K>sumLBD/ n b C o n f l i c t s ){

queueLBD . c l e a r ( ) ;r e s t a r t ( ) ;

}

Perform at least X conflicts before restartingAverage over last X LBD becomes too big w.r.t total average

Libsboa) 2016, June, 22th 46/89

introduction CDCL CDCL are complex (systems) Conclusion

Targetting UNSAT: producing good clauses onlyglucose is viewed as a clauses producer

If recent learnt clauses are bad (big LBD) a restart is performedWe use

a bounded queue (of size X) called queueLBDUsed to compute the moving average of the last X scoresthe sum of all LBD clauses sumLBDUsed to compute the average of all the scores so far

// I n ca se o f c o n f l i c tcompute l e a r n t c l a u s e c ;sumLBD+=c . l bd ( ) ;queueLBD . push ( c . l bd ( ) ) ;i f ( queueLBD . i s F u l l ( ) && queueLBD . avg ()∗K>sumLBD/ n b C o n f l i c t s ){

queueLBD . c l e a r ( ) ;r e s t a r t ( ) ;

}

Perform at least X conflicts before restartingAverage over last X LBD becomes too big w.r.t total averageglucose 1.0 and 2.0: X=100 and K=0.7glueminisat and glucose 2.1 : X=50 and K=0.8

Libsboa) 2016, June, 22th 46/89

introduction CDCL CDCL are complex (systems) Conclusion

Impact of different K and X

75

80

85

90

95

50 100 150 200 250 300 350 400 450 500

nb s

olve

d

K

SAT (0.7)SAT (0.8)

X

SAT 2011 Application benchmarks (limit 900 seconds)

Libsboa) 2016, June, 22th 47/89

introduction CDCL CDCL are complex (systems) Conclusion

Impact of different K and X

75

80

85

90

95

50 100 150 200 250 300 350 400 450 500

nb s

olve

d

K

SAT (0.7)SAT (0.8)

UNSAT (0.7)UNSAT (0.8)

X

SAT 2011 Application benchmarks (limit 900 seconds)

Libsboa) 2016, June, 22th 47/89

introduction CDCL CDCL are complex (systems) Conclusion

Targeting SAT: allowing a total assignment

Rapid restarts are dangerous for SAT instancesA global assignment in-progress can be aborted too earlyWe only have a small window of conflicts (50) before reaching thetotal assignmentMoreover, there is a chance that the solver will produce bad clauseswhen increasing the number of decisions

Idea:

Delay restarts if the number of assignments suddenly increases

Libsboa) 2016, June, 22th 48/89

introduction CDCL CDCL are complex (systems) Conclusion

Targeting SAT tooNew in glucose 2.1

We watch the trail , the assignment stack at each conflictA bounded queue of the last Y trail is added (queueTrail)It is used to compute the moving average of the last Y trail sizes

// I n ca se o f c o n f l i c tq u e u e T r a i l . push ( t r a i l . s i z e ( ) ) ;i f ( queueLBD . i s F u l l ( ) && q u e u e T r a i l . i s F u l l ( ) && t r a i l . s i z e ()>T∗ q u e u e T r a i l . avg ( ) ) {

queueLBD . c l e a r ( ) ;}

compute l e a r n t c l a u s e c. . .

The total number of assignments suddenly increasePostpone restartY=5000 and T=1.4 appears to be good

Libsboa) 2016, June, 22th 49/89

introduction CDCL CDCL are complex (systems) Conclusion

Targeting SAT tooNew in glucose 2.1

We watch the trail , the assignment stack at each conflictA bounded queue of the last Y trail is added (queueTrail)It is used to compute the moving average of the last Y trail sizes

// I n ca se o f c o n f l i c tq u e u e T r a i l . push ( t r a i l . s i z e ( ) ) ;i f ( queueLBD . i s F u l l ( ) && q u e u e T r a i l . i s F u l l ( ) && t r a i l . s i z e ()>T∗ q u e u e T r a i l . avg ( ) ) {

queueLBD . c l e a r ( ) ;}

compute l e a r n t c l a u s e c. . .

The total number of assignments suddenly increasePostpone restartY=5000 and T=1.4 appears to be good

Libsboa) 2016, June, 22th 49/89

introduction CDCL CDCL are complex (systems) Conclusion

Targeting SAT tooNew in glucose 2.1

We watch the trail , the assignment stack at each conflictA bounded queue of the last Y trail is added (queueTrail)It is used to compute the moving average of the last Y trail sizes

// I n ca se o f c o n f l i c tq u e u e T r a i l . push ( t r a i l . s i z e ( ) ) ;i f ( queueLBD . i s F u l l ( ) && q u e u e T r a i l . i s F u l l ( ) && t r a i l . s i z e ()>T∗ q u e u e T r a i l . avg ( ) ) {

queueLBD . c l e a r ( ) ;}

compute l e a r n t c l a u s e c. . .

The total number of assignments suddenly increasePostpone restartY=5000 and T=1.4 appears to be good

Libsboa) 2016, June, 22th 49/89

introduction CDCL CDCL are complex (systems) Conclusion

Targeting SAT tooNew in glucose 2.1

We watch the trail , the assignment stack at each conflictA bounded queue of the last Y trail is added (queueTrail)It is used to compute the moving average of the last Y trail sizes

// I n ca se o f c o n f l i c tq u e u e T r a i l . push ( t r a i l . s i z e ( ) ) ;i f ( queueLBD . i s F u l l ( ) && q u e u e T r a i l . i s F u l l ( ) && t r a i l . s i z e ()>T∗ q u e u e T r a i l . avg ( ) ) {

queueLBD . c l e a r ( ) ;}

compute l e a r n t c l a u s e c. . .

The total number of assignments suddenly increasePostpone restartY=5000 and T=1.4 appears to be good

Libsboa) 2016, June, 22th 49/89

introduction CDCL CDCL are complex (systems) Conclusion

Targeting SAT tooNew in glucose 2.1

We watch the trail , the assignment stack at each conflictA bounded queue of the last Y trail is added (queueTrail)It is used to compute the moving average of the last Y trail sizes

// I n ca se o f c o n f l i c tq u e u e T r a i l . push ( t r a i l . s i z e ( ) ) ;i f ( queueLBD . i s F u l l ( ) && q u e u e T r a i l . i s F u l l ( ) && t r a i l . s i z e ()>T∗ q u e u e T r a i l . avg ( ) ) {

queueLBD . c l e a r ( ) ;}

compute l e a r n t c l a u s e c. . .

The total number of assignments suddenly increasePostpone restartY=5000 and T=1.4 appears to be good

Libsboa) 2016, June, 22th 49/89

introduction CDCL CDCL are complex (systems) Conclusion

Conflict Clause minimizationMinisat 1.13, N. Sörensson, A. Biere. Minimizing Learned Clauses. In Proc. 12th Intl.Conf. on Theory and Applications of Satisfiability Testing (SAT’09), Lecture Notes inComputer Science (LNCS) vol. 5584, pages 237-243, Springer 2009.

Clauses generated using the 1st UIP scheme can be simplifiedUsing simple direct self subsumption (direct dependencies among theclause’s literals outside current decision level):

x ∨ y x ∨ ¬y ∨ zx ∨ z

self subsumptionUsing a chain of resolution steps

Libsboa) 2016, June, 22th 50/89

introduction CDCL CDCL are complex (systems) Conclusion

PreprocessingNiklas Eén, Armin Biere: Effective Preprocessing in SAT Through Variable and ClauseElimination. SAT 2005: 61-75

Variable eliminationas in DP60 if the number of clauses does not increaseby substitution if a definition such as x ↔ y1 ∨ ... ∨ yn orx ↔ y1 ∧ ... ∧ yn is detected.

Clause subsumptionself subsumptionclassical subsumption

SatELite: de-facto standard pre-processor since 2005Included in Minisat 2 (better integration with the SAT solver)Still used by SAT solver designers that do not want to implementtheir own

Libsboa) 2016, June, 22th 51/89

introduction CDCL CDCL are complex (systems) Conclusion

Clause Minimization and Preprocessing @SAT COMP. 2005

0 50 100 150 200 250 3000

2000

4000

6000

8000

10000

12000

14000

� w

llsat

v1

� h

sat.5

� va

llst.s

h

� sa

t4j.ja

r

� co

mps

at

� zc

haff

� zc

haff r

and

� cs

at

� H

aifaS

at

� Je

rusa

t1.3

1 B

� m

inisa

t sta

tic

� S

atELit

eGTI

#Solved

CP

U−T

ime

need

ed (s

)

Second Stage:All solvers on renamed Industrial benchmarks

wllsatv1 (92)hsat.5 (153)vallst.sh (154)sat4j.jar (180)compsat (189)zchaff (197)zchaff

rand (226)

csat (231)HaifaSat (242)Jerusat1.31

B (243)

minisatstatic (250)

SatELiteGTI (267)

Libsboa) 2016, June, 22th 52/89

introduction CDCL CDCL are complex (systems) Conclusion

What about parallel CDCL?

Bad idea: Try to parallelize the BCP engine

A very difficult task: each engine is eagerly using the memory

Even sharing a clause is not a good ideaThe 2-Watched literal scheme is a nightmare for sharing the clausein a single core engine the first 2 literals are a shared information betweenthe 2 watched list.

So, the state of the art is to duplicate clauses

Libsboa) 2016, June, 22th 53/89

introduction CDCL CDCL are complex (systems) Conclusion

Many CoresMulti-core architecture, cloud ⇒ design of parallel solversDifferent strategies

Divide and conquerExplicitly splits search w.r.t. assignments

Portfolio algorithmsEach thread: its own solver and the whole formula

Rely on orthogonal searchesParallel solver

communication: learnt clausesAll threads working on the same proof

Solver2(Σ)

Solver1(Σ)

Solver3(Σ)

Solver4(Σ)

Libsboa) 2016, June, 22th 54/89

introduction CDCL CDCL are complex (systems) Conclusion

Many Cores, Many more problems

Sharing clauses in parallel has many drawbacks

Preprocessing(and inprocessing)

Restarting Branching

Conflict Analysis Clause DatabaseCleaning

Imported clauses can be bad (noise, wrong way, . . . )Imported clauses can be subsumed / uselessImported clauses can dominate learnt clausesEach thread has to manage many more clausesMany side effects on all core components

Currently: Clauses are sent as soon as they are learnt, plus:manysat 1.0: size ≤ 8manysat 1.1: dynamically adjust the thresholdplingeling: size ≤ 30 and LBD ≤ 8Penelope: LBD ≤ 8 (PSM allows more clauses exchanges)

Libsboa) 2016, June, 22th 55/89

introduction CDCL CDCL are complex (systems) Conclusion

Many useless clauses even in single engine solvers

10000

100000

1e+06

1e+07

10000 100000 1e+06 1e+07

#Use

less

Cla

uses

in fi

nal U

NSA

T Pr

oof

#Conflicts

GlucoseGlucose No reduce DBL.R. Glucose (m=0.42)

L.R. Glucose No reduce DB (m=0.55)y=x

x-axis : Number of conflictsy-axis : Useless clauses in final proof (UNSAT formulas)

Libsboa) 2016, June, 22th 56/89

introduction CDCL CDCL are complex (systems) Conclusion

How many times clauses are seen in conflicts

1000

10000

100000

1e+06

1e+07

1000 10000 100000 1e+06 1e+07

# C

laus

es s

een

at le

ast Z

tim

es

# Conflicts

Seen Z=1 timeL.R. Seen 1 time (m=0.91)

Seen Z=2 timesL.R. Seen 2 times (m=0.34)

Seen Z=3 timesL.R. Seen 3 times (m=0.22)

Seen Z=4 timesL.R. Seen 4 times (m=0.17)

x-axis: Number of conflictsy-axis: Number of clauses seen at least Z times

Libsboa) 2016, June, 22th 57/89

introduction CDCL CDCL are complex (systems) Conclusion

Conclusions from the experiments

A lot of useless clauses even in a single engine!

In parallel, this situation will be even worse!

Why sending a clause that is even not locally interesting?

We will consider clauses seen 2-times (only 34% of learnt clauses)Already filter out the majority of clauses

How to efficiently detect them?Is there a window of recent clauses to check?

Can we check only recent learnt clauses (and save time)?

Libsboa) 2016, June, 22th 58/89

introduction CDCL CDCL are complex (systems) Conclusion

Learnt and Directly Reused Clauses

1000

10000

100000

1e+06

1e+07

1000 10000 100000 1e+06 1e+07

# D

irect

ly R

euse

d Le

arnt

Cla

uses

# Conflicts

Directly Reused Learnt Clausey=x

Linear Regression (m=0.41)

x-axis: Number of imported clauses (sum over 8 threads)y-axis: Number of promoted clauses (sum over 8 threads)

91% of clauses seen at least 1 time. Only 41% are immediatelyseen.

Libsboa) 2016, June, 22th 59/89

introduction CDCL CDCL are complex (systems) Conclusion

Lazy Exportation of Clauses

Clauses are sent during conflict analysis

We only export clauses when seen 2 times in conflict analysis and:Clauses with LBD ≤ median(LBD) and size ≤ average(SIZE)

Limits updated at each clause database cleaning

Unary clauses and very glue clauses are immediately sent

Lazy because we wait to have a good chance of local interestbefore considering sending it

Libsboa) 2016, June, 22th 60/89

introduction CDCL CDCL are complex (systems) Conclusion

Lazy Importation of ClausesProblem of clauses importations:

can destroy the current search effortclauses can be redundantmany clauses to manage (performance impact)

How to be sure an imported clause is interesting beforeconsidering it?

Idea: put it in probationImported clauses are put in a 1-Watched schemeWill be promoted to a 2-Watched scheme only if found empty

Other AdvantagesLess efforts for propagationsCan be seen as a dynamic Freezing/Reactivating strategyClauses are imported with a local (and correct) LBD value

Libsboa) 2016, June, 22th 61/89

introduction CDCL CDCL are complex (systems) Conclusion

How many promotions?

1000

10000

100000

1e+06

1e+07

1000 10000 100000 1e+06 1e+07

# Pr

omot

ed C

laus

es (s

um o

ver t

he 8

thre

ads)

# Imported Clauses (sum over the 8 threads)

Promoted ClausesL.R. Promoted Clauses (m=0.10)

y=x

x-axis: Number of imported clauses (sum over 8 threads)y-axis: Number of promoted clauses (sum over 8 threads)

Libsboa) 2016, June, 22th 62/89

introduction CDCL CDCL are complex (systems) Conclusion

Implementation details

Solvers have many restartsImport clauses at decision level 0 only

Imported clauses (1-Watched) database have its own deletion strategyLimits the impact of importation on the solver

(Gory) Details of Glucose-Syrup in the contest:One solver is created, then clonedNumber of solvers adjusted to fit into 40% of allowed memoryWhen approaching the max memory allowed, switch to Panic Mode:Almost Constant Memory consumption modeNo tuning of cores strategies. Only the “French’s Flair”.

Idea: as few parameters changes as possible

Libsboa) 2016, June, 22th 63/89

introduction CDCL CDCL are complex (systems) Conclusion

Today’s Itinerary

Introduction

CDCL

CDCL are complex (systems)Community Structure of Industrial ProblemsCentrality of Industrial InstancesExperimental EvidencesCommunity structure, centrality, and LBDExperiments with CommunitiesAdditional observations

Conclusion

Libsboa) 2016, June, 22th 64/89

introduction CDCL CDCL are complex (systems) Conclusion

Do we really understand what we have built?

We know how to build an efficient (single engine) SAT solver, but:

CDCL is not DPLLbecause of ultra-rapid restarts and agressive clause DB cleaning

Learning can be badwe’ll see that keeping all clauses is not a winning strategy

Restarting is not restartingdirectly go to the same search space, by an another path

Luby-based restarts are dangerousrare but very large windows are following a fixed restart strategy

What is the phase?good to reach a solution or a contradiction?

“good” variables: top or bottom of the tree?splitting on top, resolving on bottom variables

glucose is not complete! Too many restarts and forgettingLibsboa) 2016, June, 22th 65/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL solvers are complex systems

We have a lot of open problems around these questions:Understand what we have implemented

It’s ok if we don’t fully “understand” our codeVery fast and unpredictableWork well on real-world instances, but how to define such astructure?All components are tightly connected, side effects are everywhereThere is no “one-simple reason” explaining their performance(supposition)At least we know that we don’t know

Idea behind glucoseA real experimental study of CDCL solvers

Libsboa) 2016, June, 22th 66/89

introduction CDCL CDCL are complex (systems) Conclusion

CDCL solvers are complex systems – Illustration

Example of a real conflict analysis:

Many resolutions at each conflictVery reactive VSIDS (1/10s lifetime)

But: A clear structure behind!

Let’s search for structure aware mechanismsin CDCL solvers!

Libsboa) 2016, June, 22th 67/89

introduction CDCL CDCL are complex (systems) Conclusion

Community Structure

Central idea:Dense internal connections inside a groupSparser connections between groups

Work of [Ansótegui, Girádez-Cru, Levy’12]:Industrial instances do have strong communities(with high confidence)Learning does preserve them in many cases

Libsboa) 2016, June, 22th 68/89

introduction CDCL CDCL are complex (systems) Conclusion

Community Structure

Central idea:Dense internal connections inside a groupSparser connections between groups

Work of [Ansótegui, Girádez-Cru, Levy’12]:Industrial instances do have strong communities(with high confidence)Learning does preserve them in many cases

Libsboa) 2016, June, 22th 68/89

introduction CDCL CDCL are complex (systems) Conclusion

Community Structure

Central idea:Dense internal connections inside a groupSparser connections between groups

Work of [Ansótegui, Girádez-Cru, Levy’12]:Industrial instances do have strong communities(with high confidence)Learning does preserve them in many cases

Libsboa) 2016, June, 22th 68/89

introduction CDCL CDCL are complex (systems) Conclusion

The Direct Graphical ModelAs done in [Katsirelos, Simon ’12]

A bipartite, directed graphNodes are literals and clausesOutgoing edge from Clause c to Literal l iff l ∈ cOutgoing edge from Literal l to Clause c iff ¬l ∈ c

(¬1 ∨ 53 ∨ 2) ∧ (¬1 ∨ ¬2 ∨ ¬57)

A conflict graph is a subgraph of the DGMA path in this graph has a also meaning:it tries to assign literals that satisfy clauses.

Libsboa) 2016, June, 22th 69/89

introduction CDCL CDCL are complex (systems) Conclusion

Eigenvector Centrality and CDCL[Katsirelos, Simon ’12] also studied the graphical representation of CNFs.

The (Eigenvector) centrality: “importance” of a node (see pagerankalgorithm)

Libsboa) 2016, June, 22th 70/89

introduction CDCL CDCL are complex (systems) Conclusion

Eigenvector Centrality and CDCL[Katsirelos, Simon ’12] also studied the graphical representation of CNFs.

The (Eigenvector) centrality: “importance” of a node (see pagerankalgorithm)

Libsboa) 2016, June, 22th 70/89

introduction CDCL CDCL are complex (systems) Conclusion

Centrality and communities

Work of [Katsirelos, Simon’12]:Measure the (initial) centrality of each variableObserve (during run time) solvers choices w.r.t. centralityTry to see if general tendencies can be observed

Relationship between centrality and communitiesCentral nodes: the ones that you want to remove to partition thegraphCentral nodes: likely to be on the frontiere of clusters (communities)Non-Central nodes: inside clusters (communities)

Libsboa) 2016, June, 22th 71/89

introduction CDCL CDCL are complex (systems) Conclusion

Computing the centrality of huge graphs

The PageRank algorithm (Google) An efficient iterative algorithmapproximating the stationary distribution of a random walk on a graph

Centrality of literals is computed once, in an off-line run.

Each analysis can take up to 20-30 min

On beeing central, or notOn the web, central pages are the most important onesIn a CNF, central nodes are likely to be on a fringe between clustersDecomposition can be performed by removing central nodes first

Libsboa) 2016, June, 22th 72/89

introduction CDCL CDCL are complex (systems) Conclusion

First Experimental Protocol

We want to detect some correlation between:The centrality (computed only once on the initial, preprocessed,formula)And observations/measures made during the CDCL run

The 2012 Protocol, at a glanceWe used glucose as an archetype CDCL solverWe tested all 658 benchmarks from SatRace 2008, SatCompetion2009 and 2011, in the Application categoryWe fixed a cutoff of 5 Million conflicts, but placed no bound onCPU time

Libsboa) 2016, June, 22th 73/89

introduction CDCL CDCL are complex (systems) Conclusion

Picked Variables are centralPicture from [Katsirelos, Simon ’12]

1E-07

1E-06

1E-05

1E-04

1E-03

1E-02

1E-07 1E-06 1E-05 1E-04 1E-03 1E-02

Aver

age

Cen

tralit

y of

all

Varia

bles

Average Centrality of all Picked Variables

y=x

Libsboa) 2016, June, 22th 74/89

introduction CDCL CDCL are complex (systems) Conclusion

Propagated Variables are (also) centralPicture from [Katsirelos, Simon ’12]

1E-07

1E-06

1E-05

1E-04

1E-03

1E-02

1E-07 1E-06 1E-05 1E-04 1E-03 1E-02

Aver

age

Cen

tralit

y of

all

Varia

bles

Average Centrality of all Propagated Variables

y=x

Libsboa) 2016, June, 22th 75/89

introduction CDCL CDCL are complex (systems) Conclusion

Learning unit clauses is essential

A typical run of a CDCLwill “produce” top-level implied literals during the runbut the frequency of produced literals will decrease

In practiceA unit clause is learnt, and the literal is added at the top levelThis assignment will often produce immediatly other top-levelpropagated literals

Of course, on some problems, no unit-clause are learnt.

Libsboa) 2016, June, 22th 76/89

introduction CDCL CDCL are complex (systems) Conclusion

Working on Central Literals

1E-07

1E-06

1E-05

1E-04

1E-03

1E-07 1E-06 1E-05 1E-04 1E-03

Aver

age

Cen

tralit

y of

(All)

Lea

rnt L

itera

ls

Average Centrality of (Really) Learnt Literals

y=x

Libsboa) 2016, June, 22th 77/89

introduction CDCL CDCL are complex (systems) Conclusion

Measuring how the solver progresses

1E-07

1E-06

1E-05

1E-04

1E-03

1E-07 1E-06 1E-05 1E-04 1E-03

Aver

age

Cen

tralit

y of

all

lear

nt li

tera

ls

Average Centrality of first quartile learnt literals

y=xLinear Regression

Libsboa) 2016, June, 22th 78/89

introduction CDCL CDCL are complex (systems) Conclusion

Centrality of Conflict Clauses vs Learnt ClausesPicture from [Katsirelos, Simon ’12]

1E-07

1E-06

1E-05

1E-04

1E-03

1E-02

1E-07 1E-06 1E-05 1E-04 1E-03 1E-02

Aver

age

Cen

tralit

y of

Lea

rnt C

laus

e

Average Centrality of Conflict Clauses

y=x

Libsboa) 2016, June, 22th 79/89

introduction CDCL CDCL are complex (systems) Conclusion

In Learnt clauses, the 1-UIP literal is central

1e-06

1e-05

0.0001

0.001

1e-06 1e-05 0.0001 0.001

Aver

age

Cen

tralit

y of

oth

er li

tera

ls in

lear

nt c

laus

es

Centrality of FUIP literal

APrCountBits

E0xHWMC

IBMManol

PlanAAAISLPSynth

aesgss

gusmd5mizhndhfpost

qqueryrbcl

smtlibvelevvmpc

y=x

Libsboa) 2016, June, 22th 80/89

introduction CDCL CDCL are complex (systems) Conclusion

Making connections between LBD and communities

Initial Goal of the experiment:Do we observe a relationship between LBD and communities?

How we built the experiment:We partitioned the variables into communities on the initial(preprocessed) formulas.We were able to compute the communities for 189 benchmarks ofthe SAT’13 competition(over 300 benchmarks, with 5000s time out)At each conflict, we observe the differences between the

The number of communities in the clauseThe number of decision levels (LBD) in the clause

And. . . We cross our fingers!

Libsboa) 2016, June, 22th 81/89

introduction CDCL CDCL are complex (systems) Conclusion

A good example

Benchmarksdated-5-13-u

Nb Variables138808

Nb Clauses626501

Max conflicts20000

Q0.907721

Nb Partitions97775

Libsboa) 2016, June, 22th 82/89

introduction CDCL CDCL are complex (systems) Conclusion

Another good example (there are many)

Benchmarksaaai10-plan. . . -ipc5-..-17-step20

Nb Variables50277

Nb Clauses283903

Max conflicts20000

Q0.913337

Nb Partitions12776

Libsboa) 2016, June, 22th 83/89

introduction CDCL CDCL are complex (systems) Conclusion

A bad example (there are some)

Benchmarksrbcl_xits_14_SAT

Nb Variables2220

Nb Clauses148488

Max conflicts20000

Q0.531783

Nb Partitions725

Libsboa) 2016, June, 22th 84/89

introduction CDCL CDCL are complex (systems) Conclusion

Outliers everywhere!We try to understand CDCL solvers but all problems are distincts!

Number of decisions

��

���

����

�����

��� ��� ��� ��� ���� ����

�������

���

������

���

�����������������������

stats after 10,000 conflicts on 1164 “not easy” problems from all previouscontests

Libsboa) 2016, June, 22th 85/89

introduction CDCL CDCL are complex (systems) Conclusion

Outliers everywhere!We try to understand CDCL solvers but all problems are distincts!

Decisions per conflicts

��

���

����

�����

��� ��� ��� ��� ���� �����������

���

������

���

����������

������

��������

����

������

stats after 10,000 conflicts on 1164 “not easy” problems from all previouscontestsLibsboa) 2016, June, 22th 85/89

introduction CDCL CDCL are complex (systems) Conclusion

Outliers everywhere!We try to understand CDCL solvers but all problems are distincts!

“True” (non binary) glue clauses

��

���

����

�����

������

��� ��� ��� ��� ���� ������

��

���

���

���������

���

������

�������������������

stats after 10,000 conflicts on 1164 “not easy” problems from all previouscontestsLibsboa) 2016, June, 22th 85/89

introduction CDCL CDCL are complex (systems) Conclusion

Outliers everywhere!We try to understand CDCL solvers but all problems are distincts!

Successive conflicts

�����

�����

�����

�����

��� ��� ��� ��� ���� ��������

���

���

������

���

���

�����������������������

stats after 10,000 conflicts on 1164 “not easy” problems from all previouscontests

Libsboa) 2016, June, 22th 85/89

introduction CDCL CDCL are complex (systems) Conclusion

Outliers everywhere!We try to understand CDCL solvers but all problems are distincts!

Propagations

�����

�����

�����

�����

������

��� ��� ��� ��� ���� ����

��

�����

���

������

���

��������

������

���������������

stats after 10,000 conflicts on 1164 “not easy” problems from all previouscontestsLibsboa) 2016, June, 22th 85/89

introduction CDCL CDCL are complex (systems) Conclusion

When experimenting suggests that CDCL solvers areinefficient

Most of solver’s time is spent in unit propagation

But, on UNSAT instances:Only 50% of generated clauses are useful for deriving the finalcontradictionOnly 20% of unit propagation are used during conflict analysis

Only 10% of solver’s time is useful for deriving the contradiction!

Libsboa) 2016, June, 22th 86/89

introduction CDCL CDCL are complex (systems) Conclusion

Today’s Itinerary

Introduction

CDCL

CDCL are complex (systems)

ConclusionA (Possible) Illustration of learnt clause mechanismConclusion

Libsboa) 2016, June, 22th 87/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

(Possible) Illustration of learnt clause mechanism

InCluster Variable!Frontiere Variable!

Propagated Variable!Conflict Variable!

Learnt Clause Variable

Libsboa) 2016, June, 22th 88/89

introduction CDCL CDCL are complex (systems) Conclusion

Conclusion

We now how to built an efficient SAT Solver but we can hardlyexplain their power

Experimenting is essential now in SAT research

LBD are related to communities (but may be more “semantic”

We (may) need to see CDCL has clauses producers, not branchingalgorithms(much more difficult to handle, but closer to reality)

What about modelizing SAT solvers?

Libsboa) 2016, June, 22th 89/89