Decision heuristics based on an Abstraction/Refinement model
description
Transcript of Decision heuristics based on an Abstraction/Refinement model
1
Decision heuristics based on an Abstraction/Refinement model
Ofer Strichman
Roman Gershman
Technion
(HaifaSat)
2
TechnionTechnion
SAT solving “Naïve” point of view:
Searches in the decision tree, prunes subspaces. Creates “blocking clauses” that restrain the solver from
choosing the same bad path again.
This point of view fails to explain why We can solve many formulas with 105 variables, We cannot solve other formulas with 103 variables
3
TechnionTechnion
A different point of view
Modern solvers act as proof engines based on resolution, rather than as search engines, with structured problems.
Evidence: adding the shortest conflict clauses is not the best strategy [R04].
Furthermore: certain strategies resemble a proof by abstraction-refinement.
4
TechnionTechnion
Abstraction of models and formulas
Model is an (over approximating) abstraction of M if:
A degenerated case: Formula is an (over-approximation) abstraction
of F if:
F !or simply:
5
TechnionTechnion
Abstraction of formulas
Now consider Binary Resolution:
(AÇ x) Æ (B Ç :x) ! (A Ç B)
over-approximates
F !
6
TechnionTechnion
Resolution Graph
O1 O2
O3O4
O6
O7
i1
c-1
i2
i3
O5
c-2
C-3
i4
Binary DAG with intermediate and conflict clauses.
Each node in the graph is an abstraction of its descendants
Collapsed DAG with multi-degree nodes
C-1
C-3
C-2
O1 O2 O3 O4O5 O6
O7
7
TechnionTechnion
Refinement of models and formulas
An intermediate model is a refinement of if:
An intermediate formula is a refinement of if:
F ! , ! or simply:
8
TechnionTechnion
Why all this theory? …
Because Conflict Clauses are derived through a process of resolution.
Several modern Decision Heuristics are guided by the Conflict Clauses (e.g. Berkmin)
Hence, we can analyze them with the Abstraction/Refinement model.
9
TechnionTechnion
Berkmin’s heuristic
Push conflict clauses to a stack. Find the first unsatisfied clause and choose a
variable from this clause. If all conflict clauses are satisfied, choose a
variable according to the VSIDS (Zchaff) heuristic.
10
TechnionTechnion
Berkmin heuristic
tail-first conflict clause
A new conflict clause
11
TechnionTechnion
Let φ denote the original formula F abstracts φ (φ ! F ) is a refinement of F with respect to φ
(φ ! , ! F )
Berkmin heuristic
tail-first conflict clause F
Check of abstract assignment fails
12
TechnionTechnion Does not focus on a specific Abstraction/Refinement
path.
Generally: hundreds of clauses can be between a clause and its resolving clauses.
Berkmin heuristic
C-1
C-3
C-2
13
TechnionTechnion
A General Heuristic for choosing the next clause
1. Mark all roots.
2. Choose an unresolved marked clause V (If there are none - exit)
3. Decide a variable from V until it is satisfied.
4. Mark V’s children
14
TechnionTechnion
The Clause-Move-To-Front (CMTF) heuristic
Is an instantiation of the general heuristic Does not need to store the whole graph. More focused than Berkmin.
15
TechnionTechnion
Progressing on the resolve graph
Progress with “Best-First” according to some criterion.
Must store the whole resolve graph in memory – this is frequently infeasible.
HaifaSat’s strategy: Do not store graph Be more abstraction-focused than Berkmin
16
TechnionTechnion
The CMTF heuristic
Position conflict clauses together with their resolving clauses in the end of a list.
Find the first unsatisfied clause and choose a variable from this clause.
If all conflict clauses are satisfied, choose a variable according to the VMTF (Siege) heuristic.
Gives us the ‘first-layer approximation’ of the graph.
17
TechnionTechnion
CMTF
When C-3 is created, C-0, C-1 are moved to the head of the list together with C-3.
C-2 is left in place.
C-1
C-3
C-2
C-0
18
TechnionTechnion
Given a clause: choose a variable.
The Activity of a variable v: Activity score of a variable increases when it is a
resolution variable, but… only when the clause it helped resolving is currently
relevant, and… it happened recently
A recursive computation embedded in the First-UIP scheme.
19
TechnionTechnion
DecisionConflict
Decision Level
Time
work invested in refuting x=1
(some of it seems wasted)
Cx=1 Refutation of x=1
C1
C5
C4
C3
C2
Activity Score
20
TechnionTechnion
ConflictDecision
C1Decision Level
Time
x=1 Refutation of x=1
C5
C4
C3
C2
C
C5
C2
C4
Weight is given to variablesresolved-on in the process of resolving C
C
Activity Score
C0
21
TechnionTechnion
Results (sec., average)Benchmark (#) Berkmin+VSIDS CMTF+RBS
Hanoi (5) 530 130
IP (4) 395 203
Hanoi03 (4) 1342 426
Check-int (4) 3323 681
Bmc2 (6) 1030 1261
Fifo8 (4) 3944 1832
Fvp2 (22) 8638 1995
W08 (3) 5347 2680
Ibm02 (9) 9710 3875
01_rule (20) 33642 19171
11_rule_2 (20) 34006 22974
22
TechnionTechnion
(CMTF + RBS) Vs. Berkmin(both implemented inside HaifaSat)
Berkmin + VSIDS Vs. CMTF + RBS (HaifaSat)
0
500
1000
1500
2000
2500
3000
3500
0500100015002000250030003500
Berkmin + VSIDS
CM
TF
+ R
BS
23
TechnionTechnion
HaifaSat Vs. zChaff 2004
HaifaSat Vs. zChaff
0
500
1000
1500
2000
2500
3000
3500
0500100015002000250030003500
zChaff 2004
Hai
faS
at
h-c-rbs
24
TechnionTechnion
Results –SAT05 (Industrial)
25
TechnionTechnion
Results –SAT05 (Industrial)
26
TechnionTechnion
Competition...
Independently, very similar principles were discovered by Dershowitz, Hana and Nadel [SAT’05]
Reached very similar conclusions Their ‘black-box’ Eureka SAT solver took several
first and second places in last year’s competition.
27
TechnionTechnion
And now...
Two research directions Better refinement strategies. Hints.
28
TechnionTechnion
Recall the general framework:
1. Mark all roots.
2. Choose an unresolved marked clause V (If there are none - exit)
3. Decide a variable from V until it is satisfied.
4. Mark V’s children
29
TechnionTechnion
But,
HaifaSat does not really traverse the resolution graph.
The assumption is: the graph is too large to store in memory.
But, there are news: A new technique developed in IBM-Haifa allows to shrink
the graph stored in memory by two orders of magnitude. The search for new refinement strategies is now open...
30
TechnionTechnion
Refinement-driven Vs. Conflict-driven search.
O-1 O-2 O-3 O-4 O-5 O-6 O-7 O-8
W(c) = ci 2 antecedents(c) W(ci)
How should we balancebetween refinement-driven and conflict-driven strategies ?
31
TechnionTechnion
Hints
An (unpublished) idea by (Kroening, Yorav, Shacham)
Hints are constraints (clauses) that are conjectured to be true.
A separate BCP processes the set of conjectured clauses. An implied literal becomes the next decision. A conflict is ignored.
32
TechnionTechnion
Hints (cont.)
The original use of hints: high-level knowledge. We suggest: prune ‘seemingly hopeless
branches (SHB)’ Define a monotonically decreasing function
f: decision-level time-interval If time at decision level dl > f(dl) prune the branch.
This branch is seemingly hopeless.
33
TechnionTechnion
Hints: Example
A hint clause: (:l1 :l2 :l3) Perhaps a better idea:
Keep track on which subset S of l1 ... l3 were used in the SHB. The negation of literals in S is a better hint.
l1
l2
l3 : l3
SHB
34
TechnionTechnion
Hints vs. restarts
Not entirely orthogonal techniques. A restart is effective because of randomization
and/or learning. Hints are more directed: they push the solver
away from seemingly hopeless branches. Also: it is activated due to local consideration,
and not a global clock. Bart Selman: “You can not restart too much”
Perhaps now: “You can not hint too much”