• No results found

Lecture 9,10,11- Logic; Deduction Theorem

N/A
N/A
Protected

Academic year: 2023

Share "Lecture 9,10,11- Logic; Deduction Theorem"

Copied!
33
0
0

Loading.... (view fulltext now)

Full text

(1)

CS344 : Introduction to Artificial Intelligence

Pushpak Bhattacharyya

CSE Dept., IIT Bombay

Lecture 9,10,11- Logic; Deduction Theorem

23/1/09 to 30/1/09

(2)

Logic and inferencing

Vision NLP

Expert Systems

Planning Robotics

Search

Reasoning

Learning

Knowledge

Obtaining implication of given facts and rules -- Hallmark of intelligence

(3)

Propositions

Stand for facts/assertions

Declarative statements

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

Operators

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

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

) ( (~),

), ( ),

( ORNOT IMPLICATIONAND

(4)

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

(5)

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.

(6)

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 AB and

A

write B

known as MODUS PONENS

(7)

7. Axioms : Starting structures A1:

A2:

A3

This formal system defines the propositional calculus ))

(

(ABA

))) (

) ((

)) (

((A B C A B A C

) )

)

(((AFFA

(8)

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

(9)

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

(10)

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

(11)

Formalization of propositional logic (review)

Axioms :

A1 A2 A3 Inference rule:

Given and A, write B A Proof is:

A sequence of i) Hypotheses ii) Axioms

iii) Results of MP A Theorem is an

Expression proved from axioms and inference rules

)) (

(A B A

))) (

) ((

)) (

((A B C A B A C

) )

)

(((AFFA

) (A B

(12)

Example: To prove

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 (P Q)

) ))

(

((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)

Formalization of propositional logic (review)

Axioms :

A1 A2 A3 Inference rule:

Given and A, write B A Proof is:

A sequence of i) Hypotheses ii) Axioms

iii) Results of MP A Theorem is an

Expression proved from axioms and inference rules

)) (

(A B A

))) (

) ((

)) (

((A B C A B A C

) )

)

(((AFFA

) (A B

(18)

Example: To prove

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

(19)

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 (P Q)

) ))

(

((P Q F F (P Q)

)) (

( A

A

(20)

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

(21)

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

(22)

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   

(23)

More proofs

) )

((

) (

. 3

) (

) (

. 2

) (

) (

. 1

Q P

Q Q

P

P Q

Q P

Q P

Q P

(24)

Proof Sketch of the Deduction Theorem

To show that If

A

1

, A

2

, A

3

,… A

n

|- B Then

A

1

, A

2

, A

3

,… A

n-1

|- A

n

 B

(25)

Case-1: B is an axiom

One is allowed to write A

1

, A

2

, A

3

,… A

n-1

|- B

|- B(A

n

B)

|- (A

n

B); mp-rule

(26)

Case-2: B is A n

A

n

A

n

is a theorem (already proved) One is allowed to write

A

1

, A

2

, A

3

,… A

n-1

|- (A

n

A

n

)

i.e. |- (A

n

B)

(27)

Case-3: B is A i where (i <>n)

Since A

i

is one of the hypotheses One is allowed to write

A

1

, A

2

, A

3

,… A

n-1

|- B

|- B(A

n

B)

|- (A

n

B); mp-rule

(28)

Case-4: B is result of MP

Suppose

B comes from applying MP on E

i

and E

j

Where, E

i

and E

j

come before B in

A

1

, A

2

, A

3

,… A

n

|- B

(29)

B is result of MP (contd)

If it can be shown that

A

1

, A

2

, A

3

,… A

n-1

|- A

n

 E

i

and

A

1

, A

2

, A

3

,… A

n-1

|- (A

n

( E

i

B)) Then by applying MP twice

A

1

, A

2

, A

3

,… A

n-1

|- A

n

 B

(30)

B is result of MP (contd)

This involves showing that If

A

1

, A

2

, A

3

,… A

n

|- E

i

Then

A

1

, A

2

, A

3

,… A

n-1

|- A

n

 E

i

(similarly for AnEj)

(31)

B is result of MP (contd)

Adopting a case by case analysis as before,

We come to shorter and shorter length proof segments eating into the body of

A

1

, A

2

, A

3

,… A

n

|- B

Which is finite. This process has to

terminate. QED

(32)

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.

(33)

Example of ‘ of-about’

confusion

“This statement is false”

Truth of falsity cannot be decided

References

Related documents

5.6 Monthly, distribution of fungal species in decaying mangrove vegetation samples at Mangalvan for _the year 1987 (Numbers on ‘x’ axis refer to the specnes;_vide Table 5-3)..

of different accelerator combinations under conventional and efficient vulcanization systems on cure rate index, network structure and physical properties of natural rubber

And prove that the algorithms are correct with respect to the native natural numbers and arithmetic operations defined in Coq. For clarifications: please contact

I We need to define False and also True I They are defined using the following constructs:.. Inductive False :

Jitendra Kumar, student of Dayalbagh Educational Institute, Agra completed a 6-week Internship Programme under Hankernest Technologies Pvt.. As part-fulfillment of the

World liquids consumption for energy in the industrial sector, which was projected to increase by 1.1 percent per year from 2005 to 2030 in the IEO2008 reference case, increases by

This report provides some important advances in our understanding of how the concept of planetary boundaries can be operationalised in Europe by (1) demonstrating how European

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