Top Banner
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
33

CS344 : Introduction to Artificial Intelligence

Jan 08, 2016

Download

Documents

julius gazmen

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. Logic and inferencing. Vision. NLP. Search Reasoning Learning Knowledge. Expert Systems. Robotics. Planning. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS344 : Introduction to Artificial Intelligence

CS344 : Introduction to Artificial Intelligence

Pushpak BhattacharyyaCSE Dept., IIT Bombay

Lecture 9,10,11- Logic; Deduction Theorem

23/1/09 to 30/1/09

Page 2: CS344 : Introduction to Artificial Intelligence

Logic and inferencing

Vision NLP

Expert Systems

Planning

Robotics

Search Reasoning Learning Knowledge

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

Page 3: CS344 : Introduction to Artificial Intelligence

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

)((~),),(),( NIMPLICATIONOTORAND

Page 4: CS344 : Introduction to Artificial Intelligence

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

PP

)()( QPQP

Page 5: CS344 : Introduction to Artificial Intelligence

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.

Page 6: CS344 : Introduction to Artificial Intelligence

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

Page 7: CS344 : Introduction to Artificial Intelligence

7. Axioms : Starting structuresA1:

A2:

A3

This formal system defines the propositional calculus

))(( ABA

)))()(())((( CABACBA

)))((( AFFA

Page 8: CS344 : Introduction to Artificial Intelligence

Notion of proof1. 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

Page 9: CS344 : Introduction to Artificial Intelligence

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)

QP

QP

QP

RQ

RQ

RQ

Page 10: CS344 : Introduction to Artificial Intelligence

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)

)( PP

))(( PPPP

)( PPP

))]())((()))(([( PPPPPPPPP

)( PP

))()(( PPPPP

)( PP

)( PP

Page 11: CS344 : Introduction to Artificial Intelligence

Formalization of propositional logic (review)Axioms : A1

A2A3

Inference rule:Given and A, write B

A Proof is:A sequence of

i) Hypothesesii) Axiomsiii) Results of MP

A Theorem is anExpression proved from axioms and inference rules

))(( ABA )))()(())((( CABACBA

)))((( AFFA

)( BA

Page 12: CS344 : Introduction to Artificial Intelligence

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)

)( PP

))(( PPPP

)( PPP

))]())((()))(([( PPPPPPPPP

)( PP

))()(( PPPPP

)( PP

)( PP

Page 13: CS344 : Introduction to Artificial Intelligence

Shorthand1. 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 FP

))(( QFP )( QP

)))((( FFQP )( QP

))(( AA

Page 14: CS344 : Introduction to Artificial Intelligence

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

A1, A

2, A

3 ............. A

n ├ B

thenA

1, A

2, A

3, ...............A

n-1├

├ is read as 'derives'

GivenA

1

A2

A3

.

.

.

.A

n

B Picture 1

A1

A2

A3

.

.

.

.A

n-1

Picture 2

BAn

BAn

Page 15: CS344 : Introduction to Artificial Intelligence

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

))(( AA

))(( FFAA

FAA ,

FFA )(

))(( FFAA

Page 16: CS344 : Introduction to Artificial Intelligence

Prove

i.e.

├ F

├ (D.T)

├ Q (M.P with A3)

P├

)( QPP

))(( QFPP

FQFPP ,,

FPP , FFQ )(

QFP )(

))(( QFPP

Page 17: CS344 : Introduction to Artificial Intelligence

Formalization of propositional logic (review)Axioms : A1

A2A3

Inference rule:Given and A, write B

A Proof is:A sequence of

i) Hypothesesii) Axiomsiii) Results of MP

A Theorem is anExpression proved from axioms and inference rules

))(( ABA )))()(())((( CABACBA

)))((( AFFA

)( BA

Page 18: CS344 : Introduction to Artificial Intelligence

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)

)( PP

))(( PPPP

)( PPP

))]())((()))(([( PPPPPPPPP

)( PP

))()(( PPPPP

)( PP

)( PP

Page 19: CS344 : Introduction to Artificial Intelligence

Shorthand1. 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 FP

))(( QFP )( QP

)))((( FFQP )( QP

))(( AA

Page 20: CS344 : Introduction to Artificial Intelligence

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

A1, A

2, A

3 ............. A

n ├ B

thenA

1, A

2, A

3, ...............A

n-1├

├ is read as 'derives'

GivenA

1

A2

A3

.

.

.

.A

n

B Picture 1

A1

A2

A3

.

.

.

.A

n-1

Picture 2

BAn

BAn

Page 21: CS344 : Introduction to Artificial Intelligence

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

))(( AA

))(( FFAA

FAA ,

FFA )(

))(( FFAA

Page 22: CS344 : Introduction to Artificial Intelligence

Prove

i.e.

├ F

├ (D.T)

├ Q (M.P with A3)

P├

)( QPP

))(( QFPP

FQFPP ,,

FPP , FFQ )(

QFP )(

))(( QFPP

Page 23: CS344 : Introduction to Artificial Intelligence

More proofs

))(()(.3

)()(.2

)()(.1

QPQQP

PQQP

QPQP

Page 24: CS344 : Introduction to Artificial Intelligence

Proof Sketch of the Deduction Theorem

To show that

If A1, A2, A3,… An |- B

ThenA1, A2, A3,… An-1 |- An B

Page 25: CS344 : Introduction to Artificial Intelligence

Case-1: B is an axiom

One is allowed to writeA1, A2, A3,… An-1 |- B

|- B(AnB)

|- (AnB); mp-rule

Page 26: CS344 : Introduction to Artificial Intelligence

Case-2: B is An

AnAn is a theorem (already proved)

One is allowed to writeA1, A2, A3,… An-1 |- (AnAn)

i.e. |- (AnB)

Page 27: CS344 : Introduction to Artificial Intelligence

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

Since Ai is one of the hypotheses

One is allowed to writeA1, A2, A3,… An-1 |- B

|- B(AnB)

|- (AnB); mp-rule

Page 28: CS344 : Introduction to Artificial Intelligence

Case-4: B is result of MP

SupposeB comes from applying MP on

Ei and Ej

Where, Ei and Ej come before B in

A1, A2, A3,… An |- B

Page 29: CS344 : Introduction to Artificial Intelligence

B is result of MP (contd)

If it can be shown thatA1, A2, A3,… An-1 |- An Ei

andA1, A2, A3,… An-1 |- (An (EiB))

Then by applying MP twiceA1, A2, A3,… An-1 |- An B

Page 30: CS344 : Introduction to Artificial Intelligence

B is result of MP (contd)

This involves showing thatIf

A1, A2, A3,… An |- Ei

ThenA1, A2, A3,… An-1 |- An Ei

(similarly for AnEj)

Page 31: CS344 : Introduction to Artificial Intelligence

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

A1, A2, A3,… An |- B

Which is finite. This process has to terminate. QED

Page 32: CS344 : Introduction to Artificial Intelligence

Important to note Deduction Theorem is a meta-

theorem (statement about the system)

PP is a theorem (statement belonging to the system)

The distinction is crucial in AI Self reference, diagonalization Foundation of Halting Theorem,

Godel Theorem etc.

Page 33: CS344 : Introduction to Artificial Intelligence

Example of ‘of-about’ confusion

“This statement is false” Truth of falsity cannot be decided