propositional logic resolution, dpll and tableau

116
Propositional Logic Resolution, DPLL and tableau Mario Alviano University of Calabria, Italy A.Y. 2014/2015 1 / 36

Upload: others

Post on 25-Dec-2021

11 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Propositional Logic Resolution, DPLL and tableau

Propositional LogicResolution, DPLL and tableau

Mario Alviano

University of Calabria, Italy

A.Y. 2014/2015

1 / 36

Page 2: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

2 / 36

Page 3: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

3 / 36

Page 4: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

4 / 36

Page 5: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (1)

Main observation

(a ∨ b) ∧ (¬a ∨ c) ≡ (a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c)

(a ∨ b) ∧ (¬a ∨ c) |= (b ∨ c)

More general

C1 ∧ · · · ∧ Ck ∧ (a ∨ L11 ∨ . . . ∨ L1

n) ∧ (¬a ∨ L21 ∨ . . . ∨ L2

m)|= (L1

1 ∨ . . . ∨ L1n ∨ L2

1 ∨ . . . ∨ L2m)

This is known as resolution!

5 / 36

Page 6: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (1)

Main observation

(a ∨ b) ∧ (¬a ∨ c) ≡ (a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c)

(a ∨ b) ∧ (¬a ∨ c) |= (b ∨ c)

More general

C1 ∧ · · · ∧ Ck ∧ (a ∨ L11 ∨ . . . ∨ L1

n) ∧ (¬a ∨ L21 ∨ . . . ∨ L2

m)|= (L1

1 ∨ . . . ∨ L1n ∨ L2

1 ∨ . . . ∨ L2m)

This is known as resolution!

5 / 36

Page 7: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (1)

Main observation

(a ∨ b) ∧ (¬a ∨ c) ≡ (a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c)

(a ∨ b) ∧ (¬a ∨ c) |= (b ∨ c)

More general

C1 ∧ · · · ∧ Ck ∧ (a ∨ L11 ∨ . . . ∨ L1

n) ∧ (¬a ∨ L21 ∨ . . . ∨ L2

m)|= (L1

1 ∨ . . . ∨ L1n ∨ L2

1 ∨ . . . ∨ L2m)

This is known as resolution!

5 / 36

Page 8: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (1)

Main observation

(a ∨ b) ∧ (¬a ∨ c) ≡ (a ∨ b) ∧ (¬a ∨ c) ∧ (b ∨ c)

(a ∨ b) ∧ (¬a ∨ c) |= (b ∨ c)

More general

C1 ∧ · · · ∧ Ck ∧ (a ∨ L11 ∨ . . . ∨ L1

n) ∧ (¬a ∨ L21 ∨ . . . ∨ L2

m)|= (L1

1 ∨ . . . ∨ L1n ∨ L2

1 ∨ . . . ∨ L2m)

This is known as resolution!

5 / 36

Page 9: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (2)

Additional observation

(a ∨ a ∨ B) ≡ (a ∨ B)

Remove duplicated literals in clausesIt is known as factorization

Resolution (set notation)

C1, . . . ,Ck , {a ∨ L11, . . . ,L

1n}, {¬a,L2

1, . . . ,L2m}

|= {L11, . . . ,L

1n,L2

1, . . . ,L2m}

Factorization comes “for free”!

6 / 36

Page 10: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (2)

Additional observation

(a ∨ a ∨ B) ≡ (a ∨ B)

Remove duplicated literals in clausesIt is known as factorization

Resolution (set notation)

C1, . . . ,Ck , {a ∨ L11, . . . ,L

1n}, {¬a,L2

1, . . . ,L2m}

|= {L11, . . . ,L

1n,L2

1, . . . ,L2m}

Factorization comes “for free”!

6 / 36

Page 11: Propositional Logic Resolution, DPLL and tableau

Propositional resolution (2)

Additional observation

(a ∨ a ∨ B) ≡ (a ∨ B)

Remove duplicated literals in clausesIt is known as factorization

Resolution (set notation)

C1, . . . ,Ck , {a ∨ L11, . . . ,L

1n}, {¬a,L2

1, . . . ,L2m}

|= {L11, . . . ,L

1n,L2

1, . . . ,L2m}

Factorization comes “for free”!

6 / 36

Page 12: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (1)

Resolvent

Given two clauses C1 and C2 such that a ∈ C1 and ¬a ∈ C2,(C1 \ {a}) ∪ (C2 \ {¬a}) is the resolvent of C1 and C2.

Derivation

Given a set Γ of clauses, a derivation by resolution of a clauseC from Γ, denoted Γ `R C, is a sequence C1, . . . ,Cn such thatCn = C and for each Ci (1 ≤ i ≤ n) we have

1 Ci ∈ Γ, or2 Ci is a resolvent of Cj and Ck , where j < i and k < i .

Lemma

If Γ `R C then Γ |= C.

Proof. By induction on the sequence C1, . . . ,Cn.

7 / 36

Page 13: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (1)

Resolvent

Given two clauses C1 and C2 such that a ∈ C1 and ¬a ∈ C2,(C1 \ {a}) ∪ (C2 \ {¬a}) is the resolvent of C1 and C2.

Derivation

Given a set Γ of clauses, a derivation by resolution of a clauseC from Γ, denoted Γ `R C, is a sequence C1, . . . ,Cn such thatCn = C and for each Ci (1 ≤ i ≤ n) we have

1 Ci ∈ Γ, or2 Ci is a resolvent of Cj and Ck , where j < i and k < i .

Lemma

If Γ `R C then Γ |= C.

Proof. By induction on the sequence C1, . . . ,Cn.

7 / 36

Page 14: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (1)

Resolvent

Given two clauses C1 and C2 such that a ∈ C1 and ¬a ∈ C2,(C1 \ {a}) ∪ (C2 \ {¬a}) is the resolvent of C1 and C2.

Derivation

Given a set Γ of clauses, a derivation by resolution of a clauseC from Γ, denoted Γ `R C, is a sequence C1, . . . ,Cn such thatCn = C and for each Ci (1 ≤ i ≤ n) we have

1 Ci ∈ Γ, or2 Ci is a resolvent of Cj and Ck , where j < i and k < i .

Lemma

If Γ `R C then Γ |= C.

Proof. By induction on the sequence C1, . . . ,Cn.7 / 36

Page 15: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}

, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 16: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}

, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 17: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 18: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 19: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:C1 = {¬rain, streetwet}

C2 = {rain}C3 = {streetwet}

{¬rain, streetwet}

{rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 20: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:C1 = {¬rain, streetwet}C2 = {rain}

C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 21: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:C1 = {¬rain, streetwet}C2 = {rain}C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet

8 / 36

Page 22: Propositional Logic Resolution, DPLL and tableau

Derivation by resolution (2)Consider

Γ = {rain→ streetwet , rain}, or equivalentlyΓ = {¬rain ∨ streetwet , rain}, or equivalentlyΓ = {{¬rain, streetwet}, {rain}}

The following is a derivation by resolution:C1 = {¬rain, streetwet}C2 = {rain}C3 = {streetwet}

{¬rain, streetwet} {rain}

{streetwet}

rain→ streetwet , rain `R streetwet8 / 36

Page 23: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

9 / 36

Page 24: Propositional Logic Resolution, DPLL and tableau

Refutation (1)

Our goal is to model Γ |= ⊥

Let � be the empty clause

� is like ⊥� is different from an empty set of formulas!

Refutation

A derivation by resolution of � from Γ is called a refutation of Γ.

Resolution Theorem

Γ `R � if and only if Γ is unsatisfiable.

Proof. Soundness: Γ `R � implies Γ |= � (by the previousLemma).Completeness: by induction over the number of variables in Γ.

10 / 36

Page 25: Propositional Logic Resolution, DPLL and tableau

Refutation (1)

Our goal is to model Γ |= ⊥Let � be the empty clause

� is like ⊥� is different from an empty set of formulas!

Refutation

A derivation by resolution of � from Γ is called a refutation of Γ.

Resolution Theorem

Γ `R � if and only if Γ is unsatisfiable.

Proof. Soundness: Γ `R � implies Γ |= � (by the previousLemma).Completeness: by induction over the number of variables in Γ.

10 / 36

Page 26: Propositional Logic Resolution, DPLL and tableau

Refutation (1)

Our goal is to model Γ |= ⊥Let � be the empty clause

� is like ⊥

� is different from an empty set of formulas!

Refutation

A derivation by resolution of � from Γ is called a refutation of Γ.

Resolution Theorem

Γ `R � if and only if Γ is unsatisfiable.

Proof. Soundness: Γ `R � implies Γ |= � (by the previousLemma).Completeness: by induction over the number of variables in Γ.

10 / 36

Page 27: Propositional Logic Resolution, DPLL and tableau

Refutation (1)

Our goal is to model Γ |= ⊥Let � be the empty clause

� is like ⊥� is different from an empty set of formulas!

Refutation

A derivation by resolution of � from Γ is called a refutation of Γ.

Resolution Theorem

Γ `R � if and only if Γ is unsatisfiable.

Proof. Soundness: Γ `R � implies Γ |= � (by the previousLemma).Completeness: by induction over the number of variables in Γ.

10 / 36

Page 28: Propositional Logic Resolution, DPLL and tableau

Refutation (1)

Our goal is to model Γ |= ⊥Let � be the empty clause

� is like ⊥� is different from an empty set of formulas!

Refutation

A derivation by resolution of � from Γ is called a refutation of Γ.

Resolution Theorem

Γ `R � if and only if Γ is unsatisfiable.

Proof. Soundness: Γ `R � implies Γ |= � (by the previousLemma).Completeness: by induction over the number of variables in Γ.

10 / 36

Page 29: Propositional Logic Resolution, DPLL and tableau

Refutation (1)

Our goal is to model Γ |= ⊥Let � be the empty clause

� is like ⊥� is different from an empty set of formulas!

Refutation

A derivation by resolution of � from Γ is called a refutation of Γ.

Resolution Theorem

Γ `R � if and only if Γ is unsatisfiable.

Proof. Soundness: Γ `R � implies Γ |= � (by the previousLemma).Completeness: by induction over the number of variables in Γ.

10 / 36

Page 30: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwet

IFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 31: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 32: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 33: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}

C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet}

{rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 34: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}

C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain}

{¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 35: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 36: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}

C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 37: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 38: Propositional Logic Resolution, DPLL and tableau

Refutation (2)Goal: {rain→ streetwet , rain} |= streetwetIFF: {rain→ streetwet , rain} ∪ {¬streetwet} |= ⊥

The following is a refutation of{rain→ streetwet , rain, ¬streetwet}:

C1 = {¬rain, streetwet}C2 = {rain}C3 = {¬streetwet}

C4 = {streetwet}C5 = {} = �

{¬rain, streetwet} {rain} {¬streetwet}

{streetwet}

rain→ streetwet , rain, ¬streetwet `R �

11 / 36

Page 39: Propositional Logic Resolution, DPLL and tableau

Validity, equivalence, entailment, ...Validity

|= φ iff ¬φ |= ⊥Test whether ¬φ `R �

Equivalence

φ ≡ ψ iff ¬(φ↔ ψ) |= ⊥Test whether ¬(φ↔ ψ) `R �

Entailment

Γ |= φ iff Γ, ¬φ |= ⊥Test whether Γ, ¬φ `R �

Satisfiability

φ is satisfiable iff ¬φ is not validTest whether φ 6`R �

12 / 36

Page 40: Propositional Logic Resolution, DPLL and tableau

Validity, equivalence, entailment, ...Validity

|= φ iff ¬φ |= ⊥Test whether ¬φ `R �

Equivalence

φ ≡ ψ iff ¬(φ↔ ψ) |= ⊥Test whether ¬(φ↔ ψ) `R �

Entailment

Γ |= φ iff Γ, ¬φ |= ⊥Test whether Γ, ¬φ `R �

Satisfiability

φ is satisfiable iff ¬φ is not validTest whether φ 6`R �

12 / 36

Page 41: Propositional Logic Resolution, DPLL and tableau

Validity, equivalence, entailment, ...Validity

|= φ iff ¬φ |= ⊥Test whether ¬φ `R �

Equivalence

φ ≡ ψ iff ¬(φ↔ ψ) |= ⊥Test whether ¬(φ↔ ψ) `R �

Entailment

Γ |= φ iff Γ, ¬φ |= ⊥Test whether Γ, ¬φ `R �

Satisfiability

φ is satisfiable iff ¬φ is not validTest whether φ 6`R �

12 / 36

Page 42: Propositional Logic Resolution, DPLL and tableau

Validity, equivalence, entailment, ...Validity

|= φ iff ¬φ |= ⊥Test whether ¬φ `R �

Equivalence

φ ≡ ψ iff ¬(φ↔ ψ) |= ⊥Test whether ¬(φ↔ ψ) `R �

Entailment

Γ |= φ iff Γ, ¬φ |= ⊥Test whether Γ, ¬φ `R �

Satisfiability

φ is satisfiable iff ¬φ is not validTest whether φ 6`R �

12 / 36

Page 43: Propositional Logic Resolution, DPLL and tableau

Implementing resolution (1)Algorithm: SAT by resolutionInput : a set Γ of wffsOutput: true if Γ is SAT; false otherwise

1 begin2 ΓCNF := trasformToCNF (Γ);3 repeat4 if � ∈ ΓCNF then5 return false;

6 Γold := ΓCNF ;7 ΓCNF := ΓCNF ∪ resolveAll(ΓCNF );8 until Γold = ΓCNF ;9 return true;

Function resolveAll(ΓCNF : set of clauses)1 begin2 Γres := ∅;3 foreach C1 ∈ ΓCNF and foreach atom a ∈ C1 do4 foreach C2 ∈ ΓCNF such that ¬a ∈ C2 do5 Γres := Γres ∪ {C1 \ {a} ∪ C2 \ {¬a}};

6 return Γres

13 / 36

Page 44: Propositional Logic Resolution, DPLL and tableau

Implementing resolution (2)

Complexity

Deciding Γ `R � requires up to an exponential number of steps(with respect to the size of the formula)

Since unsatisfiability of a formula is coNP-complete,this is “reasonable”

Example

Is the following formula satisfiable?(A ∨ B) ∧ (A↔ B) ∧ (¬A ∨ ¬B)

14 / 36

Page 45: Propositional Logic Resolution, DPLL and tableau

Implementing resolution (2)

Complexity

Deciding Γ `R � requires up to an exponential number of steps(with respect to the size of the formula)

Since unsatisfiability of a formula is coNP-complete,this is “reasonable”

Example

Is the following formula satisfiable?(A ∨ B) ∧ (A↔ B) ∧ (¬A ∨ ¬B)

14 / 36

Page 46: Propositional Logic Resolution, DPLL and tableau

Implementing resolution (2)

Complexity

Deciding Γ `R � requires up to an exponential number of steps(with respect to the size of the formula)

Since unsatisfiability of a formula is coNP-complete,this is “reasonable”

Example

Is the following formula satisfiable?(A ∨ B) ∧ (A↔ B) ∧ (¬A ∨ ¬B)

14 / 36

Page 47: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

15 / 36

Page 48: Propositional Logic Resolution, DPLL and tableau

Refinements (1)

Drop tautological clauses

A clause C is a tautology if there is a ∈ V such thata ∈ C and ¬a ∈ C

Drop subsumed clauses

A clause C1 subsumes a clause C2 if C1 ⊆ C2

Linear Resolution

Any intermediate derivation uses the clause obtained in theprevious step.

Theorem

Linear resolution is refutation complete: If a set of wffs isunsatisfiable then a refutation by linear resolution exists.

{{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

16 / 36

Page 49: Propositional Logic Resolution, DPLL and tableau

Refinements (1)

Drop tautological clauses

A clause C is a tautology if there is a ∈ V such thata ∈ C and ¬a ∈ C

Drop subsumed clauses

A clause C1 subsumes a clause C2 if C1 ⊆ C2

Linear Resolution

Any intermediate derivation uses the clause obtained in theprevious step.

Theorem

Linear resolution is refutation complete: If a set of wffs isunsatisfiable then a refutation by linear resolution exists.

{{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

16 / 36

Page 50: Propositional Logic Resolution, DPLL and tableau

Refinements (1)

Drop tautological clauses

A clause C is a tautology if there is a ∈ V such thata ∈ C and ¬a ∈ C

Drop subsumed clauses

A clause C1 subsumes a clause C2 if C1 ⊆ C2

Linear Resolution

Any intermediate derivation uses the clause obtained in theprevious step.

Theorem

Linear resolution is refutation complete: If a set of wffs isunsatisfiable then a refutation by linear resolution exists.

{{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

16 / 36

Page 51: Propositional Logic Resolution, DPLL and tableau

Refinements (1)

Drop tautological clauses

A clause C is a tautology if there is a ∈ V such thata ∈ C and ¬a ∈ C

Drop subsumed clauses

A clause C1 subsumes a clause C2 if C1 ⊆ C2

Linear Resolution

Any intermediate derivation uses the clause obtained in theprevious step.

Theorem

Linear resolution is refutation complete: If a set of wffs isunsatisfiable then a refutation by linear resolution exists.

{{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

16 / 36

Page 52: Propositional Logic Resolution, DPLL and tableau

Refinements (1)

Drop tautological clauses

A clause C is a tautology if there is a ∈ V such thata ∈ C and ¬a ∈ C

Drop subsumed clauses

A clause C1 subsumes a clause C2 if C1 ⊆ C2

Linear Resolution

Any intermediate derivation uses the clause obtained in theprevious step.

Theorem

Linear resolution is refutation complete: If a set of wffs isunsatisfiable then a refutation by linear resolution exists.

{{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}16 / 36

Page 53: Propositional Logic Resolution, DPLL and tableau

Refinements (2)

Linear Input Resolution

Any intermediate derivation uses the clause obtained in theprevious step and a clause of the original formula.

Theorem

Linear input resolution is refutation complete for (sets of) Hornclauses, where a Horn clause is a clause containing at mostone positive atom.

Example

1 {{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}2 {{A}, {B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

17 / 36

Page 54: Propositional Logic Resolution, DPLL and tableau

Refinements (2)

Linear Input Resolution

Any intermediate derivation uses the clause obtained in theprevious step and a clause of the original formula.

Theorem

Linear input resolution is refutation complete for (sets of) Hornclauses, where a Horn clause is a clause containing at mostone positive atom.

Example

1 {{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}2 {{A}, {B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

17 / 36

Page 55: Propositional Logic Resolution, DPLL and tableau

Refinements (2)

Linear Input Resolution

Any intermediate derivation uses the clause obtained in theprevious step and a clause of the original formula.

Theorem

Linear input resolution is refutation complete for (sets of) Hornclauses, where a Horn clause is a clause containing at mostone positive atom.

Example

1 {{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

2 {{A}, {B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

17 / 36

Page 56: Propositional Logic Resolution, DPLL and tableau

Refinements (2)

Linear Input Resolution

Any intermediate derivation uses the clause obtained in theprevious step and a clause of the original formula.

Theorem

Linear input resolution is refutation complete for (sets of) Hornclauses, where a Horn clause is a clause containing at mostone positive atom.

Example

1 {{A,B}, {A,¬B}, {¬A,B}, {¬A,¬B}}2 {{A}, {B}, {A,¬B}, {¬A,B}, {¬A,¬B}}

17 / 36

Page 57: Propositional Logic Resolution, DPLL and tableau

Examples

1 Is (A1 ∨ A2) ∧ (¬A2 ∨ ¬A3) ∧ (A3 ∨ A4) ∧ (¬A4 ∨ ¬A1)satisfiable?

2 Does A follow from (A ∨ B ∨ C) ∧ (¬C ∨ B) ∧ (A ∨ ¬B)?3 Does ¬A follow from (A ∨ B ∨ C) ∧ (¬C ∨ B) ∧ (A ∨ ¬B)?4 Does A∧B follow from (¬A→ B)∧ (A→ B)∧ (¬A→ ¬B)?

18 / 36

Page 58: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

19 / 36

Page 59: Propositional Logic Resolution, DPLL and tableau

DPLL algorithm

By ¬` we denote the opposite literal of `if ` = ¬a then ¬` = a

Simplify is often called Unit PropagationCall-by-name parameters (references)

Algorithm: DPLLInput : a set Γ of clausesOutput: true if Γ is SAT; false otherwise

1 begin2 Simplify(Γ);3 if Γ = ∅ then return true ;4 if � ∈ Γ then return false ;5 ` := ChooseLiteral(Γ);6 return DPLL(Γ ∪ {`}) or DPLL(Γ ∪ {¬`});

Procedure Simplify(Γ)1 begin2 while {`} ∈ Γ do3 foreach c ∈ Γ do4 if ` ∈ c then Γ := Γ \ {c} ;5 else if ¬` ∈ c then Γ := (Γ \ {c}) ∪ (c \ {¬`}) ;

20 / 36

Page 60: Propositional Logic Resolution, DPLL and tableau

Properties

DPLL(Γ) returns true if Γ is satisfiable, and false otherwise

DPLL(Γ) can be (easily) modified in order to compute one(or all) models of Γ

DPLL is sound and complete

DPLL(Γ) works in polynomial-space

21 / 36

Page 61: Propositional Logic Resolution, DPLL and tableau

Properties

DPLL(Γ) returns true if Γ is satisfiable, and false otherwiseDPLL(Γ) can be (easily) modified in order to compute one(or all) models of Γ

DPLL is sound and complete

DPLL(Γ) works in polynomial-space

21 / 36

Page 62: Propositional Logic Resolution, DPLL and tableau

Properties

DPLL(Γ) returns true if Γ is satisfiable, and false otherwiseDPLL(Γ) can be (easily) modified in order to compute one(or all) models of Γ

DPLL is sound and complete

DPLL(Γ) works in polynomial-space

21 / 36

Page 63: Propositional Logic Resolution, DPLL and tableau

Properties

DPLL(Γ) returns true if Γ is satisfiable, and false otherwiseDPLL(Γ) can be (easily) modified in order to compute one(or all) models of Γ

DPLL is sound and complete

DPLL(Γ) works in polynomial-space

21 / 36

Page 64: Propositional Logic Resolution, DPLL and tableau

Features

Simplification

The input set of clauses is simplified at each branch using (atleast) unit clause propagation

Branching

When no further simplification is possible, a literal is selectedusing some heuristic criterion (ChooseLiteral) and assumed asa unit clause in the current set of clauses

Backtracking

When a contradiction (empty clause) arises, the searchresumes from some previous assumption ` by assuming ¬`instead

22 / 36

Page 65: Propositional Logic Resolution, DPLL and tableau

Features

Simplification

The input set of clauses is simplified at each branch using (atleast) unit clause propagation

Branching

When no further simplification is possible, a literal is selectedusing some heuristic criterion (ChooseLiteral) and assumed asa unit clause in the current set of clauses

Backtracking

When a contradiction (empty clause) arises, the searchresumes from some previous assumption ` by assuming ¬`instead

22 / 36

Page 66: Propositional Logic Resolution, DPLL and tableau

Features

Simplification

The input set of clauses is simplified at each branch using (atleast) unit clause propagation

Branching

When no further simplification is possible, a literal is selectedusing some heuristic criterion (ChooseLiteral) and assumed asa unit clause in the current set of clauses

Backtracking

When a contradiction (empty clause) arises, the searchresumes from some previous assumption ` by assuming ¬`instead

22 / 36

Page 67: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}:

Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 68: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}

ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 69: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3:

Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 70: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 71: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}:

Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 72: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}

If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 73: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3,

the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 74: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore;

otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 75: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned,

another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 76: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 77: Propositional Logic Resolution, DPLL and tableau

Examples (1)

Example

Γ = {{x1, x2,¬x3}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3}, {x4,¬x3}}ChooseLiteral returns ¬x3: Γ = ∅, i.e., the formula is SAT!

Example

Γ = {{x1, x2,¬x3,¬x4}, {¬x2}, {x4,¬x3}}

Simplify using {¬x2}: Γ = {{x1,¬x3,¬x4}, {x4,¬x3}}If ChooseLiteral returns ¬x3, the process is the same asbefore; otherwise, if x1 is returned, another choice has tobe made

Branching order (ChooseLiteral) can make big differences!

23 / 36

Page 78: Propositional Logic Resolution, DPLL and tableau

Examples (2)

1 {{x1, x2, x3}, {x1, x2,¬x3}, {x1,¬x2, x3},{x1,¬x2,¬x3}, {¬x1, x4}, {x1,¬x4,¬x5, x6}, {¬x1, x7}}

2 {{x1, x2}, {x1,¬x2}, {¬x1, x2}, {¬x1,¬x2}}

24 / 36

Page 79: Propositional Logic Resolution, DPLL and tableau

Examples (2)

1 {{x1, x2, x3}, {x1, x2,¬x3}, {x1,¬x2, x3},{x1,¬x2,¬x3}, {¬x1, x4}, {x1,¬x4,¬x5, x6}, {¬x1, x7}}

2 {{x1, x2}, {x1,¬x2}, {¬x1, x2}, {¬x1,¬x2}}

24 / 36

Page 80: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?

2-watched literalsHow to implement ChooseLiteral?

Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?

LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 81: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?

Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?

LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 82: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?

Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?

LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 83: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristics

Look-back heuristicsHow to take advantage from conflicts?

LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 84: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?

LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 85: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?

LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 86: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?Learning

BackjumpingCan we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 87: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 88: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?LearningBackjumping

Can we reuse something from a previous computation?

Progressive SAT

25 / 36

Page 89: Propositional Logic Resolution, DPLL and tableau

Refinements

How to efficiently detect unit clauses?2-watched literals

How to implement ChooseLiteral?Look-ahead heuristicsLook-back heuristics

How to take advantage from conflicts?LearningBackjumping

Can we reuse something from a previous computation?Progressive SAT

25 / 36

Page 90: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

26 / 36

Page 91: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (1)

Yet another decision procedure for unsatisfiability

The idea is to break down logical connectives into theirconstituent partsWe consider the tableau for formulas in Negation NormalForm (NNF)

Negation Normal Form

1 Eliminate >, ⊥,→,↔2 Apply double negation equivalences:

¬¬φ ≡ φ3 Apply De Morgan equivalences:

¬(φ ∨ ψ) ≡ ¬ψ ∧ ¬φ¬(φ ∧ ψ) ≡ ¬ψ ∨ ¬φ

27 / 36

Page 92: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (1)

Yet another decision procedure for unsatisfiabilityThe idea is to break down logical connectives into theirconstituent parts

We consider the tableau for formulas in Negation NormalForm (NNF)

Negation Normal Form

1 Eliminate >, ⊥,→,↔2 Apply double negation equivalences:

¬¬φ ≡ φ3 Apply De Morgan equivalences:

¬(φ ∨ ψ) ≡ ¬ψ ∧ ¬φ¬(φ ∧ ψ) ≡ ¬ψ ∨ ¬φ

27 / 36

Page 93: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (1)

Yet another decision procedure for unsatisfiabilityThe idea is to break down logical connectives into theirconstituent partsWe consider the tableau for formulas in Negation NormalForm (NNF)

Negation Normal Form

1 Eliminate >, ⊥,→,↔2 Apply double negation equivalences:

¬¬φ ≡ φ3 Apply De Morgan equivalences:

¬(φ ∨ ψ) ≡ ¬ψ ∧ ¬φ¬(φ ∧ ψ) ≡ ¬ψ ∨ ¬φ

27 / 36

Page 94: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (1)

Yet another decision procedure for unsatisfiabilityThe idea is to break down logical connectives into theirconstituent partsWe consider the tableau for formulas in Negation NormalForm (NNF)

Negation Normal Form

1 Eliminate >, ⊥,→,↔2 Apply double negation equivalences:

¬¬φ ≡ φ3 Apply De Morgan equivalences:

¬(φ ∨ ψ) ≡ ¬ψ ∧ ¬φ¬(φ ∧ ψ) ≡ ¬ψ ∨ ¬φ

27 / 36

Page 95: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (2)Let Γ be a set of wffs in NNF.

1 Start with a chain made of the formulas in Γ

2 If a branch contains a formula φ ∧ ψ then add to its leaf thechain φ — ψ

3 If a branch contains a formula φ ∨ ψ then add to its leaf twochildren φ and ψ

4 If a branch contains a formula and its negation then closethe branch

5 If all branches are closed then Γ is unsatisfiable

Notation

φ ∧ ψφψ

(∧)φ ∨ ψφ | ψ

(∨)

28 / 36

Page 96: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (2)Let Γ be a set of wffs in NNF.

1 Start with a chain made of the formulas in Γ

2 If a branch contains a formula φ ∧ ψ then add to its leaf thechain φ — ψ

3 If a branch contains a formula φ ∨ ψ then add to its leaf twochildren φ and ψ

4 If a branch contains a formula and its negation then closethe branch

5 If all branches are closed then Γ is unsatisfiable

Notation

φ ∧ ψφψ

(∧)φ ∨ ψφ | ψ

(∨)

28 / 36

Page 97: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (2)Let Γ be a set of wffs in NNF.

1 Start with a chain made of the formulas in Γ

2 If a branch contains a formula φ ∧ ψ then add to its leaf thechain φ — ψ

3 If a branch contains a formula φ ∨ ψ then add to its leaf twochildren φ and ψ

4 If a branch contains a formula and its negation then closethe branch

5 If all branches are closed then Γ is unsatisfiable

Notation

φ ∧ ψφψ

(∧)φ ∨ ψφ | ψ

(∨)

28 / 36

Page 98: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (2)Let Γ be a set of wffs in NNF.

1 Start with a chain made of the formulas in Γ

2 If a branch contains a formula φ ∧ ψ then add to its leaf thechain φ — ψ

3 If a branch contains a formula φ ∨ ψ then add to its leaf twochildren φ and ψ

4 If a branch contains a formula and its negation then closethe branch

5 If all branches are closed then Γ is unsatisfiable

Notation

φ ∧ ψφψ

(∧)φ ∨ ψφ | ψ

(∨)

28 / 36

Page 99: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (2)Let Γ be a set of wffs in NNF.

1 Start with a chain made of the formulas in Γ

2 If a branch contains a formula φ ∧ ψ then add to its leaf thechain φ — ψ

3 If a branch contains a formula φ ∨ ψ then add to its leaf twochildren φ and ψ

4 If a branch contains a formula and its negation then closethe branch

5 If all branches are closed then Γ is unsatisfiable

Notation

φ ∧ ψφψ

(∧)φ ∨ ψφ | ψ

(∨)

28 / 36

Page 100: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (2)Let Γ be a set of wffs in NNF.

1 Start with a chain made of the formulas in Γ

2 If a branch contains a formula φ ∧ ψ then add to its leaf thechain φ — ψ

3 If a branch contains a formula φ ∨ ψ then add to its leaf twochildren φ and ψ

4 If a branch contains a formula and its negation then closethe branch

5 If all branches are closed then Γ is unsatisfiable

Notation

φ ∧ ψφψ

(∧)φ ∨ ψφ | ψ

(∨)

28 / 36

Page 101: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 102: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 103: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 104: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 105: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 106: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 107: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 108: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed.

29 / 36

Page 109: Propositional Logic Resolution, DPLL and tableau

Propositional Tableau (3)

Example: Γ := {(A ∨ ¬B) ∧ B,¬A}

(A ∨ ¬B) ∧ B

¬A

A ∨ ¬B

B

A ¬B

Γ is unsatisfiable!

We can simplifythe notation usedfor a closure byputting a markeron the leaf of theclosed path!

On the blackboard

A ∧ C,¬A ∨ B

Theorem

Propositional tableau is sound and complete, i.e.,if the tableau for Γ is closed then Γ |= ⊥, andif Γ |= ⊥ then the tableau for Γ is closed. 29 / 36

Page 110: Propositional Logic Resolution, DPLL and tableau

Outline

1 Propositional resolutionResolutionRefutationsRefinements and examples

2 DPLL

3 Propositional Tableau

4 Exercises

30 / 36

Page 111: Propositional Logic Resolution, DPLL and tableau

Exercises (1)(From Logic for Computer Science: Foundations of AutomaticTheorem Proving)

1 Show that the following set of clauses are unsatisfiableusing the resolution method:

1 {{A,B,¬C}, {A,B,C}, {A,¬B}, {¬A}}2 {{A,¬B,C}, {B,C}, {¬A,C}, {B,¬C}, {¬B}}3 {{A,¬B}, {A,C}, {¬B,C}, {¬A,B}, {B,¬C}, {¬A,¬C}}4 {{A,B}, {¬A,B}, {A,¬B}, {¬A,¬B}, }

2 Find all resolvents of the following pairs of clauses:1 {A,B}, {¬A,¬B}2 {A,¬B}, {B,C,D}3 {¬A,B,¬C}, {B,C}4 {A,¬A}, {A,¬A}

3 Find all resolvents of the following sets of clauses:1 {{A,¬B}, {A,B}, {¬A}}2 {{A,B,C}, {¬B,¬C}, {¬A,¬C}}3 {{¬A,¬B}, {B,C}, {¬C,A}}4 {{A,B,C}, {A}, {B}}

31 / 36

Page 112: Propositional Logic Resolution, DPLL and tableau

Exercises (2)

1 Show using resolution whether the following statementshold:

1 x ∨ y ∨ ¬z |= (x ∨ z)↔ (¬y → x)2 ((¬X ∨ ¬Y )→ ¬(¬Y ∨ X )) is satisfiable

32 / 36

Page 113: Propositional Logic Resolution, DPLL and tableau

Exercises (3)

(From Logic for Computer Science: Foundations of AutomaticTheorem Proving)

1 Show that the following set of clauses are unsatisfiableusing the DPLL algorithm:

1 {{A,B,¬C}, {A,B,C}, {A,¬B}, {¬A}}2 {{A,¬B,C}, {B,C}, {¬A,C}, {B,¬C}, {¬B}}3 {{A,¬B}, {A,C}, {¬B,C}, {¬A,B}, {B,¬C}, {¬A,¬C}}4 {{A,B}, {¬A,B}, {A,¬B}, {¬A,¬B}, }

2 Show using DPLL whether the following statements hold:1 x ∨ y ∨ ¬z |= (x ∨ z)↔ (¬y → x)2 ((¬X ∨ ¬Y )→ ¬(¬Y ∨ X )) is satisfiable

33 / 36

Page 114: Propositional Logic Resolution, DPLL and tableau

Exercises (4)

(From Logic for Computer Science: Foundations of AutomaticTheorem Proving)

Give proof trees (by means of tableau) for the followingtautologies:

1 A→ (B → A)

2 (A→ B)→ ((A→ (B → C))→ (A→ C))

3 A→ (B → A ∧ B)

4 A→ A ∨ B5 B → A ∨ B6 (A→ B)→ ((A→ ¬B)→ ¬A)

7 A ∧ B → A8 A ∧ B → B9 (A→ C)→ ((B → C)→ (A ∨ B → C))

10 ¬¬A→ A

34 / 36

Page 115: Propositional Logic Resolution, DPLL and tableau

Exercises (5)(From Logic for Computer Science: Foundations of AutomaticTheorem Proving)

Give proof trees (by means of tableau) for the followingequivalences:

1 (A ∨ B) ∨ C ≡ A ∨ (B ∨ C) (associativity)2 (A ∧ B) ∧ C ≡ A ∧ (B ∧ C) (associativity)3 A ∨ B ≡ B ∨ A (commutativity)4 A ∧ B ≡ B ∧ A (commutativity)5 A ∨ (B ∧ C) ≡ (A ∨ B) ∧ (A ∨ C) (distributivity)6 A ∧ (B ∨ C) ≡ (A ∧ B) ∨ (A ∧ C) (distributivity)7 ¬(A ∨ B) ≡ ¬A ∧ ¬B (De Morgan)8 ¬(A ∧ B) ≡ ¬A ∨ ¬B (De Morgan)9 A ∨ A ≡ A (idempotency)

10 A ∧ A ≡ A (idempotency)11 ¬¬A ≡ A (double negation)12 (A ∨ B) ∧ (¬A ∨ C) ≡ (A ∨ B) ∧ (¬A ∨ C) ∧ (B ∨ C)

(resolution)35 / 36

Page 116: Propositional Logic Resolution, DPLL and tableau

END OF THELECTURE

36 / 36