Decision heuristics based on an Abstraction/Refinement model (HaifaSat) Ofer Strichman Roman Gershman Technion
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
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.
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:
Abstraction of formulas Now consider Binary Resolution: (AÇ x) Æ (B Ç :x) ! (A Ç B) F ! over-approximates
Resolution Graph Binary DAG with intermediate and conflict clauses. Collapsed DAG with multi-degree nodes C-1 C-3 C-2 O1 O2 O3 O4 O5 O6 O7 O1 O2 O3 O4 O6 O7 i1 c-1 i2 i3 O5 c-2 C-3 i4 Each node in the graph is an abstraction of its descendants
Refinement of models and formulas An intermediate model is a refinement of if: An intermediate formula is a refinement of if: F ! , ! or simply:
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.
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.
Berkmin heuristic A new conflict clause tail- first conflict clause Berkmin satisfies all the clauses until c. This is current abstract model M of formula f. After a conflict, Berkmin retreats with a new conflict clause. When it comes back and satisfies again all clauses until c, it creates an refinement of M.
Check of abstract assignment fails Berkmin heuristic Let φ denote the original formula F abstracts φ (φ ! F ) is a refinement of F with respect to φ (φ ! , ! F ) Berkmin satisfies all the clauses until c. This is current abstract model M of formula f. After a conflict, Berkmin retreats with a new conflict clause. When it comes back and satisfies again all clauses until c, it creates an refinement of M. tail- first conflict clause F Check of abstract assignment fails
Berkmin heuristic Does not focus on a specific Abstraction/Refinement path. Generally: hundreds of clauses can be between a clause and its resolving clauses. C-3 C-2 C-1
A General Heuristic for choosing the next clause Mark all roots. Choose an unresolved marked clause V (If there are none - exit) Decide a variable from V until it is satisfied. Mark V’s children
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.
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
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.
CMTF 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.
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.
Activity Score work invested in refuting x=1 (some of it seems wasted) Refutation of x=1 C5 C2 Decision Level C1 C4 C3 Decision Time Conflict
Activity Score Weight is given to variables resolved-on in the process of resolving C C5 C C2 C0 C x=1 Refutation of x=1 C5 C2 Decision Level C1 C4 C3 Decision Time Conflict
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
(CMTF + RBS) Vs. Berkmin (both implemented inside HaifaSat)
HaifaSat Vs. zChaff 2004
Results –SAT05 (Industrial)
Results –SAT05 (Industrial) Sorted by what ?
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.
And now... Two research directions Better refinement strategies. Hints.
Recall the general framework: Mark all roots. Choose an unresolved marked clause V (If there are none - exit) Decide a variable from V until it is satisfied. Mark V’s children
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...
Refinement-driven Vs. Conflict-driven search. W(c) = ci 2 antecedents(c) W(ci) How should we balance between refinement-driven and conflict-driven strategies ? O-1 O-2 O-3 O-4 O-5 O-6 O-7 O-8
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.
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.
Hints: Example A hint clause: (:l1 :l2 :l3) Perhaps a better idea: SHB 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.
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”