• No results found

CS621: Artificial Intelligence

N/A
N/A
Protected

Academic year: 2022

Share "CS621: Artificial Intelligence"

Copied!
29
0
0

Loading.... (view fulltext now)

Full text

(1)

CS621: Artificial Intelligence

Pushpak Bhattacharyya

CSE Dept., IIT Bombay

Lecture–9: (a) Deduction theorem; (b) Puzzle Solving using Propositional

Calculus

5th August, 2010

(2)

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

WFF P|F|WFFWFF 6. Inference rule : only one

Given AB and A

write B

known as MODUS PONENS

(3)

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

(4)

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

(5)

Example of proof

From P and and prove R H1: P

H2:

H3:

i) P H1

Q P

Q P

R Q

R Q

ii) H2

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

iv) H3

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

Q P

R Q

(6)

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)

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

v) (P P) MP, (i), (iv)

(7)

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'

¬P P F

) )

((P F Q (P Q)

) ))

(

((P Q F F (P Q)

'P AND Q' Exercise: (Challenge)

- Prove that A ¬(¬(A))

(8)

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'

B An

Given

A1 A2 A3 . . . . An

B Picture 1

A1 A2 A3 . . . . An-1

Picture 2

B An

(9)

Use of Deduction Theorem Prove

i.e.,

F (M.P)

A (D.T)

)) (

( A

A ¬ ¬

) )

((A F F

A

F A

A,

F F

A ) (

(D.T)

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

) )

((A F F

A

(10)

Prove i.e.

F

(D.T)

Q (M.P with A3)

) (P Q

P

) )

((P F Q

P

F Q

F P

P, ,

F P

P, (Q F) F

Q (M.P with A3)

P

Q F

P ) (

) )

((P F Q

P

(11)

More proofs

) (

) (

.

1 PQPQ

) )

((

) (

. 3

) (

) (

. 2

) (

) (

. 1

Q P

Q Q

P

P Q

Q P

Q P

Q P

¬

¬

¬

(12)

Proof Sketch of the Deduction Theorem

To show that If

If

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

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

(13)

Case-1: B is an axiom

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

|- B(A B)

|- B(AnB)

|- (AnB); mp-rule

(14)

Case-2: B is A

n

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

A , A , A ,… A |- (A A ) A1, A2, A3,… An-1 |- (AnAn)

i.e. |- (AnB)

(15)

Case-3: B is A

i where (i <>n)

Since Ai is one of the hypotheses One is allowed to write

A , A , A ,… A |- B A1, A2, A3,… An-1 |- B

|- B(AnB)

|- (AnB); mp-rule

(16)

Case-4: B is result of MP

Suppose

B comes from applying MP on E and E

Ei and Ej

Where, Ei and Ej come before B in A1, A2, A3,… An |- B

(17)

B is result of MP

(contd)

If it can be shown that

A1, A2, A3,… An-1 |- An Ei and

and

A1, A2, A3,… An-1 |- (An (EiB)) Then by applying MP twice

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

(18)

B is result of MP

(contd)

This involves showing that If

A , A , A ,… A |- E A1, A2, A3,… An |- Ei Then

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

(similarly for AnEj)

(19)

B is result of MP

(contd)

Adopting a case by case analysis as before,

We come to shorter and shorter length 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

(20)

Important to note

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

PP is a theorem (statement belonging to 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.

(21)

Example of ‘ of-about’

confusion

“This statement is false”

Truth of falsity cannot be decided

(22)

A puzzle

(Zohar Manna, Mathematical Theory of Computation, 1974)

From Propositional Calculus

(23)

Tourist in a country of truth- sayers and liers

Facts and Rules: In a certain country, people either always speak the truth or always

lie. A tourist T comes to a junction in the country and finds an inhabitant S of the

country standing there. One of the roads at country standing there. One of the roads at the junction leads to the capital of the

country and the other does not. S can be asked only yes/no questions.

Question: What single yes/no question can T ask of S, so that the direction of the capital is revealed?

(24)

Diagrammatic representation

Capital

S (either always says the truth Or always lies)

T (tourist)

(25)

Deciding the Propositions: a very difficult step- needs human intelligence

P: Left road leads to capital

Q: S always speaks the truth

(26)

Meta Question: What question should the tourist ask

The form of the question

Very difficult: needs human intelligence

The tourist should ask

The tourist should ask

Is R true?

The answer is “yes” if and only if the left road leads to the capital

The structure of R to be found as a function of P and Q

(27)

A more mechanical part: use of truth table

P Q S’s

Answer

R

T T Yes T

T T Yes T

T F Yes F

F T No F

F F No T

(28)

Get form of R: quite mechanical

From the truth table

R is of the form (P x-nor Q) or (P Q)

(29)

Get R in

English/Hindi/Hebrew…

Natural Language Generation: non-trivial

The question the tourist will ask is

Is it true that the left road leads to the Is it true that the left road leads to the capital if and only if you speak the truth?

Exercise: A more well known form of this

question asked by the tourist uses the X-OR operator instead of the X-Nor. What changes do you have to incorporate to the solution, to get that answer?

References

Related documents

For example, consulta- tions held with Ethiopian Electric Power (EEP), 4 the implementing agency for the World Bank–supported Ethiopia Geothermal Sector Development Project,

passive solar or or active solar active solar depending on the way depending on the way they capture, convert and distribute solar energy.. they capture, convert and

At its second meeting on 20–21 October 2020, the Panel established a Program of Work, which includes four interconnected themes: to build on the past by learning from

(Environmental variables should represent measurements of natural resources and reflect potential influences to its viability. It could incorporate air and water quality,

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

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

We know that two curves intersect at right angles if the tangents to the curves at the point of intersection i.e., at are perpendicular to each other. This implies that we

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