next up previous
Next: About this document

CSE2309/3309 Artificial Intelligence Knowledge Representation I

Dr. Ann Nicholson

School of Computer Science and Software Eng.
Rm 115 Bld 26, annn@csse.monash.edu.au

Overview

Reading:

CSE2309/CSC2030 1999 Lectures 20, 21, 23, 24, 25;

Russell & Norvig, Chapters 6, 7, 9.1-9.6

A knowledge-based agent

Central Components:

The Wumpus World (R&N Section 6.2)

The Wumpus World

Knowledge Representation Languages

A logic consists of

Basic Properties and Relations

Inference Procedures

Logics

Propositional Logic: Syntax

Propositional Logic: Semantics

Propositional Logic: Inference Procedure

Propositional Logic: Inference Rules (R&N Figure 6.13)

Wumpus in Propositional Logic


tabular154

Find the Wumpus: inference

Problem 1

Look at the following sentences and determine if each is valid, unsatisfiable, or neither, using truth tables or proofs.

  1. (Smoke tex2html_wrap_inline834 Fire) tex2html_wrap_inline834 (tex2html_wrap_inline910 Smoke tex2html_wrap_inline834 tex2html_wrap_inline910 Fire)
  2. Smoke tex2html_wrap_inline820 Fire tex2html_wrap_inline820 tex2html_wrap_inline910 Fire
  3. (Smoke tex2html_wrap_inline834 Fire) tex2html_wrap_inline834 ((Smoke tex2html_wrap_inline810 Heat) tex2html_wrap_inline834 Fire)

Hint: A sentence is valid if you can prove it. It is unsatisfiable if its negation is valid. If it's neither you can find an assignment of truth values to propositional symbols that makes the sentence false, and another which makes the sentence true.

Problem 1

Problem 2: Description

If the teller had pushed the alarm button, the vault would have locked automatically and the police would have arrived within three minutes. Had the police arrived within three minutes, the robbers' car would have been overtaken. But the robbers' car was not overtaken. Prove the teller did not push the alarm button.

Steps: Write down

Problem 2: Represented in Logic

Let

T:
V:
P:
O:

Axioms

  1.  
  2.  
  3.  

Required to prove:

Problem 2: Proof

First-Order Predicate Calculus

Divide world into:

Syntax (R&N Figure 7.1)

Notes on syntax

Functions vs predicates

Semantics Again

Semantics (cont.)

Quantifiers and Equivalences

The power of FOPC

Reasoning logically

Examples from Discrete Mathematics, H. Matheson (Lewis Carroll)

Generic logic-based agent (R&N 6.1)

function KB-agent(percept) returns action

static: KB, a knowledge base
t, a counter, initially 0, indicating time

TELL (KB, MAKE-PERCEPT-SENTENCE(percept, t)

action tex2html_wrap_inline1046 ASK (KB, MAKE-ACTION-QUERY(t)))

TELL (KB, MAKE-ACTION-SENTENCE(action, t)

t tex2html_wrap_inline1046 t + 1

return action

Reflex Agent

Representing change in the world

Situation calculus (cont.)

The Frame Problem: Blocks World Example

(a)
tex2html_wrap_inline976 s tex2html_wrap_inline976 x tex2html_wrap_inline910 on(x,Table,s) tex2html_wrap_inline834
on(x,Table,result(PutTable(x),s))

(b)
tex2html_wrap_inline976 s tex2html_wrap_inline976 x tex2html_wrap_inline976 y on(x,y,s) tex2html_wrap_inline810 y tex2html_wrap_inline1096 on(x,Table,s)

Wumpus World: Dynamic axioms

Wumpus World: Synchronic Rules

Causal Rules:
model causal connections between properties of world and percepts.

tex2html_wrap_inline976ltex2html_wrap_inline1062,ltex2html_wrap_inline1120,s at(Wumpus,ltex2html_wrap_inline1062,s) tex2html_wrap_inline810 adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120)
tex2html_wrap_inline834 smelly(ltex2html_wrap_inline1120)

tex2html_wrap_inline976ltex2html_wrap_inline1062,ltex2html_wrap_inline1120,s at(pit,ltex2html_wrap_inline1062,s) tex2html_wrap_inline810 adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120)
tex2html_wrap_inline834 breezy(ltex2html_wrap_inline1120)

Diagnostic:
infer properties of world from perceptual information.

tex2html_wrap_inline976ltex2html_wrap_inline1062,s smelly(ltex2html_wrap_inline1062) tex2html_wrap_inline834 at(Wumpus,ltex2html_wrap_inline1120,s) tex2html_wrap_inline810
(adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120) tex2html_wrap_inline820 ltex2html_wrap_inline1062=ltex2html_wrap_inline1120)

tex2html_wrap_inline976ltex2html_wrap_inline1062,s breezy(ltex2html_wrap_inline1062) tex2html_wrap_inline834 at(pit,ltex2html_wrap_inline1120,s) tex2html_wrap_inline810
adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120)

Miscellaneous

tex2html_wrap_inline976x,s tex2html_wrap_inline910at(Wumpus,x,s) tex2html_wrap_inline810 tex2html_wrap_inline910pit(x) tex2html_wrap_inline834 ok(x)

The Frame Problem

Inferential:
more things stay the same than change, but have to continue drawing inferences about things that stay the same.

In planning, will look at special action-oriented representations that avoid this (less expressive than FOPC).

Representational:
Proliferation of frame axioms (essentially one for each property an action does not affect).

Handling the Representational Frame Problem

Modify the logic:

tex2html_wrap_inline976p,s,x holds(p,s) tex2html_wrap_inline810 p tex2html_wrap_inline1112 at(x)

tex2html_wrap_inline834holds(p,result(walk-forward-3-steps,s)).

Relatives of The Frame Problem

Ramification Problems:
Specifying and inferring all the things that do change.

Example 1: When I walk forward three steps:

Example 2: Move table:

Qualification Problem:
Specifying and checking all the preconditions of an action. Example 3: Grabbing a gold brick.

Wumpus World Again

Some modified examples of axioms using the holds predicate.

tex2html_wrap_inline976s holds(glitter,s) tex2html_wrap_inline834
holds(have(gold), result(grab,s))

tex2html_wrap_inline976stex2html_wrap_inline1218x holds(have(x),result(release,s))

tex2html_wrap_inline976a,x,s holds(have(x),s) tex2html_wrap_inline810 a tex2html_wrap_inline1112 release

tex2html_wrap_inline834 holds(have(x),results(a,s))

Wumpus World Examples (cont.)

Causal Rules:
if the world is a certain way...

tex2html_wrap_inline976ltex2html_wrap_inline1062,ltex2html_wrap_inline1120,s holds(at(Wumpus,ltex2html_wrap_inline1062),s) tex2html_wrap_inline810
adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120) tex2html_wrap_inline834 smelly(ltex2html_wrap_inline1120)

tex2html_wrap_inline976ltex2html_wrap_inline1062,ltex2html_wrap_inline1120,s holds(at(pit,ltex2html_wrap_inline1062),s) tex2html_wrap_inline810
adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120) tex2html_wrap_inline834 breezy(ltex2html_wrap_inline1120)

Diagnostic:
if some consequence is true...

tex2html_wrap_inline976ltex2html_wrap_inline1062,s smelly(ltex2html_wrap_inline1062) tex2html_wrap_inline834 holds(at(Wumpus,ltex2html_wrap_inline1120)s)
tex2html_wrap_inline810 (adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120) tex2html_wrap_inline820 ltex2html_wrap_inline1062=ltex2html_wrap_inline1120)

tex2html_wrap_inline976ltex2html_wrap_inline1062,s breezy(ltex2html_wrap_inline1062) tex2html_wrap_inline834 holds(at(pit,ltex2html_wrap_inline1120),s)
tex2html_wrap_inline810 adjacent(ltex2html_wrap_inline1062,ltex2html_wrap_inline1120)

Substitution

Example 1:

subst({x/fish,y/jo}, eats(y, x))

= eats(jo,fish)

where tex2html_wrap_inline1302 = {x/fish,y/jo}, tex2html_wrap_inline750 = Likes(x, y).

New Inference Rules for FOPC

New Inference Rules for FOPC (cont)

Automating the proof procedure?

Generalised modus ponens

P(d), Q(d), tex2html_wrap_inline976x P(x) tex2html_wrap_inline810 Q(x) tex2html_wrap_inline834 R(x)

R(d)

Generalised Modus Ponens: Example

tex2html_wrap_inline976x {person(x) tex2html_wrap_inline810 lives-in-melbourne(x) tex2html_wrap_inline834 footy-fan(x)}

person(annn)

lives-in-melbourne(annn)

tex2html_wrap_inline1302 = {x/annn}

Conclusion:

subst({x/annn},footy-fan(x))=footy-fan(annn)

Unification

unify(p,q)= tex2html_wrap_inline1302 where subst(tex2html_wrap_inline1302,p)=subst(tex2html_wrap_inline1302,q).

Unification Examples

unify(P(a,x),P(a,b)) = {x/b}

unify(P(a,x),P(y,b)) = {x/b,y/a}

unify(P(a,x),P(y,f(y)) = {y/a,x/f(a)}

unify(P(a,x),P(x,b)) = failure (a tex2html_wrap_inline1112 b)

To avoid such problems, standardise variables apart. Replace x with xtex2html_wrap_inline1062 in P and x with xtex2html_wrap_inline1120 in Q. Then:

unify(P(a,xtex2html_wrap_inline1062),P(xtex2html_wrap_inline1120,b)) = {xtex2html_wrap_inline1062/btex2html_wrap_inline1062, xtex2html_wrap_inline1120/a}

unify(P(a,b),P(x,x)) = failure

unify(P(a,f(a)),P(x,x)) = failure

Use of Generalised Modus Ponens

Soundness and Completeness (again)

Completeness of FOPC?

General Resolution Rule

Refutation Proofs

Refutation Proofs

Converting WFFs to CNF

  1. Eliminate implication symbols.
  2. Reduce scopes of negation symbols. Convert:
  3. Standardize variables: convert

    tex2html_wrap_inline976x p(x) tex2html_wrap_inline810 tex2html_wrap_inline978x Q(x) to

  4. Move all universal quantifers to the front.

    Converting WFFs to CNF (cont.)

  5. Eliminate existential quantifiers (Skolemize).
  6. Eliminate universal quantifiers.
  7. Distribute tex2html_wrap_inline810 over tex2html_wrap_inline820.
  8. Flatten nested conjuncts and disjuncts (now in CNF).

Refutation proof example

Resolution Example

  1. If a course is easy, there are some students that are enrolled in it who are happy.
  2. If a course has a final exam, no students that are enrolled in it are happy.
  3. If a course has a final exam, the course is not easy.

Example

Resolution won't always yield an answer:example

KB


tabular477

WORLDS


tabular481

MODELS

M1: Dick is Deb's brother.

M2: Dick is David's father.

W3 is true in model M1, but not in M2.

Miscellaneous

Summary




next up previous
Next: About this document

Ann Nicholson
Mon Sep 6 12:32:41 EST 1999