Decision heuristics based on an AbstractionRefinement model Haifa
Decision heuristics based on an Abstraction/Refinement model (Haifa. Sat) Ofer Strichman Roman Gershman Technion 1
SAT solving Technion q “Naïve” point of view: q q q 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 q q We can solve many formulas with 105 variables, We cannot solve other formulas with 103 variables 2
A different point of view Technion q q q 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 [R 04]. Furthermore: certain strategies resemble a proof by abstraction-refinement. 3
Abstraction of models and formulas Technion q Model of M if: is an (over approximating) abstraction A degenerated case: q Formula is an (over-approximation) abstraction of F if: or simply: F! 4
Abstraction of formulas Technion F! q q Now consider Binary Resolution: (AÇ x) Æ (B Ç : x) ! (A Ç B) over-approximates 5
Resolution Graph Technion Binary DAG with intermediate and conflict clauses. Collapsed DAG with multi-degree nodes C-3 i 4 c-2 c-1 i 3 i 2 O 5 i 1 O 3 O 4 O 7 C-2 C-1 O 6 O 1 O 2 O 3 O 4 O 5 O 6 O 7 O 1 O 2 Each node in the graph is an abstraction of its descendants 6
Refinement of models and formulas Technion q An intermediate model q An intermediate formula or simply: is a refinement of F! , ! if: 7
Why all this theory? … Technion q q q 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. 8
Berkmin’s heuristic Technion q q q 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. 9
Berkmin heuristic Technion tailfirst conflict clause A new conflict clause 10
Berkmin heuristic Technion q q q Let φ denote the original formula F abstracts φ (φ ! F ) is a refinement of F with respect to φ (φ ! , ! F ) tailfirst conflict clause F Check of abstract assignment fails 11
Berkmin heuristic q Does not focus on a specific Abstraction/Refinement path. Technion C-3 C-2 C-1 q Generally: hundreds of clauses can be between a clause and its resolving clauses. 12
A General Heuristic for choosing the next clause Technion 1. 2. Mark all roots. Choose an unresolved marked clause V (If there are none - exit) 3. 4. Decide a variable from V until it is satisfied. Mark V’s children 13
The Clause-Move-To-Front (CMTF) heuristic Technion q q q Is an instantiation of the general heuristic Does not need to store the whole graph. More focused than Berkmin. 14
Progressing on the resolve graph Technion q Progress with “Best-First” according to some criterion. q Must store the whole resolve graph in memory – this is frequently infeasible. q Haifa. Sat’s strategy: q q Do not store graph Be more abstraction-focused than Berkmin 15
The CMTF heuristic Technion q Position conflict clauses together with their resolving clauses in the end of a list. q 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. q Gives us the ‘first-layer approximation’ of the graph. 16
CMTF Technion C-3 C-2 C-1 C-0 q q 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. 17
Given a clause: choose a variable. Technion q The Activity of a variable v: q q 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. 18
Activity Score Technion work invested in refuting x=1 (some of it seems wasted) C x=1 C 5 C 2 Decision Level Refutation of x=1 C 4 C 3 Time Decision Conflict 19
Activity Score C 4 Technion C 5 C C 2 Weight is given to variables resolved-on in the process of resolving C C 0 C x=1 C 5 C 2 Decision Level Refutation of x=1 C 4 C 3 Time Decision Conflict 20
Results (sec. , average) Technion Benchmark (#) Berkmin+VSIDS CMTF+RBS Hanoi (5) 530 130 IP (4) 395 203 Hanoi 03 (4) 1342 426 Check-int (4) 3323 681 Bmc 2 (6) 1030 1261 Fifo 8 (4) 3944 1832 Fvp 2 (22) 8638 1995 W 08 (3) 5347 2680 Ibm 02 (9) 9710 3875 01_rule (20) 33642 19171 11_rule_2 (20) 34006 22974 21
(CMTF + RBS) Vs. Berkmin (both implemented inside Haifa. Sat) Technion 22
Haifa. Sat Vs. z. Chaff 2004 Technion 23
Results –SAT 05 (Industrial) Technion 24
Results –SAT 05 (Industrial) Technion 25
Competition. . . Technion q q q 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. 26
And now. . . Technion q Two research directions q q Better refinement strategies. Hints. 27
Recall the general framework: Technion 1. 2. Mark all roots. Choose an unresolved marked clause V (If there are none - exit) 3. 4. Decide a variable from V until it is satisfied. Mark V’s children 28
But, Technion q q q Haifa. Sat does not really traverse the resolution graph. The assumption is: the graph is too large to store in memory. But, there are news: q q 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. . . 29
Refinement-driven Vs. Conflictdriven search. Technion 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 30
Hints Technion q q q 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. q q An implied literal becomes the next decision. A conflict is ignored. 31
Hints (cont. ) Technion q q The original use of hints: high-level knowledge. We suggest: prune ‘seemingly hopeless branches (SHB)’ q q 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. 32
Hints: Example l 1 l 2 l 3 : l 3 Technion SHB q q A hint clause: (: l 1 : l 2 : l 3) Perhaps a better idea: q q Keep track on which subset S of l 1. . . l 3 were used in the SHB. The negation of literals in S is a better hint. 33
Hints vs. restarts Technion q q q 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” q Perhaps now: “You can not hint too much” 34
- Slides: 34