CS621: Artificial Intelligence

40
CS621: Artificial Intelligence Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 11- Soundness and Completeness; proof of soundness; start of proof of completeness 12 th august, 2010

description

CS621: Artificial Intelligence. Pushpak Bhattacharyya CSE Dept., IIT Bombay Lecture 11- Soundness and Completeness; proof of soundness; start of proof of completeness 12 th august, 2010. Soundness, Completeness & Consistency. Soundness. Semantic World ---------- Valuation, - PowerPoint PPT Presentation

Transcript of CS621: Artificial Intelligence

Page 1: CS621: Artificial  Intelligence

CS621: Artificial Intelligence

Pushpak BhattacharyyaCSE Dept., IIT Bombay

Lecture 11- Soundness and Completeness; proof of soundness; start of proof of completeness

12th august, 2010

Page 2: CS621: Artificial  Intelligence

Soundness, Completeness &

Consistency

Syntactic World

----------Theorems,

Proofs

SemanticWorld

----------Valuation,Tautology

Soundness

Completeness

* *

Page 3: CS621: Artificial  Intelligence

Introduce Semantics in Propositional logic

Valuation Function V

Definition of V

V(F ) = F

Where F is called ‘false’ and is one of the two symbols (T, F)

Semantic ‘false’

Syntactic ‘false

Page 4: CS621: Artificial  Intelligence

V(F ) = F

V(AB) is defined through what is called the truth table

V(A) V(B) V(AB) T F F T T T F F T F T T

Page 5: CS621: Artificial  Intelligence

Tautology

An expression ‘E’ is a tautology if

V(E) = Tfor all valuations of constituent

propositions

Each ‘valuation’ is called a ‘model’.

Page 6: CS621: Artificial  Intelligence

Soundness

Provability Validity

Completeness

Validity Provability

Page 7: CS621: Artificial  Intelligence

Soundness: Correctness of the System

Proved entities are indeed valid

Completeness: Power of the System

Valid things are indeed provable

Page 8: CS621: Artificial  Intelligence

Consistency

The System should not be able to

prove both P and ~P, i.e., should not be

able to derive F

Page 9: CS621: Artificial  Intelligence

Examine the relation between

Soundness&

Consistency

Soundness Consistency

Page 10: CS621: Artificial  Intelligence

If a System is inconsistent, i.e., can derive

F , it can prove any expression to be a

theorem. Because

F P is a theorem

Page 11: CS621: Artificial  Intelligence

To see that

(FP) is a tautology

two modelsV(P) = TV(P) = F

V(FP) = T for both

Page 12: CS621: Artificial  Intelligence

If a system is Sound & Complete, it does not

matter how you “Prove” or “show the validity”

Take the Syntactic Path or the Semantic Path

Page 13: CS621: Artificial  Intelligence

Problem

(P Q)(P Q)

Semantic Proof A B

P Q P Q P Q ABT F F T T T T T T TF F F F TF T F T T

Page 14: CS621: Artificial  Intelligence

To show syntactically(P Q) (P Q)

i.e.[(P (Q F )) F ]

[(P F ) Q]

Page 15: CS621: Artificial  Intelligence

If we can establish

(P (Q F )) F ,(P F ), Q F ⊢ F

This is shown as Q F hypothesis(Q F ) (P (Q F)) A1

Page 16: CS621: Artificial  Intelligence

QF; hypothesis(QF)(P(QF)); A1P(QF); MPF; MPThus we have a proof of the line we

started with

Page 17: CS621: Artificial  Intelligence

Soundness Proof

Hilbert Formalization of Propositional

Calculus is sound.

“Whatever is provable is valid”

Page 18: CS621: Artificial  Intelligence

Statement

Given

A1, A2, … ,An |- B

V(B) is ‘T’ for all Vs for which V(Ai) = T

Page 19: CS621: Artificial  Intelligence

Proof

Case 1 B is an axiom

V(B) = T by actual observation

Statement is correct

Page 20: CS621: Artificial  Intelligence

Case 2 B is one of Ais

if V(Ai) = T, so is V(B)

statement is correct

Page 21: CS621: Artificial  Intelligence

Case 3B is the result of MP on Ei & Ej

Ej is Ei B

Suppose V(B) = F

Then either V(Ei) = F or V(Ej) = F

.

.

.Ei

.

.

.Ej

.

.

.B

Page 22: CS621: Artificial  Intelligence

i.e. Ei/Ej is result of MP of two expressions coming before them

Thus we progressively deal with shorter and shorter proof body.

Ultimately we hit an axiom/hypothesis.

Hence V(B) = TSoundness

proved

Page 23: CS621: Artificial  Intelligence

Towards Completeness Proof

Page 24: CS621: Artificial  Intelligence

Soundness: Correctness of the System

Proved entities are indeed true/valid

Completeness: Power of the System

True things are indeed provable

Page 25: CS621: Artificial  Intelligence

Tautology

An expression ‘E’ is a tautology if

V(E) = Tfor all valuations of constituent

propositions

Each ‘valuation’ is called a ‘model’.

Page 26: CS621: Artificial  Intelligence

Necessary results

Statement: (pq)((~pq)q)

Proof:If we can show that (pq), (~pq) |- qOr, (pq), (~pq), qF |- FThen we are done.

Page 27: CS621: Artificial  Intelligence

Proof continued1. (pq) H12. (~pq) H23. qF H34. (~pq) (~qp) theorem of contraposition5. ~qp MP, 2, 46. P MP, 3,57. q MP, 6, 18. F MP,7,3 QED

Page 28: CS621: Artificial  Intelligence

How to prove contraposition

To show (pq)(~q~p)Proof: pq, ~q, p |- FVery obvious!

Page 29: CS621: Artificial  Intelligence

An example to illustrate the completeness proof

p q p(p V q)

T F T

T T T

F T T

F F T

Page 30: CS621: Artificial  Intelligence

Running the completeness proof

For every row of the truth table set up a proof:

1. p, ~q |- p(p V q)2. p, q |- p(p V q)3. ~p, q |- p(p V q)4. ~p, ~q |- p(p V q)

Page 31: CS621: Artificial  Intelligence

1. p, ~q |- p (p V q)

i.e. p, ~q, p |- p V q

p, ~q, p, ~p |- q

p, ~q, p, ~p |- F |- F q |- q

Page 32: CS621: Artificial  Intelligence

2. p, q |- p (p V q)

i.e. p, q, p, ~p |- q

same as 1

Page 33: CS621: Artificial  Intelligence

3. ~p, q |- p (p V q)

~p, q, p, ~p |- qSame as 1, since F is

derived

4. ~p, ~q |- p (p V q) Same as 1, since F is

derived

Page 34: CS621: Artificial  Intelligence

Why all this?

If we have shown

p, q |- A

and p, ~q |- A

then we can show that

p |- A

Page 35: CS621: Artificial  Intelligence

p |- (q A)

also p |- (~q A)

But (q A) ((~q A) A)is a theorem

by MP twice

p |- A

Page 36: CS621: Artificial  Intelligence

General Statement of the completeness proof

If V(A) = T for all models

then |- A

Page 37: CS621: Artificial  Intelligence

Elaborating,

If P1, P2, …, Pn are constituent propositions of A

and if V(A) = T for every model V(Pi) = T/F

then|- A

Page 38: CS621: Artificial  Intelligence

We have a truth table with 2n rows

P1 P2 P3 . . . Pn AF F F . . . F TF F F . . . T T

. . .

T T T . . . T T

Page 39: CS621: Artificial  Intelligence

If we can show

P1’, P2’, …, Pn’ |- A’

For every row where

Pi’ = Pi if V(Pi) = T = ~Pi if V(Pi) = F

And A’ = A if V(A) = T = ~A if V(A) = F

Page 40: CS621: Artificial  Intelligence

If row has

P1’, P2’, …, Pn’, A’Then

P1’, P2’, …, Pn’ |- A’

A very critical result linking syntax with semantics

Lemma