foundations and theoretical aspects of propositional
play

Foundations and Theoretical Aspects of Propositional Satisfiability - PowerPoint PPT Presentation

Foundations and Theoretical Aspects of Propositional Satisfiability John Franco franco@gauss.ececs.uc.edu presentation to SMT/SAT Summer School 2012 June, 2012 Outline Objective: Illuminate aspects of SAT resulting in hard/easy sub-classes


  1. Linear Time Translation to CNF Example: ( v 1 ∧ v 2 ) ∨ ( v 3 ∨ v 4 ) ∨ ( v 0 ∧ v 2 ) ∨ ( v 2 ∧ v 4 ) Translation: (to obtain equi-satisfiable CNF formula) t ❞ ❝ � ❅ ∨ � ❅ � t ❞ ❝ ❅ t ❝ ❞ v f v e ( v 0 ∨ v a ) ∧ ( v 2 ∨ v a ) ∧ ( v 0 ∨ v 2 ∨ v a ) ∧ ( v 2 ∨ v b ) ∧ ( v 4 ∨ v b ) ∧ ( v 2 ∨ v 4 ∨ v b ) ∧ ( v a ∨ v c ) ∧ ( v b ∨ v c ) ∧ ( v a ∨ v b ∨ v c ) ∧ ( v 3 ∨ v d ) ∧ ( v 4 ∨ v d ) ∧ ( v 3 ∨ v 4 ∨ v d ) ∧ ( v d ∨ v e ) ∧ ( v c ∨ v e ) ∧ ( v d ∨ v c ∨ v e ) ∧ ( v 1 ∨ v f ) ∧ ( v 2 ∨ v f ) ∧ ( v 1 ∨ v 2 ∨ v f )

  2. Linear Time Translation to CNF Example: ( v 1 ∧ v 2 ) ∨ ( v 3 ∨ v 4 ) ∨ ( v 0 ∧ v 2 ) ∨ ( v 2 ∧ v 4 ) Translation: (to obtain equi-satisfiable CNF formula) t ❞ ❝ v g ( v 0 ∨ v a ) ∧ ( v 2 ∨ v a ) ∧ ( v 0 ∨ v 2 ∨ v a ) ∧ ( v 2 ∨ v b ) ∧ ( v 4 ∨ v b ) ∧ ( v 2 ∨ v 4 ∨ v b ) ∧ ( v a ∨ v c ) ∧ ( v b ∨ v c ) ∧ ( v a ∨ v b ∨ v c ) ∧ ( v 3 ∨ v d ) ∧ ( v 4 ∨ v d ) ∧ ( v 3 ∨ v 4 ∨ v d ) ∧ ( v d ∨ v e ) ∧ ( v c ∨ v e ) ∧ ( v d ∨ v c ∨ v e ) ∧ ( v 1 ∨ v f ) ∧ ( v 2 ∨ v f ) ∧ ( v 1 ∨ v 2 ∨ v f ) ∧ ( v f ∨ v g ) ∧ ( v e ∨ v g ) ∧ ( v f ∨ v e ∨ v g )

  3. Linear Time Translation to CNF Example: ( v 1 ∧ v 2 ) ∨ ( v 3 ∨ v 4 ) ∨ ( v 0 ∧ v 2 ) ∨ ( v 2 ∧ v 4 ) Translation: (to obtain equi-satisfiable CNF formula) ( v 0 ∨ v a ) ∧ ( v 2 ∨ v a ) ∧ ( v 0 ∨ v 2 ∨ v a ) ∧ ( v 2 ∨ v b ) ∧ ( v 4 ∨ v b ) ∧ ( v 2 ∨ v 4 ∨ v b ) ∧ ( v a ∨ v c ) ∧ ( v b ∨ v c ) ∧ ( v a ∨ v b ∨ v c ) ∧ ( v 3 ∨ v d ) ∧ ( v 4 ∨ v d ) ∧ ( v 3 ∨ v 4 ∨ v d ) ∧ ( v d ∨ v e ) ∧ ( v c ∨ v e ) ∧ ( v d ∨ v c ∨ v e ) ∧ ( v 1 ∨ v f ) ∧ ( v 2 ∨ v f ) ∧ ( v 1 ∨ v 2 ∨ v f ) ∧ ( v f ∨ v g ) ∧ ( v e ∨ v g ) ∧ ( v f ∨ v e ∨ v g ) ∧ ( v g )

  4. Linear Time Translation to CNF Example: v 0 ⇔ (( v 0 ⇔ ( v 1 ∨ v 2 )) ∧ ( v 1 ∨ v 2 ) ∧ ( v 2 → v 3 → v 4 )) Parse DAG: t ❝ ❞ � ❅ ⇔ � ❅ ❝ ❞ t ❝ t ❞ � ❅ ❳❳❳❳❳❳❳❳❳❳ � ∧ v 0 � � t ❞ ❝ t ❝ ❞ � ❅ � ❅ ⇔ ∧ � ❅ � ❅ t � ❝ ❞ ❅ ❝ ❞ t ❝ � t ❞ ❅ t ❞ ❝ � ❅ � ❅ � ❅ v 0 ∨ ∨ → � ❅ � ❅ � ❅ t ❞ ❝ t ❞ ❝ ❝ t ❞ t ❝ ❞ t ❞ ❝ � ❅ � ❅ � ❅ � ❅ → v 1 v 2 v 1 v 2 � ❅ � ❝ ❞ t ❅ ❝ ❞ t v 3 v 4

  5. Linear Time Translation to CNF Example: v 0 ⇔ (( v 0 ⇔ ( v 1 ∨ v 2 )) ∧ ( v 1 ∨ v 2 ) ∧ ( v 2 → v 3 → v 4 )) Translation: (to obtain equi-satisfiable CNF formula) ( v 0 ∨ v x 1 ) ∧ ( v 0 ∨ v x 1 ) ∧ ( v 2 ∨ v x 2 ) ∧ ( v 2 ∨ v x 2 ) ∧ ( v 3 ∨ v x 3 ) ∧ ( v 3 ∨ v x 3 ) ∧ ( v 1 ∨ v x 4 ) ∧ ( v x 2 ∨ v x 4 ) ∧ ( v 1 ∨ v x 2 ∨ v x 4 ) ∧ ( v x 3 ∨ v x 5 ) ∧ ( v 4 ∨ v x 5 ) ∧ ( v x 3 ∨ v 4 ∨ v x 5 ) ∧ ( v x 1 ∨ v x 4 ∨ v x 6 ) ∧ ( v x 1 ∨ v x 4 ∨ v x 6 ) ∧ ( v x 1 ∨ v x 4 ∨ v x 6 ) ∧ ( v x 1 ∨ v x 4 ∨ v x 6 ) ∧ ( v x 2 ∨ v x 7 ) ∧ ( v x 5 ∨ v x 7 ) ∧ ( v x 2 ∨ v x 5 ∨ v x 7 ) ∧ ( v x 4 ∨ v x 8 ) ∧ ( v x 7 ∨ v x 8 ) ∧ ( v x 4 ∨ v x 7 ∨ v x 8 ) ∧ ( v x 6 ∨ v x 9 ) ∧ ( v x 8 ∨ v x 9 ) ∧ ( v x 6 ∨ v x 8 ∨ v x 9 ) ∧ ( v 0 ∨ v x 9 ∨ v x 10 ) ∧ ( v 0 ∨ v x 9 ∨ v x 10 ) ∧ ( v 0 ∨ v x 9 ∨ v x 10 ) ∧ ( v 0 ∨ v x 9 ∨ v x 10 ) ∧ ( v x 10 )

  6. Regular Resolution Davis-Putnam (CNF): ( v 1 ∨ v 2 ∨ v i ) ∧ ( v i ∨ v 3 ) ∧ ( v 2 ∨ v 4 ) ∧ ( v 1 ∨ v i ) ∧ ( v i ∨ v 3 ) collect all resolvents with v i : ( v 1 ∨ v 2 ∨ v i ) ∧ ( v i ∨ v 3 ) ∧ ( v 2 ∨ v 4 ) ∧ ( v 1 ∨ v i ) ∧ ( v i ∨ v 3 ) ∧ ( v 1 ∨ v 2 ∨ v 3 ) ∧ ( v 3 ) ∧ ( v 1 ∨ v 3 ) remove all clauses with v i : ( v 2 ∨ v 4 ) ∧ ( v 1 ∨ v 2 ∨ v 3 ) ∧ ( v 3 ) ∧ ( v 1 ∨ v 3 )

  7. A Search Procedure Davis-Putnam-Loveland-Logemann (CNF): splitting rule: ( v 1 ∨ v 2 ∨ v i ) ∧ ( v i ∨ v 3 ) ∧ ( v 2 ∨ v 4 ) t ❞ ❝ ❍❍❍❍❍ v i t ❞ ❝ t ❞ ❝ ( v 1 ∨ v 2 ) ∧ ( v 2 ∨ v 4 ) ( v 3 ) ∧ ( v 2 ∨ v 4 ) unit clause rule: pure literal rule: ( v 1 ∨ v 2 ∨ v i ) ∧ ( v i ) .. ( v 1 ∨ v i ) ∧ ( v 2 ∨ v i ) ∧ ( v 3 ∨ v 4 ) .. t ❞ ❝ t ❞ ❝ ✟ ✟ v i v i ✟ ✟ ✟ ❝ ❞ t t ❞ ❝ ( v 1 ∨ v 2 ) .. ( v 3 ∨ v 4 ) ..

  8. DPLL Refutation ❝ s ❍❍❍❍ v 1 ❝ s ❍ ❝ s ❅ ❅ v 2 v 5 ❅ ❅ ❝ s ❝ s ❝ s s ❝ ❅ ❅ ❍❍❍❍ ❅ v 3 v 4 ❅ s ❝ ❍ ❝ s ❝ s ❅ s ❝ ❅ ❅ ❅ v 4 v 5 v 3 ❅ ❅ ❅ s ❝ s ❝ ❝ s ❝ s s ❝ s ❝ ❅ ❅ ❅ ❅ v 5 ❅ ❝ s ❅ s ❝ ( v 1 ∨ v 2 ∨ v 5 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ∨ v 4 ) ∧ ( v 1 ∨ v 3 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 5 )

  9. DPLL Refutation s ❝ ❍❍❍❍ v 1 ❝ s ❍ ❝ s ❅ ❅ v 2 v 5 ❅ ❅ s ❝ s ❝ ❝ s s ❝ ❅ ❅ ❍❍❍❍ ❅ v 3 v 4 ❅ s ❝ ❍ ❝ s s ❝ ❅ ❝ s ❅ ❅ ❅ v 4 v 5 v 3 ❅ ❅ ❅ ❝ s ❝ s ❝ s s ❝ s ❝ s ❝ ❅ ❅ ❅ ❅ v 5 ❅ s ❝ ❅ s ❝ ( v 1 ∨ v 2 ∨ v 5 ) ( v 1 ∨ v 2 ∨ v 5 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ∨ v 4 ) ∧ ( v 1 ∨ v 3 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 5 )

  10. DPLL is Resolution ❝ s ❍❍❍❍ v 1 s ❝ ❍ s ❝ ❅ ❅ v 2 v 5 ❅ ❅ s ❝ ❝ s ❝ s s ❝ ❅ ❅ ❍❍❍❍ ❅ v 3 ( v 1 ∨ v 2 ) ( v 1 ∨ v 5 ) v 4 ❅ ❝ s ❍ ❝ s s ❝ ❅ s ❝ ❅ ❅ ❅ ( v 1 ∨ v 4 ∨ v 5 ) v 4 v 5 v 3 ❅ ❅ ❅ ❝ s ❝ s ❝ s s ❝ ❝ s s ❝ ❅ ❅ ❅ ❅ ✻ ✻ v 5 ( v 1 ∨ v 2 ∨ v 4 ) ( v 1 ∨ v 3 ∨ v 5 ) ( v 3 ∨ v 4 ∨ v 5 ) ❅ s ❝ ❅ ❝ s ( v 1 ∨ v 2 ∨ v 5 ) ( v 3 ∨ v 4 ∨ v 5 ) ❅ ❅ ( v 1 ∨ v 2 ∨ v 5 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ∨ v 4 ) ∧ ( v 1 ∨ v 3 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 5 )

  11. DPLL is Resolution ( v 1 ∨ v 2 ∨ v 3 ) ( v 1 ) ( ∅ ) ( v 1 ) ✎ ( v 1 ∨ v 2 ) ❝ s ❇ ✄ ✄ ❍❍❍❍ ( v 1 ∨ v 5 ) ❇ ✄ ✄ ( v 1 ∨ v 2 ∨ v 3 ) ❈ v 1 ❇ ✎ ✄ ✎ ✄ ❝ s ❍ ❝ s ✄ ❈ ( v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ✄ ❇ ❅ ❅ ✄ ❈ ✄ v 2 v 5 ❇ ❆ ❈ ❲ ✎ ✄ ❅ ❅ ❝ s s ❝ ❝ s s ❝ ❅ ❅ ✄ ❍❍❍❍ ❇ ❆ ❅ ✄ ❇ v 3 ( v 1 ∨ v 2 ) ( v 1 ∨ v 5 ) v 4 ❆ ✎ ✄ ❇ ◆ ❅ ❝ s ❍ s ❝ s ❝ ❅ s ❝ ❆ ❅ ❅ ❅ ❆ ( v 1 ∨ v 4 ∨ v 5 ) v 4 v 5 v 3 ❅ ❅ ❅ ❯ ❆ s ❝ ❝ s ❝ s ❝ s s ❝ s ❝ ❅ ❅ ❅ ❅ ✻ ✻ v 5 ( v 1 ∨ v 2 ∨ v 4 ) ( v 1 ∨ v 3 ∨ v 5 ) ( v 3 ∨ v 4 ∨ v 5 ) ❅ s ❝ ❅ s ❝ ( v 1 ∨ v 2 ∨ v 5 ) ( v 3 ∨ v 4 ∨ v 5 ) ❅ ❅ ( v 1 ∨ v 2 ∨ v 5 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ∨ v 4 ) ∧ ( v 1 ∨ v 3 ∨ v 5 ) ∧ ( v 1 ∨ v 2 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 5 )

  12. Resolution vs. DPLL Complexity Minimum size of a refutation If there is a DPLL search involving n choicepoints for problem X then there’s a resolution refutation of length p ( n ) for problem X By adding some components to DPLL, namely clause learning and restarts, DPLL can p-simulate resolution By adding new variables & clauses that preserve unsatisfiability, DPLL with clause learning effectively p-simulate resolution and refute the augmented set of unsatisfiable clauses iff resolution can refute the original set of clauses. Pool resolution is exponentially stronger than regular resolution. Pool resolution is closely related to DPLL plus clause learning. Hence DPLL success with clause learning likely can be explained.

  13. Refutation Size and Max Clause Width Minimum size of a refutation ( w ( ψ ⊢ ∅ ) − w ( ψ ))2 � � Ω | V | S ( ψ ) = e where ψ is a CNF formula with variable set V . w ( ψ ) is the width of the widest clause in ψ . w ( ψ ⊢ ∅ ) is the minimum of the width of the widest clause over all refutations of ψ . S ( ψ ) is the minimum size of a resolution refutation of ψ . when Sparseness: few pairs of clauses have a common literal or complementary pair of literals.

  14. Upper Bounds Autarky A partial assignment that satisfies all those clauses affected by it. examples: a pure literal; v 1 = v 2 = 1 below. ( v 1 ∨ v 2 ∨ v 3 ) ∧ ( v 1 ∨ v 2 ∨ v 4 ) ∧ ( v 3 ∨ v 4 ∨ v 5 ) ∧ ( v 1 ∨ v 4 ∨ v 5 ) A subformula obtained by applying an autarky is satisfiable if and only if the formula is. Algorithm Idea for k -CNF formulas - 2 0 . 695 n for 3-SAT Choose smallest clause c = ( l π 1 ∨ . . . ∨ l π i ) Create i subproblems using the following assignments: l π 1 = 1 l π 1 = 0, l π 2 = 1 . . . l π 1 = 0, l π 2 = 0, . . . , l π i − 1 = 0, l π i = 1 If ∃ subformula with width k clauses, remove and continue Otherwise solve subformulas

  15. Upper Bounds A probabilistic algorithm Repeat the following (2 − 2 /k ) n times: Randomly choose an assignment M . If M is a model for ψ return M . Repeat the following 3 n times: Pick an unsatisfied clause c ∈ ψ . Randomly choose l ∈ c . Reverse the polarity of the variable associated with l . If the updated M is a model for ψ return M . Return “unsatisfiable?” Probability a model is found in 3 n steps is p ≥ (2 / 3)(2 − 2 /k ) − n Hence the algorithm solves k -SAT in time | ψ | O (1) (2 − 2 /k ) n ( | ψ | O (1) 2 0 . 42 n for k = 3) with error probability o (1) Look at the SAT Handbook for more information

  16. Resolution Can Be Bad Prove that it is impossible to assign n + 1 pigeons to n holes without at least one hole containing two pigeons Variables Subscript Range Meaning v i,k = 1 iff the k th 1 ≤ i ≤ n v i,k 1 ≤ k ≤ n + 1 pigeon is in hole i Clauses Subscript Range Meaning Every pigeon in ( v 1 ,k ∨ . . . ∨ v n,k ) 1 ≤ k ≤ n + 1 at least one hole 1 ≤ l < k ≤ n + 1 Each hole has at ( v i,l ∨ v i,k ) 1 ≤ i ≤ n most one pigeon Every resolution proof requires generating exponentially many resolvents

  17. Extended Resolution Just add this: w ⇔ f ( x, y, . . . , z ) where w is a variable not already in the formula and f is any Boolean function of variables that are in the formula. Example: ( w ∨ x ) ∧ ( w ∨ y ) ∧ ( w ∨ x ∨ y ) This is equivalent to: w ⇔ ( x ∨ y ) which means either x and y both have value 1 (then w = 0 ) or at least one of x or y has value 0 (then w = 1 ).

  18. Example, Pigeon Hole Formulas w n − 1 ⇔ v i,j ∨ ( v n,j ∧ v i,n +1 ) , 1 ≤ i ≤ n − 1 , 1 ≤ j ≤ n i,j All the w n − 1 act like the v i,j except that the maximum of i and j i,j are reduced by 1. That is, if a unique mapping is possible and the modified formula is satisfied, one of w n − 1 i, 1 , w n − 1 i, 2 , . . . , w n − 1 i,n , 1 ≤ i ≤ n − 1 , will have value 1 and all clauses w n − 1 ∨ w n − 1 will i,j i,k also have value 1.

  19. Binary Decision Diagrams ✓ ✏ v 0 Rooted binary directed acyclic graph ✒ ✑ ✓ Two leaves labeled T and F ✓ ✓ ✏ Other nodes are labeled with variable names ✓ Edges are dotted indicating a value of 0 v 1 ✓ ✒ ✑ ✑ or solid indicating a value of 1 for up var ✓ ✑ ✑ Out of each non-leaf, there is one solid and ✓ ✓ ✏ ✓ ✑ ✑ one dotted edge v 2 ✒ ✑ There is an order on the variables of the BDD ❙ and variables on any path obey it ❙ ✓ ✏ ❙ A single BDD compactly represents a Boolean v 3 function ✒ ✑ ❇ ❇ ✓ ✏ ❇ v 4 ❇ ✒ ✑ ✑ ✑ ❇ ✑ ❇ ❇ ✑ ✑ T F ( v 0 , v 1 , v 4 ) , { v 0 , v 1 , v 2 , v 3 , v 4 } , { v 0 , v 1 , v 2 , v 3 } , { v 0 , v 2 , v 3 , v 4 } , { v 1 , v 2 , v 3 }}

  20. Binary Decision Diagrams ✓ ✏ v 0 v 1 v 2 v 3 v 4 f v 0 0 0 0 0 0 0 ✒ ✑ 0 0 0 0 1 1 ✓ 0 0 0 1 0 0 ✓ ✓ ✏ 0 0 0 1 1 1 ✓ 0 0 1 0 0 0 v 1 0 0 1 0 1 1 ✓ ✒ ✑ 0 0 1 1 0 0 ✑ ✓ 0 0 1 1 1 1 ✑ 0 1 0 0 0 1 ✑ ✓ ✓ ✏ ✓ ✑ 0 1 0 0 1 1 ✑ 0 1 0 1 0 1 v 2 0 1 0 1 1 1 ✒ ✑ 0 1 1 0 0 0 ❙ 0 1 1 0 1 1 ❙ 0 1 1 1 0 0 ✓ ✏ ❙ 0 1 1 1 1 0 1 0 0 0 0 1 v 3 1 0 0 0 1 1 ✒ ✑ 1 0 0 1 0 1 ❇ 1 0 0 1 1 1 1 0 1 0 0 0 ❇ ✓ ✏ 1 0 1 0 1 1 ❇ 1 0 1 1 0 0 v 4 ❇ ✒ ✑ 1 0 1 1 1 0 ✑ 1 1 0 0 0 1 ✑ ❇ 1 1 0 0 1 1 ✑ ❇ ❇ ✑ 1 1 0 1 0 1 ✑ 1 1 0 1 1 1 1 1 1 0 0 0 T F 1 1 1 0 1 1 1 1 1 1 0 0 1 1 1 1 1 0 ( v 0 , v 1 , v 4 ) , { v 0 , v 1 , v 2 , v 3 , v 4 } , { v 0 , v 1 , v 2 , v 3 } , { v 0 , v 2 , v 3 , v 4 } , { v 1 , v 2 , v 3 }}

  21. Binary Decision Diagrams ✓ ✏ v 0 Rooted binary directed acyclic graph ✒ ✑ ✓ Two leaves labeled T and F ✓ ✓ ✏ Other nodes are labeled with variable names ✓ v 1 Edges are dotted indicating a value of 0 ✓ ✒ ✑ ✑ or solid indicating a value of 1 for up var ✓ ✑ ✑ ✓ Out of each non-leaf, there is one solid and ✓ ✏ ✓ ✑ ✑ one dotted edge v 2 ✒ ✑ There is an order on the variables of the BDD ❙ and variables on any path obey it ❙ ✓ ✏ ❙ A single BDD compactly represents a Boolean v 3 function ✒ ✑ ❇ Every path to F represents a clause, anding ❇ ✓ ✏ them gives the function ❇ v 4 ❇ ✒ ✑ ✑ ✑ ❇ ✑ ❇ ❇ ✑ ✑ T F ( v 0 ∨ v 1 ∨ v 4 ) ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ) ∧ ( v 0 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ ( v 0 ∨ v 2 ∨ v 3 )

  22. Binary Decision Diagrams ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ . . . ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ . . . ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ . . . ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ ( v 0 ∨ v 1 ∨ v 2 ∨ v 3 ∨ v 4 ) ∧ XOR representations: BDDs are exponentially smaller than CNFs unless you do something like this (for parity constraint): ( v 1 ⊕ w 1 ) ⇔ p ∧ ( v 2 ⊕ w 2 ) ⇔ w 1 ∧ . . . ∧ ( v n − 1 ⊕ w n − 1 ) ⇔ w n ∧ v n ⇔ w n

  23. Binary Decision Diagrams Via the BDD-visualizer - ordering affects size available from: http://cs.uc.edu/˜weaversa/BDD Visualizer.html

  24. Binary Decision Diagrams order(v4, v3, v2, v1, v0) ite(v4,T,F) ; BDD $1 Created ite(v3,F,T) ; BDD $2 Created ite(v2,$2,T) ; bdd $3 created ite(v1,$2,$1) ; bdd $4 created print($3,$4) findOrCreateNode( v , t , e ) { if ( t == e ) return t ; if ((node = lookup(< v , t , e >)) != null) return node; node = createNode(< v , t , e >); insertNodeDataBase(< v , t , e >,node) return node; } Hashtable lookup on nodes - nodes shared across BDDs (above is an example of the language of the BDD Visualizer)

  25. Binary Decision Diagrams order(v4, v3, v2, v1, v0) ite(v4,T,F) ; BDD $1 Created ite(v3,F,T) ; BDD $2 Created ite(v2,$2,T) ; bdd $3 created ite(v1,$2,$1) ; bdd $4 created and($3,$4) ; bdd $5 created print($5) All interesting applications conjoin BDDs

  26. Binary Decision Diagrams Conjoining is a bottom up process - complexity linear in # nodes Both v 3 = 0 and v 4 = 1 to get to T

  27. Binary Decision Diagrams Conjoining is a bottom up process - complexity linear in # nodes v 2 = 1 goes to v 3 , no change If v 2 = 0 then v 4 = 1 to get to T

  28. Binary Decision Diagrams Conjoining is a bottom up process - complexity linear in # nodes

  29. Binary Decision Diagrams Conjoining is a bottom up process - complexity linear in # nodes but the number of nodes can double - hence 2 n nodes may result from n binary conjunctions.

  30. Binary Decision Diagrams Conjoining is a bottom up process - complexity linear in # nodes but the number of nodes can double - hence 2 n nodes may result from n binary conjunctions. But more conjunctions may reduce the size of the BDD - here not(or(v2,v4)) is added.

  31. Binary Decision Diagrams Conjoining is a bottom up process - complexity linear in # nodes but the number of nodes can double - hence 2 n nodes may result from n binary conjunctions. But more conjunctions may reduce the size of the BDD - here not(or(v2,v4)) is added. Then or(v2,v3)

  32. Binary Decision Diagrams Existential quantification: A Boolean function which can be written x ) = ( v ∧ h 1 ( � x )) ∨ ( v ∧ h 2 ( � f ( v,� x )) can be replaced by x ) ∨ h 2 ( � f ( � x ) = h 1 ( � x ) where � x is a list of one or more variables. There is a solution to f ( � x ) iff there is a solution to f ( v,� x ) so it is sufficient to solve f ( � x ) to get a solution to f ( v,� x ) . - a variable is eliminated! - this is natural for BDDs

  33. Binary Decision Diagrams Consider the truth tables for BDDs f and c . Build a new BDD g over variables in f and c . On any row of c ’s truth table that has value 1, inps inps c let the corresponding row in g map to f the same value as f . 0000 0 0000 0 0001 0 0001 1 On other rows g maps to any value. 0010 1 0010 0 0011 1 0011 1 Observe f ∧ c and g ∧ c are identical, . . . . . . . . so g can replace f in a collection of BDDs. g inps BDD g is said to be a reduction - 0000 1 0001 0 0010 0 • BDD g can be made smaller than f . 0011 1 . . . . • Inferences can be discovered. • BDDs can be removed from the collection without loss.

  34. Binary Decision Diagrams Obvious reduction: g maps to 0 all rows that c maps to 0. Called zero-restrict, has weaknesses - for example c = ( v 1 ∨ v 2 ) ∧ ( v 1 ∨ v 3 ) f = ( v 2 ∨ v 3 ) will yield g = v 3 ∧ ( v 1 ∨ ( v 1 ∧ v 2 )) instead of the possible g = ( v 3 ) Obvious dual: g maps to 1 all rows that c maps to 0 No better. Desired: some rows of g to map to 1, others to 0 so that g ’s truth table reflects a pattern that generates inferences. g maps � 011 � and � 111 � to 0 and � 010 � and � 101 � to 1 to get v 3.

  35. g is a generalized co-factor of f and if for any truth assignment t , g ( t ) has the same value as f ( t ′ ) where t ′ is the nearest truth Binary Decision Diagrams t that maps to 1. BDD n that gives the variable ordering of the input BDDs. assignment to n variables as a vector in { 0 , 1 } n The notion of nearest truth assignment depends on a permutation π of t , let t i denote the i th bit of the vector representing t . the numbers 1,2, . . . , t ′ and t ′′ is defined as Represent a truth assignment to for assignment Then the distance between two truth assignments i =1 2 n − i ( t ′ π i ⊕ t ′′ � n π i ). One pair of assignments is nearer to each other than another pair if the distance between that pair is less.

  36. Binary Decision Diagrams f = ( v 1 ∨ v 3 ) ∧ ( v 1 ∨ v 2 ) ∧ ( v 1 ∨ v 2 ∨ v 3 ) ☛ ✟ v 1 ✡ ✠ c = ( v 1 ∨ v 2 ) inps inps c f ✓ ☛ ✟ ☛ ✟ ☛ ✟ ✓ 000 1 000 0 v 2 v 2 v 1 ✡ ✠ ✡ ✠ ✡ ✠ 001 0 001 0 ✓ ✲ ☛ ✟ ☛ ✟ ☛ ✟ ✓ 010 0 010 1 ✲ 011 0 011 1 v 3 v 3 v 2 ✡ ✠ ❍❍❍❍❍ ✡ ✠ ✡ ✠ 100 1 100 1 ✓ ✓ ✓ ✓ 101 1 101 1 110 1 110 1 T F T F 111 0 111 1 gcf ( f, c ) = ( v 1 ∧ ( v 2 → v 3 )) g inps ☛ ✟ ✲ v 1 ✡ ✠ 000 0 ◗◗◗ ✲ 001 0 ☛ ✟ 010 0 v 2 ✡ ✠ 011 0 ✓ 100 1 ☛ ✟ ✓ 101 1 v 3 ✡ ✠ 110 1 ✓ 111 0 ✓ F T

  37. Binary Decision Diagrams Theorem: Given BDDs f 1 , ..., f k , for any 1 ≤ i ≤ k , f 1 ∧ f 2 ∧ ... ∧ f k is satisfiable if and only if ( f 1 | f i ) ∧ ... ∧ ( f i − 1 | f i ) ∧ ( f i +1 | f i ) ∧ ... ∧ ( f k | f i ) is satisfiable. Moreover, any assignment satisfying the latter can be mapped to an assignment that satisfies f 1 ∧ ... ∧ f k . So generalized co-factoring can be used to eliminate one of the BDDs among a given conjoined set of BDDs: the solver finds an assignment satisfying gcf ( f 1 , f i ) ∧ ... ∧ gcf ( f k , f i ) and then extends the assignment to satisfy f i , otherwise the solver reports that the instance has no solution.

  38. Algebraic Methods Example: ( v 1 ∨ v 2 ∨ v 3 ) is represented by the equation v 1 (1 + v 2 )(1 + v 3 ) + v 2 (1 + v 3 ) + v 3 + 1 = 0 which may be rewritten v 1 v 2 v 3 + v 1 v 2 + v 1 v 3 + v 2 v 3 + v 1 + v 2 + v 3 + 1 = 0 Example: v 1 ⊕ v 2 ⊕ v 3 ⊕ v 4 is represented by the equation v 1 + v 2 + v 3 + v 4 + 1 = 0 .

  39. Algebraic Methods Arithmetic mod 2: New facts are derived from old facts using the following rules: 1. Any even sum of like terms in an equation may be replaced by 0. v 1 v 2 + v 1 v 2 ⇒ 0 1 + 1 ⇒ 0 . and e.g.: Needed to eliminate terms when adding equations. 2. A factor v 2 may be replaced by v Needed to ensure terms remain multi-linear after multiplication 3. An equation may be multiplied by a term, the resulting equation may be reduced by the rule above. v 3 v 4 ( v 1 + v 3 = 0) ⇒ v 1 v 3 v 4 + v 3 v 4 = 0 . e.g.: The new equation is said to be a new, derived fact. 4. Two equations may be added, using mod 2 arithmetic The new equation is said to be a new, derived fact.

  40. Algebraic Methods Example: ( v 1 ∨ v 2 ) ∧ ( v 2 ∨ v 3 ) ∧ ( v 3 ∨ v 1 ) The equations corresponding to the above are shown below as equations (1), (2), and (3). All equations below the line are derived as stated on the right. v 1 v 2 + v 2 = 0 (1) v 2 v 3 + v 3 = 0 (2) v 1 v 3 + v 1 = 0 (3) (4) ⇐ v 3 · (1) v 1 v 2 v 3 + v 2 v 3 = 0 (5) ⇐ (4) + (2) v 1 v 2 v 3 + v 3 = 0 v 1 v 2 v 3 + v 1 v 3 = 0 (6) ⇐ v 1 · (2) v 1 v 2 v 3 + v 1 = 0 (7) ⇐ (6) + (3) v 1 v 2 v 3 + v 1 v 2 = 0 (8) ⇐ v 2 · (3) (9) ⇐ (8) + (1) v 1 v 2 v 3 + v 2 = 0 (10) ⇐ (9) + (7) v 1 + v 2 = 0 (11) ⇐ (5) + (7) v 1 + v 3 = 0 From the bottom two equations, v 1 = v 2 = v 3 .

  41. Algebraic Methods An Algebraic Solver ( ψ, d ) /* Input: List of equations ψ = � e 1 , ..., e m � , integer d */ /* Output: “satisfiable” or “unsatisfiable” */ /* Locals: Set B of equations */ Set B ← ∅ . Repeat while ψ � = ∅ : Pop e ← ψ . Repeat while ∃ e ′ ∈ B : first non - zero ( e ) = first non - zero ( e ′ ): Set e ← reduce ( e + e ′ ). /* Rule 4. */ If e is 1 = 0: Output “unsatisfiable” If e is not 0 = 0: Set B ← B ∪ { e } . If degree ( e ) < d : Repeat for all variables v : If reduce ( v · e ) has not been in ψ : Append ψ ← reduce ( v · e ). /* Rule 3. */ Output “satisfiable”.

  42. Algebraic Methods Arithmetic mod 2: Theorem: The number of derivations used by the algebraic solver is within a polynomial factor of the minimum number possible. Theorem: The minimum number of derivations used by the algebraic solver cannot be much greater than, and may sometimes be far less than the minimum number needed by resolution.

  43. Algebraic Methods Arithmetic mod 2: Comparison with BDD operations ( restrict ( f , c )): f = ( v 1 ∨ v 2 ) ∧ ( v 1 ∨ v 3 ) c = ( v 2 ∨ v 3 ) ✎ ☞ ✎ ☞ ✎ ☞ v 1 v 2 v 1 ✍ ✌ ✍ ✌ ✍ ✌ ✓ ✓ ⇒ ✎ ☞ ✎ ☞ ✎ ☞ ✎ ☞ ✎ ☞ ✓ ✓ ✓ ✓ ⇓ v 3 v 2 v 3 v 3 v 2 ✍ ✌ ✍ ✌ ✍ ✌ ✍ ✌ ✍ ✌ ◗◗◗ ◗◗◗ ❙ ❙ ◗ ◗ T F T F T F Algebra: f : v 1 v 3 + v 2 + v 1 v 2 = 0 and c : v 2 v 3 + v 3 = 0 ( v 2 v 3 ) · ( v 1 v 3 + v 2 + v 1 v 2 = 0) ⇒ ( v 2 v 3 = 0) + ( v 2 v 3 + v 3 = 0) ⇒ v 3 = 0. As BDDs: ( v 2 v 3 ) means v 2 = v 3 = 1 rows are 0, all other rows are 1. All 1 rows of f are 1 rows of ( v 2 v 3 ) so product can be added as a fact. But when conjoined with c , the inference v 3 = 0 is obtained.

  44. Algebraic Methods Arithmetic mod 2: Comparison with BDD operations ( gcf ( f , c ) and Ex. Quant.): On BDDs, gcf ( f , c ) depends on the variable ordering But gcf ( f , c ) may replace f , not so for algebra In algebra, ex. quant. means multiply two equations Example: consider g = v 1 v 2 v 3 + v 1 v 3 + v 1 + 1 = 0 . To existentially quantify v 2 away from g : form equations: v 1 + 1 = 0 ( v 2 = 1) v 1 v 3 + v 1 + 1 = 0 ( v 2 = 0) Then multiply ( v 1 + 1) · ( v 1 v 3 + v 1 + 1) = ( v 1 v 3 + v 1 v 3 + v 1 + 1) = ( v 1 + 1). But the variable that is quantified away can be in just one equation.

  45. And Inverter Graphs A u X gate 1 gate 4 B w Y gate 3 v gate 5 C gate 2 A u X B w Y v C

  46. And Inverter Graphs Can be small vs. CNF representation: v 1 v 2 . . . v 3 v 4 linear in AIG but exponential in CNF or in DNF ( v 1 ∨ v 2 ∨ v 3 ... ) ∧ (¯ v 1 ∨ ¯ v 2 ∨ v 3 ... ) ∧ (¯ v 1 ∨ v 2 ∨ ¯ v 1 ∨ ¯ v 2 ∨ ¯ v 3 ∨ ¯ v 4 ∨ v 5 ... ) ... v 3 ... ) ... (¯

  47. And Inverter Graphs Can be small vs. BDD representation: Consider an integer multiplier for word size n with outputs numbered 0 to 2 n − 1 . For the Boolean function representing either the output i − 1 or 2 n − i − 1 : 1. there is a circuit of size linear in n that implements it; 2. every BDD representing one of them has exponential size.

  48. Satisfiability Modulo Theories How does it work? The SAT solver takes care of reasoning When needed, it consults a theory solver which decides the validity of predicates. Arithmetic Arrays Bit Vectors Data Types Core DPLL−based SAT Solver

  49. Satisfiability Modulo Theories What is a first order theory? Theory of linear arithmetic ( ax + by < = c ) Theory of bit vectors ( concat ( bv 1 , bv 2 ) == bv 3 ) Theory of arrays ( arr [ i := v 1 ][ j ] = v 2 ) Theory of uninterpreted functions ( f ( f ( f ( x ))) == x ) A sentence spanning several theories φ = x ≤ y ; y ≤ x + car ( cons (0 , x )); p ( h ( x ) − h ( y )); p (0);

  50. Is Probabilistic Analysis Worthwhile? The Questions: • Why are some problems so difficult? • Are there algorithms that will make them easier?

  51. Almost nothing past this point was presented but was intended to be presented

  52. Is Probabilistic Analysis Worthwhile? The Questions: • Why are some problems so difficult? • Are there algorithms that will make them easier? Why Probability? • Results and process tend to draw out intuition − Identify properties that may be exploited by a fast algorithm and properties that may prevent exploitation. − Identify reasons for the hardness of various problems - why lots of instances are hard. • Can explain the good or bad behavior of an algorithm • Afford comparison of incomparable classes of formulas

  53. Is Probabilistic Analysis Worthwhile? Some problems: • Must assume an input distribution, often not reflecting reality (but sometimes we do not need to) • Analysis can be difficult or impossible - algorithmic steps may significantly change distribution (known tools are limited) • Can yield misleading results

  54. A Misleading Result Example: A probabilistic model for random formulas Given: set L = { v 1 , v 1 , ..., v n , v n } of literals and 0 < p < 1 Construct clause c : l ∈ L independently in c with probability p Construct formula ψ : m independently constructed clauses Justification: All formulas are equally likely if p = 1 / 3 .

  55. A Misleading Result Example: A probabilistic model for random formulas Given: set L = { v 1 , v 1 , ..., v n , v n } of literals and 0 < p < 1 Construct clause c : l ∈ L independently in c with probability p Construct formula ψ : m independently constructed clauses Justification: All formulas are equally likely if p = 1 / 3 . Applied to splitting (DPLL): ( v 1 ∨ v 2 ∨ v i ) ∧ ( v i ∨ v 3 ) ∧ ( v 2 ∨ v 4 ) ❝ ❞ t ❍❍❍❍❍ v i t ❞ ❝ t ❞ ❝ ( v 1 ∨ v 2 ) ∧ ( v 2 ∨ v 4 ) ( v 3 ) ∧ ( v 2 ∨ v 4 )

  56. A Misleading Result Analysis sketch: Given m clauses, the average number of clauses removed when a value is assigned is pm

  57. A Misleading Result Analysis sketch: Given m clauses, the average number of clauses removed when a value is assigned is pm Let T i be the average number of clauses remaining on the i th iteration Then T 0 = m and T i = (1 − p ) T i − 1 For what i does T i = 1 ?

  58. A Misleading Result Analysis sketch: Given m clauses, the average number of clauses removed when a value is assigned is pm Let T i be the average number of clauses remaining on the i th iteration Then T 0 = m and T i = (1 − p ) T i − 1 For what i does T i = 1 ? When 1 = m (1 − p ) i or lg( m ) = − i lg(1 − p ) i = lg( m ) / − lg(1 − p ) So, size of search space is 2 i ≈ 2 lg( m ) /p = m c if p = 1 / 3

  59. A Misleading Result Analysis sketch: Given m clauses, the average number of clauses removed when a value is assigned is pm Let T i be the average number of clauses remaining on the i th iteration Then T 0 = m and T i = (1 − p ) T i − 1 For what i does T i = 1 ? When 1 = m (1 − p ) i or lg( m ) = − i lg(1 − p ) i = lg( m ) / − lg(1 − p ) So, size of search space is 2 i ≈ 2 lg( m ) /p = m c if p = 1 / 3 Conclusion: DPLL is fantastic, on the average!

  60. A Misleading Result Problems with the analysis: • The input model is funky! The probability that a random assignment satisfies a random formula is (1 − (1 − p ) 2 n ) m ≈ e − me − 2 pn which tends to 1 if ln( m ) /pn = o (1) and means the average width of a clause can be at least ln( m ) . With p = 1 / 3 , this holds if n > ln( m ) .

  61. A Misleading Result Problems with the analysis: • The input model is funky! The probability that a random assignment satisfies a random formula is (1 − (1 − p ) 2 n ) m ≈ e − me − 2 pn which tends to 1 if ln( m ) /pn = o (1) and means the average width of a clause can be at least ln( m ) . With p = 1 / 3 , this holds if n > ln( m ) . • If average clause width is constant ( p = c/n ) then the average search space size is 2 − lg( m ) / lg(1 − p ) ≈ 2 lg( m ) / ( c/n ) = 2 n lg( m ) /c = m n/c

  62. A Misleading Result Problems with the analysis: • The input model is funky! The probability that a random assignment satisfies a random formula is (1 − (1 − p ) 2 n ) m ≈ e − me − 2 pn which tends to 1 if ln( m ) /pn = o (1) and means the average width of a clause can be at least ln( m ) . With p = 1 / 3 , this holds if n > ln( m ) . • If average clause width is constant ( p = c/n ) then the average search space size is 2 − lg( m ) / lg(1 − p ) ≈ 2 lg( m ) / ( c/n ) = 2 n lg( m ) /c = m n/c Exponential complexity!

  63. Probabilistic Toolbox Linearity of expectation: � � E { X i } = E { X i } , X i real valued r.v.s i i

  64. Probabilistic Toolbox Linearity of expectation: � � E { X i } = E { X i } , X i real valued r.v.s i i First Moment Method: show Pr ( P ) → 0 as n → ∞ . Let X be a count of some entity Suppose some property P holds if and only if X > 1 . Since Pr ( X > 1) ≤ E { X } if E { X } → 0 then Pr ( P ) → 0 , as n → ∞ .

  65. First Moment Method An Example: Assume ψ is a random k -SAT formula, m clauses, n variables Let P be the property that ψ has a model

  66. First Moment Method An Example: Assume ψ is a random k -SAT formula, m clauses, n variables Let P be the property that ψ has a model Let X be the number of models for ψ 1 if the i th assignment is a model for ψ � Let X i = 0 otherwise

  67. First Moment Method An Example: Assume ψ is a random k -SAT formula, m clauses, n variables Let P be the property that ψ has a model Let X be the number of models for ψ 1 if the i th assignment is a model for ψ � Let X i = 0 otherwise Pr ( X i = 1) = (1 − 2 − k ) m 2 n Pr ( X i = 1) = 2 n (1 − 2 − k ) m � E { X } = i =1

  68. First Moment Method An Example: Assume ψ is a random k -SAT formula, m clauses, n variables Let P be the property that ψ has a model Let X be the number of models for ψ 1 if the i th assignment is a model for ψ � Let X i = 0 otherwise Pr ( X i = 1) = (1 − 2 − k ) m 2 n Pr ( X i = 1) = 2 n (1 − 2 − k ) m � E { X } = i =1 m 1 lg(1 − 2 − k ) ≈ 2 k Pr ( ψ has a model ) → 0 if n > m For k = 3 , ψ has no model w.h.p. if n > 5 . 19

  69. Probabilistic Toolbox Flow Analysis: Consider straight-line (non-backtracking) variants of DPLL Let ψ be a CNF Boolean expression Set M = ∅ Repeat the following: Choose an unassigned literal l in ψ If l is a positive literal, set M = M ∪ { l } Remove all clauses containing l from ψ Remove all literals l from ψ If ψ is empty then return M If some clause in ψ is falsified return "give up"

  70. Probabilistic Toolbox Flow Analysis: Consider straight-line (non-backtracking) variants of DPLL Let ψ be a CNF Boolean expression Set M = ∅ Repeat the following: Choose an unassigned literal l in ψ If l is a positive literal, set M = M ∪ { l } Remove all clauses containing l from ψ Remove all literals l from ψ If ψ is empty then return M If some clause in ψ is falsified return "give up" When does this not give up with probability tending to 1? Answer depends on the way literals are chosen

  71. Flow Analysis ✲ z k ( j ) C k ( j ) m E { m 4 ( j ) } w k − 1 ( j ) ❄ 0 ✲ z k − 1 ( j ) 1 / 4 1 / 2 3 / 4 C k − 1 ( j ) 0 1 j/n ✲ ❄ m w k − 2 ( j ) . . . E { m 3 ( j ) } ❄ w 2 ( j ) ✲ z 2 ( j ) 0 C 2 ( j ) 1 / 4 1 / 2 3 / 4 0 1 j/n ✲ w 1 ( j ) m ❄ ✲ z 1 ( j ) E { m 2 ( j ) } C 1 ( j ) 0 1 / 4 1 / 2 3 / 4 0 1 j/n ✲ w 0 ( j ) ❄

  72. Flow Analysis Example: Unit clause heuristic : When there is a clause with one unassigned variable remaining, set the value of such a variable so as to satisfy its clause.

  73. Flow Analysis Example: Unit clause heuristic : When there is a clause with one unassigned variable remaining, set the value of such a variable so as to satisfy its clause. Intuitively: If the clause flow w 1 ( j ) < 1 then any accumulation of unit clauses can be prevented and no clauses will ever be eliminated

  74. Flow Analysis Example: Unit clause heuristic : When there is a clause with one unassigned variable remaining, set the value of such a variable so as to satisfy its clause. Intuitively: If the clause flow w 1 ( j ) < 1 then any accumulation of unit clauses can be prevented and no clauses will ever be eliminated Analysis: Write difference equations describing flows: m i ( j + 1) = m i ( j ) + w i ( j ) − w i − 1 ( j ) − z i ( j ) , ∀ 0 ≤ i ≤ k, 1 < j < n Take expectations and rearrange: E { m i ( j + 1) − m i ( j ) } = E { w i ( j ) } − E { w i − 1 ( j ) } − E { z i ( j ) }

  75. Compute the expectations: � i · m i ( j ) = i · E { m i ( j ) } � E { z i ( j ) } = E { E { z i ( j ) | m i ( j ) }} = E 2( n − j ) 2( n − j ) = ( i + 1) E { m i +1 ( j ) } � ( i + 1) m i +1 ( j ) � E { w i ( j ) } = E { E { ... }} = E 2( n − j ) 2( n − j )

  76. Compute the expectations: � i · m i ( j ) = i · E { m i ( j ) } � E { z i ( j ) } = E { E { z i ( j ) | m i ( j ) }} = E 2( n − j ) 2( n − j ) = ( i + 1) E { m i +1 ( j ) } � ( i + 1) m i +1 ( j ) � E { w i ( j ) } = E { E { ... }} = E 2( n − j ) 2( n − j ) Substitute into difference equations: E { m i ( j + 1) − m i ( j ) } = ( i + 1) E { m i +1 ( j ) } − i · E { m i ( j ) } , i < k 2( n − j ) n − j E { m k ( j + 1) − m k ( j ) } = − k · E { m k ( j ) } n − j

  77. Compute the expectations: � i · m i ( j ) = i · E { m i ( j ) } � E { z i ( j ) } = E { E { z i ( j ) | m i ( j ) }} = E 2( n − j ) 2( n − j ) = ( i + 1) E { m i +1 ( j ) } � ( i + 1) m i +1 ( j ) � E { w i ( j ) } = E { E { ... }} = E 2( n − j ) 2( n − j ) Substitute into difference equations: E { m i ( j + 1) − m i ( j ) } = ( i + 1) E { m i +1 ( j ) } − i · E { m i ( j ) } , i < k 2( n − j ) n − j E { m k ( j + 1) − m k ( j ) } = − k · E { m k ( j ) } n − j Switch to differential equations (use x for j/n ): d ¯ m i ( x ) = ( i + 1) ¯ m i +1 ( x ) − i · ¯ m i ( x ) ; m k (0) = m/n, ¯ ¯ m i (0) = 0 for i < k dx 2 n (1 − x ) n − j

  78. Compute the expectations: � i · m i ( j ) = i · E { m i ( j ) } � E { z i ( j ) } = E { E { z i ( j ) | m i ( j ) }} = E 2( n − j ) 2( n − j ) = ( i + 1) E { m i +1 ( j ) } � ( i + 1) m i +1 ( j ) � E { w i ( j ) } = E { E { ... }} = E 2( n − j ) 2( n − j ) Substitute into difference equations: E { m i ( j + 1) − m i ( j ) } = ( i + 1) E { m i +1 ( j ) } − i · E { m i ( j ) } , i < k 2( n − j ) n − j E { m k ( j + 1) − m k ( j ) } = − k · E { m k ( j ) } n − j Switch to differential equations (use x for j/n ): d ¯ m i ( x ) = ( i + 1) ¯ m i +1 ( x ) − i · ¯ m i ( x ) ; m k (0) = m/n, ¯ ¯ m i (0) = 0 for i < k dx 2 n (1 − x ) n − j Solve: Translation: � i � j � k − i 1 � m � � k � m � k � � 1 − j (1 − x ) i x k − i E { m i ( j ) } = m i ( x ) = ¯ 2 k − i 2 k − i n i i n n

  79. Flow Analysis The important flow: � 2 � j � k − 2 � k � � E { w 1 ( j ) } = E { m 2 ( j ) } 1 1 − j = m 2 k − 2 ( n − j ) 2 n n Find location of maximum (set derivative = 0): � k − 2 � j ∗ = n k − 1 So, � k − 1 n < 2 k − 1 � k − 1 m E { w 1 ( j ∗ ) } < 1 when k − 2 k for k = 3 this is m n < 8 3

  80. Flow Analysis The important flow: � 2 � j � k − 2 � k � � E { w 1 ( j ) } = E { m 2 ( j ) } 1 1 − j = m 2 k − 2 ( n − j ) 2 n n Find location of maximum (set derivative = 0): � k − 2 � j ∗ = n k − 1 So, � k − 1 n < 2 k − 1 � k − 1 m E { w 1 ( j ∗ ) } < 1 when k − 2 k for k = 3 this is m n < 8 3 Conclusion: unit clause heuristic succeeds with probability bounded by a constant when m n < 8 3 .

  81. Flow Analysis What makes this work? The clausal distribution is the same, up to parameters m and n , at each level (algorithm is myopic - no information is revealed) There is pretty much never a sudden spurious flow Pr ( || C i ( j + 1) | − | C i ( j ) || > n 0 . 2 ) = o ( n − 3 ) The average flow change is pretty smooth E {| C i ( j + 1) | − | C i ( j ) |} = f i ( j/n, | C 0 ( j ) | /n, ..., | C k ( j ) | /n ) + o (1) , f i is continuous and � | f i ( u 1 , ..., u k +2 ) − f i ( v 1 , ..., v k +2 ) | ≤ L | u i − v i | 1 ≤ i ≤ j

  82. Flow Analysis good when m/n < literal selection k -SAT 3 -SAT 2 k /k Choose from unit clause, otherwise randomly 2 . 66 Choose var with maximum difference between c · 2 k /k 3 . 003 occurrences of positive and negative lits. Set value to maximize satisfied clauses Choose randomly from a clause with fewest 1 . 125 · 2 k /k 3 . 09 non-falsified literals c · 2 k /k Best possible myopic algorithm 3 . 26 literal selection, non-myopic algorithms Greedy algorithm: maximize number of clauses c · 2 k /k ? 3 . 52 satisfied, eliminate unit clauses when they exist Maximize the expected number of models of c · 2 k /k ? > 3 . 6? the reduced instance

  83. Flow Analysis Pr ( success ) 1 0 � k − 2 � k − 2 2 k 2 k � � k − 1 k − 1 0 . 4635 0 . 7725 m k + 1 k − 2 k + 1 k − 2 n ⇒ Typical probability curve of these algorithms

  84. Flow Analysis Pr ( success ) 1 0 � k − 2 � k − 2 2 k 2 k � � k − 1 k − 1 0 . 4635 0 . 7725 m k + 1 k − 2 k + 1 k − 2 n ⇒ Typical probability curve of these algorithms Is 2 k k the crossover to unsatisfiability or is it 2 k ?

  85. An explanation? Put points above a “floor” at distance = # clauses falsified Create clusters of points around a lowest point At m/n = r ∗ k ≈ (2 k /k ) log( k ) : Suddenly very many exponentially small clusters appear far apart from each other, surrounded by tall “mountains,” and containing mostly frozen variables

  86. Probabilistic Toolbox Second Moment Method: show Pr ( P ) → 1 as n → ∞ Let P be some property of a formula A witness for P : a structure whose presence in ψ implies P Let W = { w : w is a witness for P in ψ } � 1 if structure s i ∈ W Let X i = 0 otherwise � Let X = X i and E { X i } = q , then E { X } ∆ = µ = q | W | i = σ 2 = o ( µ 2 ) . Then, since Suppose var ( X ) ∆ Pr ( X = 0) ≤ σ 2 µ 2 we get Pr ( P ) → 1 as n → ∞

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend