ECE750T-28: Computer-aided Reasoning for Software Engineering...

Preview:

Citation preview

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Recommended