sspv2006 6628
Download
Report
Transcript sspv2006 6628
Decision heuristics based on an
Abstraction/Refinement model
(HaifaSat)
Ofer Strichman
Roman Gershman
An earlier version was presented in IBM’s verification
conference (Haifa, Oct. 05).
Technion
1
SAT solving
Technion
“Naïve” point of view:
Searches in the decision tree, prunes subspaces.
Creates “blocking clauses” that do not allow the solver
to choose the same 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
2
A different point of view
Technion
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.
3
Abstraction of models and formulas
Technion
Model
of M if:
is an (over approximating) abstraction
A QF formula is an (over-approximating)
abstraction of F if:
or simply:
F!
4
Refinement of models and formulas
Technion
Model
Formula
refines
if:
refines
if:
or simply:
F! ,
!
5
Abstraction of formulas
Technion
F!
Now consider Binary Resolution:
(A _ x) ^ (B _ :x) !
(A _ B)
over-approximates
Conflict Clauses are derived through a process
of Binary Resolution.
6
Resolution Graph
Technion
Binary DAG with intermediate
and conflict clauses.
Collapsed DAG with multi-degree nodes
C-3
C-3
i4
C-2
C-1
i3
i2 O
5
i1
O3
O4
O7
C-2
C-1
O6
O1
O2 O
3
O4
O5
O6
O7
O1 O2
Each node in the graph is an abstraction of its antecedents
7
Conflict clauses
Technion
Several modern Decision Heuristics are guided
by the Conflict Clauses (e.g. Berkmin)
Hence, we can analyze them with the
Abstraction/Refinement model.
8
Berkmin’s heuristic
Technion
Push conflict clauses to a ‘stack’.
Find the first unsatisfied clause and choose a
variable from this clause.
Secondary heuristic: VSIDS (Zchaff).
9
Berkmin heuristic
Technion
tailfirst conflict clause
A new
conflict
clause
10
Berkmin heuristic
Technion
Let F denote the original formula
abstracts F
(F ! )
refines
(F ! , !
)
tailfirst conflict clause
Check of abstract
assignment fails
11
Berkmin heuristic
Does not focus on a specific Abstraction/Refinement
path.
Technion
C-3
C-2
C-1
Generally: hundreds of clauses can be between a clause
and its resolving clauses.
12
Choosing the next clause by traversing
the resolution graph: a general scheme
Technion
1.
2.
Mark all sinks.
Choose an unresolved marked clause C
(If there are none - exit)
3.
4.
process C
// attempt to satisfy C.
Mark C ’s antecedents.
Berkmin chooses a clause only if all its
descendents are already satisfied.
13
Progressing on the resolve graph
Technion
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
14
The CMTF heuristic
Technion
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.
secondary strategy: the VMTF (Siege) heuristic.
Gives us the ‘first-layer approximation’ of the graph.
15
CMTF
Technion
C-3
C-2
C-1
C-0
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.
16
News
Technion
A new technique developed in IBM-Haifa allows to
shrink the graph stored in memory by ~ an order
of magnitude.
So, assuming the graph is in memory, the search
for new strategies is now open…
A contention between conflict-driven and
abstraction-driven.
17
Activity Score
T2(C)
T1(C)
time dedicated for refuting x=1
Technion
Time C is
asserting
time dedicated for creating C
C
x=1
Decision
Level
C5
C2
C1
C4
C3
Time
Decision
Conflict
18
Given a clause: choose a variable.
The activity score.
Technion
The Activity of a variable v:
Let V be the set of variables that were resolved on in
T1(C) on the resolution path of C.
Add +1 for each v2V in the interval T2(C)
Occasionally, divide all scores.
A cheap recursive computation embedded in the
First-UIP scheme.
19
Results
Technion
165 industrial hard benchmarks from previous SAT
competitions.
All heuristics (Berkmin, VSIDS) implemented inside
HaifaSat for fair comparison.
Comparing…
Time
Fails
CMTF
Berkmin
10%
12-25%
RBS
VSIDS
23%
20-30%
Berkmin
a little better than zChaff 2004
20
(CMTF + RBS) Vs. Berkmin
(both implemented inside HaifaSat)
Technion
Berkmin + VSIDS Vs. CMTF + RBS (HaifaSat)
3500
3000
2000
1500
CMTF + RBS
2500
1000
500
0
3500
3000
2500
2000
1500
1000
500
0
Berkmin + VSIDS
21
HaifaSat Vs. zChaff 2004
Technion
HaifaSat Vs. zChaff
3500
3000
2000
h-c-rbs
1500
HaifaSat
2500
1000
500
0
3500
3000
2500
2000
1500
1000
500
0
zChaff 2004
22
Results –SAT05 (Industrial)
Technion
23
Results –SAT05 (Industrial)
Technion
24
Competition...
Technion
Independently, very similar principles were
discovered by Dershowitz, Hanna 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.
25
What we explore now
Technion
We are currently investigating the possibility to
use Hints for dealing with hard instances
Hints: a yet-unpublished work by
Kroening, Yorav, Shacham.
The original use of hints: using presumed highlevel knowledge to speed SAT.
26
Hints
Technion
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 only used for deriving more hints.
27
Hints (cont.)
Technion
Use hints to prune ‘seemingly hopeless
branches (SHB)’
Define a monotonically decreasing function
f: decision-level time-interval
If time at decision level dl > f(dl) move to
another branch. It is seemingly hopeless.
Actively: force backtracking
Passively: wait for a restart
28
Hints: Example
l1
l2
l3
:l3
Technion
SHB
A hint clause: (:l1 :l2 :l3).
Option #1: hint = negation of partial assignment
Option #2: hint = projection of #1 to literals that were
used in the SHB.
29
Combining Hints and restarts
Technion
Some heuristics to be tried:
Change restart policy, using f.
Local restarts: only from a certain decision level
…
30
Hints and restarts
Technion
A restart is effective because of randomization
and/or learning. Hints will add new conjectures.
Bart Selman: “You can not restart too much”
Perhaps now: “You can not hint too much”
31