propositional logic: semantics (3/3) · shin yoo propositional logic: semantics (3/3) proof for...

24
Propositional Logic: Semantics (3/3) CS402, Spring 2018 Shin Yoo Shin Yoo Propositional Logic: Semantics (3/3)

Upload: others

Post on 16-Oct-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Propositional Logic: Semantics (3/3)CS402, Spring 2018

Shin Yoo

Shin Yoo Propositional Logic: Semantics (3/3)

Page 2: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Overview

Semantic Tableaux

Soundness and completeness

Shin Yoo Propositional Logic: Semantics (3/3)

Page 3: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic Tableaux

A relatively efficient algorithm for deciding satisfiability in thepropositional calculus.

Search systematically for a model.

If one is found, the formula is satisfiable; otherwise, it isunsatisfiable.

This method is the main tool for proving general theorems aboutthe calculus.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 4: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic Tableaux

Definition 1 (2.57)

A literal is an atom or a negation of an atom. An atom is apositive literal and the negation of an atom is a negative literal.For any atom p, {p,¬p} is a complementary pair of literals. Forany formula A, {A,¬A} is a complementary pair of formulas. A isthe complement of ¬A and ¬A is the complement of A.

Important observation: a set of litrals is satisfiable if and only ifit does not contain a complementary pair of literals.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 5: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic Tableaux

Analyze the satisfiablity of A = p ∧ (¬q ∨ ¬p) in an arbitraryinterpretation I .

νI (A) = T iff both νI (p) = T and νI (¬q ∨ ¬p) = T .

Hence, νI (A) = T if and only if either:

1 νI (p) = T and νI (¬q) = T or

2 νI (p) = T and νI (¬p) = T

∴ A is satisfiable if and only if there exists an interpretation suchthat (1) holds or (2) holds.

The process is to reduce the question from one about thesatisfiability of a formula to one about the satisfiability of sets ofliterals. Since any formula contains finite atoms, there are at mostfinite number of sets of literals. Then the decision on satisfiabilitybecomes trivial.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 6: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic Tableaux

Formula B = (p ∨ q) ∧ (¬p ∧ ¬q) under an arbitrary interpretationI .

νI (B) = T iff νI (p ∨ q) = T and νI (¬p ∧ ¬q) = T .

Hence, νI (B) = T iff νI (p ∨ q) = νI (¬p) = νI (¬q) = T .

Hence, νI (B) = T iff either:

1 νI (p) = νI (¬p) = νI (¬q) = T , or

2 νI (q) = νI (¬p) = ν(¬q) = T .

Since both {p,¬p,¬q} and {q,¬p,¬q} contain complementarypairs, B is unsatisfiable.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 7: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic tableaux

This systematic search becomes easier if we use a suitabledata structure to keep track of the assignments that must bemade to subformulas.

In semantic tableaux, trees are used.

A leaf containing a complementary set of literals will markedwith a × symbol, while a leaf containing a satisfiable set ofliterals will be marked with a � symbol.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 8: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic tableaux

Is p ∧ (¬q ∨ ¬p) satisfiable?

p ∧ (¬q ∨ ¬p)

p,¬q ∨ ¬p

p,¬p (×)p,¬q (�)

Is (p ∨ q)∧ (¬p ∧¬q) satisfiable?

(p ∨ q) ∧ (¬p ∧ ¬q)

p ∨ q,¬p ∧ ¬q

p ∨ q,¬p,¬q

q,¬p,¬q(×)p,¬p,¬q(×)

Shin Yoo Propositional Logic: Semantics (3/3)

Page 9: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

The tableau construction is not unique.

(p ∨ q) ∧ (¬p ∧ ¬q)

p ∨ q,¬p ∧ ¬q

p ∨ q,¬p,¬q

q,¬p,¬q(×)p,¬p,¬q(×)

(p ∨ q) ∧ (¬p ∧ ¬q)

p ∨ q,¬p ∧ ¬q

p ∨ q,¬p,¬q

q,¬p ∧ ¬q

q,¬p,¬q(×)

p,¬p ∧ ¬q

p,¬p,¬q(×)

Shin Yoo Propositional Logic: Semantics (3/3)

Page 10: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic tableaux

Classification of formulas according to their principal operators:

α-formulas are conjunctive and are satisfiable only if bothsubformulas, α1 and α2, are satisfied.

β-formulas are disjunctive and are satsified if at least one ofthe subformulas, β1 or β2, is satisfiable.

α α1 α2

¬¬A1 A1

A1 ∧ A2 A1 A2

¬(A1 ∨ A2) ¬A1 ¬A2

¬(A1 → A2) A1 ¬A2

¬(A1 ↑ A2) A1 A2

A1 ↓ A2 ¬A1 ¬A2

A1 ↔ A2 A1 → A2 A2 → A1

¬(A1 ⊕ A2) A1 → A2 A2 → A1

β β1 β2

¬(B1 ∧ B2) ¬B1 ¬B2

B1 ∨ B2 B1 B2

B1 → B2 ¬B1 B2

B1 ↑ B2 ¬B1 ¬B2

¬(B1 ↓ B2) B1 B2

¬(B1 ↔ B2) ¬(B1 → B2) ¬(B2 → B1)

B1 ⊕ B2 ¬(B1 → B2) ¬(B2 → B1)

Shin Yoo Propositional Logic: Semantics (3/3)

Page 11: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic tableaux

Let T for a propositional formula A be a tree, whose nodes are alllabeled with a set of formulas. Let U(l) be the set of formulas ofleaf l .Construction of Sem. Tab.(Algorithm 2.64)Input: A propositional formula AOutput: A semantic tableaux T for A with marked leaves(1) T ← a tree with a single node labeled {A}(2) while there exists an unmarked leaf(3) foreach unmarked leaf l(4) if U(l) is a set of lit.(5) if a compl. lit. pair ∈ U(l) then Mark l as ×(6) else Mark l as ⊕(7) else(8) Choose A ∈ U(l)(9) if A == α then Add l ′ to l s.t. U(l ′)← (U(l)−{α} ∪ {α1, α2}(10) if A == β then Add l ′, l ′′ to l s.t. U(l ′)← (U(l)−{β})∪{β1},

U(l ′′)← (U(l)− {β}) ∪ {β2}

This is not deterministic due to the choice of leaves in line (3).

Shin Yoo Propositional Logic: Semantics (3/3)

Page 12: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Semantic tableaux

Definition 2 (2.65)

A tableau whose construction has terminated is called acompleted tableau.

A completed tableau is closed if all leaves are marked closed(i.e. ×); otherwise, it is open.

Theorem 1 (2.66)

The construction of a semantic tableau terminates.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 13: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Soundness and Completeness

A tool operates on a formula φ at the syntactic level, i.e. it doesnot apply all possible interpretations.

A tool is sound if whenever the tool says that a formula φ isvalid (validity, not satisfiability), φ is really valid. That is, ` φimplies |= φ.A tool is complete if whenever φ is valid, the tool does saythat φ is valid. That is, |= φ implies ` φ.

Writing in a contra-positive way: a tool (or method) iscomplete if whenever the tool says that φ is not valid, then φis really not valid.

Therefore, if a tool is sound and complete, then the tool saysthat φ is valid iff φ is really valid.

Note that:

If a dumb tool always says that φ is not valid, then that toolis still sound.

If a dumb tool always says that φ is valid, then that tool isstill complete.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 14: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Soundness and Completeness

Theorem 2 (2.67)

Let T be a completed tableau for a formula A. A is unsatisfiable ifand only if T is closed.

Corollary 1 (2.68)

A is satisfiable if and only if T is open.

Corollary 2 (2.69)

A is valid if and only if the tableau for ¬A is closed.

Corollary 3 (2.70)

The method of semantic tableaux is a decision procedure forvalidity in the propositional calculus.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 15: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Soundness

Proof of soundness:

If the tableau T for a formula A closes, then A is unsatisfiable.

If a subtree rooted at node n of T closes, then the set offormulas U(n) labeling n is unsatisfiable. Let h be the heightof the node n in T .

If h = 0, n is a leaf. Since T closes, U(n) contains acomplementary set of literals. Hence U(n) is unsatisfiable.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 16: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Soundness

If h > 0, either α- or β- rule was used in creating thechild(ren) of n:

Case 1: α-rule. U(n) = {A1 ∧ A2} ∪ U0 andU(n′) = {A1,A2} ∪ U0 for some set of formulas U0.The height of n′ is h − 1; by induction, U(n′) is unsatisfiablesince the subtree rooted at n′ closes.Let ν be an arbitrary interpretation. Since U(n′) isunsatisfiable, ν(A′) = F for some A′ ∈ U(n′). There are threepossibilities:

For some A0 ∈ U0, ν(A0) = F . But A0 ∈ U0 ⊆ U(n).ν(A1) = F , ν(A1 ∧ A2) = F . And A1 ∧ A2 ∈ U(n).ν(A2) = F , ν(A1 ∧ A2) = F . And A1 ∧ A2 ∈ U(n).

In all three cases, ν(A) = F for some A ∈ U(n). Therefore,U(n) is unsatisfiable.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 17: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Soundness

If h > 0, either α- or β- rule was used in creating thechild(ren) of n:

Case 2: β-rule. U(n) = {B1 ∨ B2} ∪ U0, U(n) = {B1} ∪ U0

and U(n′′) = {B2} ∪ U0 for some set of formulas U0.By induction, both U(n′) and U(n′′) are unsatisfiable, sincethe subtrees rooted at n′ and n′′ close.Let ν be an arbitrary interpretation. There are threepossibilities:

U(n′) and U(n′′) are unsatisfiable, because ν(B0) = F forsome B0 ∈ U0. But B0 ∈ U0 ⊆ U(n).Otherwise, ν(B0) = T for all B0 ∈ U0. Since both U(n′) andU(n′′) are unsatisfiable, ν(B1) = ν(B2) = F . By definition ofν on ∨, ν(B1 ∨ B2) = F , and B1 ∨ B2 ∈ U(n).

Therefore ν(B) = F for some B ∈ U(n); since ν was arbitrary,U(n) is unsatisfiable.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 18: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Completeness

Proof of completeness:

If A is unsatisfiable, then every tableau for A closes.

Contrapositive statement (Cor 2.68): if some tableau for A isopen (i.e., if some tableau for A has an open branch), thenthe formula A is satisfiable.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 19: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Completeness

Definition 3 (2.75)

Let U be a set of formulas. U is a Hintikkaa set iff:

1 For all atoms p appearing in a formula of U, either p /∈ U or¬p /∈ U.

2 If α ∈ U is an α-formula, then α1 ∈ U and α2 ∈ U.

3 If β ∈ U is an β-formula, then either β1 ∈ U or β2 ∈ U.

aNamed after Finnish logician Jaakko Hintikka (1929-2015).

Shin Yoo Propositional Logic: Semantics (3/3)

Page 20: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Completeness

Let us first deal with the following theorem, which we will then useto prove the completeness.

Theorem 3 (2.77)

Let l be an open leaf in a completed tableau T . Let U =⋃

i U(i),where i runs over the set of nodes on the branch from the root tol . Then U is a Hintikka set.

Proof.

Literal p or ¬p cannot be decomposed. Thus, if a literal p or ¬pappears for the first time in U(n) for some n, the literal will becopied into U(k) for all nodes k on the branch from n to l , inparticular, p ∈ U(l) or ¬p ∈ U(l). This means that all literals in Uappear in U(l). Since the branch is open, no complementary pair ofliterals appears in U(l), so Condition (1) for Hitikka set holds.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 21: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Proof for Theorem 2.77 Cont.

Suppose that A ∈ U is an α-formula. Since the tableau iscompleted, A was the formula selected for decomposing at somenode n in the branch from the root to l . Then{A1,A2} ⊆ U(n′) ⊆ U , so Condition (2) holds.

Suppose that B ∈ U is an β-formula. Since the tableau iscompleted, B was the formula selected for decomposing at somenode n in the branch from the root to l . Then eitherB1 ∈ U(n′) ⊆ U or B2 ∈ U(n′) ⊆ U, so Condition (3) holds.

Shin Yoo Propositional Logic: Semantics (3/3)

Page 22: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Completeness

Theorem 4 (2.78)

Hintikka’s Lemma: Let U be a Hintikka set. Then U issatisfiable.

Proof.

Let us define an interpretation I based on the fact that U is a Hintikka set,and then show I is a model of U.

Let I : PU → {T ,F} be:

I (p) = T if p ∈ U

I (p) = F if ¬p ∈ U

I (p) = T if p /∈ U and ¬p /∈ U

Condition (1) in Definition 2.75 states that every literal is given exactly onevalue. The third case assigns arbitrary T to atoms that appear in U but not inliteral form (i.e. q ∈PU but q /∈ U and ¬q /∈ U).

Shin Yoo Propositional Logic: Semantics (3/3)

Page 23: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Proof for Theorem 2.78 Cont.

We use structural induction to show that for any a ∈ U, νI (A) = T . The basecase is when A is an atom.

A is an atom: νI (A) = νI (p) = I (p) = T , because p ∈ U.

A is a negated atom ¬p: ¬p ∈ U, therefore I (p) = F , thereforeνI (A) = νI (¬p) = T .

A is an α-formula: by Condition (2) of Def. 2.75, A1 ∈ U and A2 ∈ U.By inductive hypothesis, νI (A1) = νI (A2) = T , so by definition of theconjunctive operator, νI (A) = T .

A is an β-formula: by Condition (3) of Def. 2.75, either B1 ∈ U orB2 ∈ U. By inductive hypothesis, either νI (B1) = T or νI (B2) = T , soby definition of the disjunctive operator, νI (A) = νI (B) = T .

Shin Yoo Propositional Logic: Semantics (3/3)

Page 24: Propositional Logic: Semantics (3/3) · Shin Yoo Propositional Logic: Semantics (3/3) Proof for Theorem 2.77 Cont. Suppose that A 2U is an -formula. Since the tableau is completed,

Completeness

Proof of Completeness for Semantic Tableaux.

Let T be a completed open tableau for A. Then U, the union ofthe labels of the nodes on an open branch, is a Hintikka set byTheorem 2.77, and a model can be found for U by Theorem 2.78.Since A is the formula labeling the root, A ∈ U, so theinterpretation is a model of A.

Shin Yoo Propositional Logic: Semantics (3/3)