Lookahead Techniques Marijn J.H. Heule http://www.cs.cmu.edu/~mheule/15816-f19/ Automated Reasoning and Satisfiability, September 26, 2019 1 / 29
DPLL Procedure Look-ahead Architecture Look-ahead Learning Autarky Reasoning Tree-based Look-ahead 2 / 29
DPLL Procedure Look-ahead Architecture Look-ahead Learning Autarky Reasoning Tree-based Look-ahead 3 / 29
SAT Solving: DPLL Davis Putnam Logemann Loveland [DP60,DLL62] Recursive procedure that in each recursive call: Simplifies the formula (using unit propagation) Splits the formula into two subformulas • Variable selection heuristics (which variable to split on) • Direction heuristics (which subformula to explore first) 4 / 29
DPLL: Example F DPLL := ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 3 ) ∧ ( x 1 ∨ x 3 ) 5 / 29
DPLL: Example F DPLL := ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 3 ) ∧ ( x 1 ∨ x 3 ) x 3 0 1 5 / 29
DPLL: Example F DPLL := ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 3 ) ∧ ( x 1 ∨ x 3 ) x 2 x 3 0 1 0 1 x 1 x 3 0 1 1 0 5 / 29
DPLL: Slightly Harder Example Slightly Harder Example Construct a DPLL tree for: ( a ∨ b ∨ c ) ∧ ( a ∨ b ∨ c ) ∧ ( b ∨ c ∨ d ) ∧ ( b ∨ c ∨ d ) ∧ ( a ∨ c ∨ d ) ∧ ( a ∨ c ∨ d ) ∧ ( a ∨ b ∨ d ) 6 / 29
Look-ahead: Definition DPLL with selection of (effective) decision variables by look-aheads on variables 7 / 29
Look-ahead: Definition DPLL with selection of (effective) decision variables by look-aheads on variables Look-ahead: Assign a variable to a truth value 7 / 29
Look-ahead: Definition DPLL with selection of (effective) decision variables by look-aheads on variables Look-ahead: Assign a variable to a truth value Simplify the formula 7 / 29
Look-ahead: Definition DPLL with selection of (effective) decision variables by look-aheads on variables Look-ahead: Assign a variable to a truth value Simplify the formula Measure the reduction 7 / 29
Look-ahead: Definition DPLL with selection of (effective) decision variables by look-aheads on variables Look-ahead: Assign a variable to a truth value Simplify the formula Measure the reduction Learn if possible 7 / 29
Look-ahead: Definition DPLL with selection of (effective) decision variables by look-aheads on variables Look-ahead: Assign a variable to a truth value Simplify the formula Measure the reduction Learn if possible Backtrack 7 / 29
DPLL Procedure Look-ahead Architecture Look-ahead Learning Autarky Reasoning Tree-based Look-ahead 8 / 29
Look-ahead: Example F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) 9 / 29
Look-ahead: Example F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 2 =0 } 9 / 29
Look-ahead: Example F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 2 =0 , x 1 =0 } 9 / 29
Look-ahead: Example F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 2 =0 , x 1 =0 , x 6 =0 } 9 / 29
Look-ahead: Example F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 2 =0 , x 1 =0 , x 6 =0 , x 3 =1 } 9 / 29
Look-ahead: Properties Very expensive 10 / 29
Look-ahead: Properties Very expensive Effective compared to cheap heuristics 10 / 29
Look-ahead: Properties Very expensive Effective compared to cheap heuristics Detection of failed literals (and more) 10 / 29
Look-ahead: Properties Very expensive Effective compared to cheap heuristics Detection of failed literals (and more) Strong on random k -SAT formulae 10 / 29
Look-ahead: Properties Very expensive Effective compared to cheap heuristics Detection of failed literals (and more) Strong on random k -SAT formulae Examples: march, OKsolver, kcnfs 10 / 29
DEMO 11 / 29
Look-ahead: Reduction heuristics Number of satisfied clauses 12 / 29
Look-ahead: Reduction heuristics Number of satisfied clauses Number of implied variables 12 / 29
Look-ahead: Reduction heuristics Number of satisfied clauses Number of implied variables New (reduced, not satisfied) clauses • Smaller clauses more important • Weights based on occurring 12 / 29
Look-ahead: Architecture DPLL x a 0 1 x b x c 1 0 0 ? LookAhead F LA x 1 x 2 x 3 x 4 0 1 0 1 0 1 0 1 H ( x i ) 9 9 13 6 7 10 8 13 / 29
Look-ahead: Pseudo-code 1: F := Simplify ( F ) 2: if F is empty then return satisfiable 3: if ∅ ∈ F then return unsatisfiable 4: �F ; l decision � := LookAhead ( F ) 5: if (DPLL( F ( l decision ← 1)) = satisfiable ) then return satisfiable 6: 7: return DPLL ( F ( l decision ← 0)) 14 / 29
DPLL Procedure Look-ahead Architecture Look-ahead Learning Autarky Reasoning Tree-based Look-ahead 15 / 29
Local Learning Look-ahead solvers do not perform global learning, in contrast to contrast to conflict-driven clause learning (CDCL) solvers Instead, look-ahead solvers learn locally: Learn small (typically unit or binary) clauses that are valid for the current node and lower in the DPLL tree Locally learnt clauses have to be removed during backtracking 16 / 29
Failed Literals and Double Look-aheads A literal l is called a failed literal if the look-ahead on l = 1 results in a conflict: failed literal l is forced to false followed by unit propagation if both x and x are failed literals, then backtrack Failed literals can be generalized by double lookahead: assign two literals and learn a binary clause in case of a conflict. 17 / 29
Failed Literals and Double Look-aheads A literal l is called a failed literal if the look-ahead on l = 1 results in a conflict: failed literal l is forced to false followed by unit propagation if both x and x are failed literals, then backtrack Failed literals can be generalized by double lookahead: assign two literals and learn a binary clause in case of a conflict. F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) 17 / 29
Failed Literals and Double Look-aheads A literal l is called a failed literal if the look-ahead on l = 1 results in a conflict: failed literal l is forced to false followed by unit propagation if both x and x are failed literals, then backtrack Failed literals can be generalized by double lookahead: assign two literals and learn a binary clause in case of a conflict. F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 4 =0 , x 6 =1 } 17 / 29
Failed Literals and Double Look-aheads A literal l is called a failed literal if the look-ahead on l = 1 results in a conflict: failed literal l is forced to false followed by unit propagation if both x and x are failed literals, then backtrack Failed literals can be generalized by double lookahead: assign two literals and learn a binary clause in case of a conflict. F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 4 =0 , x 6 =1 , x 1 =1 } 17 / 29
Failed Literals and Double Look-aheads A literal l is called a failed literal if the look-ahead on l = 1 results in a conflict: failed literal l is forced to false followed by unit propagation if both x and x are failed literals, then backtrack Failed literals can be generalized by double lookahead: assign two literals and learn a binary clause in case of a conflict. F learning := ( x 1 ∨ x 3 ∨ x 4 ) ∧ ( x 1 ∨ x 2 ∨ x 3 ) ∧ ( x 1 ∨ x 2 ) ∧ ( x 1 ∨ x 3 ∨ x 6 ) ∧ ( x 1 ∨ x 4 ∨ x 5 ) ∧ ( x 1 ∨ x 6 ) ∧ ( x 4 ∨ x 5 ∨ x 6 ) ∧ ( x 5 ∨ x 6 ) ϕ = { x 4 =0 , x 6 =1 , x 1 =1 , x 2 =1 } 17 / 29
Recommend
More recommend