Elimination Techniques In Modern Propositional Logic Reasoning - - PowerPoint PPT Presentation

elimination techniques in modern propositional logic
SMART_READER_LITE
LIVE PREVIEW

Elimination Techniques In Modern Propositional Logic Reasoning - - PowerPoint PPT Presentation

Elimination Techniques In Modern Propositional Logic Reasoning Norbert Manthey nmanthey@conp-solutions.com December 7, 2017 Outline Satisfiability Testing Elimination in SAT Solving Algorithms Constraint Types Model


slide-1
SLIDE 1

Elimination Techniques In Modern Propositional Logic Reasoning

Norbert Manthey

nmanthey@conp-solutions.com

December 7, 2017

slide-2
SLIDE 2

Outline

◮ Satisfiability Testing ◮ Elimination in SAT

◮ Solving Algorithms ◮ Constraint Types ◮ Model Reconstruction ◮ Variable Addition

◮ Conclusion

slide-3
SLIDE 3

Satisfiability Testing

slide-4
SLIDE 4

Propositional Logic

◮ Variables: v1, v2, · · · ∈ V of Boolean domain {⊥, ⊤}

◮ often also seen as {0, 1}

◮ Connectives:

◮ negation ¬v1 (also written as v1) ◮ disjunction v1 ∨ v2 ◮ conjunction v1 ∧ v2 ◮ many more, can be defined over truth table

◮ Literals: p, ¬q, x1, x2, . . . are variables, or negated variables

◮ double negation is eliminated

◮ Function vars(F) returns set of variables of formula F ◮ Function lits(F) returns set of literals of formula F

slide-5
SLIDE 5

Propositional Logic - Semantics

◮ Interpretation: function that maps variables to truth values

◮ total: map all variables of the input language ◮ partial: map variables of the input language ◮ complete (wrt. formula): map all variables of the formula

◮ An interpretation I satisfies a formula F, if the formula

evaluates to ⊤ after mapping the variables to their truth values, i.e. I | = F.

slide-6
SLIDE 6

Propositional Logic - Semantics

◮ Interpretation: function that maps variables to truth values

◮ total: map all variables of the input language ◮ partial: map variables of the input language ◮ complete (wrt. formula): map all variables of the formula

◮ An interpretation I satisfies a formula F, if the formula

evaluates to ⊤ after mapping the variables to their truth values, i.e. I | = F.

◮ A formula F is satisfiable, if such an interpretation I exists. ◮ Satisfiability Testing: Given a formula F, is it satisfiable?

◮ Compute a model, an unsatisfiable subset or proof!

slide-7
SLIDE 7

Propositional Logic - Conjunctive Normal Form (CNF)

◮ Proposition logic formulas can be complex ◮ Reasoners should be fast ◮ Pick reasonable subset

slide-8
SLIDE 8

Propositional Logic - Conjunctive Normal Form (CNF)

◮ Proposition logic formulas can be complex ◮ Reasoners should be fast ◮ Pick reasonable subset ◮ Clause: disjunction of literals (x1 ∨ · · · ∨ xk)

◮ equal to a (multi)set of literals {x1, . . . , xk}

◮ CNF Formula: conjunction of clauses (C1 ∧ · · · ∧ Cn)

◮ equal to a (multi)set of clauses {C1, . . . , Ck}

◮ Resolvent of clauses C and D with x ∈ C and x ∈ D:

◮ C ⊗ D = (C \ x) ∪ (D \ x)

slide-9
SLIDE 9

Propositional Logic - Conjunctive Normal Form (CNF)

◮ Proposition logic formulas can be complex ◮ Reasoners should be fast ◮ Pick reasonable subset ◮ Clause: disjunction of literals (x1 ∨ · · · ∨ xk)

◮ equal to a (multi)set of literals {x1, . . . , xk}

◮ CNF Formula: conjunction of clauses (C1 ∧ · · · ∧ Cn)

◮ equal to a (multi)set of clauses {C1, . . . , Ck}

◮ Resolvent of clauses C and D with x ∈ C and x ∈ D:

◮ C ⊗ D = (C \ x) ∪ (D \ x)

◮ Reduct F wrt set of literals x, F|x: map x to ⊤, simplify ◮ Subformula Fx of F wrt literal x: clauses with x

slide-10
SLIDE 10

Propositional Logic - Conjunctive Normal Form (CNF)

◮ Proposition logic formulas can be complex ◮ Reasoners should be fast ◮ Pick reasonable subset ◮ Clause: disjunction of literals (x1 ∨ · · · ∨ xk)

◮ equal to a (multi)set of literals {x1, . . . , xk}

◮ CNF Formula: conjunction of clauses (C1 ∧ · · · ∧ Cn)

◮ equal to a (multi)set of clauses {C1, . . . , Ck}

◮ Resolvent of clauses C and D with x ∈ C and x ∈ D:

◮ C ⊗ D = (C \ x) ∪ (D \ x)

◮ Reduct F wrt set of literals x, F|x: map x to ⊤, simplify ◮ Subformula Fx of F wrt literal x: clauses with x

F = {{x, y}, {x, y}} F|x = {{y}} Fx = {{x, y}}

slide-11
SLIDE 11

Propositional Logic - Formula Relations

◮ Given, formulas F and G ◮ F |

= G, if all (total) interpretations I with I | = F also satisfy G, I | = G

◮ Equivalence F ≡ G: F |

= G and G | = F

◮ Equi-Satisfiability F ≡SAT G: F and G are both satisfiable, or

F and G are both unsatisfiable

◮ Unsatisfiability-Preserving F |

=UNSAT G: if F | = G and F ≡SAT G

slide-12
SLIDE 12

Propositional Logic - Formula Relations

◮ Given, formulas F and G ◮ F |

= G, if all (total) interpretations I with I | = F also satisfy G, I | = G

◮ Equivalence F ≡ G: F |

= G and G | = F

◮ Equi-Satisfiability F ≡SAT G: F and G are both satisfiable, or

F and G are both unsatisfiable

◮ Unsatisfiability-Preserving F |

=UNSAT G: if F | = G and F ≡SAT G x | = (x ∨ y) x ≡SAT y (x ∧ x) | = y (x ∧ x) | =UNSAT (y ∧ y) (x ∧ x) | =UNSAT y does not hold!

slide-13
SLIDE 13

Propositional Logic - Advanced Formula Relations

Definition (Model Constructibility)

A formula G is model constructible with respect to a formula F and to a set of variables S, in symbols F S

mc G, if for each total

model I of F there exists a total model I ′ of G such that I(x) = I ′(x) for all x ∈ (V \ S).

Definition (Constructibility)

A formula G is constructible from a formula F, in symbols F ∩ G, if for each model I of F there exists a model I ′ of G such that I(x) = I ′(x) for all x ∈ vars(F).

Definition (Mutual Constructibility)

Two formulas F and G are mutually constructible, in symbols F ∩ G, if F ∩ G and G ∩ F.

slide-14
SLIDE 14

Mutual Constructibility

◮ Original formula

F = (x ∨ d) ∧ (a ∨ b ∨ x) ∧ (a ∨ x) ∧ (b ∨ x) ∧ (x ∨ c)

◮ Formula without x, vars(F) ∩ vars(G) = {a, b, c, d}

G = (d ∨ a) ∧ (d ∨ b) ∧ (a ∨ b ∨ c)

◮ Both satisfiable: JF = (abcdx)

JG = (abcdx)

◮ By changing the mapping of x, JF can be turned into JG, and

vice versa. In this example, F ∩ G.

slide-15
SLIDE 15

Formula Relations

F ≡ G F | =UNSAT G F | = G F ≡SAT G F ∩ G F ∩ G classical constructability

More details in [Man14].

slide-16
SLIDE 16

Elimination in SAT

slide-17
SLIDE 17

Modern SAT Solving

◮ Successfully applied in different areas

◮ hardware/software model checking, planning,

  • ptimization, verification, general purpose backend, . . .

◮ Many different input pattern

◮ AND-gates, XOR-gates, cardinality constraints, clauses

◮ Combine different solving strategies ◮ Special purpose techniques

◮ Gaussian Elimination, Cardinality Extraction, Variable

Elimination, Clause Eliminations, Variable Addition, Failed Literal Probing

slide-18
SLIDE 18

Solving Algorithms

slide-19
SLIDE 19

DavisPutnam (CNF formula F) Input: A formula F in CNF Output: The solution SAT or UNSAT of this formula

1

while true

2

if F = ∅ then return SAT // satisfiability rule

3

if ⊥ ∈ F then return UNSAT // unsatisfiability rule

4

if (x) ∈ F then // unit rule

5

F := F|x

6

continue

7

if x ∈ lits(F) and x / ∈ lits(F) then // pure literal rule

8

F := F|x

9

continue

10

G := F \ {Fx ∪ Fx} // clauses without x

11

F := G ∪ {Fx ⊗ Fx} // variable elimination

slide-20
SLIDE 20

Using Elimination During Search

◮ 1960: DP Algorithm [DP60] ◮ 1962: search and backtracking instead of elimination

(DLL) [DLL62]

◮ 1999: backjumping and learning (CDCL) [MSS96] ◮ 200X: improve heuristics, data structures [MMZ+01, SE02] ◮ 2005: (partial) variable elimination as preprocessing

◮ MiniSAT with SatELite [EB05]

◮ 2009: simplification during search [Bie09] ◮ 2009: (partial) Gaussian elimination [SNC09] ◮ 2012: automated variable addition [MHB13] ◮ 2013: (partial) cardinality reasoning [BLBLM14] ◮ Systems like Lingeling, Riss or CryptoMinisat

implement most of the above and schedule heuristically.

slide-21
SLIDE 21

(Bounded) Variable Elimination

◮ Formula F and variable v to be eliminated ◮ v might be functionally dependent, v ↔ (a ∧ b)

◮ Gv = {(v ∨ a ∨ b)}

Gv = {(v ∨ a), (v ∨ b)}

◮ before elimination, split:

◮ Fv = Gv ∧ Rv

Fv = Gv ∧ Rv

◮ new clauses S := Fv ⊗ Fv ◮ if functional dependent S := Rv ⊗ Gv ∧ Gv ⊗ Rv

F ′ := (F \ (Fv ∪ Fv)) ∪ S

◮ Bounded (number of clauses matters):

◮ |S| ≤ |Fv| + |Fv|, ignoring tautologies ◮ |Fv| ≤ 5 ∧ |Fv| ≤ 15, or symmetric

slide-22
SLIDE 22

Variable Elimination Example

◮ Original formula

F = (x ∨ d) ∧ (a ∨ b ∨ x) ∧ (a ∨ x) ∧ (b ∨ x) ∧ (x ∨ c)

slide-23
SLIDE 23

Variable Elimination Example

◮ Original formula

F = (x ∨ d) ∧ (a ∨ b ∨ x) ∧ (a ∨ x) ∧ (b ∨ x) ∧ (x ∨ c)

◮ Subformulas

slide-24
SLIDE 24

Variable Elimination Example

◮ Original formula

F = (x ∨ d) ∧ (a ∨ b ∨ x) ∧ (a ∨ x) ∧ (b ∨ x) ∧ (x ∨ c)

◮ Subformulas

Gx = (a ∨ b ∨ x) Gx = (a ∨ x) ∧ (b ∨ x) Rx = (x ∨ d) Rx = (x ∨ c)

slide-25
SLIDE 25

Variable Elimination Example

◮ Original formula

F = (x ∨ d) ∧ (a ∨ b ∨ x) ∧ (a ∨ x) ∧ (b ∨ x) ∧ (x ∨ c)

◮ Subformulas

Gx = (a ∨ b ∨ x) Gx = (a ∨ x) ∧ (b ∨ x) Rx = (x ∨ d) Rx = (x ∨ c)

◮ Formula without x

S := Gx ⊗ Rx ∧ Rx ⊗ Gx S = (d ∨ a) ∧ (d ∨ b) ∧ (a ∨ b ∨ c)

◮ Redundant:

Gx ⊗ Gx = ⊤ Rx ⊗ Rx = (c ∨ d)

slide-26
SLIDE 26

BVE in 2005 won the competition significantly (267 solved, 242 next)

slide-27
SLIDE 27

Elimination using Constraints

(http://www.pragmaticsofssat.org/2012/application-cactus-pos12.png)

slide-28
SLIDE 28

Elimination using Constraints

◮ Problems do not come in CNF ◮ F might contain cardinality constraints (CCs) or XORs ◮ Extract constraints, apply reasoning there

◮ Boolean domain is {0, 1} instead of {⊥, ⊤}

◮ Find new constraints to be encoded to CNF

◮ or efficiently prove inconsistency

slide-29
SLIDE 29

Elimination using Constraints

◮ Problems do not come in CNF ◮ F might contain cardinality constraints (CCs) or XORs ◮ Extract constraints, apply reasoning there

◮ Boolean domain is {0, 1} instead of {⊥, ⊤}

◮ Find new constraints to be encoded to CNF

◮ or efficiently prove inconsistency

◮ Cardinality Constraints: ∑i wixi ≤ k, with wi, k ∈ Z

◮ Instead of resolution, use addition, and multiplication

slide-30
SLIDE 30

Elimination using Constraints

◮ Problems do not come in CNF ◮ F might contain cardinality constraints (CCs) or XORs ◮ Extract constraints, apply reasoning there

◮ Boolean domain is {0, 1} instead of {⊥, ⊤}

◮ Find new constraints to be encoded to CNF

◮ or efficiently prove inconsistency

◮ Cardinality Constraints: ∑i wixi ≤ k, with wi, k ∈ Z

◮ Instead of resolution, use addition, and multiplication

◮ XORs: ∑i xi mod 2 = 1, with wi, k ∈ Z

◮ Instead of resolution, use addition with modulo ◮ Find new XOR constraints to be encoded to CNF

slide-31
SLIDE 31

Model Reconstruction

slide-32
SLIDE 32

Model Reconstruction

◮ J′ |

= F ′ does not imply J′ | = F, v can be mapped arbitrarily

◮ solver only finds J′ ◮ simplifier knows F

slide-33
SLIDE 33

Model Reconstruction

◮ J′ |

= F ′ does not imply J′ | = F, v can be mapped arbitrarily

◮ solver only finds J′ ◮ simplifier knows F

J =      (J′ \ {v}) ∪ {v}, if J′ | = Fv (J′ \ {v}) ∪ {v}, if J′ | = Fv J′,

  • therwise
slide-34
SLIDE 34

Model Reconstruction

◮ J′ |

= F ′ does not imply J′ | = F, v can be mapped arbitrarily

◮ solver only finds J′ ◮ simplifier knows F

J =      (J′ \ {v}) ∪ {v}, if J′ | = Fv (J′ \ {v}) ∪ {v}, if J′ | = Fv J′,

  • therwise

◮ Implementation

◮ when eliminating v, store Fv and Fv ◮ or, store only Fv and set J′ := (J′ \ {v}) ∪ {v}

slide-35
SLIDE 35

Variable Addition

slide-36
SLIDE 36

Variable Addition

Definition (Extension)

A formula F with two literals l and l′ that occur in F can be extended with a fresh variable x to F ′ = F ∧ (x ∨ l) ∧ (x ∨ l′) ∧ (x ∨ l ∨ l′).

◮ For any model J′ with J′ |

= F ′, also J′ | = F

◮ What would happen when using variable elimination next? ◮ Used for short theoretical proofs (extended resolution)

◮ There exists clause based short proofs for e.g. pigeon hole

◮ Cannot be automated efficiently (as far as we know)

slide-37
SLIDE 37

Variable Addition

Definition (Extension)

A formula F with two literals l and l′ that occur in F can be extended with a fresh variable x to F ′ = F ∧ (x ∨ l) ∧ (x ∨ l′) ∧ (x ∨ l ∨ l′).

◮ For any model J′ with J′ |

= F ′, also J′ | = F

◮ What would happen when using variable elimination next? ◮ Used for short theoretical proofs (extended resolution)

◮ There exists clause based short proofs for e.g. pigeon hole

◮ Cannot be automated efficiently (as far as we know) ◮ Exploit number of clauses matters?

slide-38
SLIDE 38

(Bounded) Variable Addition BVA

◮ Can you reduce the number of clauses here?

F := (a ∨ c) ∧ (a ∨ d) ∧ (a ∨ e) ∧ (b ∨ c) ∧ (b ∨ d) ∧ (b ∨ e)

slide-39
SLIDE 39

(Bounded) Variable Addition BVA

◮ Can you reduce the number of clauses here?

F := (a ∨ c) ∧ (a ∨ d) ∧ (a ∨ e) ∧ (b ∨ c) ∧ (b ∨ d) ∧ (b ∨ e)

◮ Simplified, with fresh variable x

F ′ := (x ∨ c) ∧ (x ∨ d) ∧ (x ∨ e) ∧ (a ∨ x) ∧ (b ∨ x)

slide-40
SLIDE 40

(Bounded) Variable Addition BVA

◮ Can you reduce the number of clauses here?

F := (a ∨ c) ∧ (a ∨ d) ∧ (a ∨ e) ∧ (b ∨ c) ∧ (b ∨ d) ∧ (b ∨ e)

◮ Simplified, with fresh variable x

F ′ := (x ∨ c) ∧ (x ∨ d) ∧ (x ∨ e) ∧ (a ∨ x) ∧ (b ∨ x)

◮ How about variable elimination on x?

slide-41
SLIDE 41

(Bounded) Variable Addition BVA

◮ Can you reduce the number of clauses here?

F := (a ∨ c) ∧ (a ∨ d) ∧ (a ∨ e) ∧ (b ∨ c) ∧ (b ∨ d) ∧ (b ∨ e)

◮ Simplified, with fresh variable x

F ′ := (x ∨ c) ∧ (x ∨ d) ∧ (x ∨ e) ∧ (a ∨ x) ∧ (b ∨ x)

◮ How about variable elimination on x? ◮ BVA linearizes naive quadratic at-most-one encoding

slide-42
SLIDE 42

Conclusion

slide-43
SLIDE 43

Take Home Message

◮ Variable Elimination is an extremely powerful technique ◮ Produces mutual constructible formulas ◮ Similar techniques exist for higher level constraints ◮ The reverse – variable addition – is not that effective ◮ Elimination has to be applied limited

slide-44
SLIDE 44

Elimination Techniques In Modern Propositional Logic Reasoning

Norbert Manthey

nmanthey@conp-solutions.com

December 7, 2017 Thank you for your attention

slide-45
SLIDE 45

Armin Biere. PrecoSAT system description. http://fmv.jku.at/precosat/preicosat-sc09.pdf, 2009. Armin Biere, Daniel Le Berre, Emmanuel Lonca, and Norbert Manthey. Detecting cardinality constraints in CNF. In SAT 2014, volume 8561 of LNCS, pages 285–301, 2014. Martin Davis, George Logemann, and Donald Loveland. A machine program for theorem-proving. Communications of the ACM, 5(7):394–397, 1962. Martin Davis and Hilary Putnam. A computing procedure for quantification theory. Journal of the ACM, 7(3):201–215, 1960.

slide-46
SLIDE 46

Niklas E´ en and Armin Biere. Effective preprocessing in SAT through variable and clause elimination. In SAT 2005, volume 3569 of LNCS, pages 61–75, 2005. Norbert Manthey. Towards Next Generation Sequential and Parallel SAT Solvers. PhD thesis, TU Dresden, 2014. Norbert Manthey, Marijn J.H. Heule, and Armin Biere. Automated reencoding of Boolean formulas. In Hardware and Software: Verification and Testing, volume 7857 of LNCS, pages 102–117, 2013. Matthew W. Moskewicz, Conor F. Madigan, Ying Zhao, Lintao Zhang, and Sharad Malik. Chaff: Engineering an efficient SAT solver. In DAC, pages 530–535. ACM, 2001.

slide-47
SLIDE 47

Jo˜ ao P. Marques-Silva and Karem A. Sakallah. GRASP – a new search algorithm for satisfiability. ICCAD ’96, pages 220–227. IEEE Computer Society, 1996. Niklas S¨

  • rensson and Niklas E´

en. Minisat v1.13 - A SAT solver with conflict-clause

  • minimization. 2005. SAT-2005 poster.

Technical report, Chalmers University of Technology, 2002. Mate Soos, Karsten Nohl, and Claude Castelluccia. Extending SAT solvers to cryptographic problems. In SAT 2009, volume 5584 of LNCS, pages 244–257, 2009.