• No results found

Pushpak Bhattacharyya

N/A
N/A
Protected

Academic year: 2022

Share "Pushpak Bhattacharyya"

Copied!
83
0
0

Loading.... (view fulltext now)

Full text

(1)

CS344: Introduction to Artificial Intelligence

(associated lab: CS386)

Pushpak Bhattacharyya

CSE Dept., IIT Bombay

Lecture–15, 17, 19, 20: Foundations: Axiom, Rule, Concept, Soundness, Completeness, Consistency, Derivability

3rd, 7th , 19th and 21st March, 2014

(Lecture 13 and 14 were on Logic by Brendan; lecture 16 and 18 were on HMM by Manish )

(2)

Theory of CS

Theory A

Logic

Theory B

Algorithm an Complexity

(3)

Concepts, Axioms, Rule

Some foundational questions for

Mechanization or Automation of Knowledge Representation and Reasoning:

What are symbols and concepts (well formed formulae)

What are the self evident and ground truths in the system (axiomatization)

What is the validity of the inference (soundness and consistency)

Is the inference system powerful enough to capture reality (completeness)

Can it be implemented in Turing machine (derivability and complexity)

(4)

Case study: Propositional calculus

Propositions

Stand for facts/assertions

Declarative statements

As opposed to interrogative statements (questions) or imperative statements (request, order)

Operators

AND (/\), OR (\/), NOT (¬), IMPLICATION (=>)

=> and ¬ form a minimal set (can express other operations) - Prove it.

Tautologies are formulae whose truth value is always T, whatever the assignment is

(5)

Model

In propositional calculus any formula with n propositions has 2n models (assignments)

- Tautologies evaluate to T in all models.

Examples:

1)

2)

-e Morgan with AND

P P  

) (

)

(PQ  P  Q

(6)

Example

Prove is a Tautology.

Proof by Truth Table

T T F F T

T F T T T

F T T T T

F F T T T

)

~ (~

) (

~ PQ P Q

) (

~ P Q

L

P

Q R ~ P ~ Q L R

(7)

Formal Systems

Rule governed

Strict description of structure and rule application

Constituents

Symbols

Well formed formulae

Inference rules

Assignment of semantics

Notion of proof

Notion of soundness, completeness, consistency, decidability etc.

(8)

Hilbert's formalization of propositional calculus 1. Elements are propositions : Capital letters

2. Operator is only one :  (called implies) 3. Special symbol F (called 'false')

4. Two other symbols : '(' and ')'

5. Well formed formula is constructed according to the grammar WFF P|F|WFFWFF

6. Inference rule : only one Given AB and

A

write B

known as MODUS PONENS

(9)

7. Axioms : Starting structures A1:

A2:

A3

This formal system defines the propositional calculus ))

(

(A B A

))) (

) ((

)) (

((A B C A B A C )

) )

(((A F F A

(10)

Notion of proof

1. Sequence of well formed formulae 2. Start with a set of hypotheses

3. The expression to be proved should be the last line in the sequence

4. Each intermediate expression is either one of the hypotheses or one of the axioms or the result of modus ponens

5. An expression which is proved only from the axioms and inference rules is called a THEOREM within the system

(11)

Example of proof

From P and and prove R H1: P

H2:

H3:

i) P H1

ii) H2

iii) Q MP, (i), (ii)

iv) H3

v) R MP, (iii), (iv)

Q P

Q P

Q P

R Q

R Q

R Q

(12)

Prove that is a THEOREM

i) A1 : P for A and B

ii) A1: P for A and for B

iii)

A2: with P for A, for B and P for C

iv) MP, (ii), (iii)

v) MP, (i), (iv)

) (P P

) )

((P P P

P

)

(P P

P

))]

( ))

( ((

)) )

((

[(P P P P P P P P P

) (P P ))

( )

(

(P P P P P )

(P P

) (P P

(13)

Shorthand

1. is written as and called 'NOT P'

2. is written as and called 'P OR Q’

3. is written as and called

'P AND Q' Exercise: (Challenge) - Prove that

¬P P F

) )

((P F Q (PQ)

) ))

(

((P Q F F (P Q)

)) (

( A

A

(14)

A very useful theorem (Actually a meta theorem, called deduction theorem)

Statement If

A1, A2, A3 ... An ├ B then

A1, A2, A3, ...An-1

├ is read as 'derives' Given

A1 A2 A3 . . . . An

B Picture 1

A1 A2 A3 . . . . An-1

Picture 2 B

An

B An

(15)

Use of Deduction Theorem Prove

i.e.,

├ F (M.P)

A├ (D.T)

(D.T)

Very difficult to prove from first principles, i.e., using axioms and inference rules only

)) (

( A

A

) )

((A F F

A

F A

A,

F F

A ) (

) )

((A F F

A

(16)

Prove i.e.

├ F

(D.T)

├ Q (M.P with A3)

P

) (P Q

P

) )

((P F Q

P

F Q

F P

P, ,

F P

P, (Q F) F

Q F

P ) (

) )

((P F Q

P

(17)

More proofs

) )

((

) (

. 3

) (

) (

. 2

) (

) (

. 1

Q P

Q Q

P

P Q

Q P

Q P

Q P

(18)

Important to note

Deduction Theorem is a meta-theorem (statement about the system)

P P is a theorem (statement belonging to the system)

The distinction is crucial in AI

Self reference, diagonalization

Foundation of Halting Theorem, Godel

Theorem etc.

(19)

Example of ‘of-about’

confusion

“This statement is false”

Truth of falsity cannot be decided

(20)

Soundness, Completeness &

Consistency

Syntactic World ---

Theorems, Proofs

Semantic World ---

Valuation, Tautology

Soundness

Completeness

* *

(21)

Soundness

Provability Truth

Completeness

Truth Provability

(22)

Soundness:

Correctness of the System

Proved entities are indeed true/valid

Completeness:

Power of the System

True things are indeed provable

(23)

TRUE Expression

s System

Outside Knowledge Validation

(24)

Consistency

The System should not be able to prove both P and ~P, i.e., should not be able to derive

F

(25)

Examine the relation between Soundness

&

Consistency

Soundness Consistency

(26)

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

(27)

InconsistencyUnsoundness

To show that

FP is a theorem

Observe that

F, PF F By D.T.

F (PF)F; A3

P

i.e. ⊢ FP

Thus, inconsistency implies unsoundness

(28)

UnsoundnessInconsistency

Suppose we make the Hilbert System of

propositional calculus unsound by introducing (A /\ B) as an axiom

Now AND can be written as

(A(BF )) F

If we assign F to A, we have

(F (BF )) F

But (F (BF )) is an axiom (A1)

Hence F is derived

(29)

Inconsistency is a Serious issue.

Informal Statement of Godel Theorem:

If a sufficiently powerful system is complete it is inconsistent.

Sufficiently powerful: Can capture at least

Peano Arithmetic

(30)

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

(31)

V(F ) = F

V(AB) is defined through what is called the truth table

V(A) V(B) V(AB)

T F F

T T T

F F T

F T T

(32)

Tautology

An expression ‘E’ is a tautology if V(E) = T

for all valuations of constituent propositions Each ‘valuation’ is called a ‘model’.

(33)

To see that

(FP) is a tautology two models

V(P) = T V(P) = F V(FP) = T for both

(34)

F P is a theorem

F P is a tautology

Soundness Completeness

(35)

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

(36)

Syntax vs. Semantics issue

Refers to

FORM VS. CONTENT

Tea

(Content) Form

(37)

Form & Content

Godel, Escher, Bach

By D. Hofstadter

logician

painter

musician

(38)

Problem

(P Q)(P Q)

Semantic Proof

A B

P Q P Q P Q AB

T F F T T

T T T T T

F F F F T

F T F T T

(39)

To show syntactically

(P Q) (P Q)

i.e.

[(P (Q F )) F ]

[(P F ) Q]

(40)

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

(41)

QF; hypothesis

(QF)(P(QF)); A1 P(QF); MP

F; MP

Thus we have a proof of the line we

started with

(42)

Soundness and Completeness

proofs

(43)

Soundness, Completeness &

Consistency

Syntactic World ---

Theorems, Proofs

Semantic World ---

Valuation, Tautology

Soundness

Completeness

* *

(44)

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

(45)

V(F ) = F

V(AB) is defined through what is called the truth table

V(A) V(B) V(AB)

T F F

T T T

F F T

F T T

(46)

Tautology

An expression ‘E’ is a tautology if V(E) = T

for all valuations of constituent propositions Each ‘valuation’ is called a ‘model’.

(47)

Soundness

Provability Validity

Completeness

Validity Provability

(48)

Soundness:

Correctness of the System

Proved entities are indeed valid

Completeness:

Power of the System

Valid things are indeed provable

(49)

Consistency

The System should not be able to prove both P and ~P, i.e., should not be able to derive

F

(50)

Examine the relation between Soundness

&

Consistency

Soundness Consistency

(51)

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

(52)

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

(53)

Soundness Proof

Hilbert Formalization of Propositional Calculus is sound.

“Whatever is provable is valid”

(54)

Any statement in propositional calculus can be written as

(A

1

(A

2

(A

3

…(A

n

B)…) Because,

WFF F | P | (WFF WFF) Statement

Given

A

1

, A

2

, … ,A

n

|- B

V(B) is ‘T’ for all V

s

for which V(A

i

) = T

(55)

Proof

Case 1 B is an axiom

V(B) = T by actual observation

Statement is correct

(56)

Case 2 B is one of A

is

if V(A

i

) = T, so is V(B)

statement is correct

(57)

Case 3 B 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

(58)

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) = T

Soundness proved

(59)

Towards Completeness Proof

(60)

Soundness:

Correctness of the System

Proved entities are indeed true/valid

Completeness:

Power of the System

True things are indeed provable

(61)

Tautology

An expression ‘E’ is a tautology if V(E) = T

for all valuations of constituent propositions Each ‘valuation’ is called a ‘model’.

(62)

Necessary results

Statement: (pq)((~pq)q) Proof:

If we can show that (pq), (~pq) |- q Or,

(pq), (~pq), qF |- F Then we are done.

(63)

Proof continued

1. (pq) H1 2. (~pq) H2 3. qF H3

4. (~pq) (~qp) theorem of contraposition 5. ~qp MP, 2, 4

6. P MP, 3,5 7. q MP, 6, 1 8. F MP,7,3 QED

(64)

How to prove contraposition

To show

(p q) (~q ~p) Proof:

p q, ~q, p |- F

Very obvious!

(65)

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

(66)

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)

(67)

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

(68)

2.

p, q |- p (p V q)

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

same as 1

(69)

3.

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

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

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

Same as 1, since F is derived

(70)

Why all this?

If we have shown p, q |- A

and p, ~q |- A

then we can show that p |- A

(71)

p |- (q A) also p |- (~q A)

But (q A) ((~q A) A)

is a theorem by MP twice

p |- A

(72)

General Statement of the completeness proof

If V(A) = T for all models then

|- A

(73)

Elaborating,

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

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

|- A

(74)

We have a truth table with 2n rows P1 P2 P3 . . . Pn A F F F . . . F T F F F . . . T T

. . .

T T T . . . T T

(75)

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

(76)

If row has

P

1

’, P

2

’, …, P

n

’, A’

Then

P

1

’, P

2

’, …, P

n

’ |- A’

A very critical result linking syntax with semantics

Lemma

(77)

Completeness Proof

(78)

P1 P2 P3 . . . Pn A F F F . . . F T F F F . . . T T

. . .

T T T . . . T T

We have a truth table with 2

n

rows

(79)

We should 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

(80)

Completeness of Propositional Calculus

Statement

If V(A) = T for all V,

then |--A i.e. A is a theorem.

Lemma:

If A consists of propositions P

1

, P

2

, …, P

n

then P’

1

, P’

2

, …, P’

n

|-- A’, where

A’ = A if V(A) = true

= ~A otherwise

Similarly for each P’

i

(81)

Proof for Lemma

Proof by induction on the number of ‘→’

symbols in A

Basis: Number of ‘→’ symbols is zero.

A is or P. This is true as, |-- (A → A) i.e. A → A is a theorem.

Hypothesis: Let the lemma be true for number of ‘→’ symbols ≤ n.

Induction: Let A which is B → C, contain n+1

‘→’

(82)

Induction:

By hypothesis,

P’1, P’2, …, P’n |-- B’

P’1, P’2, …, P’n |-- C’

If we show that B’, C’ |-- A’ (A is B → C), then the proof is complete.

For this we have to show:

B, C |-- B → C

True as B, C, B |-- C

B, ~C |-- ~(B → C)

True since B, ~C, B → C |--

~B, C |-- B → C

True since ~B, C, B |-- C

~B, ~C |-- B → C

True since ~B, ~C, B, C → |--

Hence the lemma is proved.

Proof of Lemma (contd.)

(83)

Proof of Theorem

A is a tautology.

There are 2n models corresponding to P1, P2, …, Pn propositions.

Consider,

P1, P2, …, Pn |-- A and P1, P2, …, ~Pn |-- A

P1, P2, …, Pn-1 |-- Pn A and P1, P2, …, Pn-1 |-- ~Pn A

RHS can be written as:

|-- ((Pn A) → ((~Pn A) → A))

|-- (~Pn A) → A

|-- A

Thus dropping the propositions progressively we show |-- A

References

Related documents

appliance designed to preserve the space created by the premature loss of a primary tooth or a group of teeth.... ANTERIOR

e) If the seller has delivered goods before the date for delivery, he may, up to that date, deliver any missing part or make up any deficiency in the quantity of the goods

-s file Returns true if file exists and has a greater size that zero -s file Returns true if file exists and has a greater size that zero -w file Returns true if file exists and

INDEPENDENT MONITORING BOARD | RECOMMENDED ACTION.. Rationale: Repeatedly, in field surveys, from front-line polio workers, and in meeting after meeting, it has become clear that

A random sample of 8 mango trees reveals the following number of fruits they yield.. of errors

The scan line algorithm which is based on the platform of calculating the coordinate of the line in the image and then finding the non background pixels in those lines and

10. If it is linked with cost of living then why not demand from the govt, : 11. Special allowance.5. 10.

Extra Care of Concern : While deciding upon physical strategies for CWSN, extra care and concern shall be given like extra time, to avoid stress light music.. Any four techniques