Stronger learning and higher backjumping Clause minimization Stronger learning and higher backjumping Recursive conflict clause reduction (deep /shallow) Glucose-style Volunteers and inverse-arcs ContraMinisat
Learnt Conflict Clauses, and minimization 𝑟𝑒𝑎𝑠𝑜𝑛 𝑥 3 = 𝜔 4 , 𝑟𝑒𝑎𝑠𝑜𝑛 𝑥 6 = 𝜔 5 , … Local / General implication graph x10=0@3 x5=1@6 4 1 x2=1@6 Learnt Conflict clause: (x10 Ç :x4 Ç x11) 6 conflict Decision 3 x1=1@6 x4=1@6 3 2 5 Redundant – does not change the satisfiability 2 5 x3=1@6 x6=1@6 𝑥 10 → 𝑥 11 or, 𝑥 11 → 𝑥 10 Clause minimization: Drop 𝑥 11 x9=0@1 x11=0@3
Learnt Conflict Clauses, and minimization More generally: if we have a c.c. 𝑐=( 𝑥 0 ∨⋯∨ 𝑥 𝑛 ), and ... all reverse paths on the implication graph hit 𝑐 literals... x10=0@3 x5=1@6 4 6 conflict x4=1@6 5 Redundant – does not change the satisfiability 5 x6=1@6 𝑥 𝑖 ∈𝑐 𝑥 𝑖 ∧ 𝑥 𝑗 ∧ 𝑥 𝑘 → 𝑥 𝑙 or, 𝑥 𝑙 → 𝑥 𝑖 ∨ 𝑥 𝑗 ∨ 𝑥 𝑘 Clause minimization: Drop 𝑥 𝑙 𝑥 𝑙 =0@3 𝑥 𝑗 ∈𝑐 𝑥 𝑘 ∈𝑐
More generally... Learnt clause: 𝑐= 𝑥 0 ∨⋯∨ 𝑥 𝑛 For 0≤𝑗≤𝑛, we can remove 𝑥 𝑗 if 𝜑∧ 𝑥 𝑗 → 𝑐∖𝑥 𝑗 Or, more generally, for any 𝑐 ′ ⊆ 𝑐∖ 𝑥 𝑗 , 𝜑∧ 𝑥 𝑗 →𝑐′ equivalently, if 𝜑∧ 𝑐 ′ → 𝑥 𝑗 E.g., in the previous slide: 𝑥 𝑖 ∧ 𝑥 𝑗 ∧ 𝑥 𝑘 → 𝑥 𝑙 Order of checking matters. Can we optimize ?
Clause minimization: minisat Deep mode (recursive conflict-clause reduction): Traverse recursively 𝑟𝑒𝑎𝑠𝑜𝑛( 𝑥 𝑗 ) Stop if a literal is not in the decision levels of 𝑐 . Stop if hitting a decision variable. If all paths hit a variable from 𝑐, remove 𝑥 𝑗 . e.g., we hit 𝑥 2 , 𝑥 5 , 𝑥 7 , hence 𝑥 2 ∧ 𝑥 5 ∧ 𝑥 7 → 𝑥 𝑗 , or equivalently 𝑥 𝑗 → 𝑥 2 ∨ 𝑥 5 ∨ 𝑥 7 Instead of maintaining the list of decision levels of c’s literals and checking it each time, they maintain an abstraction of that list; hence they might end up visiting such a level, which will anyway result in hitting a decision variable and aborting. * Minimizing Learned clauses/Sörensson, Biere, SAT’09
Clause minimization: minisat Deep mode (recursive conflict-clause reduction), optimization: Suppose 𝐿= 𝑥∈𝑐 𝑑.𝑙.(𝑥) Don’t: maintain 𝐿 as a list and search it. Do: maintain an abstraction of 𝐿 in a 32- bit int; Suppose we hit 𝑙∉𝐿 but 𝑙∈𝑎𝑏𝑠(𝐿) => hit a decision variable and abort. Hence, cannot hinder correctness * Minimizing Learned clauses/Sörensson, Biere, SAT’09
Clause minimization: minisat Shallow mode: same as deep mode, but only search in current d.l. Literals seen in the current analysis * Minimizing Learned clauses/Sörensson, Biere, SAT’09
Clause minimization: Glucose Use binary clauses: If (𝑐 0 ∨ 𝑥 𝑖 ) is a binary clause, remove 𝑥 𝑖 from 𝑐. asserting literal Instead of maintaining the list of decision levels of c’s literals and checking it each time, they maintain an abstraction of that list; hence they might end up visiting such a level, which will anyway result in hitting a decision variable and aborting. * Chanseok Ho’s Glucose patch to minisat.
Volunteers and inverse arcs Let c = ( 𝑥 0 ∨…∨ 𝑥 𝑛 ) = 𝑟𝑒𝑎𝑠𝑜𝑛(𝑥 0 ) i.e., 𝑥 1 ∧⋯∧ 𝑥 𝑛 → 𝑥 0 𝑐 has the following two properties: 𝑥 1 … 𝑥 𝑛 are currently false 𝑥 0 is the latest in the trail In a volunteer of 𝑥 0 , item#2 no longer holds: For some 1≤𝑖≤𝑛, 𝑙𝑒𝑣𝑒𝑙 𝑥 𝑖 >𝑙𝑒𝑣𝑒𝑙( 𝑥 0 ) i.e., some false literal discovered after true literal.
Volunteers and inverse arcs Let c ′ = 𝑥 0 ∨ 𝑦 1 …∨ 𝑦 𝑛 i.e., 𝑦 1 ∧⋯∧ 𝑦 𝑛 → 𝑥 0 𝑐′ has the following two properties: 𝑦 1 … 𝑦 𝑛 are currently false 𝑥 0 is not the latest in the trail // (possibly earlier d.l., possibly was a decision) e.g., current level: 6 𝑥 1 ∧ 𝑥 2 ∧⋯∧ 𝑥 𝑛 → 𝑥 0 𝑐 ′ is called a volunteer* for 𝑥 0 : gives us an alternative reason clause. Volunteers are generalization of inverse-arcs** 6 5 3 level: * Generalized Conflict-Clause Strengthening for Satisfiability Solvers/Van-Gelder, SAT’11 ** generalized framework for conflict analysis / Audemard et al. SAT’08.
Inverse arcs Conflict clause A=( α∨ 𝑥 𝑚 ∨ 𝑦 𝑖 ) Conflict clause A=( α∨ 𝑥 𝑚 ∨ 𝑦 𝑖 ) 𝛼 – literals with level ≤𝑖 𝑥 – asserting literal 𝑖<𝑚 – back-jumping level 4. Find a volunteer for 𝑦 𝑖 𝑐′=( 𝛽 𝑗 ∨ 𝛾 𝑘 ∨ 𝑦 𝑖 ) 𝐴 ′ = 𝑟𝑒𝑠 𝐴,𝑐′,𝑦 = 𝛼∨ 𝛽 𝑗 ∨ 𝛾 𝑘 ∨ 𝑥 𝑚 Ideally: 𝛾 𝑘 =0 Then 𝐴′ is an asserting clause with back-jumping level 𝑗<𝑖. Otherwise… (next slide) 𝑗<𝑖 𝑘≥𝑖 1 Note that we do not start the process if in A there is more than one literal at level i. ** generalized framework for conflict analysis / Audemard et al. SAT’08.
Inverse arcs Otherwise 𝛾 𝑘 >0 : repeat with 𝐴′ being the conflicting clause. Not necessarily will be better. But we can apply recursively. Heuristics for choosing the inverse arc 𝑐′: Do not start the process if in 𝐴 there is more than one literal at level 𝑖. Otherwise, allow only if ∀𝑙∈ 𝛾 𝑘 . 𝑙𝑒𝑣𝑒𝑙 𝑙 =𝑚 and 𝑙 seen on the implication graph so far This guarantees that it will be eliminated during conflict analysis, … and that we jump to 𝑗 < 𝑖 ** generalized framework for conflict analysis / Audemard et al. SAT’08.
Inverse arcs can create cycles Generally adding inverse arcs can lead to cycles in the implication graph, e.g.: 𝑐 0 = 𝑥 0 𝑥 1 𝑥 4 𝑐 1 =( 𝑥 2 𝑥 0 𝑥 3 ) 𝑐 2 = 𝑥 1 𝑥 2 This, in turn, may lead to cycles in the resolution process. Such cycles are expensive to detect. 𝑥 0 𝑥 1 𝑥 3 𝑥 2 𝑥 4 ** generalized framework for conflict analysis / Audemard et al. SAT’08.
Precosat’s solution to volunteers without cycles Precosat considers volunteers of a specific type: When learning 𝑐 with asserting literal 𝑥 0 (𝑟𝑒𝑎𝑠𝑜𝑛 𝑥 0 =𝑐) Consider a clause c′=( 𝑥 0 𝑦 1 ⋯ 𝑦 𝑛 ) a volunteer if 𝑥 0 was last to be assigned in 𝑐’. ⇒ 𝑥 0 did not lead to propagating any 𝑦 𝑖 , ⇒ no cycles 𝑐′≠𝑟𝑒𝑎𝑠𝑜𝑛( 𝑥 0 ) because of the literal order in the trail. Precosat apparently has the same goal but looks only at a specific type of volunteers. * Precosat (unpublished; open source)
Example Suppose 𝑐= 𝑥 0 𝑧 , 𝑐′={ 𝑥 0 𝑦 } The trail: Had 𝑦 been processed first… 𝑟𝑒𝑎𝑠𝑜𝑛 𝑥 0 =𝑐′ 𝑥 … 𝑦 𝑥 0 𝑟𝑒𝑎𝑠𝑜𝑛 𝑥 0 =𝐶 qhead * Precosat (unpublished; open source)
ContraMiniSat BCP is not done directly on the trail as in Minisat Instead, maintain a priority-queue of implications Implication = clause + priority 𝑙𝑒𝑣𝑒𝑙, 𝑡𝑟𝑎𝑖𝑙_𝐼𝑛𝑑𝑒𝑥 // lower is better Rationale: prefer antecedents with low decision levels; among those, prefer stronger literals. Max. dec. level of the non-watched literals Index of the implying literal in the local trail * Contrasat – A contrarian SAT solver (system description) /Van-Gelder