Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can...

27
Knowledge Representation Use of logic

Transcript of Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can...

Page 1: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Knowledge Representation

Use of logic

Page 2: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Artificial agents

need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally Logic primary vehicle K always definite ( T/F)

Page 3: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Problem for a robot

If red light is ON or it is morning shift or supervisor absent then door is locked.

If door is locked it implies that the red light is turned ON or it is morning shift or the supervisor is absent

If load is small in size or load is light then the conveyor belt moves

If the conveyor belt is moving then it means the load has a small size or load is light

The Red light is off, the Conveyor belt is not moving and the Door is locked.

The robot wants to know if the load is heavy (not light).

Page 4: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Robot needs a Knowledge Base and reasoning ability

Page 5: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Knowledge base

Central component of a K based agent Set of sentences INFERENCE

– Deriving new info from old

Language to enable building KB

Page 6: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Interpretations

Language semantics defines TRUTH of each sentence w.r.t. each possible world

Page 7: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Similarity with CSP

Constraint solving is a form of Logical reasoning

Constraint languages: LOGICS

Page 8: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Wff and logical reasoning

Entailment:– Sentence follows logically from another sentence

KB |= s iff in every model in which KB is true, s is

also true

Page 9: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Inference algorithm

Enumerate the models Check if s is true in every model

(interpretation) for which KB is also true Backtracking search – recursively assign

values to variables Exponential complexity

Page 10: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

definitions

Validity Tautology Deduction theorem Satisfiability inconsistancy

Page 11: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Reasoning patterns in Propositional logic

Page 12: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Inference rules

Modus Ponens And Elimination Standard logical equivalances

– De Morgan– Contra positive– Distributive laws– Associative laws

Page 13: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Deduction

With the knowledge base that the robot has, and what it currently perceives

(more knowledge added to the KB),

the robot wants to deduce that

the load is not light

Page 14: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Knowledge that robot has

If red light is ON or it is morning shift or supervisor absent then door is locked.

If door is locked it implies that the red light is turned ON or it is morning shift or the supervisor is absent

If load is small in size or load is light then the conveyor belt moves

If the conveyor belt is moving then it means the load has a small size or load is light

Page 15: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Observations by the robot

Red light is off Conveyor belt is not moving Door is locked

Page 16: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

What the robot wants to establish?

The load is not light

( or in other words it is heavy)

Page 17: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Knowledge + Observation (K.B.)

If red light is ON or it is morning shift or supervisor absent then door is locked.

If door is locked it implies that the red light is turned ON or it is morning shift or the supervisor is absent

If load is small in size or load is light then the conveyor belt moves

If the conveyor belt is moving then it means the load has a small size or load is light

Red light is off Conveyor belt is not moving Door is locked

Page 18: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Propositions

P: red light is ON M: it is morning shift N: supervisor absent D: door is locked. Q: load is small in size R: load is light B: the conveyor belt is moving

Page 19: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Next?

Now generate wffs and start the inference process

Page 20: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Steps to help the robot (inferencing)

Consider a relevant rule for conveyor belt Use And-elimination Use contra-positive relation Use modus ponens Use de morgan’s law

Page 21: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

PROOF?

PROOF: Sequence of application of Inference rules. Finding proofs is like finding solutions to search

problems. Successor function generates all possible application

of inference rules In worst case, search for proof would be as bad as

enumerating all the models Some irrelevant propositions can be ignored to

speed up search.

Page 22: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Monotonicity

Set of entailed sentences can only increase as info is added to KB.

Rules can be applied wherever suitable

Page 23: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Resolution

What about completeness? Can everything be inferred? Resolution rule forms basis for a family of

complete inference procedures.

Page 24: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Refutation completeness

Resolution can be used to either

CONFIRM

or

REFUTE a sentence

Page 25: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Artificial Intelligence

Page 26: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

Intelligent?

Page 27: Knowledge Representation Use of logic. Artificial agents need Knowledge and reasoning power Can combine GK with current percepts Build up KB incrementally.

What is intelligence?

computational part of the ability to achieve goals in the world