260 likes | 383 Views
Integrating conjectured information in SAT. Ofer Strichman Vadim Ryvchin Technion, Haifa, Israel. Conjectured information / manual. Input : Propositional formula F Conjectured propositional formula (“hint”) H Output : Is F satisfiable ? Can we use H to solve this problem faster ?
E N D
Integrating conjectured information in SAT Ofer Strichman Vadim Ryvchin Technion, Haifa, Israel
Conjectured information / manual • Input: • Propositional formula F • Conjectured propositional formula (“hint”) H • Output: Is F satisfiable ? • Can we use H to solve this problem faster ? • Problem & solution suggested by Kroening a few years ago* * personal communication
Conjectured information / automatic • Input: • Propositional formula F • Output: Is F satisfiable ? • Can we derive hints H to solve this problem faster ? • Suggestion: prune “seemingly bad branches”
Goal • Generate ‘good’ hints • If SAT: won’t make it unsat • If UNSAT: help find a proof in F • Use them wisely
Using conjectured information • Let F be the formula • Let H be the current set of hints. • H may change during run time • How can we use H to speed up the search ?
Strategy I: hints as clauses • Refer to H clauses as regular clauses • A learned clause is marked as hint if it is inferred from hints. • SAT: ok • UNSAT: if hints involved: • trace back to an involved original hint h • remove h + inferred cone
Dimensions of strategy I • Which hint h to delete ? • Which part of cone(h) to remove ? • Entire cone • The part of cone(h) that participated in inferring the empty clause • Hints affect score: yes / no • Hint conflict clauses deleted more aggressively: yes / no
Strategy II: hints affect decisions • II.i At time of decision, • Choose a literal l implied by H • if there are none, revert to SAT’s decision heuristic • II.ii Same, but deal with conflicts in H • If H conflicts current state • if at “real” decision level 0, erase hint and its cone • otherwise, learn new hint and backtrack to a “real” decision level.
DPLL full assignment Decide SAT p.a. Backtrack BCP Analyze conflict no conflict conflict UNSAT
DPLL + hints (II.i) none full assignment Decide SAT p.a. Backtrack Find hint implication found BCP Analyze conflict no conflict conflict UNSAT
DPLL + hints (II.ii) none full assignment Decide SAT p.a. Backtrack Find hint implication found BCP Analyze conflict no conflict conflict conflict UNSAT Hints Analyze conflict r_bl¸ 0 r_bl · bl r_bl = dec. level not including hint decisions r_bl< 0 Delete cone of a root hint + btk to 0
Zoom on... “Find hint implication” • In ‘Find hint implication’ we choose heuristically between: • 2-watch-litetal scheme • clause-based scheme • 2-watch literal scheme is too expensive when there are few hints. • Most watched literals not present in H
Zoom on... “Find hint implication” • Clause-based scheme: search for 2 non-false literals in each H clause. • Maintaining hints in two stacks: resolved, unresolved • Searching only the unresolved stack • Choice between schemes: #unresolved hints * > # Unchecked literals in trail. Magic number
Zoom on “hint analyze-conflict” • Can we learn and backtrack as normal? Trail 8 Normal backtracking 7 6 Hints implication Literals@{6,7,8} (incl. conflict) are H-implied by decision@5 5 4 3 Must change decision@5! 2 1
Zoom on “hint analyze-conflict” • Analyze conflict must change! • When searching for 1-uip, must ignore hint dl.
Zoom on “hint analyze-conflict” • Conceptually: • Normally we maintain with each literal the dl in which it was asserted. Example: l@4 • Now maintain also the dl as if H are real clauses. Denote by l#2 • Example: Trail 8 7 l@7 l#3 l 6 ... if H contained real clauses 5 4 3 3 2 2 1 1
5 4 3 2 1 Zoom on “hint analyze-conflict” • Build conflict graph with respect to #dl. • Apply standard Analyze-conflict Trail 8 conf. clause ... after backtrack and hint implication 7 hint 6 5 4 3 2 1
implication 1UIP H-implication @2 @2 @3 @4 @3 @4 @3 @4 Zoom on “hint analyze-conflict” @4 @5 @5 X @5 @2
implication 1UIP H-implication #2 #2 #3 #3 #3 #3 #3 #3 Zoom on “hint analyze-conflict” #3 #3 #3 X #3 #2
Dimensions of strategy II • Effect on decision: choose literal / choose value • Heuristic for choosing the next decision: first hint / “best” hint • “Best” – score / solver’s choice • Specific to II.ii: • In ‘Delete cone of a root hint” - which root hint to delete ?
Using hints to minimize assumptions • H - unproven constraints on the environment. • Interested in the result of F Æ H • Goal: if unsat, minimize h µ H, such that F Æ h is unsat • Why ? need to prove h separately. • Current solution: minimize unsat core (?)
Using hints to minimize assumptions • Use hints mechanism to minimize the usage of assumptions. • Model assumptions as hints • Discourage using assumptions • Option I: • Hints as clauses. • Delay BCP on H • Iterate to find smaller h. • Option II: • Strategy II.ii • Iterate to find smaller h.
Using hints to minimize assumptions • Q: What is the difference • A: Option II much better ! • Reason: marks less clauses as ‘hints’ • Result: smaller h !
Using hints to minimize assumptions • Why ? • Example: • H → l • l participates in conflict, resulting in clause c. • Option I: c is a hint. • Option II: l is a decision, hence c is not a hint.
DPLL + hints (II.ii) none full assignment Decide SAT p.a. Backtrack Find hint implication found BCP Analyze conflict no conflict conflict conflict UNSAT Hints Analyze conflict r_bl¸ 0 ? r_bl< 0 Delete cone of a root hint + btk to 0
DPLL + hints (II.ii) none full assignment Decide SAT p.a. Backtrack Find hint implication found BCP Analyze conflict no conflict conflict conflict UNSAT Hints Analyze conflict r_bl¸ 0 r_bl< 0 Stop? h UNSAT Delete cone of a root hint + btk to 0