1.6k likes | 1.77k Views
SAT Genealogy. Alexander Nadel, Intel, Haifa, Israel The Technion, Haifa, Israel July , 3 2012. Agenda. Introduction Early Days of SAT Solving Core SAT Solving Conflict Analysis and Learning Boolean Constraint Propagation Decision Heuristics Restart Strategies Inprocessing
E N D
SAT Genealogy Alexander Nadel, Intel, Haifa, Israel The Technion, Haifa, Israel July, 3 2012
Agenda • Introduction • Early Days of SAT Solving • Core SAT Solving • Conflict Analysis and Learning • Boolean Constraint Propagation • Decision Heuristics • Restart Strategies • Inprocessing • Extensions to SAT • Incremental SAT Solving under Assumptions • Simultaneous Satisfiability (SSAT) • Diverse Solutions Generation • High-level (group-oriented) MUC Extraction
Agenda • Introduction • Early Days of SAT Solving • Core SAT Solving • Conflict Analysis and Learning • Boolean Constraint Propagation • Decision Heuristics • Restart Strategies • Inprocessing • Extensions to SAT • Incremental SAT Solving under Assumptions • Simultaneous Satisfiability (SSAT) • Diverse Solutions Generation • High-level (group-oriented) MUC Extraction We won’t use implication graphs for explanation, but: Duality between search and resolution
What is SAT? • Find a variable assignment (AKA solution or model) that satisfies a propositional formula or prove that there are no solutions • SAT solvers operate on CNF formulas: • Any formula can be reduced to a CNF CNF Formula: F = ( a + c ) ( b + c ) (a’ + b’+ c’ ) negative literal clause positive literal
SAT: Theory and Practice • Theory: • SAT is the first known NP-complete problem • Stephen Cook, 1971 • One can check a solution in polynomial time • Can one find a solution in polynomial time? • The P=NP question… • Practice: • Amazingly, nowadays SAT solvers can solve industrial problems having millions of clauses and variables • SAT has numerous applications in formal verification, planning, bioinformatics, combinatorics, …
Approaches to SAT Solving • Backtrack search: DFS search for a solution • The baseline approach for industrial-strength solvers. In focus today. • Look-ahead: BFS search for a solution • Helpful for certain classes of formulas • Recently, there were attempts of combining it with backtrack search • Local search • Helpful mostly for randomly generated formulas
Early Days of SAT Solving Agenda • Resolution • Backtrack Search
a + b + c’ + f g + h’ + c + f a + b + g + h’ a + b + g + h’ + f Resolution: a Way to Derive New Valid Clauses • Resolution over a pair of clauses with exactly one pivot variable: a variable appearing in different polarities: • Known to be invented by Davis&Putnam, 1960 • Had been invented independently by Lowenheim in early 1900’s (as well as the DP algorithm, presented next) • According to Chvatal&Szemeredy, 1988 (JACM) - The resolvent clause is a logical consequence of the two source clauses
(a + b + c) (b + c’ + f’) (b’ + e) (a + b) (a + b’) (a’ + c) (a’ + c’) (a + c + e) (c’ + e + f) (a) (a’ + c) (a’ + c’) (c) (c’) (a + e + f) ( ) DP Algorithm: Davis&Putnam, 1960 Remove the variables one-by-one by resolution over all the clauses containing that variable DP is sound and complete SAT UNSAT
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b b’ + c b’ + c’ a’ + b
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ b’ + c b’ + c’ a’ + b
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ Decision level1 b’ + c b’ + c’ a’ + b a is the decision variable; a’ is the decision literal
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ b’ + c b’ + c’ b’ a’ + b Decision level 2
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ b’ + c b’ + c’ b’ a’ + b a + b A conflict.A blocking clause – a clause, falsified by the current assignment – is encountered.
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ b’ + c b’ + c’ b’ b Backtrack and flip a’ + b a + b
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ b’ + c Decision level 1 b’ + c’ b’ b a’ + b a + b c’ Decision level 2 b’ + c
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ b’ + c b’ + c’ b’ b Decision level 1 a’ + b a + b c’ c b’ + c b’ + c’
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ a b’ + c b’ + c’ b’ b a’ + b a + b c’ c b’ + c b’ + c’
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ a b’ + c b’ + c’ b’ b a’ + b a + b b c’ c b’ + c b’ + c’
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ a b’ + c b’ + c’ b’ b a’ + b a + b b c’ c b’ + c b’ + c’ c’ b’ + c
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ a b’ + c b’ + c’ b’ b a’ + b a + b b c’ c b’ + c b’ + c’ c’ c b’ + c b’ + c’
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 a + b a’ a b’ + c b’ + c’ b’ b a’ + b b’ a + b b c’ c a’ + b b’ + c b’ + c’ c’ c b’ + c b’ + c’
Backtrack Search or DLL: Davis-Logemann-Loveland, 1962 UNSAT! a + b a’ a b’ + c b’ + c’ b’ b a’ + b b’ a + b b c’ c a’ + b b’ + c b’ + c’ c’ c b’ + c b’ + c’
Core SAT Solving: the Principles • DLL could solve problems with <2000 clauses • How can modern SAT solvers solve problems with millions of clauses and variables? • The major principles: • Learning and pruning • Block already explored paths • Locality and dynamicity • Focus the search on the relevant data • Well-engineered data structures • Extremely fast propagation
Agenda • Introduction • Early Days of SAT Solving • Core SAT Solving • Conflict Analysis and Learning • Boolean Constraint Propagation • Decision Heuristics • Restart Strategies • Inprocessing • Extensions to SAT • Incremental SAT Solving under Assumptions • Simultaneous Satisfiability (SSAT) • Diverse Solutions Generation • High-level (group-oriented) MUC Extraction
Duality between Basic Backtrack Search and Resolution One can associate a resolution derivation with every invocation of DLL over an unsatisfiable formula
Duality between Basic Backtrack Search and Resolution a + b b’ + c b’ + c’ a’ + b
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c b’ + c’ a’ + b
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c b’ + c’ b’ a’ + b a + b
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c b’ + c’ b’ b a’ + b a + b • A parent clause P(x) is associated with every flip operation for variable x. It contains: • The flipped literal • A subset of previously assigned falsified literals • The parent clause justifies the flip: its existence proves that the explored subspace has no solutions
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c b’ + c’ b’ b a’ + b a + b c’ b’ + c
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c b’ + c’ b’ b a’ + b a + b c’ c b’ + c
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c b’ + c’ b’ b a’ + b a + b c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c • Backtracking over a flipped variable x can be associated with a resolution operation: • P = P(x) P • P is to become the parent clause for the upcoming flip • P is initialized with the last blocking clause b’ + c’ b’ b Pnew a’ + b a + b b’ c’ c P(c) Pold b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ b’ + c Pnew a • Backtracking over a flipped variable x can be associated with a resolution operation: • P = P(x) P • P is to become the parent clause for the upcoming flip • P is initialized with the last blocking clause b’ + c’ b’ b P(b) Pold a’ + b a + b b’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c (a) a b’ + c’ b’ b a’ + b a + b b’ c’ c b’ + c b’ + c’ • The parent clause P(a) is derived by resolution. • The resolution proof (a) of the parent clause is called parent resolution
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b a + b b’ b c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b a + b b’ b c’ c b’ + c b’ + c’ c’ b’ + c
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b a + b b’ b c’ c b’ + c b’ + c’ c’ c P(c) b’ + c
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b a + b b’ b c’ c b’ + c b’ + c’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b a + b b’ b c’ c Pnew b’ b’ + c b’ + c’ c’ c P(c) Pold b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b b’ a + b b’ b c’ c (b) b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a b’ + c’ b’ b a’ + b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c Pnew a a’ b’ + c’ b’ b a’ + b b’ a + b b’ b c’ c P(b) Pold a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution Pnew a + b a’ a P(a) b’ + c Pold a a’ b’ + c’ b’ b a’ + b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution a + b a’ a b’ + c a a’ b’ + c’ b’ b a’ + b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Duality between Basic Backtrack Search and Resolution • The final trace of DLL is both a decision tree(top-down view) and a resolution refutation (bottom-up view) • Variables associated with the edges are both decision variables in the tree and pivot variables for the resolution • A forest of parent resolutions is maintained • The forest converges to one resolution refutation in the end (for an UNSAT formula) a’ a a a’ b’ b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Conflict Clause Recording • The idea: update the instance with conflict clauses, that is some of the clauses generated by resolution • Introduced in SAT by Bayardo&Schrag, 1997 (rel_sat) a’ a a a’ b’ b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Conflict Clause Recording • Assume the brown clause below was recorded a’ a a a’ b’ b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’
Conflict Clause Recording • Assume the brown clause below was recorded • The violet part would not have been explored • It is redundant a’ a a a’ b’ b b’ a + b b’ b c’ c a’ + b b’ b’ + c b’ + c’ c’ c b’ + c b’ + c’