199
ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL Vijay Ganesh (Original notes from Isil Dillig) Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 1/39

ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

ECE750T-28:Computer-aided Reasoning for Software Engineering

Lecture 2:Normal Forms and DPLL

Vijay Ganesh(Original notes from Isil Dillig)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 1/39

Page 2: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Overview

I Last lecture:

I Two simple techniques for proving satisfiability and validity in propositionallogic: truth tables and semantic argument

I Neither very useful for practical automated reasoning

I This Lecture:

I An algorithm called DPLL for determining satisfiability

I Many SAT solvers used today based on DPLL (more precisely,conflict-driven clause-learning)

I However, requires converting formulas to a respresentation called normalforms

I The plan: First talk about normal forms, then discuss DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 2/39

Page 3: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Overview

I Last lecture:

I Two simple techniques for proving satisfiability and validity in propositionallogic: truth tables and semantic argument

I Neither very useful for practical automated reasoning

I This Lecture:

I An algorithm called DPLL for determining satisfiability

I Many SAT solvers used today based on DPLL (more precisely,conflict-driven clause-learning)

I However, requires converting formulas to a respresentation called normalforms

I The plan: First talk about normal forms, then discuss DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 2/39

Page 4: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Overview

I Last lecture:

I Two simple techniques for proving satisfiability and validity in propositionallogic: truth tables and semantic argument

I Neither very useful for practical automated reasoning

I This Lecture:

I An algorithm called DPLL for determining satisfiability

I Many SAT solvers used today based on DPLL (more precisely,conflict-driven clause-learning)

I However, requires converting formulas to a respresentation called normalforms

I The plan: First talk about normal forms, then discuss DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 2/39

Page 5: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Overview

I Last lecture:

I Two simple techniques for proving satisfiability and validity in propositionallogic: truth tables and semantic argument

I Neither very useful for practical automated reasoning

I This Lecture:

I An algorithm called DPLL for determining satisfiability

I Many SAT solvers used today based on DPLL (more precisely,conflict-driven clause-learning)

I However, requires converting formulas to a respresentation called normalforms

I The plan: First talk about normal forms, then discuss DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 2/39

Page 6: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Overview

I Last lecture:

I Two simple techniques for proving satisfiability and validity in propositionallogic: truth tables and semantic argument

I Neither very useful for practical automated reasoning

I This Lecture:

I An algorithm called DPLL for determining satisfiability

I Many SAT solvers used today based on DPLL (more precisely,conflict-driven clause-learning)

I However, requires converting formulas to a respresentation called normalforms

I The plan: First talk about normal forms, then discuss DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 2/39

Page 7: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Overview

I Last lecture:

I Two simple techniques for proving satisfiability and validity in propositionallogic: truth tables and semantic argument

I Neither very useful for practical automated reasoning

I This Lecture:

I An algorithm called DPLL for determining satisfiability

I Many SAT solvers used today based on DPLL (more precisely,conflict-driven clause-learning)

I However, requires converting formulas to a respresentation called normalforms

I The plan: First talk about normal forms, then discuss DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 2/39

Page 8: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Normal Forms

I A normal form of a formula F is another formula F ′ such that F isequivalent to F ′, but F ′ obeys certain syntactic restrictions.

I There are three kinds of normal forms that are interesting in propositionallogic:

I Negation Normal Form (NNF)

I Disjunctive Normal Form (DNF)

I Conjunctive Normal Form (CNF)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 3/39

Page 9: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Normal Forms

I A normal form of a formula F is another formula F ′ such that F isequivalent to F ′, but F ′ obeys certain syntactic restrictions.

I There are three kinds of normal forms that are interesting in propositionallogic:

I Negation Normal Form (NNF)

I Disjunctive Normal Form (DNF)

I Conjunctive Normal Form (CNF)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 3/39

Page 10: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Normal Forms

I A normal form of a formula F is another formula F ′ such that F isequivalent to F ′, but F ′ obeys certain syntactic restrictions.

I There are three kinds of normal forms that are interesting in propositionallogic:

I Negation Normal Form (NNF)

I Disjunctive Normal Form (DNF)

I Conjunctive Normal Form (CNF)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 3/39

Page 11: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Normal Forms

I A normal form of a formula F is another formula F ′ such that F isequivalent to F ′, but F ′ obeys certain syntactic restrictions.

I There are three kinds of normal forms that are interesting in propositionallogic:

I Negation Normal Form (NNF)

I Disjunctive Normal Form (DNF)

I Conjunctive Normal Form (CNF)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 3/39

Page 12: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Normal Forms

I A normal form of a formula F is another formula F ′ such that F isequivalent to F ′, but F ′ obeys certain syntactic restrictions.

I There are three kinds of normal forms that are interesting in propositionallogic:

I Negation Normal Form (NNF)

I Disjunctive Normal Form (DNF)

I Conjunctive Normal Form (CNF)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 3/39

Page 13: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Normal Forms

I A normal form of a formula F is another formula F ′ such that F isequivalent to F ′, but F ′ obeys certain syntactic restrictions.

I There are three kinds of normal forms that are interesting in propositionallogic:

I Negation Normal Form (NNF)

I Disjunctive Normal Form (DNF)

I Conjunctive Normal Form (CNF)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 3/39

Page 14: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF?

Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 15: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF?

Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 16: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF?

Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 17: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF?

Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 18: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF?

Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 19: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF? Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 20: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF? Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))?

No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 21: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF? Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))? No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 22: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF? Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))? No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))?

No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 23: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Negation Normal Form (NNF)

Negation Normal Form requires two syntactic restrictions:

I The only logical connectives are ¬,∧,∨ (i.e., no →, ↔)

I Negations appear only in literals

I i.e., negations not allowed inside ∧, ∨, or any other ¬

I i.e., negations can only appear in front of variables

I Is formula p ∨ (¬q ∧ (r ∨ ¬s)) in NNF? Yes!

I What about p ∨ (¬q ∧ ¬(¬r ∧ s))? No!

I What about p ∨ (¬q ∧ (¬¬r ∨ ¬s))? No!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 4/39

Page 24: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF I

I To make sure the only logical connectives are ¬,∧,∨, need to eliminate →and ↔

I How do we express F1 → F2 using ∨,∧,¬?

F1 → F2 ⇔ ¬F1 ∨ F2

I How do we express F1 ↔ F2 using only ¬,∧.∨?

F1 ↔ F2 ⇔ (¬F1 ∨ F2) ∧ (¬F2 ∨ F1)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 5/39

Page 25: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF I

I To make sure the only logical connectives are ¬,∧,∨, need to eliminate →and ↔

I How do we express F1 → F2 using ∨,∧,¬?

F1 → F2 ⇔ ¬F1 ∨ F2

I How do we express F1 ↔ F2 using only ¬,∧.∨?

F1 ↔ F2 ⇔ (¬F1 ∨ F2) ∧ (¬F2 ∨ F1)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 5/39

Page 26: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF I

I To make sure the only logical connectives are ¬,∧,∨, need to eliminate →and ↔

I How do we express F1 → F2 using ∨,∧,¬?

F1 → F2 ⇔ ¬F1 ∨ F2

I How do we express F1 ↔ F2 using only ¬,∧.∨?

F1 ↔ F2 ⇔ (¬F1 ∨ F2) ∧ (¬F2 ∨ F1)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 5/39

Page 27: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF I

I To make sure the only logical connectives are ¬,∧,∨, need to eliminate →and ↔

I How do we express F1 → F2 using ∨,∧,¬?

F1 → F2 ⇔ ¬F1 ∨ F2

I How do we express F1 ↔ F2 using only ¬,∧.∨?

F1 ↔ F2 ⇔ (¬F1 ∨ F2) ∧ (¬F2 ∨ F1)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 5/39

Page 28: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF I

I To make sure the only logical connectives are ¬,∧,∨, need to eliminate →and ↔

I How do we express F1 → F2 using ∨,∧,¬?

F1 → F2 ⇔ ¬F1 ∨ F2

I How do we express F1 ↔ F2 using only ¬,∧.∨?

F1 ↔ F2 ⇔ (¬F1 ∨ F2) ∧ (¬F2 ∨ F1)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 5/39

Page 29: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF II

I Also need to ensure negations appear only in literals: push negations in

I Use DeMorgan’s laws to distribute ¬ over ∧ and ∨:

¬(F1 ∧ F2)⇔ ¬F1 ∨ ¬F2

¬(F1 ∨ F2)⇔ ¬F1 ∧ ¬F2

I We also disallow double negations:

¬¬F ⇔ F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 6/39

Page 30: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF II

I Also need to ensure negations appear only in literals: push negations in

I Use DeMorgan’s laws to distribute ¬ over ∧ and ∨:

¬(F1 ∧ F2)⇔ ¬F1 ∨ ¬F2

¬(F1 ∨ F2)⇔ ¬F1 ∧ ¬F2

I We also disallow double negations:

¬¬F ⇔ F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 6/39

Page 31: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF II

I Also need to ensure negations appear only in literals: push negations in

I Use DeMorgan’s laws to distribute ¬ over ∧ and ∨:

¬(F1 ∧ F2)⇔ ¬F1 ∨ ¬F2

¬(F1 ∨ F2)⇔ ¬F1 ∧ ¬F2

I We also disallow double negations:

¬¬F ⇔ F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 6/39

Page 32: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF II

I Also need to ensure negations appear only in literals: push negations in

I Use DeMorgan’s laws to distribute ¬ over ∧ and ∨:

¬(F1 ∧ F2)⇔ ¬F1 ∨ ¬F2

¬(F1 ∨ F2)⇔ ¬F1 ∧ ¬F2

I We also disallow double negations:

¬¬F ⇔ F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 6/39

Page 33: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF II

I Also need to ensure negations appear only in literals: push negations in

I Use DeMorgan’s laws to distribute ¬ over ∧ and ∨:

¬(F1 ∧ F2)⇔ ¬F1 ∨ ¬F2

¬(F1 ∨ F2)⇔ ¬F1 ∧ ¬F2

I We also disallow double negations:

¬¬F ⇔ F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 6/39

Page 34: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to NNF II

I Also need to ensure negations appear only in literals: push negations in

I Use DeMorgan’s laws to distribute ¬ over ∧ and ∨:

¬(F1 ∧ F2)⇔ ¬F1 ∨ ¬F2

¬(F1 ∨ F2)⇔ ¬F1 ∧ ¬F2

I We also disallow double negations:

¬¬F ⇔ F

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 6/39

Page 35: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

NNF Example

Convert F : ¬(p → (p ∧ q)) to NNF

F1 : ¬(¬p ∨ (p ∧ q))F2 : ¬¬p ∧ ¬(p ∧ q)F3 : ¬¬p ∧ (¬p ∨ ¬q)F4 : p ∧ (¬p ∨ ¬q)

F4 is equivalent to F and is in NNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 7/39

Page 36: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

NNF Example

Convert F : ¬(p → (p ∧ q)) to NNF

F1 : ¬(¬p ∨ (p ∧ q))

F2 : ¬¬p ∧ ¬(p ∧ q)F3 : ¬¬p ∧ (¬p ∨ ¬q)F4 : p ∧ (¬p ∨ ¬q)

F4 is equivalent to F and is in NNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 7/39

Page 37: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

NNF Example

Convert F : ¬(p → (p ∧ q)) to NNF

F1 : ¬(¬p ∨ (p ∧ q))F2 : ¬¬p ∧ ¬(p ∧ q)

F3 : ¬¬p ∧ (¬p ∨ ¬q)F4 : p ∧ (¬p ∨ ¬q)

F4 is equivalent to F and is in NNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 7/39

Page 38: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

NNF Example

Convert F : ¬(p → (p ∧ q)) to NNF

F1 : ¬(¬p ∨ (p ∧ q))F2 : ¬¬p ∧ ¬(p ∧ q)F3 : ¬¬p ∧ (¬p ∨ ¬q)

F4 : p ∧ (¬p ∨ ¬q)

F4 is equivalent to F and is in NNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 7/39

Page 39: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

NNF Example

Convert F : ¬(p → (p ∧ q)) to NNF

F1 : ¬(¬p ∨ (p ∧ q))F2 : ¬¬p ∧ ¬(p ∧ q)F3 : ¬¬p ∧ (¬p ∨ ¬q)F4 : p ∧ (¬p ∨ ¬q)

F4 is equivalent to F and is in NNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 7/39

Page 40: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

NNF Example

Convert F : ¬(p → (p ∧ q)) to NNF

F1 : ¬(¬p ∨ (p ∧ q))F2 : ¬¬p ∧ ¬(p ∧ q)F3 : ¬¬p ∧ (¬p ∨ ¬q)F4 : p ∧ (¬p ∨ ¬q)

F4 is equivalent to F and is in NNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 7/39

Page 41: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Disjunctive Normal Form (DNF)

I A formula in disjunctive normal form is a disjunction of conjunction ofliterals. ∨

i

∧j

`i,j for literals `i,j

I i.e., ∨ can never appear inside ∧ or ¬

I Called disjunctive normal form because disjuncts are at the outer level

I Each inner conjunction is called a clause

I Question: If a formula is in DNF, is it also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 8/39

Page 42: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Disjunctive Normal Form (DNF)

I A formula in disjunctive normal form is a disjunction of conjunction ofliterals. ∨

i

∧j

`i,j for literals `i,j

I i.e., ∨ can never appear inside ∧ or ¬

I Called disjunctive normal form because disjuncts are at the outer level

I Each inner conjunction is called a clause

I Question: If a formula is in DNF, is it also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 8/39

Page 43: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Disjunctive Normal Form (DNF)

I A formula in disjunctive normal form is a disjunction of conjunction ofliterals. ∨

i

∧j

`i,j for literals `i,j

I i.e., ∨ can never appear inside ∧ or ¬

I Called disjunctive normal form because disjuncts are at the outer level

I Each inner conjunction is called a clause

I Question: If a formula is in DNF, is it also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 8/39

Page 44: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Disjunctive Normal Form (DNF)

I A formula in disjunctive normal form is a disjunction of conjunction ofliterals. ∨

i

∧j

`i,j for literals `i,j

I i.e., ∨ can never appear inside ∧ or ¬

I Called disjunctive normal form because disjuncts are at the outer level

I Each inner conjunction is called a clause

I Question: If a formula is in DNF, is it also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 8/39

Page 45: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Disjunctive Normal Form (DNF)

I A formula in disjunctive normal form is a disjunction of conjunction ofliterals. ∨

i

∧j

`i,j for literals `i,j

I i.e., ∨ can never appear inside ∧ or ¬

I Called disjunctive normal form because disjuncts are at the outer level

I Each inner conjunction is called a clause

I Question: If a formula is in DNF, is it also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 8/39

Page 46: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to DNF

I To convert formula to DNF, first convert it to NNF.

I Then, distribute ∧ over ∨:

(F1 ∨ F2) ∧ F3 ⇔ (F1 ∧ F3) ∨ (F2 ∧ F3)

F1 ∧ (F2 ∨ F3) ⇔ (F1 ∧ F2) ∨ (F1 ∧ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 9/39

Page 47: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to DNF

I To convert formula to DNF, first convert it to NNF.

I Then, distribute ∧ over ∨:

(F1 ∨ F2) ∧ F3 ⇔ (F1 ∧ F3) ∨ (F2 ∧ F3)

F1 ∧ (F2 ∨ F3) ⇔ (F1 ∧ F2) ∨ (F1 ∧ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 9/39

Page 48: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to DNF

I To convert formula to DNF, first convert it to NNF.

I Then, distribute ∧ over ∨:

(F1 ∨ F2) ∧ F3

⇔ (F1 ∧ F3) ∨ (F2 ∧ F3)

F1 ∧ (F2 ∨ F3) ⇔ (F1 ∧ F2) ∨ (F1 ∧ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 9/39

Page 49: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to DNF

I To convert formula to DNF, first convert it to NNF.

I Then, distribute ∧ over ∨:

(F1 ∨ F2) ∧ F3 ⇔ (F1 ∧ F3) ∨ (F2 ∧ F3)

F1 ∧ (F2 ∨ F3) ⇔ (F1 ∧ F2) ∨ (F1 ∧ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 9/39

Page 50: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to DNF

I To convert formula to DNF, first convert it to NNF.

I Then, distribute ∧ over ∨:

(F1 ∨ F2) ∧ F3 ⇔ (F1 ∧ F3) ∨ (F2 ∧ F3)

F1 ∧ (F2 ∨ F3)

⇔ (F1 ∧ F2) ∨ (F1 ∧ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 9/39

Page 51: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to DNF

I To convert formula to DNF, first convert it to NNF.

I Then, distribute ∧ over ∨:

(F1 ∨ F2) ∧ F3 ⇔ (F1 ∧ F3) ∨ (F2 ∧ F3)

F1 ∧ (F2 ∨ F3) ⇔ (F1 ∧ F2) ∨ (F1 ∧ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 9/39

Page 52: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

Convert F : (q1 ∨ ¬¬q2) ∧ (¬r1 → r2) into DNF

F1 : (q1 ∨ ¬¬q2) ∧ (¬¬r1 ∨ r2) remove→F2 : (q1 ∨ q2) ∧ (r1 ∨ r2) in NNFF3 : (q1 ∧ (r1 ∨ r2)) ∨ (q2 ∧ (r1 ∨ r2)) distF4 : (q1 ∧ r1) ∨ (q1 ∧ r2) ∨ (q2 ∧ r1) ∨ (q2 ∧ r2) dist

F4 equivalent to F and is in DNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 10/39

Page 53: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

Convert F : (q1 ∨ ¬¬q2) ∧ (¬r1 → r2) into DNF

F1 : (q1 ∨ ¬¬q2) ∧ (¬¬r1 ∨ r2) remove→

F2 : (q1 ∨ q2) ∧ (r1 ∨ r2) in NNFF3 : (q1 ∧ (r1 ∨ r2)) ∨ (q2 ∧ (r1 ∨ r2)) distF4 : (q1 ∧ r1) ∨ (q1 ∧ r2) ∨ (q2 ∧ r1) ∨ (q2 ∧ r2) dist

F4 equivalent to F and is in DNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 10/39

Page 54: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

Convert F : (q1 ∨ ¬¬q2) ∧ (¬r1 → r2) into DNF

F1 : (q1 ∨ ¬¬q2) ∧ (¬¬r1 ∨ r2) remove→F2 : (q1 ∨ q2) ∧ (r1 ∨ r2) in NNF

F3 : (q1 ∧ (r1 ∨ r2)) ∨ (q2 ∧ (r1 ∨ r2)) distF4 : (q1 ∧ r1) ∨ (q1 ∧ r2) ∨ (q2 ∧ r1) ∨ (q2 ∧ r2) dist

F4 equivalent to F and is in DNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 10/39

Page 55: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

Convert F : (q1 ∨ ¬¬q2) ∧ (¬r1 → r2) into DNF

F1 : (q1 ∨ ¬¬q2) ∧ (¬¬r1 ∨ r2) remove→F2 : (q1 ∨ q2) ∧ (r1 ∨ r2) in NNFF3 : (q1 ∧ (r1 ∨ r2)) ∨ (q2 ∧ (r1 ∨ r2)) dist

F4 : (q1 ∧ r1) ∨ (q1 ∧ r2) ∨ (q2 ∧ r1) ∨ (q2 ∧ r2) dist

F4 equivalent to F and is in DNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 10/39

Page 56: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

Convert F : (q1 ∨ ¬¬q2) ∧ (¬r1 → r2) into DNF

F1 : (q1 ∨ ¬¬q2) ∧ (¬¬r1 ∨ r2) remove→F2 : (q1 ∨ q2) ∧ (r1 ∨ r2) in NNFF3 : (q1 ∧ (r1 ∨ r2)) ∨ (q2 ∧ (r1 ∨ r2)) distF4 : (q1 ∧ r1) ∨ (q1 ∧ r2) ∨ (q2 ∧ r1) ∨ (q2 ∧ r2) dist

F4 equivalent to F and is in DNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 10/39

Page 57: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

Convert F : (q1 ∨ ¬¬q2) ∧ (¬r1 → r2) into DNF

F1 : (q1 ∨ ¬¬q2) ∧ (¬¬r1 ∨ r2) remove→F2 : (q1 ∨ q2) ∧ (r1 ∨ r2) in NNFF3 : (q1 ∧ (r1 ∨ r2)) ∨ (q2 ∧ (r1 ∨ r2)) distF4 : (q1 ∧ r1) ∨ (q1 ∧ r2) ∨ (q2 ∧ r1) ∨ (q2 ∧ r2) dist

F4 equivalent to F and is in DNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 10/39

Page 58: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Satisfiability

I Claim: If formula is in DNF, trivial to determine satisfiability. How?

I Since disjunction of clauses, formula is satisfied if any clause is satisifed.

I If there is any clause that neither contains ⊥ nor a literal and is and itsnegation, then the formula is satisfiable.

I Idea: To determine satisfiability, convert formula to DNF and just do asyntactic check.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 11/39

Page 59: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Satisfiability

I Claim: If formula is in DNF, trivial to determine satisfiability. How?

I Since disjunction of clauses, formula is satisfied if any clause is satisifed.

I If there is any clause that neither contains ⊥ nor a literal and is and itsnegation, then the formula is satisfiable.

I Idea: To determine satisfiability, convert formula to DNF and just do asyntactic check.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 11/39

Page 60: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Satisfiability

I Claim: If formula is in DNF, trivial to determine satisfiability. How?

I Since disjunction of clauses, formula is satisfied if any clause is satisifed.

I If there is any clause that neither contains ⊥ nor a literal and is and itsnegation, then the formula is satisfiable.

I Idea: To determine satisfiability, convert formula to DNF and just do asyntactic check.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 11/39

Page 61: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Satisfiability

I Claim: If formula is in DNF, trivial to determine satisfiability. How?

I Since disjunction of clauses, formula is satisfied if any clause is satisifed.

I If there is any clause that neither contains ⊥ nor a literal and is and itsnegation, then the formula is satisfiable.

I Idea: To determine satisfiability, convert formula to DNF and just do asyntactic check.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 11/39

Page 62: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:

(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 63: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:

(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 64: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 65: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 66: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 67: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 68: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF and Blow-up in formula size

I This idea is completely impractical. Why?

I Consider formula: (F1 ∨ F2) ∧ (F3 ∨ F4)

I In DNF:(F1 ∧ F3) ∨ (F1 ∧ F4) ∨ (F2 ∧ F3) ∨ (F2 ∧ F4)

I Every time we distribute, formula size doubles!

I Moral: DNF conversion causes exponential blow-up in size!

I Checking satisfiability by converting to DNF is almost as bad as truthtables!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 12/39

Page 69: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conjunctive Normal Form (CNF)

I A formula in conjuctive normal form is a conjunction of disjunction ofliterals. ∧

i

∨j

`i,j for literals `i,j

I i.e., ∧ not allowed inside ∨,¬.

I Called conjunctive normal form because conjucts are at the outer level

I Each inner disjunction is called a clause

I Is formula in CNF also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 13/39

Page 70: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conjunctive Normal Form (CNF)

I A formula in conjuctive normal form is a conjunction of disjunction ofliterals. ∧

i

∨j

`i,j for literals `i,j

I i.e., ∧ not allowed inside ∨,¬.

I Called conjunctive normal form because conjucts are at the outer level

I Each inner disjunction is called a clause

I Is formula in CNF also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 13/39

Page 71: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conjunctive Normal Form (CNF)

I A formula in conjuctive normal form is a conjunction of disjunction ofliterals. ∧

i

∨j

`i,j for literals `i,j

I i.e., ∧ not allowed inside ∨,¬.

I Called conjunctive normal form because conjucts are at the outer level

I Each inner disjunction is called a clause

I Is formula in CNF also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 13/39

Page 72: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conjunctive Normal Form (CNF)

I A formula in conjuctive normal form is a conjunction of disjunction ofliterals. ∧

i

∨j

`i,j for literals `i,j

I i.e., ∧ not allowed inside ∨,¬.

I Called conjunctive normal form because conjucts are at the outer level

I Each inner disjunction is called a clause

I Is formula in CNF also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 13/39

Page 73: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conjunctive Normal Form (CNF)

I A formula in conjuctive normal form is a conjunction of disjunction ofliterals. ∧

i

∨j

`i,j for literals `i,j

I i.e., ∧ not allowed inside ∨,¬.

I Called conjunctive normal form because conjucts are at the outer level

I Each inner disjunction is called a clause

I Is formula in CNF also in NNF?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 13/39

Page 74: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to CNF

I To convert formula to CNF, first convert it to NNF.

I Then, distribute ∨ over ∧:

(F1 ∧ F2) ∨ F3 ⇔ (F1 ∨ F3) ∧ (F2 ∨ F3)

F1 ∨ (F2 ∧ F3) ⇔ (F1 ∨ F2) ∧ (F1 ∨ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 14/39

Page 75: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to CNF

I To convert formula to CNF, first convert it to NNF.

I Then, distribute ∨ over ∧:

(F1 ∧ F2) ∨ F3 ⇔ (F1 ∨ F3) ∧ (F2 ∨ F3)

F1 ∨ (F2 ∧ F3) ⇔ (F1 ∨ F2) ∧ (F1 ∨ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 14/39

Page 76: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to CNF

I To convert formula to CNF, first convert it to NNF.

I Then, distribute ∨ over ∧:

(F1 ∧ F2) ∨ F3

⇔ (F1 ∨ F3) ∧ (F2 ∨ F3)

F1 ∨ (F2 ∧ F3) ⇔ (F1 ∨ F2) ∧ (F1 ∨ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 14/39

Page 77: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to CNF

I To convert formula to CNF, first convert it to NNF.

I Then, distribute ∨ over ∧:

(F1 ∧ F2) ∨ F3 ⇔ (F1 ∨ F3) ∧ (F2 ∨ F3)

F1 ∨ (F2 ∧ F3) ⇔ (F1 ∨ F2) ∧ (F1 ∨ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 14/39

Page 78: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to CNF

I To convert formula to CNF, first convert it to NNF.

I Then, distribute ∨ over ∧:

(F1 ∧ F2) ∨ F3 ⇔ (F1 ∨ F3) ∧ (F2 ∨ F3)

F1 ∨ (F2 ∧ F3)

⇔ (F1 ∨ F2) ∧ (F1 ∨ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 14/39

Page 79: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Conversion to CNF

I To convert formula to CNF, first convert it to NNF.

I Then, distribute ∨ over ∧:

(F1 ∧ F2) ∨ F3 ⇔ (F1 ∨ F3) ∧ (F2 ∨ F3)

F1 ∨ (F2 ∧ F3) ⇔ (F1 ∨ F2) ∧ (F1 ∨ F3)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 14/39

Page 80: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De MorganF5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 81: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔

F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De MorganF5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 82: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →

F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De MorganF5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 83: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →

F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De MorganF5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 84: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De Morgan

F5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 85: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De MorganF5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 86: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

CNF Conversion Example

Convert F : (p ↔ (q → r)) into CNF

F1 : (p → (q → r)) ∧ ((q → r)→ p) remove ↔F2 : (¬p ∨ (q → r)) ∧ (¬(q → r) ∨ p) remove →F3 : (¬p ∨ (¬q ∨ r)) ∧ (¬(¬q ∨ r) ∨ p) remove →F4 : (¬p ∨ ¬q ∨ r) ∧ ((q ∧ ¬r) ∨ p) De MorganF5 : (¬p ∨ ¬q ∨ r) ∧ (q ∨ p) ∧ (¬r ∨ p) Distribute ∨ over ∧

F5 is equivalent to F and is in CNF

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 15/39

Page 87: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF vs. CNF

I Fact: Unlike DNF, it is not trivial to determine satisfiability of formula inCNF.

I Does CNF conversion cause exponential blow-up in size?

Yes

I News: But almost all SAT solvers first convert formula to CNF beforesolving!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 16/39

Page 88: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF vs. CNF

I Fact: Unlike DNF, it is not trivial to determine satisfiability of formula inCNF.

I Does CNF conversion cause exponential blow-up in size?

Yes

I News: But almost all SAT solvers first convert formula to CNF beforesolving!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 16/39

Page 89: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF vs. CNF

I Fact: Unlike DNF, it is not trivial to determine satisfiability of formula inCNF.

I Does CNF conversion cause exponential blow-up in size? Yes

I News: But almost all SAT solvers first convert formula to CNF beforesolving!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 16/39

Page 90: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DNF vs. CNF

I Fact: Unlike DNF, it is not trivial to determine satisfiability of formula inCNF.

I Does CNF conversion cause exponential blow-up in size? Yes

I News: But almost all SAT solvers first convert formula to CNF beforesolving!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 16/39

Page 91: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Why CNF?

I Interesting Question: If it is just as expensive to convert formula to CNFas to DNF, why do solvers convert to CNF although it is much easier todetermine satisfiability in DNF?

I Two reasons:

1. Possible to convert to equisatisfiable (not equivalent) CNF formula withonly linear increase in size!

2. CNF makes it possible to perform interesting deductions (resolution)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 17/39

Page 92: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Why CNF?

I Interesting Question: If it is just as expensive to convert formula to CNFas to DNF, why do solvers convert to CNF although it is much easier todetermine satisfiability in DNF?

I Two reasons:

1. Possible to convert to equisatisfiable (not equivalent) CNF formula withonly linear increase in size!

2. CNF makes it possible to perform interesting deductions (resolution)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 17/39

Page 93: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Why CNF?

I Interesting Question: If it is just as expensive to convert formula to CNFas to DNF, why do solvers convert to CNF although it is much easier todetermine satisfiability in DNF?

I Two reasons:

1. Possible to convert to equisatisfiable (not equivalent) CNF formula withonly linear increase in size!

2. CNF makes it possible to perform interesting deductions (resolution)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 17/39

Page 94: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Why CNF?

I Interesting Question: If it is just as expensive to convert formula to CNFas to DNF, why do solvers convert to CNF although it is much easier todetermine satisfiability in DNF?

I Two reasons:

1. Possible to convert to equisatisfiable (not equivalent) CNF formula withonly linear increase in size!

2. CNF makes it possible to perform interesting deductions (resolution)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 17/39

Page 95: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent?

No!

I Example:

Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 96: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent?

No!

I Example:

Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 97: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent? No!

I Example:

Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 98: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent? No!

I Example: Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 99: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent? No!

I Example: Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 100: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent? No!

I Example: Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 101: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Equisatisfiability

I Two formulas F and F ′ are equisatisfiable iff:

F is satisfiable if and only if F ′ is satisfiable

I If two formulas are equisatisfiable, are they equivalent? No!

I Example: Any satisfiable formula (e.g., p) is equisat as >

I But clearly, p is not equivalent to >! Why?

I Equisatisfiability is a much weaker notion than equivalence.

I But useful if all we want to do is determine satisfiability.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 18/39

Page 102: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

The Plan

I To determine satisfiability of F , convert formula to equisatisfiable formulaF ′ in CNF

I Use an algorithm (DPLL) to decide satisfiability of F ′

I Since F ′ is equisatisfiable to F , F is satifiable iff algorithm decides F ′ issatisfiable

I Big question: How do we convert formula to equisatisfiable formulawithout causing exponential blow-up in size?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 19/39

Page 103: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

The Plan

I To determine satisfiability of F , convert formula to equisatisfiable formulaF ′ in CNF

I Use an algorithm (DPLL) to decide satisfiability of F ′

I Since F ′ is equisatisfiable to F , F is satifiable iff algorithm decides F ′ issatisfiable

I Big question: How do we convert formula to equisatisfiable formulawithout causing exponential blow-up in size?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 19/39

Page 104: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

The Plan

I To determine satisfiability of F , convert formula to equisatisfiable formulaF ′ in CNF

I Use an algorithm (DPLL) to decide satisfiability of F ′

I Since F ′ is equisatisfiable to F , F is satifiable iff algorithm decides F ′ issatisfiable

I Big question: How do we convert formula to equisatisfiable formulawithout causing exponential blow-up in size?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 19/39

Page 105: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

The Plan

I To determine satisfiability of F , convert formula to equisatisfiable formulaF ′ in CNF

I Use an algorithm (DPLL) to decide satisfiability of F ′

I Since F ′ is equisatisfiable to F , F is satifiable iff algorithm decides F ′ issatisfiable

I Big question: How do we convert formula to equisatisfiable formulawithout causing exponential blow-up in size?

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 19/39

Page 106: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation

Tseitin’s transformation converts formula Fto equisatisfiable formula F ′ in CNFwith only a linear increase in size.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 20/39

Page 107: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation I

I Step 1: Introduce a new variable pG for every subformula G of F (unlessG is already an atom).

I For instance, if F = G1 ∧G2, introduce two variables pG1 and pG2

representing G1 and G2 respectively.

I pG1 is said to be representative of G1 and pG2 is representative of G2.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 21/39

Page 108: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation I

I Step 1: Introduce a new variable pG for every subformula G of F (unlessG is already an atom).

I For instance, if F = G1 ∧G2, introduce two variables pG1 and pG2

representing G1 and G2 respectively.

I pG1 is said to be representative of G1 and pG2 is representative of G2.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 21/39

Page 109: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation I

I Step 1: Introduce a new variable pG for every subformula G of F (unlessG is already an atom).

I For instance, if F = G1 ∧G2, introduce two variables pG1 and pG2

representing G1 and G2 respectively.

I pG1 is said to be representative of G1 and pG2 is representative of G2.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 21/39

Page 110: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Step 2: Consider each subformula

G : G1 ◦G2 (◦ arbitrary boolean connective)

I Stipulate representative of G is equivalent to representative of G1 ◦G2

pG ↔ pG1 ◦ pG2

I Step 3: Convert pG ↔ pG1 ◦ pG2 to equivalent CNF (by converting toNNF and distributing ∨’s over ∧’s).

I Observe: Since pG ↔ pG1 ◦ pG2 contains at most three propositionalvariables and exactly two connectives, size of this formula in CNF is boundby a constant.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 22/39

Page 111: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Step 2: Consider each subformula

G : G1 ◦G2 (◦ arbitrary boolean connective)

I Stipulate representative of G is equivalent to representative of G1 ◦G2

pG ↔ pG1 ◦ pG2

I Step 3: Convert pG ↔ pG1 ◦ pG2 to equivalent CNF (by converting toNNF and distributing ∨’s over ∧’s).

I Observe: Since pG ↔ pG1 ◦ pG2 contains at most three propositionalvariables and exactly two connectives, size of this formula in CNF is boundby a constant.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 22/39

Page 112: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Step 2: Consider each subformula

G : G1 ◦G2 (◦ arbitrary boolean connective)

I Stipulate representative of G is equivalent to representative of G1 ◦G2

pG ↔ pG1 ◦ pG2

I Step 3: Convert pG ↔ pG1 ◦ pG2 to equivalent CNF (by converting toNNF and distributing ∨’s over ∧’s).

I Observe: Since pG ↔ pG1 ◦ pG2 contains at most three propositionalvariables and exactly two connectives, size of this formula in CNF is boundby a constant.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 22/39

Page 113: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Step 2: Consider each subformula

G : G1 ◦G2 (◦ arbitrary boolean connective)

I Stipulate representative of G is equivalent to representative of G1 ◦G2

pG ↔ pG1 ◦ pG2

I Step 3: Convert pG ↔ pG1 ◦ pG2 to equivalent CNF (by converting toNNF and distributing ∨’s over ∧’s).

I Observe: Since pG ↔ pG1 ◦ pG2 contains at most three propositionalvariables and exactly two connectives, size of this formula in CNF is boundby a constant.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 22/39

Page 114: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Step 2: Consider each subformula

G : G1 ◦G2 (◦ arbitrary boolean connective)

I Stipulate representative of G is equivalent to representative of G1 ◦G2

pG ↔ pG1 ◦ pG2

I Step 3: Convert pG ↔ pG1 ◦ pG2 to equivalent CNF (by converting toNNF and distributing ∨’s over ∧’s).

I Observe: Since pG ↔ pG1 ◦ pG2 contains at most three propositionalvariables and exactly two connectives, size of this formula in CNF is boundby a constant.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 22/39

Page 115: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Given original formula F , let pF be its representative and let SF be the setof all subformulas of F (including F itself).

I Then, introduce the formula

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I Claim: This formula is equisatisfiable to F .

I The proof is by structural induction

I Formula is also in CNF because conjunction of CNF formulas is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 23/39

Page 116: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Given original formula F , let pF be its representative and let SF be the setof all subformulas of F (including F itself).

I Then, introduce the formula

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I Claim: This formula is equisatisfiable to F .

I The proof is by structural induction

I Formula is also in CNF because conjunction of CNF formulas is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 23/39

Page 117: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Given original formula F , let pF be its representative and let SF be the setof all subformulas of F (including F itself).

I Then, introduce the formula

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I Claim: This formula is equisatisfiable to F .

I The proof is by structural induction

I Formula is also in CNF because conjunction of CNF formulas is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 23/39

Page 118: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Given original formula F , let pF be its representative and let SF be the setof all subformulas of F (including F itself).

I Then, introduce the formula

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I Claim: This formula is equisatisfiable to F .

I The proof is by structural induction

I Formula is also in CNF because conjunction of CNF formulas is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 23/39

Page 119: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation II

I Given original formula F , let pF be its representative and let SF be the setof all subformulas of F (including F itself).

I Then, introduce the formula

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I Claim: This formula is equisatisfiable to F .

I The proof is by structural induction

I Formula is also in CNF because conjunction of CNF formulas is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 23/39

Page 120: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation and Size

I Using this transformation, we converted F to an equisatisfiable CNFformula F ′.

I What about the size of F ′?

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I |SF | is bound by the number of connectives in F .

I Each formula CNF (pg ↔ pg1 ◦ pg2) has constant size.

I Thus, trasformation causes only linear increase in formula size.

I More precisely, the size of resulting formula is bound by 30n + 2 where nis size of original formula

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 24/39

Page 121: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation and Size

I Using this transformation, we converted F to an equisatisfiable CNFformula F ′.

I What about the size of F ′?

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I |SF | is bound by the number of connectives in F .

I Each formula CNF (pg ↔ pg1 ◦ pg2) has constant size.

I Thus, trasformation causes only linear increase in formula size.

I More precisely, the size of resulting formula is bound by 30n + 2 where nis size of original formula

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 24/39

Page 122: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation and Size

I Using this transformation, we converted F to an equisatisfiable CNFformula F ′.

I What about the size of F ′?

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I |SF | is bound by the number of connectives in F .

I Each formula CNF (pg ↔ pg1 ◦ pg2) has constant size.

I Thus, trasformation causes only linear increase in formula size.

I More precisely, the size of resulting formula is bound by 30n + 2 where nis size of original formula

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 24/39

Page 123: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation and Size

I Using this transformation, we converted F to an equisatisfiable CNFformula F ′.

I What about the size of F ′?

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I |SF | is bound by the number of connectives in F .

I Each formula CNF (pg ↔ pg1 ◦ pg2) has constant size.

I Thus, trasformation causes only linear increase in formula size.

I More precisely, the size of resulting formula is bound by 30n + 2 where nis size of original formula

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 24/39

Page 124: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation and Size

I Using this transformation, we converted F to an equisatisfiable CNFformula F ′.

I What about the size of F ′?

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I |SF | is bound by the number of connectives in F .

I Each formula CNF (pg ↔ pg1 ◦ pg2) has constant size.

I Thus, trasformation causes only linear increase in formula size.

I More precisely, the size of resulting formula is bound by 30n + 2 where nis size of original formula

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 24/39

Page 125: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation and Size

I Using this transformation, we converted F to an equisatisfiable CNFformula F ′.

I What about the size of F ′?

pF ∧∧

G=(G1◦G2)∈SF

CNF (pg ↔ pg1 ◦ pg2)

I |SF | is bound by the number of connectives in F .

I Each formula CNF (pg ↔ pg1 ◦ pg2) has constant size.

I Thus, trasformation causes only linear increase in formula size.

I More precisely, the size of resulting formula is bound by 30n + 2 where nis size of original formula

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 24/39

Page 126: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 127: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 128: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 129: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3)

⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 130: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)

p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 131: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q)

⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 132: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)

p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 133: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4)

⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 134: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 135: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r

⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 136: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 137: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Tseitin’s Transformation Example

Convert F : (p ∨ q)→ (p ∧ ¬r) to equisatisfiable CNF formula.

1. For each subformula, introduce new variables: p1 for F , p2 for p ∨ q , p3for p ∧ ¬r , and p4 for ¬r .

2. Stipulate equivalences and convert them to CNF:

p1 ↔ (p2 → p3) ⇒ F1 : (¬p1 ∨ ¬p2 ∨ p3) ∧ (p2 ∨ p1) ∧ (¬p3 ∨ p1)p2 ↔ (p ∨ q) ⇒ F2 : (¬p2 ∨ p ∨ q) ∧ (¬p ∨ p2) ∧ (¬q ∨ p2)p3 ↔ (p ∧ p4) ⇒ F3 : (¬p3 ∨ p) ∧ (¬p3 ∨ p4) ∧ (¬p ∨ ¬p4 ∨ p3)

p4 ↔ ¬r ⇒ F4 : (¬p4 ∨ ¬r) ∧ (p4 ∨ r)

3. The formulap1 ∧ F1 ∧ F2 ∧ F3 ∧ F4

is equisatisfiable to F and is in CNF.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 25/39

Page 138: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

SAT Solvers

I Almost all SAT solvers today are based on an algorithm called DPLL(Davis-Putnam-Logemann-Loveland)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 26/39

Page 139: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

SAT Solvers

I Almost all SAT solvers today are based on an algorithm called DPLL(Davis-Putnam-Logemann-Loveland)

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 26/39

Page 140: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL: Historical Perspective

I 1962: the original algorithm known as DP (Davis-Putnam)⇒“simple” procedure for automated theorem proving

I Davis and Putnam hired two programmers,George Logemann and David Loveland, toimplement their ideas on the IBM 704.

I Not all of their ideas worked out asplanned ⇒ refined algorithm to what isknown today as DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 27/39

Page 141: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL: Historical Perspective

I 1962: the original algorithm known as DP (Davis-Putnam)⇒“simple” procedure for automated theorem proving

I Davis and Putnam hired two programmers,George Logemann and David Loveland, toimplement their ideas on the IBM 704.

I Not all of their ideas worked out asplanned ⇒ refined algorithm to what isknown today as DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 27/39

Page 142: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL: Historical Perspective

I 1962: the original algorithm known as DP (Davis-Putnam)⇒“simple” procedure for automated theorem proving

I Davis and Putnam hired two programmers,George Logemann and David Loveland, toimplement their ideas on the IBM 704.

I Not all of their ideas worked out asplanned ⇒ refined algorithm to what isknown today as DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 27/39

Page 143: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL: Historical Perspective

I 1962: the original algorithm known as DP (Davis-Putnam)⇒“simple” procedure for automated theorem proving

I Davis and Putnam hired two programmers,George Logemann and David Loveland, toimplement their ideas on the IBM 704.

I Not all of their ideas worked out asplanned ⇒ refined algorithm to what isknown today as DPLL

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 27/39

Page 144: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL insight

I There are two distinct ways to approach the boolean satisfiability problem:

I Search

I Find satisfying assignment in by searching through all possible assignments⇒ most basic incarnation: truth table!

I Deduction

I Deduce new facts from set of known facts ⇒ application of proof rules,semantic argument method

I DPLL combines search and deduction in a very effective way!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 28/39

Page 145: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL insight

I There are two distinct ways to approach the boolean satisfiability problem:

I SearchI Find satisfying assignment in by searching through all possible assignments

⇒ most basic incarnation: truth table!

I Deduction

I Deduce new facts from set of known facts ⇒ application of proof rules,semantic argument method

I DPLL combines search and deduction in a very effective way!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 28/39

Page 146: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL insight

I There are two distinct ways to approach the boolean satisfiability problem:

I SearchI Find satisfying assignment in by searching through all possible assignments

⇒ most basic incarnation: truth table!

I DeductionI Deduce new facts from set of known facts ⇒ application of proof rules,

semantic argument method

I DPLL combines search and deduction in a very effective way!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 28/39

Page 147: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL insight

I There are two distinct ways to approach the boolean satisfiability problem:

I SearchI Find satisfying assignment in by searching through all possible assignments

⇒ most basic incarnation: truth table!

I DeductionI Deduce new facts from set of known facts ⇒ application of proof rules,

semantic argument method

I DPLL combines search and deduction in a very effective way!

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 28/39

Page 148: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Deduction in DPLL

I Deductive principle underlying DPLL is propositional resolution

I Resolution can only be applied to formulas in CNF

I SAT solvers convert formulas to CNF to be able to perform resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 29/39

Page 149: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Deduction in DPLL

I Deductive principle underlying DPLL is propositional resolution

I Resolution can only be applied to formulas in CNF

I SAT solvers convert formulas to CNF to be able to perform resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 29/39

Page 150: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Deduction in DPLL

I Deductive principle underlying DPLL is propositional resolution

I Resolution can only be applied to formulas in CNF

I SAT solvers convert formulas to CNF to be able to perform resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 29/39

Page 151: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Propositional Resolution

I Consider two clauses in CNF:

C1 : (l1 ∨ . . . p . . . ∨ lk ) C2 : (l ′1 ∨ . . .¬p . . . ∨ l ′n)

I From these, we can deduce a new clause C3, called resolvent:

C3 : (l1 ∨ . . . ∨ lk ∨ l ′1 ∨ . . . . . . ∨ l ′n)

I Correctness:

I Suppose p is assigned >: Since C2 must be satisfied and since ¬p is ⊥,(l ′1 ∨ . . . . . . ∨ l ′n ) must be true.

I Suppose p is assigned ⊥: Since C1 must be satisfied and since p is ⊥,(l1 ∨ . . . . . . ∨ lk ) must be true.

I Thus, C3 must be true.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 30/39

Page 152: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Propositional Resolution

I Consider two clauses in CNF:

C1 : (l1 ∨ . . . p . . . ∨ lk ) C2 : (l ′1 ∨ . . .¬p . . . ∨ l ′n)

I From these, we can deduce a new clause C3, called resolvent:

C3 : (l1 ∨ . . . ∨ lk ∨ l ′1 ∨ . . . . . . ∨ l ′n)

I Correctness:

I Suppose p is assigned >: Since C2 must be satisfied and since ¬p is ⊥,(l ′1 ∨ . . . . . . ∨ l ′n ) must be true.

I Suppose p is assigned ⊥: Since C1 must be satisfied and since p is ⊥,(l1 ∨ . . . . . . ∨ lk ) must be true.

I Thus, C3 must be true.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 30/39

Page 153: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Propositional Resolution

I Consider two clauses in CNF:

C1 : (l1 ∨ . . . p . . . ∨ lk ) C2 : (l ′1 ∨ . . .¬p . . . ∨ l ′n)

I From these, we can deduce a new clause C3, called resolvent:

C3 : (l1 ∨ . . . ∨ lk ∨ l ′1 ∨ . . . . . . ∨ l ′n)

I Correctness:

I Suppose p is assigned >: Since C2 must be satisfied and since ¬p is ⊥,(l ′1 ∨ . . . . . . ∨ l ′n ) must be true.

I Suppose p is assigned ⊥: Since C1 must be satisfied and since p is ⊥,(l1 ∨ . . . . . . ∨ lk ) must be true.

I Thus, C3 must be true.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 30/39

Page 154: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Propositional Resolution

I Consider two clauses in CNF:

C1 : (l1 ∨ . . . p . . . ∨ lk ) C2 : (l ′1 ∨ . . .¬p . . . ∨ l ′n)

I From these, we can deduce a new clause C3, called resolvent:

C3 : (l1 ∨ . . . ∨ lk ∨ l ′1 ∨ . . . . . . ∨ l ′n)

I Correctness:

I Suppose p is assigned >: Since C2 must be satisfied and since ¬p is ⊥,(l ′1 ∨ . . . . . . ∨ l ′n ) must be true.

I Suppose p is assigned ⊥: Since C1 must be satisfied and since p is ⊥,(l1 ∨ . . . . . . ∨ lk ) must be true.

I Thus, C3 must be true.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 30/39

Page 155: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Propositional Resolution

I Consider two clauses in CNF:

C1 : (l1 ∨ . . . p . . . ∨ lk ) C2 : (l ′1 ∨ . . .¬p . . . ∨ l ′n)

I From these, we can deduce a new clause C3, called resolvent:

C3 : (l1 ∨ . . . ∨ lk ∨ l ′1 ∨ . . . . . . ∨ l ′n)

I Correctness:

I Suppose p is assigned >: Since C2 must be satisfied and since ¬p is ⊥,(l ′1 ∨ . . . . . . ∨ l ′n ) must be true.

I Suppose p is assigned ⊥: Since C1 must be satisfied and since p is ⊥,(l1 ∨ . . . . . . ∨ lk ) must be true.

I Thus, C3 must be true.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 30/39

Page 156: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Propositional Resolution

I Consider two clauses in CNF:

C1 : (l1 ∨ . . . p . . . ∨ lk ) C2 : (l ′1 ∨ . . .¬p . . . ∨ l ′n)

I From these, we can deduce a new clause C3, called resolvent:

C3 : (l1 ∨ . . . ∨ lk ∨ l ′1 ∨ . . . . . . ∨ l ′n)

I Correctness:

I Suppose p is assigned >: Since C2 must be satisfied and since ¬p is ⊥,(l ′1 ∨ . . . . . . ∨ l ′n ) must be true.

I Suppose p is assigned ⊥: Since C1 must be satisfied and since p is ⊥,(l1 ∨ . . . . . . ∨ lk ) must be true.

I Thus, C3 must be true.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 30/39

Page 157: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Unit Resolution

I DPLL uses a restricted form of resolution, known as unit resolution.

I Unit resolution is propositional resolution, but one of the clauses must bea unit clause (i.e., contains only one literal)

I C1 : p C2 : (l1 ∨ . . .¬p . . . ∨ ln)

I Resolvent: (l1 ∨ . . . ∨ ln)

I Performing unit resolution on C1 and C2 is same as replacing p with truein the original clauses.

I In DPLL, all possible applications of unit resolution called BooleanConstraint Propagation (BCP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 31/39

Page 158: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Unit Resolution

I DPLL uses a restricted form of resolution, known as unit resolution.

I Unit resolution is propositional resolution, but one of the clauses must bea unit clause (i.e., contains only one literal)

I C1 : p C2 : (l1 ∨ . . .¬p . . . ∨ ln)

I Resolvent: (l1 ∨ . . . ∨ ln)

I Performing unit resolution on C1 and C2 is same as replacing p with truein the original clauses.

I In DPLL, all possible applications of unit resolution called BooleanConstraint Propagation (BCP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 31/39

Page 159: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Unit Resolution

I DPLL uses a restricted form of resolution, known as unit resolution.

I Unit resolution is propositional resolution, but one of the clauses must bea unit clause (i.e., contains only one literal)

I C1 : p C2 : (l1 ∨ . . .¬p . . . ∨ ln)

I Resolvent: (l1 ∨ . . . ∨ ln)

I Performing unit resolution on C1 and C2 is same as replacing p with truein the original clauses.

I In DPLL, all possible applications of unit resolution called BooleanConstraint Propagation (BCP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 31/39

Page 160: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Unit Resolution

I DPLL uses a restricted form of resolution, known as unit resolution.

I Unit resolution is propositional resolution, but one of the clauses must bea unit clause (i.e., contains only one literal)

I C1 : p C2 : (l1 ∨ . . .¬p . . . ∨ ln)

I Resolvent: (l1 ∨ . . . ∨ ln)

I Performing unit resolution on C1 and C2 is same as replacing p with truein the original clauses.

I In DPLL, all possible applications of unit resolution called BooleanConstraint Propagation (BCP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 31/39

Page 161: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Unit Resolution

I DPLL uses a restricted form of resolution, known as unit resolution.

I Unit resolution is propositional resolution, but one of the clauses must bea unit clause (i.e., contains only one literal)

I C1 : p C2 : (l1 ∨ . . .¬p . . . ∨ ln)

I Resolvent: (l1 ∨ . . . ∨ ln)

I Performing unit resolution on C1 and C2 is same as replacing p with truein the original clauses.

I In DPLL, all possible applications of unit resolution called BooleanConstraint Propagation (BCP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 31/39

Page 162: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Unit Resolution

I DPLL uses a restricted form of resolution, known as unit resolution.

I Unit resolution is propositional resolution, but one of the clauses must bea unit clause (i.e., contains only one literal)

I C1 : p C2 : (l1 ∨ . . .¬p . . . ∨ ln)

I Resolvent: (l1 ∨ . . . ∨ ln)

I Performing unit resolution on C1 and C2 is same as replacing p with truein the original clauses.

I In DPLL, all possible applications of unit resolution called BooleanConstraint Propagation (BCP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 31/39

Page 163: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause:

q

I New formula:

q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again:

(r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 164: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause:

q

I New formula:

q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again:

(r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 165: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause: q

I New formula:

q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again:

(r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 166: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause: q

I New formula:

q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again:

(r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 167: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause: q

I New formula: q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again:

(r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 168: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause: q

I New formula: q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again:

(r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 169: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause: q

I New formula: q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again: (r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 170: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Boolean Constraint Propagation (BCP) Example

I Apply BCP to CNF formula:

(p) ∧ (¬p ∨ q) ∧ (r ∨ ¬q ∨ s)

I Resolvent of first and second clause: q

I New formula: q ∧ (r ∨ ¬q ∨ s)

I Apply unit resolution again: (r ∨ s)

I No more unit resolution possible, so this is the result of BCP.

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 32/39

Page 171: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)2. if(φ′ = >) then return SAT;3. else if(φ′ = ⊥) then return UNSAT;4. p = choose var(φ′);5. if(DPLL(φ′[p 7→ >])) then return SAT;6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 172: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)

2. if(φ′ = >) then return SAT;3. else if(φ′ = ⊥) then return UNSAT;4. p = choose var(φ′);5. if(DPLL(φ′[p 7→ >])) then return SAT;6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 173: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)2. if(φ′ = >) then return SAT;

3. else if(φ′ = ⊥) then return UNSAT;4. p = choose var(φ′);5. if(DPLL(φ′[p 7→ >])) then return SAT;6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 174: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)2. if(φ′ = >) then return SAT;3. else if(φ′ = ⊥) then return UNSAT;

4. p = choose var(φ′);5. if(DPLL(φ′[p 7→ >])) then return SAT;6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 175: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)2. if(φ′ = >) then return SAT;3. else if(φ′ = ⊥) then return UNSAT;4. p = choose var(φ′);

5. if(DPLL(φ′[p 7→ >])) then return SAT;6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 176: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)2. if(φ′ = >) then return SAT;3. else if(φ′ = ⊥) then return UNSAT;4. p = choose var(φ′);5. if(DPLL(φ′[p 7→ >])) then return SAT;

6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 177: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Basic DPLL

bool DPLL(φ){

1. φ′ = BCP(φ)2. if(φ′ = >) then return SAT;3. else if(φ′ = ⊥) then return UNSAT;4. p = choose var(φ′);5. if(DPLL(φ′[p 7→ >])) then return SAT;6. else return (DPLL(φ′[p 7→ ⊥]));

}

I Recursive procedure; input is formula in CNF

I Formula is > if no more clauses left

I Formula becomes ⊥ if we derive ⊥ due to unit resolution

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 33/39

Page 178: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

An Optimization: Pure Literal Propagation

I If variable p occurs only positively in the formula (i.e., no ¬p), p must beset to >

I Similarly, if p occurs only negatively (i.e., only appears as ¬p), p must beset to ⊥

I This is known as Pure Literal Propagation (PLP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 34/39

Page 179: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

An Optimization: Pure Literal Propagation

I If variable p occurs only positively in the formula (i.e., no ¬p), p must beset to >

I Similarly, if p occurs only negatively (i.e., only appears as ¬p), p must beset to ⊥

I This is known as Pure Literal Propagation (PLP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 34/39

Page 180: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

An Optimization: Pure Literal Propagation

I If variable p occurs only positively in the formula (i.e., no ¬p), p must beset to >

I Similarly, if p occurs only negatively (i.e., only appears as ¬p), p must beset to ⊥

I This is known as Pure Literal Propagation (PLP).

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 34/39

Page 181: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

DPLL with Pure Literal Propagation

bool DPLL(φ){

1. φ′ = BCP(φ)2. φ′′ = PLP(φ′)3. if(φ′′ = >) then return SAT;4. else if(φ′′ = ⊥) then return UNSAT;5. p = choose var(φ′′);6. if(DPLL(φ′′[p 7→ >])) then return SAT;7. else return (DPLL(φ′′[p 7→ ⊥]));

}

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 35/39

Page 182: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)

I No BCP possible because no unit clause

I No PLP possible because there are no pure literals

I Choose variable q to branch on:

F [q 7→ >] : (r) ∧ (¬r) ∧ (p ∨ ¬r)

I Unit resolution using (r) and (¬r) deduces ⊥ ⇒ backtrack

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 36/39

Page 183: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I No BCP possible because no unit clause

I No PLP possible because there are no pure literals

I Choose variable q to branch on:

F [q 7→ >] : (r) ∧ (¬r) ∧ (p ∨ ¬r)

I Unit resolution using (r) and (¬r) deduces ⊥ ⇒ backtrack

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 36/39

Page 184: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I No BCP possible because no unit clause

I No PLP possible because there are no pure literals

I Choose variable q to branch on:

F [q 7→ >] : (r) ∧ (¬r) ∧ (p ∨ ¬r)

I Unit resolution using (r) and (¬r) deduces ⊥ ⇒ backtrack

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 36/39

Page 185: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I No BCP possible because no unit clause

I No PLP possible because there are no pure literals

I Choose variable q to branch on:

F [q 7→ >] : (r) ∧ (¬r) ∧ (p ∨ ¬r)

I Unit resolution using (r) and (¬r) deduces ⊥ ⇒ backtrack

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 36/39

Page 186: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I No BCP possible because no unit clause

I No PLP possible because there are no pure literals

I Choose variable q to branch on:

F [q 7→ >] : (r) ∧ (¬r) ∧ (p ∨ ¬r)

I Unit resolution using (r) and (¬r) deduces ⊥ ⇒ backtrack

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 36/39

Page 187: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example Cont.

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I Now, try q = ⊥

F [q 7→ ⊥] : (¬p ∨ r)

I By PLP, set p to ⊥ and r to >

I F [q 7→ ⊥, p 7→ ⊥, r 7→ >] : >

I Thus, F is satisfiable and the assignment [q 7→ ⊥, p 7→ ⊥, r 7→ >] is amodel (i.e., a satisfying interpretation) of F .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 37/39

Page 188: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example Cont.

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I Now, try q = ⊥

F [q 7→ ⊥] : (¬p ∨ r)

I By PLP, set p to ⊥ and r to >

I F [q 7→ ⊥, p 7→ ⊥, r 7→ >] : >

I Thus, F is satisfiable and the assignment [q 7→ ⊥, p 7→ ⊥, r 7→ >] is amodel (i.e., a satisfying interpretation) of F .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 37/39

Page 189: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example Cont.

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I Now, try q = ⊥

F [q 7→ ⊥] : (¬p ∨ r)

I By PLP, set p to ⊥ and r to >

I F [q 7→ ⊥, p 7→ ⊥, r 7→ >] : >

I Thus, F is satisfiable and the assignment [q 7→ ⊥, p 7→ ⊥, r 7→ >] is amodel (i.e., a satisfying interpretation) of F .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 37/39

Page 190: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Example Cont.

F : (¬p ∨ q ∨ r) ∧ (¬q ∨ r) ∧ (¬q ∨ ¬r) ∧ (p ∨ ¬q ∨ ¬r)I Now, try q = ⊥

F [q 7→ ⊥] : (¬p ∨ r)

I By PLP, set p to ⊥ and r to >

I F [q 7→ ⊥, p 7→ ⊥, r 7→ >] : >

I Thus, F is satisfiable and the assignment [q 7→ ⊥, p 7→ ⊥, r 7→ >] is amodel (i.e., a satisfying interpretation) of F .

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 37/39

Page 191: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Summary

I Normals forms: NNF, DNF, CNF (will come up again)

I For every formula, there exists an equivalent formula in normal form

I But equivalence-preserving transformation to DNF and CNF causesexponential blowup

I However, Tseitin’s transformation gives an equisatisfiable formula in CNFwith only linear increase in size

I Almost all SAT solvers work on CNF formulas to perform BCP

I DPLL basis of most state-of-the-art SAT solvers

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 38/39

Page 192: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Summary

I Normals forms: NNF, DNF, CNF (will come up again)

I For every formula, there exists an equivalent formula in normal form

I But equivalence-preserving transformation to DNF and CNF causesexponential blowup

I However, Tseitin’s transformation gives an equisatisfiable formula in CNFwith only linear increase in size

I Almost all SAT solvers work on CNF formulas to perform BCP

I DPLL basis of most state-of-the-art SAT solvers

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 38/39

Page 193: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Summary

I Normals forms: NNF, DNF, CNF (will come up again)

I For every formula, there exists an equivalent formula in normal form

I But equivalence-preserving transformation to DNF and CNF causesexponential blowup

I However, Tseitin’s transformation gives an equisatisfiable formula in CNFwith only linear increase in size

I Almost all SAT solvers work on CNF formulas to perform BCP

I DPLL basis of most state-of-the-art SAT solvers

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 38/39

Page 194: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Summary

I Normals forms: NNF, DNF, CNF (will come up again)

I For every formula, there exists an equivalent formula in normal form

I But equivalence-preserving transformation to DNF and CNF causesexponential blowup

I However, Tseitin’s transformation gives an equisatisfiable formula in CNFwith only linear increase in size

I Almost all SAT solvers work on CNF formulas to perform BCP

I DPLL basis of most state-of-the-art SAT solvers

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 38/39

Page 195: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Summary

I Normals forms: NNF, DNF, CNF (will come up again)

I For every formula, there exists an equivalent formula in normal form

I But equivalence-preserving transformation to DNF and CNF causesexponential blowup

I However, Tseitin’s transformation gives an equisatisfiable formula in CNFwith only linear increase in size

I Almost all SAT solvers work on CNF formulas to perform BCP

I DPLL basis of most state-of-the-art SAT solvers

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 38/39

Page 196: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Summary

I Normals forms: NNF, DNF, CNF (will come up again)

I For every formula, there exists an equivalent formula in normal form

I But equivalence-preserving transformation to DNF and CNF causesexponential blowup

I However, Tseitin’s transformation gives an equisatisfiable formula in CNFwith only linear increase in size

I Almost all SAT solvers work on CNF formulas to perform BCP

I DPLL basis of most state-of-the-art SAT solvers

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 38/39

Page 197: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Next Lecture

I Substantial improvements over basic DPLL used by modern SAT solvers:non-chronological backtracking and learning

I Implementation tricks used to perform BCP very efficiently

I Useful heuristics for choosing variable to branch on

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 39/39

Page 198: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Next Lecture

I Substantial improvements over basic DPLL used by modern SAT solvers:non-chronological backtracking and learning

I Implementation tricks used to perform BCP very efficiently

I Useful heuristics for choosing variable to branch on

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 39/39

Page 199: ECE750T-28: Computer-aided Reasoning for Software Engineering …vganesh/TEACHING/F2013/SATSMT... · 2013. 10. 24. · Normal Forms and DPLL Vijay Ganesh (Original notes from Isil

Next Lecture

I Substantial improvements over basic DPLL used by modern SAT solvers:non-chronological backtracking and learning

I Implementation tricks used to perform BCP very efficiently

I Useful heuristics for choosing variable to branch on

Vijay Ganesh(Original notes from Isil Dillig), ECE750T-28: Computer-aided Reasoning for Software Engineering Lecture 2: Normal Forms and DPLL 39/39