Propositional Logic Steffen H olldobler International Center for - - PowerPoint PPT Presentation

propositional logic
SMART_READER_LITE
LIVE PREVIEW

Propositional Logic Steffen H olldobler International Center for - - PowerPoint PPT Presentation

Propositional Logic Steffen H olldobler International Center for Computational Logic Technische Universit at Dresden Germany Syntax Semantics Equivalence and Normal Forms Proof Procedures Satisfiability Testing


slide-1
SLIDE 1

◮ Syntax ◮ Semantics ◮ Equivalence and Normal Forms ◮ Proof Procedures ◮ Satisfiability Testing ◮ Properties

Steffen H¨

  • lldobler

Propositional Logic 1

Propositional Logic

Steffen H¨

  • lldobler

International Center for Computational Logic Technische Universit¨ at Dresden Germany

slide-2
SLIDE 2

Syntax – Formulas

◮ Definition 3.1 An alphabet Σ is a finite or countably infinite set.

The elements of this set are called symbols. Without loss of generality (Wlog) we assume that Λ ∈ Σ.

◮ Definition 3.2 Let Σ be an alphabet. The set of words (or strings) over Σ

is denoted by Σ∗ and is the smallest set satisfying the following conditions:

  • 1. Λ ∈ Σ∗.
  • 2. If w ∈ Σ∗ and a ∈ Σ, then aw ∈ Σ∗.

Λ is called empty word or empty string.

◮ Example Let Σ = {1, 2}. We can form the following words:

Λ, 1Λ, 2Λ, 11Λ, 12Λ, 21Λ, 22Λ, 111Λ, . . . .

Steffen H¨

  • lldobler

Propositional Logic 2

slide-3
SLIDE 3

The Alphabet of Propositional Logic

◮ Definition 3.3 An alphabet of propositional logic consists of

⊲ a (countably) infinite set R = {p1, p2, . . .} of propositional variables, ⊲ the set {¬/1, ∧/2, ∨/2, →/2, ↔/2} of connectives, and ⊲ the set {(, )} of special characters.

◮ Indices are sometimes omitted. ◮ We will occasionally use other letters to denote variables. ◮ Propositional variables are also called nullary relation symbols. ◮ Different alphabets of propositional logic differ in R.

Steffen H¨

  • lldobler

Propositional Logic 3

slide-4
SLIDE 4

Propositional Formulas

◮ Definition 3.4

A (propositional) atomic formula, briefly called atom, is a propositional variable.

◮ Definition 3.5 Let R be a set of propositional variables. The set of

propositional formulas is the smallest set L(R) of strings over R, the connectives and the special symbols with the following properties:

  • 1. If F is an atomic formula, then F ∈ L(R).
  • 2. If F ∈ L(R), then ¬F ∈ L(R).
  • 3. If ◦/2 is a binary connective, F, G ∈ L(R), then (F ◦ G) ∈ L(R).

◮ Does such a smallest set exist?

⊲ There are sets, which satisfy all properties. ⊲ The intersection of such sets satisfies the properties too. ⊲ The smallest set is the intersection of all sets satisfying the properties.

◮ Notation

A (possibly indexed) denotes an atom, F, G, H (possibly indexed) denote propositional formulas.

Steffen H¨

  • lldobler

Propositional Logic 4

slide-5
SLIDE 5

Structural Induction and Recursion

◮ How can we prove properties of sets of formulas? ◮ Theorem 3.6 (Principle of structural induction)

Every propositional formula has a property E, if the following conditions are met:

  • 1. Induction Base: Every atom has property E.
  • 2. Induction Steps:

If F has property E, then ¬F has property E as well. If ◦/2 is a binary connective, and F and G have property E, then (F ◦ G) has property E as well.

◮ Proof Let E be the set of all formulas satisfying E.

⊲ E ⊆ L(R). ⊲ E satisfies the three conditions of definition 3.5. ⊲ Because L(R) is the smallest set satisfying these conditions, L(R) ⊆ E must hold. qed

Steffen H¨

  • lldobler

Propositional Logic 5

slide-6
SLIDE 6

Structural Recursion

◮ How can we define functions acting on formulas? ◮ Theorem 3.7 (Principle of structural recursion)

Let M be an arbitrary set and let the following functions be given: ⊲ fooR : R → M, ⊲ foo¬ : M → M, ⊲ foo◦ : M × M → M for ◦ ∈ {∧, ∨, →, ↔}. Then there is exactly one function foo : L(R) → M satisfying the following conditions:

  • 1. Recursion base foo(A) = fooR(A) for all A ∈ R.
  • 2. Recursion steps

foo(¬G) = foo¬(foo(G)) for all G ∈ L(R). foo((G1 ◦ G2)) = foo◦(foo(G1), foo(G2)) for all G1, G2 ∈ L(R).

◮ Proof Exercise

Steffen H¨

  • lldobler

Propositional Logic 6

slide-7
SLIDE 7

Structural Recursion – Example

◮ M = N. ◮ foo1R(A) = 0 for all A ∈ R. ◮ foo1¬(X) = X for all X ∈ M. ◮ foo1◦(X, Y) = X + Y + 1 for all ◦ ∈ {∧, ∨, →, ↔} and all X, Y ∈ M. ◮ We obtain:

foo1(F) =    if F is an atom, foo1(G) if F is of the form ¬G, foo1(G1) + foo1(G2) + 1 if F is of the form (G1 ◦ G2).

◮ Often foo1R, foo1¬ and foo1◦ are not explicitely specified. ◮ foo is a function symbol of a meta language.

Steffen H¨

  • lldobler

Propositional Logic 7

slide-8
SLIDE 8

Structural Recursion – Another Example

◮ The set of positions or occurrences in F

pos(F) = {Λ} ∪        ∅ if F is an atom, {1π | π ∈ pos(G)} if F is of the form ¬G, {1π1 | π1 ∈ pos(G1)} ∪ {2π2 | π2 ∈ pos(G2)} if F is of the form (G1 ◦ G2)

Steffen H¨

  • lldobler

Propositional Logic 8

slide-9
SLIDE 9

Subformulas

◮ Definition 3.8 Let F ∈ L(R) be a propositional formula. The set of subformulas

  • f F is the smallest set of formulas SF satisfying the following conditions:
  • 1. F ∈ SF .
  • 2. If ¬G ∈ SF , then G ∈ SF .
  • 3. If (G1 ◦ G2) ∈ SF , then G1, G2 ∈ SF .

The set RF of variables occurring in F is SF ∩ R. G is called subformula of F, if it is in SF .

◮ Example Let F = ¬((p1 → p2) ∨ p1).

SF = {¬((p1 → p2) ∨ p1), ((p1 → p2) ∨ p1), (p1 → p2), p1, p2}. RF = {p1, p2}

Steffen H¨

  • lldobler

Propositional Logic 9

slide-10
SLIDE 10

Semantics

◮ What is the meaning of ¬((p1 → p2) ∨ p1)? ◮ Here formulas may be true (⊤) or false (⊥) binary logic.

Steffen H¨

  • lldobler

Propositional Logic 10

slide-11
SLIDE 11

The Structure of the Truth Values

◮ A structure consists of a set of individuals and a set of functions defined on it. ◮ The set of truth values W is the set {⊤, ⊥}. ◮ Unary functions of type W → W:

⊲ Negation ¬∗: ¬∗(⊤) = ⊥ and ¬∗(⊥) = ⊤. ⊲ Identity. ⊲ Projections onto ⊥ and ⊤.

◮ Binary functions of type W × W → W:

⊲ Conjunction ∧∗/2. ⊲ Disjunction ∨∗/2. ⊲ Implication →∗ /2. ⊲ NAND ↑ ∗/2. ⊲ NOR ↓∗ /2. ⊲ Equivalence ↔∗ /2. Etc.

Steffen H¨

  • lldobler

Propositional Logic 11

slide-12
SLIDE 12

The Functions over the Set of Truth Values

∧∗ ∨∗ →∗ ←∗ ↑

↓∗ →∗ ←∗ ⊤ ⊤ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ⊥ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊥ ⊥ ⊥ ⊤ ⊤ ⊤ ⊤ ⊥ ⊥ ↔∗ ↔∗ ∗ ∗ ւ∗ ւ∗ ց∗ ց∗ ⊤ ⊤ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤ ⊥ ⊤ ⊤ ⊥ ⊥ ⊤ ⊤ ⊥ ⊥ ⊥ ⊤ ⊥ ⊤ ⊥ ⊥ ⊤ ⊥ ⊤

◮ Here negation, conjunction, disjunction, implication, equivalence.

Steffen H¨

  • lldobler

Propositional Logic 12

slide-13
SLIDE 13

Interpretations

◮ Definition 3.9 A (propositional) interpretation I = (W, ·I) consists of the set W

and a mapping ·I : L(R) → W which meets the following conditions: [F]I = ¬∗[G]I if F is of the form ¬G, ([G1]I ◦∗ [G2]I) if F is of the form (G1 ◦ G2).

◮ An interpretation I = (W, ·I) is uniquely defined

by specifying how ·I acts on propositional variables.

◮ Recall that A denotes an atom. ◮ We will sometimes identify an interpretation I = (W, ·I) with {A | [A]I = ⊤}. ◮ We often write F I instead of [F]I. ◮ I (possibly indexed) denotes an interpretation.

Steffen H¨

  • lldobler

Propositional Logic 13

slide-14
SLIDE 14

Satisfiability of Formulas

◮ Definition 3.12 Let F ∈ L(R).

⊲ F is called satisfiable if there is an interpretation I = (W, ·I) with F I = ⊤. ⊲ F is called valid (or F is a tautology) if for all interpretations I = (W, ·I) we have: F I = ⊤. ⊲ F is called falsifiable if there is an interpretation I = (W, ·I) with F I = ⊥. ⊲ F is called unsatisfiable if for all interpretations I = (W, ·I) we have: F I = ⊥.

Steffen H¨

  • lldobler

Propositional Logic 14

slide-15
SLIDE 15

Truth Tables

◮ How can we compute the value of a formula F

under all possible interpretations?

◮ Computing a truth table:

1 Let m = |SF | be the number of subformulas of F. 2 Let n = |RF | 3 Form a table with 2n rows and m columns, where the first n columns are marked by the n propositional variables occurring in F, the last column is marked by F, and the remaining columns are marked by the other subformulas of F. 4 Fill in the first n columns with ⊤ und ⊥ as follows: In the first column fill in alternating downwards ⊤⊥⊤⊥ . . ., in the second column ⊤⊤⊥⊥ . . ., in the third column ⊤⊤⊤⊤⊥⊥⊥⊥ . . ., etc. 5 Calculate the values in the remaining columns using the known functions on the set of truth values.

Steffen H¨

  • lldobler

Propositional Logic 15

slide-16
SLIDE 16

Working with Truth Tables

◮ Let F be a formula and T(F) a corresponding truth table. Then:

⊲ F is satisfiable iff T(F) contains a row with ⊤ in the last column. ⊲ F is valid iff all rows in T(F) have ⊤ in the last column. ⊲ F is falsifiable iff T(F) contains a row with ⊥ in the final column. ⊲ F is unsatisfiable iff all rows T(F) have ⊥ in the final column.

Steffen H¨

  • lldobler

Propositional Logic 16

slide-17
SLIDE 17

Models

◮ Definition 3.13 An interpretation I = (W, ·I) is called model for a propositional

formula F, in symbols I | = F, if F I = ⊤.

◮ Abbreviations

⊲ If I is not a model for the formula F, i. e. if F I = ⊥, then we write I | = F. ⊲ If F is valid, then we write | = F.

Steffen H¨

  • lldobler

Propositional Logic 17

slide-18
SLIDE 18

Validity and Unsatisfiability

◮ Theorem 3.14 A propositional formula F is valid (|

= F) iff ¬F is unsatisfiable.

◮ Proof

| = F iff all interpretations are models for F iff no interpretation is a model for ¬F iff ¬F is unsatisfiable. qed

Steffen H¨

  • lldobler

Propositional Logic 18

slide-19
SLIDE 19

Satisfiability of a Set of Formulas

◮ Definition 3.15 Let G be a set of formulas.

⊲ An interpretation I is called model for G, in symbols I | = G, if I is model for all F ∈ G. ⊲ G is satisfiable, if there is a model for G. ⊲ G is unsatisfiable, if there is no model for G. ⊲ G is falsifiable, if there is an interpretation which is no model for G. ⊲ G is valid, if all interpretations are models for G.

Steffen H¨

  • lldobler

Propositional Logic 19

slide-20
SLIDE 20

Logical Consequences

◮ Definition 3.16

A propositional formula F is a (propositional) consequence of a set of propositional formulas G, in symbols G | = F, iff for every interpretation I we have: if I | = G, then I | = F as well.

◮ Theorem 3.17 Let F, F1, . . . , Fn be propositional formulas.

{F1, . . . , Fn} | = F holds iff | = ((. . . (F1 ∧ F2) ∧ . . . ∧ Fn) → F) holds.

◮ Proof Exercise

Steffen H¨

  • lldobler

Propositional Logic 20

slide-21
SLIDE 21

Equivalence and Normal Forms

◮ Semantic Equivalence ◮ Negation Normal Form ◮ Clausal Form

Steffen H¨

  • lldobler

Propositional Logic 21

slide-22
SLIDE 22

Semantic Equivalence

◮ Definition 3.18 Two propositional formulas F and G are semantically

equivalent, in symbols F ≡ G, if for all interpretations I we have: I | = F iff I | = G.

◮ Observe ≡ is an equivalence relation:

⊲ ≡ is reflexive: F ≡ F. ⊲ ≡ is symmetric: If F ≡ G, then G ≡ F. ⊲ ≡ is transitive: If F ≡ G and G ≡ H, then F ≡ H. This follows immediately from Definition 3.18 Exercise.

Steffen H¨

  • lldobler

Propositional Logic 22

slide-23
SLIDE 23

Well-Known Semantic Equivalences

◮ Theorem 3.19 The following equivalences hold:

(F ∧ F) ≡ F (F ∨ F) ≡ F idempotency (F ∧ G) ≡ (G ∧ F) (F ∨ G) ≡ (G ∨ F) commutativity ((F ∧ G) ∧ H) ≡ (F ∧ (G ∧ H)) ((F ∨ G) ∨ H) ≡ (F ∨ (G ∨ H)) associativity ((F ∧ G) ∨ F) ≡ F ((F ∨ G) ∧ F) ≡ F absorption (F ∧ (G ∨ H)) ≡ ((F ∧ G) ∨ (F ∧ H)) (F ∨ (G ∧ H)) ≡ ((F ∨ G) ∧ (F ∨ H)) distributivity

Steffen H¨

  • lldobler

Propositional Logic 23

slide-24
SLIDE 24

Theorem 3.19 (continued)

◮ The following equivalences hold:

¬¬F ≡ F double negation ¬(F ∧ G) ≡ (¬F ∨ ¬G) ¬(F ∨ G) ≡ (¬F ∧ ¬G) de Morgan (F ∨ G) ≡ F, if F is valid (F ∧ G) ≡ G, if F is valid tautology (F ∨ G) ≡ G, if F is unsatisfiable (F ∧ G) ≡ F, if F is unsatisfiable unsatisfiability (F ↔ G) ≡ ((F ∧ G) ∨ (¬G ∧ ¬F)) equivalence (F → G) ≡ (¬F ∨ G) implication

◮ Proof Exercise

Steffen H¨

  • lldobler

Propositional Logic 24

slide-25
SLIDE 25

Positions

◮ Recall

pos(F) = {Λ} ∪        ∅ if F is an atom, {1π | π ∈ pos(G)} if F is of form ¬G, {1π1 | π1 ∈ pos(G1)} ∪ {2π2 | π2 ∈ pos(G2)} if F is of the form (G1 ◦ G2).

◮ Definition 3.20

Let F be a formula. The set of positions in F, in symbols PF , is pos(F).

◮ Positions are words over {1, 2}.

Steffen H¨

  • lldobler

Propositional Logic 25

slide-26
SLIDE 26

Subformulas and Replacements

◮ Definition 3.21 The subformula of F at position π ∈ PF ,

in symbols F⌈π⌉, is defined by:

  • 1. F⌈Λ⌉ = F.
  • 2. F⌈1π⌉ = G⌈π⌉, if F is of the form ¬G.
  • 3. F⌈iπ⌉ = Gi⌈π⌉, if F is of the form (G1 ◦ G2) and i ∈ {1, 2}.

◮ Definition 3.22 The replacement of the subformula of F at position π ∈ PF

by H, in symbols F⌈π → H⌉, is defined by:

  • 1. F⌈Λ → H⌉ = H,
  • 2. F⌈1π → H⌉ = ¬(G⌈π → H⌉), if F is of the form ¬G.
  • 3. F⌈1π → H⌉ = (G1⌈π → H⌉ ◦ G2), if F is of the form (G1 ◦ G2).
  • 4. F⌈2π → H⌉ = (G1 ◦ G2⌈π → H⌉), if F is of the form (G1 ◦ G2).

Steffen H¨

  • lldobler

Propositional Logic 26

slide-27
SLIDE 27

The Replacement Theorem

◮ Theorem 3.23

Let F, G, H ∈ L(R), π ∈ PF , F⌈π⌉ = G and G ≡ H. Then, F ≡ F⌈π → H⌉.

◮ Proof Structural induction on π. ◮ Induction basis Let π = Λ.

⊲ F = F⌈Λ⌉ = G ≡ H = F⌈Λ → H⌉. √

◮ Induction hypothesis (IH) The theorem holds for π′.

Steffen H¨

  • lldobler

Propositional Logic 27

slide-28
SLIDE 28

Proof Replacement Theorem (Continuation)

◮ Induction step Let π = iπ′. We distinguish two cases:

⊲ i = 1 π = 1π′ ∈ PF , hence F must be of the form ¬F ′ or (G1 ◦ G2).

◮ ◮ ¬F ′ F⌈1π′ → H⌉ = (¬F ′)⌈1π′ → H⌉ = ¬(F ′⌈π′ → H⌉).

From IH we conclude: F ′ ≡ F ′⌈π′ → H⌉ Hence, for all interpretations I we find: [F]I = [¬F ′]I Assumption = ¬∗[F ′]I Def I = ¬∗[F ′⌈π′ → H⌉]I IH and Def ≡ = [¬(F ′⌈π′ → H⌉)]I Def I = [(¬F ′)⌈1π′ → H⌉]I Def replacement = [F⌈1π′ → H⌉]I Assumption Hence, F ≡ F⌈1π′ → H⌉ √

◮ ◮ (G1 ◦ G2) analogously

⊲ i = 2 analogously qed

Steffen H¨

  • lldobler

Propositional Logic 28

slide-29
SLIDE 29

Agreement

◮ If π ∈ PF then F⌈π → H⌉ := F. ◮ Let F⌈π⌉ = G.

If it is obvious from the context which subformula G is to be replaced, then we write F⌈G → H⌉ instead of F⌈π → H⌉.

◮ Theorem 3.23 allows to replace all occurrences of the connectives ↔ and →.

⊲ Wlog we consider only formulas over R ∪ {¬, ∧, ∨, (, )}.

Steffen H¨

  • lldobler

Propositional Logic 29

slide-30
SLIDE 30

Negation Normal Form

◮ Definition 3.24 A propositional formula F is in negation normal form if all

negation signs ¬ occurring in F appear directly in front of propositional variables.

◮ Proposition 3.25 There is an algorithm which transforms any formula into a

semantically equivalent formula in negation normal form.

◮ Algorithm Given F. While F is not in negation normal form do:

⊲ Select a subformula of F having the form ¬G with G ∈ R. ⊲ If ¬G = ¬¬H, then replace ¬G by H. ⊲ If ¬G = ¬(G1 ∧ G2), then replace ¬G by (¬G1 ∨ ¬G2). ⊲ If ¬G = ¬(G1 ∨ G2), then replace ¬G by (¬G1 ∧ ¬G2).

Steffen H¨

  • lldobler

Propositional Logic 30

slide-31
SLIDE 31

The Rules of the Algorithm

◮ The rules will be abbreviated by:

¬¬H H ¬(G1 ∧ G2) (¬G1 ∨ ¬G2) ¬(G1 ∨ G2) (¬G1 ∧ ¬G2)

◮ The algorithm is (don’t care) non-deterministic! ◮ Example

¬(r ∨ ¬(¬p ∧ q)) ≡ (¬r ∧ ¬¬(¬p ∧ q)) de Morgan ≡ (¬r ∧ (¬p ∧ q)) double negation

Steffen H¨

  • lldobler

Propositional Logic 31

slide-32
SLIDE 32

3.3.3 Clause Form

◮ Definition 3.26

A literal is a propositional variable, or a negated propositional variable. A propositional variable is also called positive literal, whereas a negated propositional variable is called negative literal.

◮ Notation

⊲ L (possible indexed) denotes a literal. ⊲ Generalized disjunction [F1, . . . , Fn] = (. . . ((F1 ∨ F2) ∨ F3) ∨ . . . ∨ Fn) ⊲ Generalized conjunction F1, . . . , Fn = (. . . ((F1 ∧ F2) ∧ F3) ∧ . . . ∧ Fn) ⊲ Observe [F] = F and F = F. Hence, [F] ≡ F and F ≡ F. ⊲ Empty generalized disjunction: [ ] with [ ]I = ⊥ for all I. ⊲ Empty generalized conjunction: with I = ⊤ for all I. ⊲ Observe (G ∨ [ ]) ≡ G and (G ∧ ) ≡ G.

Steffen H¨

  • lldobler

Propositional Logic 32

slide-33
SLIDE 33

Clauses

◮ Definition 3.27

⊲ A clause is a generalized disjunction [L1, . . . , Ln], n ≥ 0, where every Li, 1 ≤ i ≤ n, is a literal. ⊲ A dual clause is a generalized conjunction L1, . . . , Ln, n ≥ 0, where every Li, 1 ≤ i ≤ n, is a literal. ⊲ A formula is in conjunctive normal form, or clause form, iff it is of the form C1, . . . , Cm, m ≥ 0, and if every Cj, 1 ≤ j ≤ m, is a clause. ⊲ A formula is in disjunctive normal form, or dual clause form, iff it is of the form [C1, . . . , Cm], m ≥ 0, and if every Cj, 1 ≤ j ≤ m, is a dual clause.

◮ Notation C (possibly indexed) denotes a clause.

Steffen H¨

  • lldobler

Propositional Logic 33

slide-34
SLIDE 34

An Observation

◮ Let F be a formula in clause form. The following holds:

⊲ F is unsatisfiable if a clause occurring in F is unsatisfiable. ⊲ A clause is unsatisfiable iff it is of the form [ ].

Steffen H¨

  • lldobler

Propositional Logic 34

slide-35
SLIDE 35

Transformation into Clause Form

◮ Theorem 3.28

1 There is an algorithm which transforms any formula into a semantically equivalent formula in clause form. 2 There is an algorithm which transforms any formula into a semantically equivalent formula in dual clause form.

◮ Proof of 1

⊲ We have to specify the algorithm. ⊲ We have to show that the algorithm is correct or sound, i.e., if it outputs G given F, then G must be in clause form and F ≡ G must hold. ⊲ We have to show that the algorithm terminates, i.e., it stops in finite time given F.

Steffen H¨

  • lldobler

Propositional Logic 35

slide-36
SLIDE 36

An Algorithm for the Transformation into Clause Form

◮ Input: A propositional formula F.

Output: A formula, which is in conjunctive normal form and is equivalent to F. G := [F]. (G is a conjunction of disjunctions.) While G is not in conjunctive normal form do: Select a non-clausal element H from G. Select a non-literal element K from H. Apply the rule among the following ones which is applicable. ¬¬D D (D1 ∧ D2) D1 | D2 ¬(D1 ∧ D2) ¬D1, ¬D2 (D1 ∨ D2) D1, D2 ¬(D1 ∨ D2) ¬D1 | ¬D2

◮ A rule

D D′ is applicable to K if K is of the form D.

If applied, then K is replaced by D′.

◮ A rule

D D1|D2 is applicable to K if K is of the form D.

If applied, H is replaced by two disjunctions: The first one is obtained from H by replacing the occurrence of D by D1. The second one is obtained from H by replacing the occurrence of D by D2.

Steffen H¨

  • lldobler

Propositional Logic 36

slide-37
SLIDE 37

A Lemma

◮ Lemma 3.29 If a propositional formula G is a conjunction of disjunctions and

G′ is obtained from G by applying one of the rules of the algorithm, then G′ is a conjunction of disjunctions and G ≡ G′.

◮ Proof Exercise

Steffen H¨

  • lldobler

Propositional Logic 37

slide-38
SLIDE 38

Induction Principle for While-Loops

◮ A loop invariant for a while-loop W is a statement E having the following

property: If E holds, then E still holds after one execution of the body of W.

◮ Theorem 3.30 (Induction Principle for While-Loops)

If a statement E holds before entering a loop W, and is a loop invariant for W, then E holds after termination of W as well (if W terminates).

◮ Proof

⊲ E is true on the first entry into the loop. ⊲ Suppose E is not true after termination of W. ⊲ There exists an iteration after which E becomes false. ⊲ Let n be the first such iteration. ⊲ Thus, after the ith iteration E is true for i ∈ [1, n). ⊲ In particular, after the n − 1st iteration E is true. ⊲ After the n − 1st iteration the guard of the loop W must be true as otherwise termination would occur. ⊲ Because E is a loop invariant, E must hold after the nth iteration Contradiction

Steffen H¨

  • lldobler

Propositional Logic 38

slide-39
SLIDE 39

Soundness of the Algorithm

◮ Let F be the given propositional formula and let E be the statement:

G ist a conjunction of disjunctions and F ≡ G holds. ⊲ Initially G is defined to be [F]. ⊲ Because F ≡ [F] holds, E holds before entering the while-loop. ⊲ From Lemma 3.29 we learn that E is a loop invariant for the while-loop. ⊲ Hence, by Theorem 3.30 E holds when the loop has terminated. ⊲ The loop terminates only when G is in conjunctive normal form. The algorithm is sound!

Steffen H¨

  • lldobler

Propositional Logic 39

slide-40
SLIDE 40

Termination of the Algorithm

◮ When does a non-deterministic algorithm terminate?

⊲ Weak Termination There is at least one way to execute the algorithm such that it terminates. ⊲ Strong Termination The algorithm terminates independently of which choice we make in the non-deterministic situations.

◮ Definition 3.31 The function rnk, called rank of a propositional formula, is

defined over L(R) as follows: rnk(H) =                if H is a literal, rnk(F) + 1 if H is of the form ¬¬F, rnk(F) + rnk(G) + 1 if H is of the form (F ∧ G) or (F ∨ G), rnk(¬F) + rnk(¬G) + 1 if H is of the form ¬(F ∧ G) or ¬(F ∨ G).

Steffen H¨

  • lldobler

Propositional Logic 40

slide-41
SLIDE 41

Multisets

◮ A multiset is comparable to a set,

but the individual elements may occur multiple times in it.

◮ Here multisets of natural numbers.

⊲ ˙ {1, 1, 2, 2, 2, 3 ˙ }. ⊲ M1 ≻ M2 holds iff M2 is obtained from M1 by deleting a number n from M1 and replacing it by finitely many numbers which are all less than n. ⊲ ˙ {1, 1, 2, 2, 2, 3 ˙ } ≻ ˙ {1, 1, 1, 1, 2, 2, 2, 2 ˙ }. ⊲ ≻ is not transitive and, hence, is not an ordering relation. ⊲ Observation there cannot be infinitely long sequences (Mi | i ≥ 0) of finite multisets of natural numbers such that M0 ≻ M1 ≻ . . .. Proof see Dershowitz, Manna: Proving Termination with Multiset Orderings, CACM 22, 465-475 (1979).

Steffen H¨

  • lldobler

Propositional Logic 41

slide-42
SLIDE 42

Proof of Termination

◮ Let G = [H11, . . . , H1,n1], . . . , [Hm1, . . . , Hmnm]. We define:

f(G) = ˙ {

n1

  • j=1

rnk(H1j), . . . ,

nm

  • j=1

rnk(Hmj) ˙ }

◮ Observation With every execution of the while-loop, the associated multisets

become smaller with respect to ≻/2 (Proof Exercise) Termination. qed

◮ Example

[¬(p ∨ (¬(p ∧ q) ∧ ¬r))] ˙ {5 ˙ } [¬p], [¬(¬(p ∧ q) ∧ ¬r)] ˙ {0, 4 ˙ } [¬p], [¬¬(p ∧ q), ¬¬r] ˙ {0, 3 ˙ } [¬p], [(p ∧ q), ¬¬r] ˙ {0, 2 ˙ } [¬p], [(p ∧ q), r] ˙ {0, 1 ˙ } [¬p], [p, r], [q, r] ˙ {0, 0, 0 ˙ }

◮ Observation If G is in clause form, then f(G) = ˙

{0, . . . , 0 ˙ } and the number of clauses occurring in G is equal to the number of occurrences of 0 in f(G).

Steffen H¨

  • lldobler

Propositional Logic 42

slide-43
SLIDE 43

Proof Methods

◮ {F1, . . . , Fn} |

= F iff (F1, . . . , Fn → F) is valid iff ¬(F1, . . . , Fn → F) is unsatisfiable iff F1, . . . , Fn, ¬F is unsatisfiable.

◮ Until now truth tabling ◮ Resolution ◮ Semantic tableaus ◮ Calculus of natural deduction ◮ Other proof systems and calculi

(sequent calculus, connection method, Hilbert systems, Davis-Putnam-Logemann-Loveland procedure)

Steffen H¨

  • lldobler

Propositional Logic 43

slide-44
SLIDE 44

Resolution

◮ Resolution is a method to show unsatisfiability of formulas. ◮ Here Wlog we assume that formulas are in clause form. ◮ A formula in clause form is unsatisfiable if

⊲ it contains the empty clause, or ⊲ it can be transformed into a semantically equivalent formula which contains the empty clause.

◮ Resolution is search for the empty clause using an appropriate inference rule.

Steffen H¨

  • lldobler

Propositional Logic 44

slide-45
SLIDE 45

Example

◮ Some Facts

K1 If it is hot and humid, then it will rain. K2 If it is humid, then it is hot. K3 It is humid now.

◮ Question

K4 Will it rain?

◮ Introducing propositional variables

p it is hot q it is humid r it will rain

◮ Formalization

F1 ((p ∧ q) → r) F2 (q → p) F3 q F4 r

Steffen H¨

  • lldobler

Propositional Logic 45

slide-46
SLIDE 46

Example (continued)

{((p ∧ q) → r), (q → p), q} | = r iff (((p ∧ q) → r), (q → p), q → r) is valid iff ¬(((p ∧ q) → r), (q → p), q → r) is unsatisfiable iff ((p ∧ q) → r), (q → p), q, ¬r is unsatisfiable iff [¬p, ¬q, r], [¬q, p], [q], [¬r] is unsatisfiable

Steffen H¨

  • lldobler

Propositional Logic 46

slide-47
SLIDE 47

How to Show Unsatisfiability?

◮ Recall

[¬p, ¬q, r], [¬q, p], [q], [¬r]

◮ Observation

{[¬p, ¬q, r], [q]} | = [¬p, r]

◮ Hence

[¬p, ¬q, r], [¬q, p], [q], [¬r] ≡ [¬p, ¬q, r], [¬q, p], [q], [¬r], [¬p, r]

Steffen H¨

  • lldobler

Propositional Logic 47

slide-48
SLIDE 48

Resolution Rule

◮ Definition 3.32 Let C1 be a clause where the atom A occurs,

and C2 a clause where the negated atom ¬A occurs. Let C be the result of performing the following steps: 1 Remove all occurrences of A from C1. 2 Remove all occurrences of ¬A from C2. 3 Combine the clauses obtained in this way disjunctively. C was generated applying the (propositional) resolution rule to C1 and C2, where A is the literal that was resolved upon. We also call C the resolvent of C1 and C2 wrt A.

◮ C may be the resolvent of C1 and C1.

Steffen H¨

  • lldobler

Propositional Logic 48

slide-49
SLIDE 49

Derivations and Refutations

◮ Definition 3.33 Let F = C1, . . . , Cn be a formula in clause form.

1 The sequence (Ci | 1 ≤ i ≤ n) is a resolution derivation for F. 2 If (Ci | 1 ≤ i ≤ m) is a resolution derivation for F, and Cm+1 is obtained by applying the resolution rule to two elements from (Ci | 1 ≤ i ≤ m), then (Ci | 1 ≤ i ≤ m + 1) is a resolution derivation for F. 3 A resolution derivation for F which contains the empty clause [ ] is called resolution refutation for F.

◮ F may contain [ ]. ◮ It suffices to consider refutations in which [ ] occurs once. ◮ We may assume that [ ] is the last clause in a refutation.

Steffen H¨

  • lldobler

Propositional Logic 49

slide-50
SLIDE 50

Example (continued)

1 [¬p, ¬q, r] 2 [¬q, p] 3 [q] 4 [¬r] 5 [¬q, ¬q, r] res(1, 2) 6 [r] res(3, 5) 7 [ ] res(4, 6)

Steffen H¨

  • lldobler

Propositional Logic 50

slide-51
SLIDE 51

Resolution Proofs

◮ Definition 3.34

Let F be a propositional formula, and G a formula in clause form equivalent to ¬F. ⊲ A propositional resolution proof for F is a resolution refutation for G. ⊲ F is called theorem of the resolution calculus, if there is a resolution proof for F. ⊲ We denote by ⊢r F, that F has a resolution proof.

◮ Requirements

⊲ Soundness If ⊢r F, then | = F. ⊲ Completeness If | = F, then ⊢r F.

◮ Observation

⊲ Let F be a formula with n propositional variables. ⊲ (F ∧ (p ∧ ¬p)) is unsatisfiable. ⊲ The proof consists of a single resolution step!

Steffen H¨

  • lldobler

Propositional Logic 51

slide-52
SLIDE 52

The Calculus of Natural Deduction

◮ Gentzen 1935: How to represent logical reasoning in mathematics?

⊲ Calculus of natural deduction.

◮ Its set of propositional letters is Rn := R ∪ {[ ]}. ◮ [ ]I := ⊥ for all interpretions I. ◮ Its language is L(Rn).

Steffen H¨

  • lldobler

Propositional Logic 52

slide-53
SLIDE 53

An Introductory Example

◮ Suppose we want to show the validity of

((p ∨ (q ∧ r)) → ((p ∨ q) ∧ (p ∨ r))).

◮ A proof could look like the following:

Assume that (p ∨ (q ∧ r)) holds. We distinguish two cases: (i) Assume that p holds. Hence, (p ∨ q) must hold. (ii) Assume that (q ∧ r) holds. Hence, q and, consequently, (p ∨ q) must hold. Thus, (p ∨ q) must hold in any case. Likewise, we conclude that (p ∨ r) must hold. From (1) and (2) we conclude that ((p ∨ q) ∧ (p ∨ r)) holds. We can now cancel the assumption and, thus, obtain a proof of ((p ∨ (q ∧ r)) → ((p ∨ q) ∧ (p ∨ r))).

Steffen H¨

  • lldobler

Propositional Logic 53

slide-54
SLIDE 54

Inference Rules – Examples

◮ Elimination of the implication

G (G → F) (→E) F

◮ Introduction of the implication

⌊G⌋ . . . F (→I) (G → F)

◮ Schemas which need to be instantiated, e.g.,

(p ∧ q) ((p ∧ q) → (q ∧ p)) (→E) (q ∧ p)

Steffen H¨

  • lldobler

Propositional Logic 54

slide-55
SLIDE 55

Natural Deduction - Inference Rules

◮ Negation

[ ] (f) G ⌊¬F⌋ . . . [ ] (raa) F ⌊F⌋ . . . [ ] (¬I) ¬F F ¬F (¬E) [ ]

◮ Conjunction

F G (∧I) (F ∧ G) (F ∧ G) (∧E) F (F ∧ G) (∧E) G

◮ Disjunction

F (∨I) (F ∨ G) G (∨I) (F ∨ G) (F ∨ G) ⌊F⌋ . . . H ⌊G⌋ . . . H (∨E) H

Steffen H¨

  • lldobler

Propositional Logic 55

slide-56
SLIDE 56

Natural Deduction – Inference Rules (Continued)

◮ Implication

⌊G⌋ . . . F (→I) (G → F) ⌊¬F⌋ . . . ¬G (→I) (G → F) G (G → F) (→E) F

◮ Equivalence

⌊G⌋ . . . F ⌊F⌋ . . . G (↔I) (G ↔ F) G (G ↔ F) (↔E) F F (G ↔ F) (↔E) G

Steffen H¨

  • lldobler

Propositional Logic 56

slide-57
SLIDE 57

Derivation Trees

◮ Derivations are finite trees, where

⊲ nodes are labeled by formulas, ⊲ arcs are labeled by inference rules, ⊲ leaf nodes may be marked by ⌊ ⌋ and an index j ∈ N, ⊲ arcs may be marked by an index j ∈ N, and which are constructed as defined below.

◮ If a leaf node is labeled by F and marked by ⌊ ⌋ and j,

then this is denoted by ⌊F⌋j; F is said to be marked by ⌊ ⌋ and j.

◮ Formulas labeling leaf nodes are called hypotheses or assumptions.

⊲ If a leaf node is labeled by ⌊F⌋j, then this occurrence of F is said to be cancelled;

  • therwise it is said to be uncancelled.

◮ If a derivation tree ▽contains an uncancelled occurrence of a hypothesis F,

then F is said to be an uncancelled hypothesis of ▽.

Steffen H¨

  • lldobler

Propositional Logic 57

slide-58
SLIDE 58

Derivation Trees – Notation

◮ A derivation tree whose root is labeled by F is denoted by ▽F . ◮ A derivation tree whose root is labeled by F and which contains an uncancelled

hypothesis G is denoted by ▽G

F .

◮ Let j be an index.

▽⌊G⌋j

F

denotes the tree obtained from ▽G

F by marking

at least one of the uncancelled occurrences of the hypothesis G by ⌊ ⌋j.

Steffen H¨

  • lldobler

Propositional Logic 58

slide-59
SLIDE 59

Derivation Trees – Formal Definition (1)

◮ Definition 3.38 The set of derivation trees in the calculus of natural deduction

is the smallest set X with the following properties 1 Each tree consisting of a single node labeled by some F ∈ L(Rn) is in X. 2 If ▽H1 ∈ X and H1 r H2 is the instance of a rule r ∈ {(f), (∧E), (∨I)}, then ▽H1 r H2 is in X.

Steffen H¨

  • lldobler

Propositional Logic 59

slide-60
SLIDE 60

Derivation Trees – Formal Definition (2)

3 If ▽H1

H2 ∈ X, j is a new index, and

⌊H1⌋ . . . H2 r H3 is an instance of a rule r ∈ {(raa), (¬I), (→I)}, then ▽⌊H1⌋j

H2

rj H3 is a derivation tree in X.

Steffen H¨

  • lldobler

Propositional Logic 60

slide-61
SLIDE 61

Derivation Trees – Formal Definition (3)

4 If ▽H1, ▽H2 ∈ X and H1 H2 r H3 is an instance of a rule r ∈ {(¬E), (∧I), (→E), (↔E)}, then ▽H1 ▽H2 r H3 is a derivation tree in X.

Steffen H¨

  • lldobler

Propositional Logic 61

slide-62
SLIDE 62

Derivation Trees – Formal Definition (4)

5 If ▽(F∨G), ▽F

H, ▽G H ∈ X and j is a new index, then

▽(F∨G) ▽⌊F⌋j

H

▽⌊G⌋j

H

(∨E)j H is a derivation tree in X. 6 If ▽G

F , ▽F G ∈ X and j is a new index, then

▽⌊G⌋j

F

▽⌊F⌋j

G

(↔ I)j (G ↔ F) is a derivation tree in X.

Steffen H¨

  • lldobler

Propositional Logic 62

slide-63
SLIDE 63

Derivations and Proofs

◮ Definition 3.39 Let ▽F be a derivation tree and {F1, . . . , Fm} the set of

uncancelled hypothesis occurring in ▽F . Then, ▽F is said to be a derivation of F from {F1, . . . , Fm}, and we denote this by {F1, . . . , Fm} ⊢n F.

◮ Definition 3.40 A proof of a propositional formula F

in the calculus of natural deduction is a derivation of F from the empty set. Instead of ∅ ⊢n F we write ⊢n F, if there exists a proof of F in the calculus of natural deduction.

◮ A simple example A proof of (p → p)

⌊p⌋1 (→ I)1 (p → p)

Steffen H¨

  • lldobler

Propositional Logic 63

slide-64
SLIDE 64

The Introductory Example Revisited

⌊(p ∨ (q ∧ r))⌋1 ⌊p⌋2 (∨I) (p ∨ q) ⌊(q ∧ r)⌋2 (∧E) q (∨I) (p ∨ q) (∨E)2 (p ∨ q) ⌊(p ∨ (q ∧ r))⌋1 ⌊p⌋3 (∨I) (p ∨ r) ⌊(q ∧ r)⌋3 (∧E) r (∨I) (p ∨ r) (∨E)3 (p ∨ r) (∧I) ((p ∨ q) ∧ (p ∨ r)) (→ I)1 ((p ∨ (q ∧ r)) → ((p ∨ q) ∧ (p ∨ r)))

◮ Please compare this to the informal proof given at the beginning.

Steffen H¨

  • lldobler

Propositional Logic 64

slide-65
SLIDE 65

Lemmas (1)

◮ Certain derivation trees may occur over and over again,

e.g., {¬¬F} ⊢n F or ¬¬F ⌊¬F⌋1 (¬E) [ ] (raa)1 F

◮ Idea Generate such derivation tree once and for all,

specify corresponding inference rules called lemmas, and apply the lemmas in addition to the usual inference rules.

◮ In the example we obtain

¬¬F (l1) F

Steffen H¨

  • lldobler

Propositional Logic 65

slide-66
SLIDE 66

Lemmas (2)

◮ The lemma

¬(F ∧ G) F (l2) ¬G

◮ and its derivation tree

¬(F ∧ G) F ⌊G⌋1 (∧I) (F ∧ G) (¬E) [ ] (¬I)1 ¬G

Steffen H¨

  • lldobler

Propositional Logic 66

slide-67
SLIDE 67

Lemmas (3)

◮ The lemma

¬(F ∧ G) G (l3) ¬F

◮ and its derivation tree

¬(F ∧ G) ⌊F⌋1 G (∧I) (F ∧ G) (¬E) [ ] (¬I)1 ¬F

Steffen H¨

  • lldobler

Propositional Logic 67

slide-68
SLIDE 68

Lemmas (4)

◮ The lemma

¬(F ∨ G) (l4) (¬F ∧ ¬G)

◮ and its derivation tree

¬(F ∨ G) ⌊F⌋1 (∨I) (F ∨ G) (¬E) [ ] (¬I)1 ¬F ¬(F ∨ G) ⌊G⌋2 (∨I) (F ∨ G) (¬E) [ ] (¬I)2 ¬G (∧I) (¬F ∧ ¬G)

Steffen H¨

  • lldobler

Propositional Logic 68

slide-69
SLIDE 69

Another Example Demonstrating the Use of Lemmas

◮ A proof of (p ∨ ¬p)

⌊¬(p ∨ ¬p)⌋1 (l4) (¬p ∧ ¬¬p) (∧E) ¬¬p (l1) p ⌊¬(p ∨ ¬p)⌋1 (l4) (¬p ∧ ¬¬p) (∧E) ¬p (¬E) [ ] (raa)1 (p ∨ ¬p)

Steffen H¨

  • lldobler

Propositional Logic 69

slide-70
SLIDE 70

Some Remarks on Natural Deduction

◮ Lemmas shorten proofs, but enlarge the search space. ◮ The calculus of natural deduction is sound and complete.

(see e.g. van Dalen: Logic and Structure. Springer 1997).

◮ Human readable proofs versus machine generated proofs. ◮ Sequent calculus. ◮ Proof theory.

Steffen H¨

  • lldobler

Propositional Logic 70

slide-71
SLIDE 71

3.6 Properties

◮ Compactness Theorem ◮ Soundness and Completeness Theorems

Steffen H¨

  • lldobler

Propositional Logic 71

slide-72
SLIDE 72

3.6.1 Compactness Theorem – Introduction

◮ How can we decide whether a possibly infinite set of formulas is satisfiable? ◮ Idea We test all finite subsets. ◮ Remember ≡ is an equivalence relation on L(R). ◮ Let L(R, n) ⊆ L(R) be the set of formulas in which only the variables

p1, . . . , pn occur.

◮ There are 2n different interpretations for L(R, n). ◮ How many different equivalence classes are defined by ≡ on L(R, n)?

Steffen H¨

  • lldobler

Propositional Logic 72

slide-73
SLIDE 73

Compactness Theorem

◮ Theorem 3.45 (Compactness Theorem)

A set F of propositional formulas is satisfiable iff every finite subset G ⊆ F is satisfiable.

◮ Proof Let F be a (possibly infinite) set of formulas. We have to show:

(i) If F is satisfiable, so is each finite G ⊆ F. (ii) If each G ⊆ F is satisfiable, so is F. ⊲ (i) follows immediately from the definition of satisfiability for sets. ⊲ To show (ii) we have to prove the existence of a model for F starting from the models for each finite G ⊆ F.

Steffen H¨

  • lldobler

Propositional Logic 73

slide-74
SLIDE 74

Proof of Part (ii) of the Compactness Theorem

◮ Suppose, each finite H ⊆ G is satisfiable. ◮ Let Gn = G ∩ L(R, n). ◮ There are at most k ≤ 22n different equivalence classes on Gn defined by ≡. ◮ Let G1, . . . , Gk be representatives of these equivalence classes. ◮ Hence, for each G ∈ Gn there is an i, 1 ≤ i ≤ k, with G ≡ Gi. ◮ Hence, each model for {G1, . . . , Gk} is also a model for Gn. ◮ Because {G1, . . . , Gk} is a finite subset of F, it has a model. ◮ Let In be this model. ◮ Because G1 ⊆ G2 ⊆ . . . ⊆ Gn, In is also a model for all Gj, 1 ≤ j ≤ n.

Steffen H¨

  • lldobler

Propositional Logic 74

slide-75
SLIDE 75

Proof of Part (ii) of the Compactness Theorem (continued)

◮ We construct a model I for F as follows:

Set I := ∅, K0 := N and n = 1. Do the following: If there are infinitely many j ∈ Kn−1 with [pn]Ij = ⊤ , then set I := I ∪ {pn} and Kn := Kn−1 \ {j | [pn]Ij = ⊥}, (⊤) else set Kn := Kn−1 \ {j | [pn]Ij = ⊤}. (⊥) Set n := n + 1. Goto “Do the following”.

◮ I is an interpretation. ◮ By induction the following proposition E(n) can be proven:

Kn contains infinitely many elements and for all m ∈ Kn we find: [pi]Im = [pi]I for all 1 ≤ i ≤ n. Proof Exercise.

Steffen H¨

  • lldobler

Propositional Logic 75

slide-76
SLIDE 76

Proof of Part (ii) of the Compactness Theorem (continued)

◮ To show I is a model for F. ◮ Let F be an arbitrary but fixed element of F. ◮ There are at most finitely many propositional variables occurring in F. ◮ Let pn be the variable with the highest index. ◮ Then, F ∈ Gn ⊆ Gn+1 ⊆ . . .

and each interpretation In, In+1, . . . is a model for F.

◮ Because of E(n) we find:

⊲ Kn contains infinitely many elements. ⊲ For all m ∈ Kn we find: [pi]Im = [pi]I for all 1 ≤ i ≤ n.

◮ Select m ∈ Kn with m > n. ◮ Because Im is a model for F and F contains only the variables p1, . . . , pn,

I must be a model for F as well.

◮ Because F is an arbitrary element from F, I must also be a model for F.

qed

Steffen H¨

  • lldobler

Propositional Logic 76

slide-77
SLIDE 77

Implications of the Compactness Theorem

◮ The proof is not constructive. ◮ We may negate both sides of the compactness theorem. ◮ Corollary 3.46 A set of propositional formulas is unsatisfiable

iff one of its finite subsets is unsatisfiable.

◮ Procedure to prove unsatisfiability of F:

⊲ We generate all finite subsets of F in a systematic way and test them for unsatisfiability.

Steffen H¨

  • lldobler

Propositional Logic 77

slide-78
SLIDE 78

3.6.2 Soundness and Completeness Theorems

◮ Lemma 3.47 (Propositional Resolution Lemma) Let F = C1, . . . , Cn be a

propositional formula in clause form with the clauses Ci, 1 ≤ i ≤ n, and let C be a resolvent of two clauses from F. Then F ≡ (F ∧ C) holds.

◮ Proof To show I |

= (F ∧ C) iff I | = F. ⇒ immediate ⇐ Suppose I | = F. Let C be the resolvent of Ci and Cj wrt A, 1 ≤ i, j ≤ n. ⊲ Let C′

i = Ci “without” A and C′ j = Cj “without” ¬A.

⊲ Then C = (C′

i ∨ C′ j ).

⊲ Case 1 I | = A. Then, I | = ¬A. Because I | = Cj we conclude I | = C′

j .

Hence, I | = C. ⊲ Case 2 I | = A. Because I | = Ci we find I | = C′

i .

Hence I | = C. qed

Steffen H¨

  • lldobler

Propositional Logic 78

slide-79
SLIDE 79

An Implication of the Resolution Lemma

◮ Corollary 3.48 Let F = C1, . . . , Cn be a propositional logic formula

in clause form with clauses Ci, 1 ≤ i ≤ n, and let D1, . . . , Dm be the computed resolvents in a resolution derivation from F. Then, F ≡ F, D1, . . . , Dm.

◮ Proof Induction over m. Exercise

Steffen H¨

  • lldobler

Propositional Logic 79

slide-80
SLIDE 80

Resolution Method

◮ Theorem 3.49 (Soundness and Completeness of the Prop. Resolution Method)

Let F be a propositional formula. | = F iff ⊢r F.

◮ Proof Soundness To show If ⊢r F, then |

= F. ⊲ Suppose ⊢r F. ⊲ By Theorem 3.28 there is a formula G in clause form with G ≡ ¬F. ⊲ By Definition 3.34 we find a resolution refutation for G, i.e., by Definition 3.33 a resolution derivation with [ ] as last element. ⊲ Let D1, . . . , Dm, [ ] be all resolvents computed in that refutation. ⊲ By Corollary 3.48 we find G ≡ G, D1, . . . , Dm, [ ]. ⊲ Because [ ] is unsatisfiable we conclude by Theorem 3.19 that G ≡ [ ], i.e. G ist unsatisfiable. ⊲ Because G ≡ ¬F and Theorem 3.14 we find | = F.

Steffen H¨

  • lldobler

Propositional Logic 80

slide-81
SLIDE 81

Completeness of the Resolution Method

◮ Proof Completeness To show If |

= F, then ⊢r F. ⊲ Suppose | = F. ⊲ By Theorem 3.28 we find a formula G in clause form with G ≡ ¬F. ⊲ By Theorem 3.14 we find that G is unsatisfiable. ⊲ To show: there is a resolution refutation for G ⊲ The proof is by induction on the number n of propositional variables

  • ccurring in G.

◮ n = 0 Then G = [ ], . . . , [ ] and we are done. ◮ n ⇒ n + 1 Assume that the proposition holds for n, i.e.

if G is unsatisfiable and in G occur only the variables p1, . . . , pn, then there is a resolution refutation for G. ⊲ Wlog we may assume that p1, . . . , pn are the n variables occurring in G. Exercise

Steffen H¨

  • lldobler

Propositional Logic 81

slide-82
SLIDE 82

Completeness of the Resolution Method (continued)

◮ Let G′ be a formula in clause form in which the variables p1, . . . , pn+1 occur.

⊲ Let G′

⊤ be the formula obtained from G′ by

◮ ◮ deleting each clause, in which pn+1 occurs, and ◮ ◮ deleting each occurrence of ¬pn+1.

⊲ Let G′

⊥ be the formula obtained from G′ by

◮ ◮ deleting each clause, in which ¬pn+1 occurs, and ◮ ◮ deleting each occurrence of pn+1.

⊲ We find: G′

⊤ and G′ ⊥ are unsatisfiable if G′ is unsatisfiable.

Exercise

Steffen H¨

  • lldobler

Propositional Logic 82

slide-83
SLIDE 83

Completeness of the Resolution Method (continued)

◮ Applying the induction assumption we find refutations for G′

⊥ and G′ ⊤.

◮ resolvents G′

⊤ resolvents G′.

Case 1 resolution refutation for G′. Case 2 resolution derivation with [¬pn+1, . . . ¬pn+1] as last entry.

◮ resolvents G′

⊥ resolvents G′.

Case 1 resolution refutation for G′. Case 2 resolution derivation with [pn+1, . . . , pn+1] as last entry.

◮ If case 2 was selected twice, then compute the resolvent of

[pn+1, . . . , pn+1] and [¬pn+1, . . . , ¬pn+1] resolution refutation for G′.

◮ An application of the induction principle yields the desired result.

qed

Steffen H¨

  • lldobler

Propositional Logic 83