Theory of Computer Science B3. Propositional Logic III Gabriele R - - PowerPoint PPT Presentation

theory of computer science
SMART_READER_LITE
LIVE PREVIEW

Theory of Computer Science B3. Propositional Logic III Gabriele R - - PowerPoint PPT Presentation

Theory of Computer Science B3. Propositional Logic III Gabriele R oger University of Basel February 26, 2020 Logical Consequences Inference Resolution Calculus Summary Logical Consequences Logical Consequences Inference Resolution


slide-1
SLIDE 1

Theory of Computer Science

  • B3. Propositional Logic III

Gabriele R¨

  • ger

University of Basel

February 26, 2020

slide-2
SLIDE 2

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences

slide-3
SLIDE 3

Logical Consequences Inference Resolution Calculus Summary

Logic: Overview

Logic Propositional Logic Syntax Semantics Properties Equivalences Normal Forms Logical Consequence Inference Resolution Predicate Logic

slide-4
SLIDE 4

Logical Consequences Inference Resolution Calculus Summary

Knowledge Bases: Example

If not DrinkBeer, then EatFish. If EatFish and DrinkBeer, then not EatIceCream. If EatIceCream or not DrinkBeer, then not EatFish. KB = {(¬DrinkBeer → EatFish), ((EatFish ∧ DrinkBeer) → ¬EatIceCream), ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish)}

Exercise from U. Sch¨

  • ning: Logik f¨

ur Informatiker Picture courtesy of graur razvan ionut / FreeDigitalPhotos.net

slide-5
SLIDE 5

Logical Consequences Inference Resolution Calculus Summary

Models for Sets of Formulas

Definition (Model for Knowledge Base) Let KB be a knowledge base over A,

  • i. e., a set of propositional formulas over A.

A truth assignment I for A is a model for KB (written: I | = KB) if I is a model for every formula ϕ ∈ KB.

German: Wissensbasis, Modell

slide-6
SLIDE 6

Logical Consequences Inference Resolution Calculus Summary

Properties of Sets of Formulas

A knowledge base KB is satisfiable if KB has at least one model unsatisfiable if KB is not satisfiable valid (or a tautology) if every interpretation is a model for KB falsifiable if KB is no tautology

German: erf¨ ullbar, unerf¨ ullbar, g¨ ultig, g¨ ultig/eine Tautologie, falsifizierbar

slide-7
SLIDE 7

Logical Consequences Inference Resolution Calculus Summary

Example I

Which of the properties does KB = {(A ∧ ¬B), ¬(B ∨ A)} have? KB is unsatisfiable: For every model I with I | = (A ∧ ¬B) we have I(A) = 1. This means I | = (B ∨ A) and thus I | = ¬(B ∨ A). This directly implies that KB is falsifiable, not satisfiable and no tautology.

slide-8
SLIDE 8

Logical Consequences Inference Resolution Calculus Summary

Example I

Which of the properties does KB = {(A ∧ ¬B), ¬(B ∨ A)} have? KB is unsatisfiable: For every model I with I | = (A ∧ ¬B) we have I(A) = 1. This means I | = (B ∨ A) and thus I | = ¬(B ∨ A). This directly implies that KB is falsifiable, not satisfiable and no tautology.

slide-9
SLIDE 9

Logical Consequences Inference Resolution Calculus Summary

Example I

Which of the properties does KB = {(A ∧ ¬B), ¬(B ∨ A)} have? KB is unsatisfiable: For every model I with I | = (A ∧ ¬B) we have I(A) = 1. This means I | = (B ∨ A) and thus I | = ¬(B ∨ A). This directly implies that KB is falsifiable, not satisfiable and no tautology.

slide-10
SLIDE 10

Logical Consequences Inference Resolution Calculus Summary

Example II

Which of the properties does KB = {(¬DrinkBeer → EatFish), ((EatFish ∧ DrinkBeer) → ¬EatIceCream), ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish)} have?

slide-11
SLIDE 11

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences: Motivation

What’s the secret of your long life? I am on a strict diet: If I don’t drink beer to a meal, then I always eat fish. When- ever I have fish and beer with the same meal, I abstain from ice cream. When I eat ice cream or don’t drink beer, then I never touch fish. Claim: the woman drinks beer to every meal. How can we prove this?

Exercise from U. Sch¨

  • ning: Logik f¨

ur Informatiker Picture courtesy of graur razvan ionut/FreeDigitalPhotos.net

slide-12
SLIDE 12

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences

Definition (Logical Consequence) Let KB be a set of formulas and ϕ a formula. We say that KB logically implies ϕ (written as KB | = ϕ) if all models of KB are also models of ϕ. also: KB logically entails ϕ, ϕ logically follows from KB, ϕ is a logical consequence of KB

German: KB impliziert ϕ logisch, ϕ folgt logisch aus KB, ϕ ist logische Konsequenz von KB

Attention: the symbol | = is “overloaded”: KB | = ϕ vs. I | = ϕ. What if KB is unsatisfiable or the empty set?

slide-13
SLIDE 13

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences

Definition (Logical Consequence) Let KB be a set of formulas and ϕ a formula. We say that KB logically implies ϕ (written as KB | = ϕ) if all models of KB are also models of ϕ. also: KB logically entails ϕ, ϕ logically follows from KB, ϕ is a logical consequence of KB

German: KB impliziert ϕ logisch, ϕ folgt logisch aus KB, ϕ ist logische Konsequenz von KB

Attention: the symbol | = is “overloaded”: KB | = ϕ vs. I | = ϕ. What if KB is unsatisfiable or the empty set?

slide-14
SLIDE 14

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences

Definition (Logical Consequence) Let KB be a set of formulas and ϕ a formula. We say that KB logically implies ϕ (written as KB | = ϕ) if all models of KB are also models of ϕ. also: KB logically entails ϕ, ϕ logically follows from KB, ϕ is a logical consequence of KB

German: KB impliziert ϕ logisch, ϕ folgt logisch aus KB, ϕ ist logische Konsequenz von KB

Attention: the symbol | = is “overloaded”: KB | = ϕ vs. I | = ϕ. What if KB is unsatisfiable or the empty set?

slide-15
SLIDE 15

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences: Example

Let ϕ = DrinkBeer and KB = {(¬DrinkBeer → EatFish), ((EatFish ∧ DrinkBeer) → ¬EatIceCream), ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish)}. Show: KB | = ϕ Proof sketch. Proof by contradiction: assume I | = KB, but I | = DrinkBeer. Then it follows that I | = ¬DrinkBeer. Because I is a model of KB, we also have I | = (¬DrinkBeer → EatFish) and thus I | = EatFish. (Why?) With an analogous argumentation starting from I | = ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish) we get I | = ¬EatFish and thus I | = EatFish. Contradiction!

slide-16
SLIDE 16

Logical Consequences Inference Resolution Calculus Summary

Logical Consequences: Example

Let ϕ = DrinkBeer and KB = {(¬DrinkBeer → EatFish), ((EatFish ∧ DrinkBeer) → ¬EatIceCream), ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish)}. Show: KB | = ϕ Proof sketch. Proof by contradiction: assume I | = KB, but I | = DrinkBeer. Then it follows that I | = ¬DrinkBeer. Because I is a model of KB, we also have I | = (¬DrinkBeer → EatFish) and thus I | = EatFish. (Why?) With an analogous argumentation starting from I | = ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish) we get I | = ¬EatFish and thus I | = EatFish. Contradiction!

slide-17
SLIDE 17

Logical Consequences Inference Resolution Calculus Summary

Important Theorems about Logical Consequences

Theorem (Deduction Theorem) KB ∪ {ϕ} | = ψ iff KB | = (ϕ → ψ)

German: Deduktionssatz

Theorem (Contraposition Theorem) KB ∪ {ϕ} | = ¬ψ iff KB ∪ {ψ} | = ¬ϕ

German: Kontrapositionssatz

Theorem (Contradiction Theorem) KB ∪ {ϕ} is unsatisfiable iff KB | = ¬ϕ

German: Widerlegungssatz

(without proof)

slide-18
SLIDE 18

Logical Consequences Inference Resolution Calculus Summary

Questions Questions?

slide-19
SLIDE 19

Logical Consequences Inference Resolution Calculus Summary

Inference

slide-20
SLIDE 20

Logical Consequences Inference Resolution Calculus Summary

Logic: Overview

Logic Propositional Logic Syntax Semantics Properties Equivalences Normal Forms Logical Consequence Inference Resolution Predicate Logic

slide-21
SLIDE 21

Logical Consequences Inference Resolution Calculus Summary

Inference: Motivation

up to now: proof of logical consequence with semantic arguments no general algorithm solution: produce with syntactic inference rules formulas that are logical consequences of given formulas. advantage: mechanical method can easily be implemented as an algorithm

slide-22
SLIDE 22

Logical Consequences Inference Resolution Calculus Summary

Inference: Motivation

up to now: proof of logical consequence with semantic arguments no general algorithm solution: produce with syntactic inference rules formulas that are logical consequences of given formulas. advantage: mechanical method can easily be implemented as an algorithm

slide-23
SLIDE 23

Logical Consequences Inference Resolution Calculus Summary

Inference: Motivation

up to now: proof of logical consequence with semantic arguments no general algorithm solution: produce with syntactic inference rules formulas that are logical consequences of given formulas. advantage: mechanical method can easily be implemented as an algorithm

slide-24
SLIDE 24

Logical Consequences Inference Resolution Calculus Summary

Inference: Motivation

up to now: proof of logical consequence with semantic arguments no general algorithm solution: produce with syntactic inference rules formulas that are logical consequences of given formulas. advantage: mechanical method can easily be implemented as an algorithm

slide-25
SLIDE 25

Logical Consequences Inference Resolution Calculus Summary

Inference Rules

Inference rules have the form ϕ1, . . . , ϕk ψ . Meaning: ”‘Every model of ϕ1, . . . , ϕk is a model of ψ.”’ An axiom is an inference rule with k = 0. A set of syntactic inference rules is called a calculus

  • r proof system.

German: Inferenzregel

slide-26
SLIDE 26

Logical Consequences Inference Resolution Calculus Summary

Inference Rules

Inference rules have the form ϕ1, . . . , ϕk ψ . Meaning: ”‘Every model of ϕ1, . . . , ϕk is a model of ψ.”’ An axiom is an inference rule with k = 0. A set of syntactic inference rules is called a calculus

  • r proof system.

German: Inferenzregel

slide-27
SLIDE 27

Logical Consequences Inference Resolution Calculus Summary

Inference Rules

Inference rules have the form ϕ1, . . . , ϕk ψ . Meaning: ”‘Every model of ϕ1, . . . , ϕk is a model of ψ.”’ An axiom is an inference rule with k = 0. A set of syntactic inference rules is called a calculus

  • r proof system.

German: Inferenzregel, Axiom

slide-28
SLIDE 28

Logical Consequences Inference Resolution Calculus Summary

Inference Rules

Inference rules have the form ϕ1, . . . , ϕk ψ . Meaning: ”‘Every model of ϕ1, . . . , ϕk is a model of ψ.”’ An axiom is an inference rule with k = 0. A set of syntactic inference rules is called a calculus

  • r proof system.

German: Inferenzregel, Axiom, Kalk¨ ul, Beweissystem

slide-29
SLIDE 29

Logical Consequences Inference Resolution Calculus Summary

Some Inference Rules for Propositional Logic

Modus ponens ϕ, (ϕ → ψ) ψ

slide-30
SLIDE 30

Logical Consequences Inference Resolution Calculus Summary

Some Inference Rules for Propositional Logic

Modus ponens ϕ, (ϕ → ψ) ψ Modus tollens ¬ψ, (ϕ → ψ) ¬ϕ

slide-31
SLIDE 31

Logical Consequences Inference Resolution Calculus Summary

Some Inference Rules for Propositional Logic

Modus ponens ϕ, (ϕ → ψ) ψ Modus tollens ¬ψ, (ϕ → ψ) ¬ϕ ∧-elimination (ϕ ∧ ψ) ϕ (ϕ ∧ ψ) ψ

slide-32
SLIDE 32

Logical Consequences Inference Resolution Calculus Summary

Some Inference Rules for Propositional Logic

Modus ponens ϕ, (ϕ → ψ) ψ Modus tollens ¬ψ, (ϕ → ψ) ¬ϕ ∧-elimination (ϕ ∧ ψ) ϕ (ϕ ∧ ψ) ψ ∧-introduction ϕ, ψ (ϕ ∧ ψ)

slide-33
SLIDE 33

Logical Consequences Inference Resolution Calculus Summary

Some Inference Rules for Propositional Logic

Modus ponens ϕ, (ϕ → ψ) ψ Modus tollens ¬ψ, (ϕ → ψ) ¬ϕ ∧-elimination (ϕ ∧ ψ) ϕ (ϕ ∧ ψ) ψ ∧-introduction ϕ, ψ (ϕ ∧ ψ) ∨-introduction ϕ (ϕ ∨ ψ)

slide-34
SLIDE 34

Logical Consequences Inference Resolution Calculus Summary

Some Inference Rules for Propositional Logic

Modus ponens ϕ, (ϕ → ψ) ψ Modus tollens ¬ψ, (ϕ → ψ) ¬ϕ ∧-elimination (ϕ ∧ ψ) ϕ (ϕ ∧ ψ) ψ ∧-introduction ϕ, ψ (ϕ ∧ ψ) ∨-introduction ϕ (ϕ ∨ ψ) ↔-elimination (ϕ ↔ ψ) (ϕ → ψ) (ϕ ↔ ψ) (ψ → ϕ)

slide-35
SLIDE 35

Logical Consequences Inference Resolution Calculus Summary

Derivation

Definition (Derivation) A derivation or proof of a formula ϕ from a knowledge base KB is a sequence of formulas ψ1, . . . , ψk with ψk = ϕ and for all i ∈ {1, . . . , k}:

ψi ∈ KB, or ψi is the result of the application of an inference rule to elements from {ψ1, . . . , ψi−1}. German: Ableitung, Beweis

slide-36
SLIDE 36

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-37
SLIDE 37

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-38
SLIDE 38

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-39
SLIDE 39

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-40
SLIDE 40

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-41
SLIDE 41

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-42
SLIDE 42

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-43
SLIDE 43

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-44
SLIDE 44

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-45
SLIDE 45

Logical Consequences Inference Resolution Calculus Summary

Derivation: Example

Example Given: KB = {P, (P → Q), (P → R), ((Q ∧ R) → S)} Task: Find derivation of (S ∧ R) from KB.

1 P (KB) 2 (P → Q) (KB) 3 Q (1, 2, Modus ponens) 4 (P → R) (KB) 5 R (1, 4, Modus ponens) 6 (Q ∧ R) (3, 5, ∧-introduction) 7 ((Q ∧ R) → S) (KB) 8 S (6, 7, Modus ponens) 9 (S ∧ R) (8, 5, ∧-introduction)

slide-46
SLIDE 46

Logical Consequences Inference Resolution Calculus Summary

Correctness and Completeness

Definition (Correctness and Completeness of a Calculus) We write KB ⊢C ϕ if there is a derivation of ϕ from KB in calculus C. (If calculus C is clear from context, also only KB ⊢ ϕ.) A calculus C is correct if for all KB and ϕ KB ⊢C ϕ implies KB | = ϕ. A calculus C is complete if for all KB and ϕ KB | = ϕ implies KB ⊢C ϕ. Consider calculus C, consisting of the derivation rules seen earlier. Question: Is C correct? Question: Is C complete?

German: korrekt, vollst¨ andig

slide-47
SLIDE 47

Logical Consequences Inference Resolution Calculus Summary

Correctness and Completeness

Definition (Correctness and Completeness of a Calculus) We write KB ⊢C ϕ if there is a derivation of ϕ from KB in calculus C. (If calculus C is clear from context, also only KB ⊢ ϕ.) A calculus C is correct if for all KB and ϕ KB ⊢C ϕ implies KB | = ϕ. A calculus C is complete if for all KB and ϕ KB | = ϕ implies KB ⊢C ϕ. Consider calculus C, consisting of the derivation rules seen earlier. Question: Is C correct? Question: Is C complete?

German: korrekt, vollst¨ andig

slide-48
SLIDE 48

Logical Consequences Inference Resolution Calculus Summary

Refutation-completeness

We obviously want correct calculi. Do we always need a complete calculus? Contradiction theorem: KB ∪ {ϕ} is unsatisfiable iff KB | = ¬ϕ This implies that KB | = ϕ iff KB ∪ {¬ϕ} is unsatisfiable. We can reduce the general implication problem to a test of unsatisfiability. In calculi, we us the special symbol for (provably) unsatisfiable formulas. Definition (Refutation-Completeness) A calculus C is refutation-complete if it holds for all unsatisfiable KB that KB ⊢C .

German: widerlegungsvollst¨ andig

slide-49
SLIDE 49

Logical Consequences Inference Resolution Calculus Summary

Refutation-completeness

We obviously want correct calculi. Do we always need a complete calculus? Contradiction theorem: KB ∪ {ϕ} is unsatisfiable iff KB | = ¬ϕ This implies that KB | = ϕ iff KB ∪ {¬ϕ} is unsatisfiable. We can reduce the general implication problem to a test of unsatisfiability. In calculi, we us the special symbol for (provably) unsatisfiable formulas. Definition (Refutation-Completeness) A calculus C is refutation-complete if it holds for all unsatisfiable KB that KB ⊢C .

German: widerlegungsvollst¨ andig

slide-50
SLIDE 50

Logical Consequences Inference Resolution Calculus Summary

Refutation-completeness

We obviously want correct calculi. Do we always need a complete calculus? Contradiction theorem: KB ∪ {ϕ} is unsatisfiable iff KB | = ¬ϕ This implies that KB | = ϕ iff KB ∪ {¬ϕ} is unsatisfiable. We can reduce the general implication problem to a test of unsatisfiability. In calculi, we us the special symbol for (provably) unsatisfiable formulas. Definition (Refutation-Completeness) A calculus C is refutation-complete if it holds for all unsatisfiable KB that KB ⊢C .

German: widerlegungsvollst¨ andig

slide-51
SLIDE 51

Logical Consequences Inference Resolution Calculus Summary

Refutation-completeness

We obviously want correct calculi. Do we always need a complete calculus? Contradiction theorem: KB ∪ {ϕ} is unsatisfiable iff KB | = ¬ϕ This implies that KB | = ϕ iff KB ∪ {¬ϕ} is unsatisfiable. We can reduce the general implication problem to a test of unsatisfiability. In calculi, we us the special symbol for (provably) unsatisfiable formulas. Definition (Refutation-Completeness) A calculus C is refutation-complete if it holds for all unsatisfiable KB that KB ⊢C .

German: widerlegungsvollst¨ andig

slide-52
SLIDE 52

Logical Consequences Inference Resolution Calculus Summary

Questions Questions?

slide-53
SLIDE 53

Logical Consequences Inference Resolution Calculus Summary

Resolution Calculus

slide-54
SLIDE 54

Logical Consequences Inference Resolution Calculus Summary

Logic: Overview

Logic Propositional Logic Syntax Semantics Properties Equivalences Normal Forms Logical Consequence Inference Resolution Predicate Logic

slide-55
SLIDE 55

Logical Consequences Inference Resolution Calculus Summary

Resolution: Idea

Resolution is a refutation-complete calculus for knowledge bases in conjunctive normal form. Every knowledge base can be transformed into equivalent formulas in CNF.

Transformation can require exponential time. Alternative: efficient transformation in equisatisfiable formulas (not part of this course)

Show KB | = ϕ by derivability of KB ∪ {¬ϕ} ⊢R with resolution calculus R. Resolution can require exponential time. This is probably the case for all refutation-complete proof

  • methods. complexity theory

German: Resolution, erf¨ ullbarkeits¨ aquivalent

slide-56
SLIDE 56

Logical Consequences Inference Resolution Calculus Summary

Resolution: Idea

Resolution is a refutation-complete calculus for knowledge bases in conjunctive normal form. Every knowledge base can be transformed into equivalent formulas in CNF.

Transformation can require exponential time. Alternative: efficient transformation in equisatisfiable formulas (not part of this course)

Show KB | = ϕ by derivability of KB ∪ {¬ϕ} ⊢R with resolution calculus R. Resolution can require exponential time. This is probably the case for all refutation-complete proof

  • methods. complexity theory

German: Resolution, erf¨ ullbarkeits¨ aquivalent

slide-57
SLIDE 57

Logical Consequences Inference Resolution Calculus Summary

Resolution: Idea

Resolution is a refutation-complete calculus for knowledge bases in conjunctive normal form. Every knowledge base can be transformed into equivalent formulas in CNF.

Transformation can require exponential time. Alternative: efficient transformation in equisatisfiable formulas (not part of this course)

Show KB | = ϕ by derivability of KB ∪ {¬ϕ} ⊢R with resolution calculus R. Resolution can require exponential time. This is probably the case for all refutation-complete proof

  • methods. complexity theory

German: Resolution, erf¨ ullbarkeits¨ aquivalent

slide-58
SLIDE 58

Logical Consequences Inference Resolution Calculus Summary

Resolution: Idea

Resolution is a refutation-complete calculus for knowledge bases in conjunctive normal form. Every knowledge base can be transformed into equivalent formulas in CNF.

Transformation can require exponential time. Alternative: efficient transformation in equisatisfiable formulas (not part of this course)

Show KB | = ϕ by derivability of KB ∪ {¬ϕ} ⊢R with resolution calculus R. Resolution can require exponential time. This is probably the case for all refutation-complete proof

  • methods. complexity theory

German: Resolution, erf¨ ullbarkeits¨ aquivalent

slide-59
SLIDE 59

Logical Consequences Inference Resolution Calculus Summary

Knowledge Base as Set of Clauses

Simplified notation of knowledge bases in CNF Formula in CNF as set of clauses (due to commutativity, idempotence, associativity of ∧) Set of formulas as set of clauses Clause as set of literals (due to commutativity, idempotence, associativity of ∨) Knowledge base as set of sets of literals Example KB = {(P ∨ P), ((¬P ∨ Q) ∧ (¬P ∨ R) ∧ (¬P ∨ Q) ∧ R), KB = {((¬Q ∨ ¬R ∨ S) ∧ P)} as set of clauses:

slide-60
SLIDE 60

Logical Consequences Inference Resolution Calculus Summary

Knowledge Base as Set of Clauses

Simplified notation of knowledge bases in CNF Formula in CNF as set of clauses (due to commutativity, idempotence, associativity of ∧) Set of formulas as set of clauses Clause as set of literals (due to commutativity, idempotence, associativity of ∨) Knowledge base as set of sets of literals Example KB = {(P ∨ P), ((¬P ∨ Q) ∧ (¬P ∨ R) ∧ (¬P ∨ Q) ∧ R), KB = {((¬Q ∨ ¬R ∨ S) ∧ P)} as set of clauses:

slide-61
SLIDE 61

Logical Consequences Inference Resolution Calculus Summary

Knowledge Base as Set of Clauses

Simplified notation of knowledge bases in CNF Formula in CNF as set of clauses (due to commutativity, idempotence, associativity of ∧) Set of formulas as set of clauses Clause as set of literals (due to commutativity, idempotence, associativity of ∨) Knowledge base as set of sets of literals Example KB = {(P ∨ P), ((¬P ∨ Q) ∧ (¬P ∨ R) ∧ (¬P ∨ Q) ∧ R), KB = {((¬Q ∨ ¬R ∨ S) ∧ P)} as set of clauses: ∆ = {{P}, {¬P, Q}, {¬P, R}, {R}, {¬Q, ¬R, S}}

slide-62
SLIDE 62

Logical Consequences Inference Resolution Calculus Summary

Resolution Rule

The resolution calculus consists of a single rule, called resolution rule: C1 ∪ {L}, C2 ∪ {¬L} C1 ∪ C2 , where C1 und C2 are (possibly empty) clauses and L is an atomic proposition. If we derive the empty clause, we write instead of {}. Terminology: L and ¬L are the resolution literals, C1 ∪ {L} and C2 ∪ {¬L} are the parent clauses, and C1 ∪ C2 is the resolvent.

German: Resolutionskalk¨ ul, Resolutionsregel, Resolutionsliterale, German: Elternklauseln, Resolvent

slide-63
SLIDE 63

Logical Consequences Inference Resolution Calculus Summary

Resolution Rule

The resolution calculus consists of a single rule, called resolution rule: C1 ∪ {L}, C2 ∪ {¬L} C1 ∪ C2 , where C1 und C2 are (possibly empty) clauses and L is an atomic proposition. If we derive the empty clause, we write instead of {}. Terminology: L and ¬L are the resolution literals, C1 ∪ {L} and C2 ∪ {¬L} are the parent clauses, and C1 ∪ C2 is the resolvent.

German: Resolutionskalk¨ ul, Resolutionsregel, Resolutionsliterale, German: Elternklauseln, Resolvent

slide-64
SLIDE 64

Logical Consequences Inference Resolution Calculus Summary

Resolution Rule

The resolution calculus consists of a single rule, called resolution rule: C1 ∪ {L}, C2 ∪ {¬L} C1 ∪ C2 , where C1 und C2 are (possibly empty) clauses and L is an atomic proposition. If we derive the empty clause, we write instead of {}. Terminology: L and ¬L are the resolution literals, C1 ∪ {L} and C2 ∪ {¬L} are the parent clauses, and C1 ∪ C2 is the resolvent.

German: Resolutionskalk¨ ul, Resolutionsregel, Resolutionsliterale, German: Elternklauseln, Resolvent

slide-65
SLIDE 65

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution

Definition (Proof by Resolution) A proof by resolution of a clause D from a knowledge base ∆ is a sequence of clauses C1, . . . , Cn with Cn = D and for all i ∈ {1, . . . , n}:

Ci ∈ ∆, or Ci is resolvent of two clauses from {C1, . . . , Ci−1}.

If there is a proof of D by resolution from ∆, we say that D can be derived with resolution from ∆ and write ∆ ⊢R D. Remark: Resolution is a correct, refutation-complete, Remark: but incomplete calculus.

German: Resolutionsbeweis, “mit Resolution aus ∆ abgeleitet”

slide-66
SLIDE 66

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example

Proof by Resolution for Testing a Logical Consequence: Example Given: KB = {P, (P → (Q ∧ R))}. Show with resolution that KB | = (R ∨ S). Three steps:

1 Reduce logical consequence to unsatisfiability. 2 Transform knowledge base into clause form (CNF). 3 Derive empty clause with resolution.

Step 1: Reduce logical consequence to unsatisfiability. KB | = (R ∨ S) iff KB ∪ {¬(R ∨ S)} is unsatisfiable. Thus, consider KB′ = KB ∪ {¬(R ∨ S)} = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. . . .

slide-67
SLIDE 67

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example

Proof by Resolution for Testing a Logical Consequence: Example Given: KB = {P, (P → (Q ∧ R))}. Show with resolution that KB | = (R ∨ S). Three steps:

1 Reduce logical consequence to unsatisfiability. 2 Transform knowledge base into clause form (CNF). 3 Derive empty clause with resolution.

Step 1: Reduce logical consequence to unsatisfiability. KB | = (R ∨ S) iff KB ∪ {¬(R ∨ S)} is unsatisfiable. Thus, consider KB′ = KB ∪ {¬(R ∨ S)} = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. . . .

slide-68
SLIDE 68

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example

Proof by Resolution for Testing a Logical Consequence: Example Given: KB = {P, (P → (Q ∧ R))}. Show with resolution that KB | = (R ∨ S). Three steps:

1 Reduce logical consequence to unsatisfiability. 2 Transform knowledge base into clause form (CNF). 3 Derive empty clause with resolution.

Step 1: Reduce logical consequence to unsatisfiability. KB | = (R ∨ S) iff KB ∪ {¬(R ∨ S)} is unsatisfiable. Thus, consider KB′ = KB ∪ {¬(R ∨ S)} = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. . . .

slide-69
SLIDE 69

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example

Proof by Resolution for Testing a Logical Consequence: Example Given: KB = {P, (P → (Q ∧ R))}. Show with resolution that KB | = (R ∨ S). Three steps:

1 Reduce logical consequence to unsatisfiability. 2 Transform knowledge base into clause form (CNF). 3 Derive empty clause with resolution.

Step 1: Reduce logical consequence to unsatisfiability. KB | = (R ∨ S) iff KB ∪ {¬(R ∨ S)} is unsatisfiable. Thus, consider KB′ = KB ∪ {¬(R ∨ S)} = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. . . .

slide-70
SLIDE 70

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example (continued)

Proof by Resolution for Testing a Logical Consequence: Example KB′ = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. Step 2: Transform knowledge base into clause form (CNF). P Clauses:{P} P → (Q ∧ R)) ≡ (¬P ∨ (Q ∧ R)) ≡ ((¬P ∨ Q) ∧ (¬P ∨ R)) Clauses:{¬P, Q}, {¬P, R} ¬(R ∨ S) ≡ (¬R ∧ ¬S) Clauses:{¬R}, {¬S} ∆ = {{P}, {¬P, Q}, {¬P, R}, {¬R}, {¬S}} . . .

slide-71
SLIDE 71

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example (continued)

Proof by Resolution for Testing a Logical Consequence: Example KB′ = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. Step 2: Transform knowledge base into clause form (CNF). P Clauses:{P} P → (Q ∧ R)) ≡ (¬P ∨ (Q ∧ R)) ≡ ((¬P ∨ Q) ∧ (¬P ∨ R)) Clauses:{¬P, Q}, {¬P, R} ¬(R ∨ S) ≡ (¬R ∧ ¬S) Clauses:{¬R}, {¬S} ∆ = {{P}, {¬P, Q}, {¬P, R}, {¬R}, {¬S}} . . .

slide-72
SLIDE 72

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example (continued)

Proof by Resolution for Testing a Logical Consequence: Example KB′ = {P, (P → (Q ∧ R)), ¬(R ∨ S)}. Step 2: Transform knowledge base into clause form (CNF). P Clauses:{P} P → (Q ∧ R)) ≡ (¬P ∨ (Q ∧ R)) ≡ ((¬P ∨ Q) ∧ (¬P ∨ R)) Clauses:{¬P, Q}, {¬P, R} ¬(R ∨ S) ≡ (¬R ∧ ¬S) Clauses:{¬R}, {¬S} ∆ = {{P}, {¬P, Q}, {¬P, R}, {¬R}, {¬S}} . . .

slide-73
SLIDE 73

Logical Consequences Inference Resolution Calculus Summary

Proof by Resolution: Example (continued)

Proof by Resolution for Testing a Logical Consequence: Example ∆ = {{P}, {¬P, Q}, {¬P, R}, {¬R}, {¬S}} Step 3: Derive empty clause with resolution. C1 = {P} (from ∆) C2 = {¬P, Q} (from ∆) C3 = {¬P, R} (from ∆) C4 = {¬R} (from ∆) C5 = {Q} (from C1 und C2) C6 = {¬P} (from C3 und C4) C7 = (from C1 und C6) Note: There are shorter proofs. (For example?)

slide-74
SLIDE 74

Logical Consequences Inference Resolution Calculus Summary

Another Example

Another Example for Resolution Show with resolution, that KB | = DrinkBeer, where KB = {(¬DrinkBeer → EatFish), ((EatFish ∧ DrinkBeer) → ¬EatIceCream), ((EatIceCream ∨ ¬DrinkBeer) → ¬EatFish)}.

slide-75
SLIDE 75

Logical Consequences Inference Resolution Calculus Summary

Questions Questions?

slide-76
SLIDE 76

Logical Consequences Inference Resolution Calculus Summary

Summary

slide-77
SLIDE 77

Logical Consequences Inference Resolution Calculus Summary

Summary

knowledge base: set of formulas describing given information; satisfiable, valid etc. used like for individual formulas logical consequence KB | = ϕ means that ϕ is true whenever (= in all models where) KB is true A logical consequence KB | = ϕ allows to conclude that KB implies ϕ based on the semantics. A correct calculus supports such conclusions

  • n the basis of purely syntactical derivations KB ⊢ ϕ.

Complete calculi often not necessary: For many questions refutation-completeness is sufficient. The resolution calculus is correct and refutation-complete.

slide-78
SLIDE 78

Logical Consequences Inference Resolution Calculus Summary

Further Topics

There are many aspects of propositional logic that we do not cover in this course. resolution strategies to make resolution as efficient as possible in practice,

  • ther proof systems, as for example tableaux proofs,

algorithms for model construction, such as the Davis-Putnam-Logemann-Loveland (DPLL) algorithm. → Foundations of AI course