Prepocessing Marijn J.H. Heule The University of Texas at Austin - - PowerPoint PPT Presentation

prepocessing
SMART_READER_LITE
LIVE PREVIEW

Prepocessing Marijn J.H. Heule The University of Texas at Austin - - PowerPoint PPT Presentation

Prepocessing Marijn J.H. Heule The University of Texas at Austin July 5, 2013 M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 1 / 42 Interaction between different solving approaches Translator reencoding encoding Simplifier


slide-1
SLIDE 1

Prepocessing

Marijn J.H. Heule The University of Texas at Austin July 5, 2013

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 1 / 42

slide-2
SLIDE 2

Interaction between different solving approaches

encoding reencoding preprocessing inprocessing Translator Simplifier Clause Learner

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 2 / 42

slide-3
SLIDE 3

Interaction between different solving approaches

encoding reencoding preprocessing inprocessing Translator Simplifier Clause Learner

It all comes down to adding and removing redundant clauses

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 2 / 42

slide-4
SLIDE 4

Redundant clauses A clause is redundant w.r.t. a formula if adding it to the formula preserves satisfiability. For unsatisfiable formulas, all clauses can be added, including the empty clause ( ).

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 3 / 42

slide-5
SLIDE 5

Redundant clauses A clause is redundant w.r.t. a formula if adding it to the formula preserves satisfiability. For unsatisfiable formulas, all clauses can be added, including the empty clause ( ). A clause is redundant w.r.t. a formula if removing it from the formula preserves unsatisfiability. For satisfiable formulas, all clauses can be removed.

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 3 / 42

slide-6
SLIDE 6

Redundant clauses A clause is redundant w.r.t. a formula if adding it to the formula preserves satisfiability. For unsatisfiable formulas, all clauses can be added, including the empty clause ( ). A clause is redundant w.r.t. a formula if removing it from the formula preserves unsatisfiability. For satisfiable formulas, all clauses can be removed. Challenge regarding redundant clauses: How to check redundancy in polynomial time? Ideally find redundant clauses in linear time

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 3 / 42

slide-7
SLIDE 7

Outline

1 Subsumption 2 Variable Elimination 3 Bounded Variable Addition 4 Blocked Clause Elimination 5 Hyper Binary Resolution 6 Unhiding Redundancy

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 4 / 42

slide-8
SLIDE 8

Subsumption

Subsumption

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 5 / 42

slide-9
SLIDE 9

Subsumption

Tautologies and Subsumption

Definition (Tautology) A clause C is a tautology if its contains two complementary literals l, ¯ l. Example The clause (a ∨ b ∨ ¯ b) is a tautology. Definition (Subsumption) Clause C subsumes clause D if and only if C ⊂ D. Example The clause (a ∨ b) subsumes clause (a ∨ b ∨ ¯ c).

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 6 / 42

slide-10
SLIDE 10

Subsumption

Self-Subsuming Resolution

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 7 / 42

slide-11
SLIDE 11

Subsumption

Self-Subsuming Resolution

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example assume a CNF contains both antecedents . . . (a ∨ b ∨ l)(a ∨ b ∨ c ∨ ¯ l) · · · if D is added then D ∨ ¯ l can be removed ⇓ which in essence removes ¯ l from D ∨ ¯ l . . . (a ∨ b ∨ l)(a ∨ b ∨ c ) . . . initially in the SATeLite preprocessor [EenBiere’07] now common in many SAT solvers

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 7 / 42

slide-12
SLIDE 12

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption (a ∨ b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ∨ b ∨ ¯ c ) ∧ ( a ∨ ¯ b ∨ c ) ∧ (¯ a ∨ ¯ b ∨ d ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ∨ d ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-13
SLIDE 13

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption ( b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ∨ b ∨ ¯ c ) ∧ ( a ∨ ¯ b ∨ c ) ∧ (¯ a ∨ ¯ b ∨ d ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ∨ d ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-14
SLIDE 14

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption ( b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ∨ b ) ∧ ( a ∨ ¯ b ∨ c ) ∧ (¯ a ∨ ¯ b ∨ d ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ∨ d ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-15
SLIDE 15

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption ( b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ∨ b ) ∧ ( a ∨ c ) ∧ (¯ a ∨ ¯ b ∨ d ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ∨ d ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-16
SLIDE 16

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption ( b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ∨ b ) ∧ ( a ∨ c ) ∧ (¯ a ∨ ¯ b ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ∨ d ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-17
SLIDE 17

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption ( b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ∨ b ) ∧ ( a ∨ c ) ∧ (¯ a ∨ ¯ b ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-18
SLIDE 18

Subsumption

Self-Subsuming Example

Self-Subsuming Resolution C ∨ l D ∨ ¯ l D C ⊆ D (a ∨ b ∨ l) (a ∨ b ∨ c ∨ ¯ l) (a ∨ b ∨ c) resolvent D subsumes second antecedent D ∨ ¯ l Example: Remove literals using self-subsumption ( b ∨ c ) ∧ ( ¯ a ∨ b ∨ c ) ∧ (¯ a ) ∧ ( a ∨ c ) ∧ (¯ a ∨ ¯ b ) ∧ ( ¯ a ∨ ¯ b ∨ ¯ d ) ∧ (a ∨ ¯ c ) ∧ ( a ∨ ¯ c ∨ ¯ d )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 8 / 42

slide-19
SLIDE 19

Subsumption

Implementing Subsumtion

Definition (Subsumption) Clause C subsumes clause D if and only if C ⊂ D. Example The clause (a ∨ b) subsumes clause (a ∨ b ∨ ¯ c). Forward Subsumption for each clause C in formula F do if C is subsumed by a clause D in F \ C then remove C from F

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 9 / 42

slide-20
SLIDE 20

Subsumption

Implementing Subsumtion

Definition (Subsumption) Clause C subsumes clause D if and only if C ⊂ D. Example The clause (a ∨ b) subsumes clause (a ∨ b ∨ ¯ c). Forward Subsumption for each clause C in formula F do if C is subsumed by a clause D in F \ C then remove C from F Backward Subsumption for each clause C in formula F do remove all clauses D in F that are subsumed by C

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 9 / 42

slide-21
SLIDE 21

Subsumption

Implementing Subsumtion

Definition (Subsumption) Clause C subsumes clause D if and only if C ⊂ D. Example The clause (a ∨ b) subsumes clause (a ∨ b ∨ ¯ c). Forward Subsumption for each clause C in formula F do if C is subsumed by a clause D in F \ C then remove C from F Backward Subsumption for each clause C in formula F do pick a literal l in C remove all clauses D in F l that are subsumed by C

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 9 / 42

slide-22
SLIDE 22

Variable Elimination

Variable Elimination

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 10 / 42

slide-23
SLIDE 23

Variable Elimination

Variable Elimination [DavisPutnam’60]

Definition (Resolution) Given two clauses C = (x ∨ a1 ∨ · · · ∨ ai) and D = (¯ x ∨ b1 ∨ · · · ∨ bj), the resolvent of C and D on variable x (denoted by C ⊗x D) is (a1 ∨ · · · ∨ ai ∨ b1 ∨ · · · ∨ bj) Resolution on sets of clauses Fx and F¯

x (denoted by Fx ⊗x F¯ x)

generates all (non-tautological) resolvents of C ∈ Fx and D ∈ F¯

x.

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 11 / 42

slide-24
SLIDE 24

Variable Elimination

Variable Elimination [DavisPutnam’60]

Definition (Resolution) Given two clauses C = (x ∨ a1 ∨ · · · ∨ ai) and D = (¯ x ∨ b1 ∨ · · · ∨ bj), the resolvent of C and D on variable x (denoted by C ⊗x D) is (a1 ∨ · · · ∨ ai ∨ b1 ∨ · · · ∨ bj) Resolution on sets of clauses Fx and F¯

x (denoted by Fx ⊗x F¯ x)

generates all (non-tautological) resolvents of C ∈ Fx and D ∈ F¯

x.

Definition (Variable elimination (VE)) Given a CNF formula F, variable elimination (or DP resolution) removes a variable x by replacing Fx and F¯

x by Fx ⊗x F¯ x

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 11 / 42

slide-25
SLIDE 25

Variable Elimination

Variable Elimination [DavisPutnam’60]

Definition (Resolution) Given two clauses C = (x ∨ a1 ∨ · · · ∨ ai) and D = (¯ x ∨ b1 ∨ · · · ∨ bj), the resolvent of C and D on variable x (denoted by C ⊗x D) is (a1 ∨ · · · ∨ ai ∨ b1 ∨ · · · ∨ bj) Resolution on sets of clauses Fx and F¯

x (denoted by Fx ⊗x F¯ x)

generates all (non-tautological) resolvents of C ∈ Fx and D ∈ F¯

x.

Definition (Variable elimination (VE)) Given a CNF formula F, variable elimination (or DP resolution) removes a variable x by replacing Fx and F¯

x by Fx ⊗x F¯ x

Proof procedure [DavisPutnam60] VE is a complete proof procedure. Applying VE until fixpoint results in the empty formula (satisfiable) or empty clause (unsatisfiable)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 11 / 42

slide-26
SLIDE 26

Variable Elimination

Example VE by clause distribution [DavisPutnam’60]

Definition (Variable elimination (VE)) Given a CNF formula F, variable elimination (or DP resolution) removes a variable x by replacing Fx and F¯

x by Fx ⊗x F¯ x

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 12 / 42

slide-27
SLIDE 27

Variable Elimination

Example VE by clause distribution [DavisPutnam’60]

Definition (Variable elimination (VE)) Given a CNF formula F, variable elimination (or DP resolution) removes a variable x by replacing Fx and F¯

x by Fx ⊗x F¯ x

Example of clause distribution Fx

  • (x ∨ c)

(x ∨ ¯ d) (x ∨ ¯ a ∨ ¯ b) F¯

x

   (¯ x ∨ a) (a ∨ c) (a ∨ d) (a ∨ ¯ a ∨ ¯ b) (¯ x ∨ b) (b ∨ c) (b ∨ d) (b ∨ ¯ a ∨ ¯ b) (¯ x ∨ ¯ e ∨ f ) (c ∨ ¯ e ∨ f ) (d ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 12 / 42

slide-28
SLIDE 28

Variable Elimination

Example VE by clause distribution [DavisPutnam’60]

Definition (Variable elimination (VE)) Given a CNF formula F, variable elimination (or DP resolution) removes a variable x by replacing Fx and F¯

x by Fx ⊗x F¯ x

Example of clause distribution Fx

  • (x ∨ c)

(x ∨ ¯ d) (x ∨ ¯ a ∨ ¯ b) F¯

x

   (¯ x ∨ a) (a ∨ c) (a ∨ d) (a ∨ ¯ a ∨ ¯ b) (¯ x ∨ b) (b ∨ c) (b ∨ d) (b ∨ ¯ a ∨ ¯ b) (¯ x ∨ ¯ e ∨ f ) (c ∨ ¯ e ∨ f ) (d ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 12 / 42

slide-29
SLIDE 29

Variable Elimination

Example VE by clause distribution [DavisPutnam’60]

Definition (Variable elimination (VE)) Given a CNF formula F, variable elimination (or DP resolution) removes a variable x by replacing Fx and F¯

x by Fx ⊗x F¯ x

Example of clause distribution Fx

  • (x ∨ c)

(x ∨ ¯ d) (x ∨ ¯ a ∨ ¯ b) F¯

x

   (¯ x ∨ a) (a ∨ c) (a ∨ d) (a ∨ ¯ a ∨ ¯ b) (¯ x ∨ b) (b ∨ c) (b ∨ d) (b ∨ ¯ a ∨ ¯ b) (¯ x ∨ ¯ e ∨ f ) (c ∨ ¯ e ∨ f ) (d ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f ) example: |Fx ⊗ F¯

x| > |Fx| + |F¯ x|; in general: exponential growth of clauses

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 12 / 42

slide-30
SLIDE 30

Variable Elimination

VE by substitution [EenBiere07]

General idea Detect gates (or definitions) x = GATE(a1, . . . , an) in the formula and use them to reduce the number of added clauses

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 13 / 42

slide-31
SLIDE 31

Variable Elimination

VE by substitution [EenBiere07]

General idea Detect gates (or definitions) x = GATE(a1, . . . , an) in the formula and use them to reduce the number of added clauses Possible gates gate Gx G¯

x

AND(a1, . . . , an) (x ∨ ¯ a1 ∨ · · · ∨ ¯ an) (¯ x ∨ a1), . . . , (¯ x ∨ an) OR(a1, . . . , an) (x ∨ ¯ a1), . . . , (x ∨ ¯ an) (¯ x ∨ a1 ∨ · · · ∨ an) ITE(c, t, f ) (x ∨ ¯ c ∨ ¯ t), (x ∨ c ∨ ¯ f ) (¯ x ∨ ¯ c ∨ t), (¯ x ∨ c ∨ f )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 13 / 42

slide-32
SLIDE 32

Variable Elimination

VE by substitution [EenBiere07]

General idea Detect gates (or definitions) x = GATE(a1, . . . , an) in the formula and use them to reduce the number of added clauses Possible gates gate Gx G¯

x

AND(a1, . . . , an) (x ∨ ¯ a1 ∨ · · · ∨ ¯ an) (¯ x ∨ a1), . . . , (¯ x ∨ an) OR(a1, . . . , an) (x ∨ ¯ a1), . . . , (x ∨ ¯ an) (¯ x ∨ a1 ∨ · · · ∨ an) ITE(c, t, f ) (x ∨ ¯ c ∨ ¯ t), (x ∨ c ∨ ¯ f ) (¯ x ∨ ¯ c ∨ t), (¯ x ∨ c ∨ f ) Variable elimination by substitution [EenBiere07] Let Rx = Fx \ Gx; R¯

x = F¯ x \ G¯ x.

Replace Fx ∧ F¯

x by Gx ⊗x R¯ x ∧ G¯ x ⊗x Rx. Always less than Fx ⊗x F¯ x !

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 13 / 42

slide-33
SLIDE 33

Variable Elimination

VE by substitution [EenBiere’07]

Example of gate extraction: x = AND(a, b)

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

x = (¯

x ∨ a) ∧ (¯ x ∨ b) ∧ (¯ x ∨ ¯ e ∨ f )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 14 / 42

slide-34
SLIDE 34

Variable Elimination

VE by substitution [EenBiere’07]

Example of gate extraction: x = AND(a, b)

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

x = (¯

x ∨ a) ∧ (¯ x ∨ b) ∧ (¯ x ∨ ¯ e ∨ f )

Example of substitution Rx Gx

  • (x ∨ c)

(x ∨ ¯ d) (x ∨ ¯ a ∨ ¯ b) G¯

x

x ∨ a) (a ∨ c) (a ∨ d) (¯ x ∨ b) (b ∨ c) (b ∨ d) R¯

x

x ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f )

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 14 / 42

slide-35
SLIDE 35

Variable Elimination

VE by substitution [EenBiere’07]

Example of gate extraction: x = AND(a, b)

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

x = (¯

x ∨ a) ∧ (¯ x ∨ b) ∧ (¯ x ∨ ¯ e ∨ f )

Example of substitution Rx Gx

  • (x ∨ c)

(x ∨ ¯ d) (x ∨ ¯ a ∨ ¯ b) G¯

x

x ∨ a) (a ∨ c) (a ∨ d) (¯ x ∨ b) (b ∨ c) (b ∨ d) R¯

x

x ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f ) using substitution: |Fx ⊗ F¯

x| < |Fx| + |F¯ x|

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 14 / 42

slide-36
SLIDE 36

Bounded Variable Addition

Bounded Variable Addition

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 15 / 42

slide-37
SLIDE 37

Bounded Variable Addition

Bounded Variable Addition

Main Idea Given a CNF formula F, can we construct a logically equivalent F ′ by introducing a new variable x / ∈ VAR(F) such that |F ′| < |F|?

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 16 / 42

slide-38
SLIDE 38

Bounded Variable Addition

Bounded Variable Addition

Main Idea Given a CNF formula F, can we construct a logically equivalent F ′ by introducing a new variable x / ∈ VAR(F) such that |F ′| < |F|? Reverse of Variable Elimination For example, replace the clauses (a ∨ c) (a ∨ d) (b ∨ c) (b ∨ d) (c ∨ ¯ e ∨ f ) (d ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f ) by (¯ x ∨ a) (¯ x ∨ b) (¯ x ∨ ¯ e ∨ f ) (x ∨ c) (x ∨ d) (x ∨ ¯ a ∨ ¯ b)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 16 / 42

slide-39
SLIDE 39

Bounded Variable Addition

Bounded Variable Addition

Main Idea Given a CNF formula F, can we construct a logically equivalent F ′ by introducing a new variable x / ∈ VAR(F) such that |F ′| < |F|? Reverse of Variable Elimination For example, replace the clauses (a ∨ c) (a ∨ d) (b ∨ c) (b ∨ d) (c ∨ ¯ e ∨ f ) (d ∨ ¯ e ∨ f ) (¯ a ∨ ¯ b ∨ ¯ e ∨ f ) by (¯ x ∨ a) (¯ x ∨ b) (¯ x ∨ ¯ e ∨ f ) (x ∨ c) (x ∨ d) (x ∨ ¯ a ∨ ¯ b) Challenge: how to find suitable patterns for replacement?

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 16 / 42

slide-40
SLIDE 40

Bounded Variable Addition

Factoring Out Subclauses

Example Replace (a ∨ b ∨ c ∨ d) (a ∨ b ∨ c ∨ e) (a ∨ b ∨ c ∨ f ) by (x ∨ d) (x ∨ e) (x ∨ f ) (¯ x ∨ a ∨ b ∨ c) adds 1 variable and one clause reduces number of literals by 2 Not compatible with BVE, which would eliminate x immediately! . . . so this does not work . . .

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 17 / 42

slide-41
SLIDE 41

Bounded Variable Addition

Bounded Variable Addition

Smallest Example Replace (a ∨ d) (a ∨ e) (b ∨ d) (b ∨ e) (c ∨ d) (c ∨ e) by (¯ x ∨ a) (¯ x ∨ b) (¯ x ∨ c) (x ∨ d) (x ∨ e) adds 1 variable removes 1 clause

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 18 / 42

slide-42
SLIDE 42

Bounded Variable Addition

Bounded Variable Addition

Possible Patterns (X1 ∨ L1) . . . (X1 ∨ Lk) . . . . . . (Xn ∨ L1) . . . (Xn ∨ Lk) ≡

n

  • i=1

k

  • j=1

(Xi ∨ Lj) replaced by

n

  • i=1

(y ∨ Xi) ∧

k

  • j=1

(¯ y ∨ Lj) Every k clauses share sets of literals Lj There are n sets of literals Xi that appear in clauses with Lj

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 19 / 42

slide-43
SLIDE 43

Bounded Variable Addition

Bounded Variable Addition

Possible Patterns (X1 ∨ L1) . . . (X1 ∨ Lk) . . . . . . (Xn ∨ L1) . . . (Xn ∨ Lk) ≡

n

  • i=1

k

  • j=1

(Xi ∨ Lj) replaced by

n

  • i=1

(y ∨ Xi) ∧

k

  • j=1

(¯ y ∨ Lj) Every k clauses share sets of literals Lj There are n sets of literals Xi that appear in clauses with Lj Reduction: nk − n − k clauses are removed by replacement

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 19 / 42

slide-44
SLIDE 44

Bounded Variable Addition

Bounded Variable Addition

Possible Patterns (X1 ∨ L1) . . . (X1 ∨ Lk) . . . . . . (Xn ∨ L1) . . . (Xn ∨ Lk) ≡

n

  • i=1

k

  • j=1

(Xi ∨ Lj) replaced by

n

  • i=1

(y ∨ Xi) ∧

k

  • j=1

(¯ y ∨ Lj) Every k clauses share sets of literals Lj There are n sets of literals Xi that appear in clauses with Lj Reduction: nk − n − k clauses are removed by replacement

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 19 / 42

slide-45
SLIDE 45

Bounded Variable Addition

Bounded Variable Addition on AtMostOneZero (1) Example encoding of AtMostOneZero (x1, x2, . . . , xn) (x1 ∨ x2) ∧ (x9 ∨ x10) ∧ (x8 ∨ x10) ∧ (x7 ∨ x10) ∧ (x6 ∨ x10) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x8 ∨ x9) ∧ (x7 ∨ x9) ∧ (x6 ∨ x9) ∧ (x1 ∨ x4) ∧ (x2 ∨ x4) ∧ (x3 ∨ x4) ∧ (x7 ∨ x8) ∧ (x6 ∨ x8) ∧ (x1 ∨ x5) ∧ (x2 ∨ x5) ∧ (x3 ∨ x5) ∧ (x4 ∨ x5) ∧ (x6 ∨ x7) ∧ (x1 ∨ x6) ∧ (x2 ∨ x6) ∧ (x3 ∨ x6) ∧ (x4 ∨ x6) ∧ (x5 ∨ x6) ∧ (x1 ∨ x7) ∧ (x2 ∨ x7) ∧ (x3 ∨ x7) ∧ (x4 ∨ x7) ∧ (x5 ∨ x7) ∧ (x1 ∨ x8) ∧ (x2 ∨ x8) ∧ (x3 ∨ x8) ∧ (x4 ∨ x8) ∧ (x5 ∨ x8) ∧ (x1 ∨ x9) ∧ (x2 ∨ x9) ∧ (x3 ∨ x9) ∧ (x4 ∨ x9) ∧ (x5 ∨ x9) ∧ (x1 ∨ x10) ∧ (x2 ∨ x10) ∧ (x3 ∨ x10) ∧ (x4 ∨ x10) ∧ (x5 ∨ x10)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 20 / 42

slide-46
SLIDE 46

Bounded Variable Addition

Bounded Variable Addition on AtMostOneZero (1) Example encoding of AtMostOneZero (x1, x2, . . . , xn) (x1 ∨ x2) ∧ (x9 ∨ x10) ∧ (x8 ∨ x10) ∧ (x7 ∨ x10) ∧ (x6 ∨ x10) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x8 ∨ x9) ∧ (x7 ∨ x9) ∧ (x6 ∨ x9) ∧ (x1 ∨ x4) ∧ (x2 ∨ x4) ∧ (x3 ∨ x4) ∧ (x7 ∨ x8) ∧ (x6 ∨ x8) ∧ (x1 ∨ x5) ∧ (x2 ∨ x5) ∧ (x3 ∨ x5) ∧ (x4 ∨ x5) ∧ (x6 ∨ x7) ∧ (x1 ∨ x6) ∧ (x2 ∨ x6) ∧ (x3 ∨ x6) ∧ (x4 ∨ x6) ∧ (x5 ∨ x6) ∧ (x1 ∨ x7) ∧ (x2 ∨ x7) ∧ (x3 ∨ x7) ∧ (x4 ∨ x7) ∧ (x5 ∨ x7) ∧ (x1 ∨ x8) ∧ (x2 ∨ x8) ∧ (x3 ∨ x8) ∧ (x4 ∨ x8) ∧ (x5 ∨ x8) ∧ (x1 ∨ x9) ∧ (x2 ∨ x9) ∧ (x3 ∨ x9) ∧ (x4 ∨ x9) ∧ (x5 ∨ x9) ∧ (x1 ∨ x10) ∧ (x2 ∨ x10) ∧ (x3 ∨ x10) ∧ (x4 ∨ x10) ∧ (x5 ∨ x10)

Replace (xi ∨ xj) with i ∈ {1..5}, j ∈ {6..10} by (xi ∨ y), (xj ∨ ¯ y)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 20 / 42

slide-47
SLIDE 47

Bounded Variable Addition

Bounded Variable Addition on AtMostOneZero (2) Example encoding of AtMostOneZero (x1, x2, . . . , xn) (x1 ∨ x2) ∧ (x9 ∨ x10) ∧ (x8 ∨ x10) ∧ (x7 ∨ x10) ∧ (x6 ∨ x10) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x8 ∨ x9) ∧ (x7 ∨ x9) ∧ (x6 ∨ x9) ∧ (x1 ∨ x4) ∧ (x2 ∨ x4) ∧ (x3 ∨ x4) ∧ (x7 ∨ x8) ∧ (x6 ∨ x8) ∧ (x1 ∨ x5) ∧ (x2 ∨ x5) ∧ (x3 ∨ x5) ∧ (x4 ∨ x5) ∧ (x6 ∨ x7) ∧ (x1 ∨ y) ∧ (x2 ∨ y) ∧ (x3 ∨ y) ∧ (x4 ∨ y) ∧ (x5 ∨ y) ∧ (x6 ∨ ¯ y) ∧ (x7 ∨ ¯ y) ∧ (x8 ∨ ¯ y) ∧ (x9 ∨ ¯ y) ∧ (x10 ∨ ¯ y)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 21 / 42

slide-48
SLIDE 48

Bounded Variable Addition

Bounded Variable Addition on AtMostOneZero (2) Example encoding of AtMostOneZero (x1, x2, . . . , xn) (x1 ∨ x2) ∧ (x9 ∨ x10) ∧ (x8 ∨ x10) ∧ (x7 ∨ x10) ∧ (x6 ∨ x10) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x8 ∨ x9) ∧ (x7 ∨ x9) ∧ (x6 ∨ x9) ∧ (x1 ∨ x4) ∧ (x2 ∨ x4) ∧ (x3 ∨ x4) ∧ (x7 ∨ x8) ∧ (x6 ∨ x8) ∧ (x1 ∨ x5) ∧ (x2 ∨ x5) ∧ (x3 ∨ x5) ∧ (x4 ∨ x5) ∧ (x6 ∨ x7) ∧ (x1 ∨ y) ∧ (x2 ∨ y) ∧ (x3 ∨ y) ∧ (x4 ∨ y) ∧ (x5 ∨ y) ∧ (x6 ∨ ¯ y) ∧ (x7 ∨ ¯ y) ∧ (x8 ∨ ¯ y) ∧ (x9 ∨ ¯ y) ∧ (x10 ∨ ¯ y) Replace matched pattern (x1 ∨ z) ∧ (x2 ∨ z) ∧ (x3 ∨ z) ∧ (x4 ∨ ¯ z) ∧ (x5 ∨ ¯ z) ∧ (y ∨ ¯ z)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 21 / 42

slide-49
SLIDE 49

Bounded Variable Addition

Bounded Variable Addition on AtMostOneZero (3) Example encoding of AtMostOneZero (x1, x2, . . . , xn) (x1 ∨ x2) ∧ (x9 ∨ x10) ∧ (x8 ∨ x10) ∧ (x7 ∨ x10) ∧ (x6 ∨ x10) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x8 ∨ x9) ∧ (x7 ∨ x9) ∧ (x6 ∨ x9) ∧ (x1 ∨ z) ∧ (x2 ∨ z) ∧ (x3 ∨ z) ∧ (x7 ∨ x8) ∧ (x6 ∨ x8) ∧ (x4 ∨ ¯ z) ∧ (x5 ∨ ¯ z) ∧ (y ∨ ¯ z) ∧ (x4 ∨ x5) ∧ (x6 ∨ x7) ∧ (x4 ∨ y) ∧ (x5 ∨ y) ∧ (x6 ∨ ¯ y) ∧ (x7 ∨ ¯ y) ∧ (x8 ∨ ¯ y) (x9 ∨ ¯ y) ∧ (x10 ∨ ¯ y)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 22 / 42

slide-50
SLIDE 50

Bounded Variable Addition

Bounded Variable Addition on AtMostOneZero (3) Example encoding of AtMostOneZero (x1, x2, . . . , xn) (x1 ∨ x2) ∧ (x9 ∨ x10) ∧ (x8 ∨ x10) ∧ (x7 ∨ x10) ∧ (x6 ∨ x10) ∧ (x1 ∨ x3) ∧ (x2 ∨ x3) ∧ (x8 ∨ x9) ∧ (x7 ∨ x9) ∧ (x6 ∨ x9) ∧ (x1 ∨ z) ∧ (x2 ∨ z) ∧ (x3 ∨ z) ∧ (x7 ∨ x8) ∧ (x6 ∨ x8) ∧ (x4 ∨ ¯ z) ∧ (x5 ∨ ¯ z) ∧ (y ∨ ¯ z) ∧ (x4 ∨ x5) ∧ (x6 ∨ x7) ∧ (x4 ∨ y) ∧ (x5 ∨ y) ∧ (x6 ∨ ¯ y) ∧ (x7 ∨ ¯ y) ∧ (x8 ∨ ¯ y) (x9 ∨ ¯ y) ∧ (x10 ∨ ¯ y) Replace matched pattern (x6 ∨ w) ∧ (x7 ∨ w) ∧ (x8 ∨ w) ∧ (x9 ∨ ¯ w) ∧ (x10 ∨ ¯ w) ∧ (¯ y ∨ ¯ w)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 22 / 42

slide-51
SLIDE 51

Blocked Clause Elimination

Blocked Clause Elimination

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 23 / 42

slide-52
SLIDE 52

Blocked Clause Elimination

Blocked Clauses [Kullmann’99]

Definition (Blocking literal) A literal l in a clause C of a CNF F blocks C w.r.t. F if for every clause D ∈ F with ¯ l ∈ D, the resolvent (C \ {l}) ∪ (D \ {¯ l}) obtained from resolving C and D on l is a tautology. With respect to a fixed CNF and its clauses we have: Definition (Blocked clause) A clause is blocked if it contains a literal that blocks it.

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 24 / 42

slide-53
SLIDE 53

Blocked Clause Elimination

Blocked Clauses [Kullmann’99]

Definition (Blocking literal) A literal l in a clause C of a CNF F blocks C w.r.t. F if for every clause D ∈ F with ¯ l ∈ D, the resolvent (C \ {l}) ∪ (D \ {¯ l}) obtained from resolving C and D on l is a tautology. With respect to a fixed CNF and its clauses we have: Definition (Blocked clause) A clause is blocked if it contains a literal that blocks it. Example Consider the formula (a ∨ b) ∧ (a ∨ ¯ b ∨ ¯ c) ∧ (¯ a ∨ c). First clause is not blocked. Second clause is blocked by both a and ¯

  • c. Third clause is blocked by c

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 24 / 42

slide-54
SLIDE 54

Blocked Clause Elimination

Blocked Clauses [Kullmann’99]

Definition (Blocking literal) A literal l in a clause C of a CNF F blocks C w.r.t. F if for every clause D ∈ F with ¯ l ∈ D, the resolvent (C \ {l}) ∪ (D \ {¯ l}) obtained from resolving C and D on l is a tautology. With respect to a fixed CNF and its clauses we have: Definition (Blocked clause) A clause is blocked if it contains a literal that blocks it. Example Consider the formula (a ∨ b) ∧ (a ∨ ¯ b ∨ ¯ c) ∧ (¯ a ∨ c). First clause is not blocked. Second clause is blocked by both a and ¯

  • c. Third clause is blocked by c

Proposition Removal of an arbitrary blocked clause preserves satisfiability.

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 24 / 42

slide-55
SLIDE 55

Blocked Clause Elimination

Blocked Clause Elimination (BCE)

Definition (BCE) While there is a blocked clause C in a CNF F, remove C from F. Example Consider (a ∨ b) ∧ (a ∨ ¯ b ∨ ¯ c) ∧ (¯ a ∨ c). After removing either (a ∨ ¯ b ∨ ¯ c) or (¯ a ∨ c), the clause (a ∨ b) becomes blocked (no clause with either ¯ b or ¯ a). An extreme case in which BCE removes all clauses of a formula!

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 25 / 42

slide-56
SLIDE 56

Blocked Clause Elimination

Blocked Clause Elimination (BCE)

Definition (BCE) While there is a blocked clause C in a CNF F, remove C from F. Example Consider (a ∨ b) ∧ (a ∨ ¯ b ∨ ¯ c) ∧ (¯ a ∨ c). After removing either (a ∨ ¯ b ∨ ¯ c) or (¯ a ∨ c), the clause (a ∨ b) becomes blocked (no clause with either ¯ b or ¯ a). An extreme case in which BCE removes all clauses of a formula! Proposition BCE is confluent, i.e., has a unique fixpoint Blocked clauses stay blocked w.r.t. removal

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 25 / 42

slide-57
SLIDE 57

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-58
SLIDE 58

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-59
SLIDE 59

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-60
SLIDE 60

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-61
SLIDE 61

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-62
SLIDE 62

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-63
SLIDE 63

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-64
SLIDE 64

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-65
SLIDE 65

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-66
SLIDE 66

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-67
SLIDE 67

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-68
SLIDE 68

Blocked Clause Elimination

BCE very effective on circuits [J¨

arvisaloBiereHeule’10]

BCE converts the Tseitin encoding to Plaisted Greenbaum BCE simulates Pure literal elimination, Cone of influence and much more Example of circuit simplification by BCE on Tseitin encoding

(c1) (¯ c1 ∨ t1 ∨ ¯ t2) (c1 ∨ ¯ t1) (c1 ∨ t2) (¯

  • 0 ∨ t3 ∨ c0)

  • 0 ∨ ¯

t3 ∨ ¯ c0) (o0 ∨ t3 ∨ ¯ c0) (o0 ∨ ¯ t3 ∨ c0) (t1 ∨ ¯ t3 ∨ ¯ c0) (¯ t1 ∨ t3) (¯ t1 ∨ c0) (t2 ∨ ¯ a0 ∨ ¯ b0) (¯ t2 ∨ a0) (¯ t2 ∨ b0) (¯ t3 ∨ a0 ∨ b0) (¯ t3 ∨ ¯ a0 ∨ ¯ b0) (t3 ∨ a0 ∨ ¯ b0) (t3 ∨ ¯ a0 ∨ b0)

a0 b0 c0 and xor

  • r

and xor t3 t2

c1 t1 t ¬

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 26 / 42

slide-69
SLIDE 69

Hyper Binary Resolution

Hyper Binary Resolution

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 27 / 42

slide-70
SLIDE 70

Hyper Binary Resolution

Hyper Binary Resolution [Bacchus-AAAI02]

Definition (Hyper Binary Resolution Rule) (l ∨ l1 ∨ l2 ∨ · · · ∨ ln) (¯ l1 ∨ l′) (¯ l2 ∨ l′) . . . (¯ ln ∨ l′) (l ∨ l′) binary edge hyper edge hyper binary edge ¯ l′ l ¯ l1 . . . ¯ l2 ¯ ln l′ ¯ l Hyper Binary Resolution Rule: combines multiple resolution steps into one uses one n-ary clauses and multiple binary clauses special case hyper unary resolution where l = l′

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 28 / 42

slide-71
SLIDE 71

Hyper Binary Resolution

Hyper Binary Resolution (HBR)

Definition (Hyper Binary Resolution) Apply the hyper binary resolution rule until fixpoint Example Consider (¯ a ∨ b) ∧ (¯ a∨ c) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ d) ∧ (¯ c ∨ e) ∧ ( ¯ d ∨ ¯ e ∨ f ). a b c d e f hyper binary resolvents: (¯ a ∨ f ), (¯ b ∨ f ), (¯ c ∨ f ) HBR is confluent, i.e., has a unique fixpoint

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 29 / 42

slide-72
SLIDE 72

Hyper Binary Resolution

Structural Hashing of AND-gates via HBR

gate g g ⇒ f (g1, . . . gn) g ⇐ f (g1, . . . gn) “positive” “negative” g := or(g1, . . . , gn) (¯ g ∨ g1 ∨ · · · ∨ gn) (g ∨ ¯ g1),. . . ,(g ∨ ¯ gn) g := and(g1, . . . , gn) (¯ g ∨ g1),. . . ,(¯ g ∨ gn) (g ∨ ¯ g1 ∨ · · · ∨ ¯ gn) g := xor(g1, g2) (¯ g ∨ ¯ g1 ∨ ¯ g2), (¯ g ∨ g1 ∨ g2) (g ∨ ¯ g1 ∨ g2), (g ∨ g1 ∨ ¯ g2) g := ite(g1, g2, g3) (¯ g ∨ ¯ g1 ∨ g2), (¯ g ∨ g1 ∨ g3) (g ∨ ¯ g1 ∨ ¯ g2), (g ∨ g1 ∨ ¯ g3)

Definition (Structural Hashing of AND-gates) Given a Boolean circuit with two equivalent gates, merge the gates. Example x a b y x = AND(a,b) : (¯ x ∨ a) ∧ (¯ x ∨ b) ∧ (x ∨ ¯ a ∨ ¯ b) y = AND(a,b) : (¯ y ∨ a) ∧ (¯ y ∨ b) ∧ (y ∨ ¯ a ∨ ¯ b) the two HBRs (¯ x ∨ y) and (x ∨ ¯ y) express that x = y

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 30 / 42

slide-73
SLIDE 73

Hyper Binary Resolution

Non-transitive Hyper Binary Resolution (NHBR)

A problem with classic HBR is that it adds many transitive binary clauses Example Consider (¯ a ∨ b) ∧ (¯ a∨ c) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ d) ∧ (¯ c ∨ e) ∧ ( ¯ d ∨ ¯ e ∨ f ). a b c d e f adding (¯ b ∨ f ) or (¯ c ∨ f ) makes (¯ a ∨ f ) transitive Solution [HeuleJ¨ arvisaloBiere 2013] Add only non-transitive hyper binary resolvents Can be implemented using an alternative unit propagation style

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 31 / 42

slide-74
SLIDE 74

Hyper Binary Resolution

Space Complexity of NHBR: Quadratic

Question regarding complexity [Biere 2009] Are there formulas where the transitively reduced hyper binary resolution closure is quadratic in size w.r.t. to the size of the original? where size = #clauses or size = #literals or size = #variables

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 32 / 42

slide-75
SLIDE 75

Hyper Binary Resolution

Space Complexity of NHBR: Quadratic

Question regarding complexity [Biere 2009] Are there formulas where the transitively reduced hyper binary resolution closure is quadratic in size w.r.t. to the size of the original? where size = #clauses or size = #literals or size = #variables Yes! Consider the formula Fn =

1≤i≤n

xi ∨ v) ∧ (¯ xi ∨ w) ∧ (¯ v ∨ ¯ w ∨ yi)

  • x1

x2 . . . xn v w y1 y2 . . . yn #variables: 2n + 2 #clauses: 3n #literals: 7n

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 32 / 42

slide-76
SLIDE 76

Hyper Binary Resolution

Space Complexity of NHBR: Quadratic

Question regarding complexity [Biere 2009] Are there formulas where the transitively reduced hyper binary resolution closure is quadratic in size w.r.t. to the size of the original? where size = #clauses or size = #literals or size = #variables Yes! Consider the formula Fn =

1≤i≤n

xi ∨ v) ∧ (¯ xi ∨ w) ∧ (¯ v ∨ ¯ w ∨ yi)

  • x1

x2 . . . xn v w y1 y2 . . . yn #variables: 2n + 2 #clauses: 3n #literals: 7n n2 hyper binary resolvents: (¯ xi ∨ yj) for 1 ≤ i, j ≤ n

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 32 / 42

slide-77
SLIDE 77

Unhiding Redundancy

Unhiding Redundancy

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 33 / 42

slide-78
SLIDE 78

Unhiding Redundancy

Redundancy Redundant clauses:

Removal of C ∈ F preserves unsatisfiability of F Assign all l ∈ C to false and check for a conflict in F \ {C}

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 34 / 42

slide-79
SLIDE 79

Unhiding Redundancy

Redundancy Redundant clauses:

Removal of C ∈ F preserves unsatisfiability of F Assign all l ∈ C to false and check for a conflict in F \ {C}

Redundant literals:

Removal of l ∈ C preserves satisfiability of F Assign all l ′ ∈ C \ {l} to false and check for a conflict in F

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 34 / 42

slide-80
SLIDE 80

Unhiding Redundancy

Redundancy Redundant clauses:

Removal of C ∈ F preserves unsatisfiability of F Assign all l ∈ C to false and check for a conflict in F \ {C}

Redundant literals:

Removal of l ∈ C preserves satisfiability of F Assign all l ′ ∈ C \ {l} to false and check for a conflict in F

Redundancy elimination during pre- and in-processing

Distillation [JinSomenzi2005] ReVivAl [PietteHamadiSa¨ ıs2008] Unhiding [HeuleJ¨ arvisaloBiere2011]

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 34 / 42

slide-81
SLIDE 81

Unhiding Redundancy

Unhide: Binary implication graph (BIG)

unhide: use the binary clauses to detect redundant clauses and literals a b c d e f g h ¯ a ¯ b ¯ c ¯ d ¯ e ¯ f ¯ g ¯ h (¯ a ∨ c) ∧ (¯ a ∨ d) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ f ) ∧ ( ¯ d ∨ f ) ∧ (¯ g ∨ f ) ∧ (¯ f ∨ h) ∧ (¯ g ∨ h) ∧ (¯ a ∨ ¯ e ∨ h) ∧ (¯ b ∨ ¯ c ∨ h) ∧ (a ∨ b ∨ c ∨ d ∨ e ∨ f ∨ g ∨ h)

  • non binary clauses

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 35 / 42

slide-82
SLIDE 82

Unhiding Redundancy

Unhide: Transitive reduction (TRD)

transitive reduction: remove shortcuts in the binary implication graph a b c d e f g h ¯ a ¯ b ¯ c ¯ d ¯ e ¯ f ¯ g ¯ h (¯ a ∨ c) ∧ (¯ a ∨ d) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ f ) ∧ ( ¯ d ∨ f ) ∧ (¯ g ∨ f ) ∧ (¯ f ∨ h) ∧ TRD

g → f → h

(¯ g ∨ h) ∧ (¯ a ∨ ¯ e ∨ h) ∧ (¯ b ∨ ¯ c ∨ h) ∧ (a ∨ b ∨ c ∨ d ∨ e ∨ f ∨ g ∨ h)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 36 / 42

slide-83
SLIDE 83

Unhiding Redundancy

Unhide: Hidden tautology elimination (HTE) (1)

HTE removes clauses that are subsumed by an implication in BIG a b c d e f g h ¯ a ¯ b ¯ c ¯ d ¯ e ¯ f ¯ g ¯ h (¯ a ∨ c) ∧ (¯ a ∨ d) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ f ) ∧ ( ¯ d ∨ f ) ∧ (¯ g ∨ f ) ∧ (¯ f ∨ h) ∧ HTE

a → d → f → h

(¯ a ∨ ¯ e ∨ h) ∧ (¯ b ∨ ¯ c ∨ h) ∧ (a ∨ b ∨ c ∨ d ∨ e ∨ f ∨ g ∨ h)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 37 / 42

slide-84
SLIDE 84

Unhiding Redundancy

Unhide: Hidden tautology elimination (HTE) (2)

HTE removes clauses that are subsumed by an implication in BIG a b c d e f g h ¯ a ¯ b ¯ c ¯ d ¯ e ¯ f ¯ g ¯ h (¯ a ∨ c) ∧ (¯ a ∨ d) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ f ) ∧ ( ¯ d ∨ f ) ∧ (¯ g ∨ f ) ∧ (¯ f ∨ h) ∧ HTE

c → f → h

(¯ b ∨ ¯ c ∨ h) ∧ (a ∨ b ∨ c ∨ d ∨ e ∨ f ∨ g ∨ h)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 38 / 42

slide-85
SLIDE 85

Unhiding Redundancy

Unhide: Hidden literal elimination (HLE)

HLE removes literal using the implication in BIG a b c d e f g h ¯ a ¯ b ¯ c ¯ d ¯ e ¯ f ¯ g ¯ h (¯ a ∨ c) ∧ (¯ a ∨ d) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ f ) ∧ ( ¯ d ∨ f ) ∧ (¯ g ∨ f ) ∧ (¯ f ∨ h) ∧ HLE

all but e imply h

also b implies e

(a ∨ b ∨ c ∨ d ∨ e ∨ f ∨ g ∨ h)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 39 / 42

slide-86
SLIDE 86

Unhiding Redundancy

Unhide: TRD + HTE + HLE

unhide: redundancy elimination removes and adds arcs from BIG(F) a b c d e f g h ¯ a ¯ b ¯ c ¯ d ¯ e ¯ f ¯ g ¯ h (¯ a ∨ c) ∧ (¯ a ∨ d) ∧ (¯ b ∨ d) ∧ (¯ b ∨ e) ∧ (¯ c ∨ f ) ∧ ( ¯ d ∨ f ) ∧ (¯ g ∨ f ) ∧ (¯ f ∨ h) ∧ (e ∨ h)

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 40 / 42

slide-87
SLIDE 87

Unhiding Redundancy

Conclusions Many pre- or in-processing techniques in SAT solvers: (Self-)Subsumption Variable Elimination Blocked Clause Elimination Hyper Binary Resolution Bounded Variable Addition Equivalent Literal Substitution Failed Literal Elimination Autarky Reasoning ...

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 41 / 42

slide-88
SLIDE 88

Unhiding Redundancy

Prepocessing

Marijn J.H. Heule The University of Texas at Austin July 5, 2013

M.J.H. Heule (UT Austin) Prepocessing July 5, 2013 42 / 42