Unit3 AI - Rejinpaul
Unit3 AI - Rejinpaul
www.rejinpaul.com
1
Lecture #12 – Knowledge Representation
Outline
Artificial Intelligence
ICS461 Ontological engineering
Fall 2010 Categories and objects
Actions, situations and events
Mental events and mental objects
Nancy E. Reed The internet shopping world
Reasoning systems for categories
nreed@hawaii.edu
Reasoning with default information
Truth maintenance systems 2
E l E h ti D iti
Describing Change
Simplest Situation calculus requires two
axioms to describe change:
• Possibility axiom: when is it possible to do the action
- At(Agent,x,s) ∧ Adjacent(x,y) ⇒
Poss(Go(x,y),s)
• Effect axiom: describe changes due to action
- P ) ) ⇒
Poss(Go(x,y),s)
(G (
At(Agent,y,Result(Go(x,y),s))
What stays the same?
• Frame problem: how to represent all things that stay
the same?
• Frame axiom: describe non-changes due to actions
- At(o,x,s) ∧ (o ≠ Agent) ∧ ¬Holding(o,s)
⇒ At(o,x,Result(Go(y,z),s))
17 18
E h ti ff t i ti d l
21 22
24
23
27 28
First-Order Logic
• Ontological commitment
(i.e.) what it assumes about the nature
of reality
– Propositional logic facts that either hold or
do not hold.
– First-order logic objects with relations
among them that hold or do not hold.
logic
Propositional logic is declarative
Propositional logic allows partial/disjunctive/negated information
– (unlike most data structures and databases)
Propositional logic is compositional:
– meaning of B1,1 P1,2 is derived from meaning of B1,1 and of P1,2
Propositional logic is context-independent
– (unlike natural language, where meaning depends on context)
Propositional logic has very limited expressive power
– (unlike natural language)
– E.g., cannot say "pits cause breezes in adjacent squares“
• except by writing one sentence for each square
Different Logics
LANGUAGES Ontological Commitment Epistemological
Commitment
Atomic sentences
Atomic sentence = predicate (term1,...,termn)
or term1 = term2
• E.g., Brother(John,Richard)
Complex sentences
• Complex sentences are made from atomic sentences using
connectives
S, S1 S2, S1 S2, S1 S2, S1 S2,
Universal quantification
• <variables> <sentence>
Everyone in cse is smart:
x (x,cse) Smart(x)
Existential quantification
• <variables> <sentence>
• Someone in cse is smart:
• x (x,cse) Smart(x)
Properties of quantifiers
• x y is the same as y x
• x y is the same as y x
Nested Quantifiers
• x y Loves(x,y)
– “There is a person who loves everyone in the
world”
–
• y x Loves(y,x)
– “Everyone in the world is loved by at least one
person”
Quantifier duality
θ = {x/John,y/John} works
Unification
• To unify Knows(John,x) and Knows(y,z),
qθ
p1' is King(John) p1 is King(x)
p2' is Greedy(y) p2 is Greedy(x)
θ is {x/John,y/John} q is Evil(x)
q θ is Evil(John)
Forward Chaining
• What is Forward Chaining?
-Start with the atomic sentences in the KB
and apply modus ponens in the forward
direction
-Known facts to goal
• Modus ponens, α β , α
β
From the given sentence α, β can be inferred.
• Definite Clauses
Ex:- situation Response
Definite clauses are useful for systems that
make inferences in responses to newly arrived
information.
• Datalog:
– Datalog= first-order definite clauses + no functions
• Termination –
-FC terminates for Datalog in finite number of iterations
- May not terminate in general if sentence α is not
entailed
RESOLUTION
Resolution:- It means to show that a given
sentence is entailed by the set of sentences in
a KB.
completeness theorem:- any entailed
sentence has a finite proof.
BINARY RESOLUTION
• Resolution rule that resolves exactly two
literals.
• The binary resolution rule by itself does not
yield a complete inference procedure.
Completeness of Resolution
• Resolution is refutation-complete, which
means that if a set of sentences is
unsatisfiable, then resolution will always be
able to derive a contradiction
Resolution Strategies
• Resolution inference rule will eventually find a
proof if one exists
Unit Preference
• Prefer inferences that produce shorter
clauses.
Set of support
Input Resolution
• Every resolution combines one of the input
sentences (from the KB or the query) with
some other sentence.
• The linear resolution strategy is a slight
generalization that allows P and Q to be
resolved together either if P is in the original
KB or if P is an ancestor of Q in the proof tree.
Linear resolution is complete.
Subsumption
• The subsumption method eliminates all
sentences that are subsumed by an existing
sentence in the KB.
• For example, if P(x) is in the KB, then there is
no sense in adding P(A) and even less sense in
adding P(A) V Q(B).
• Subsumption helps keep the KB small, and
thus helps keep the search space small.
Backward Chaining
• Goal to known facts
• List of goals – stack
• For first goal , the BC algorithm finds every
clause in the KB whose positive literal unifies
with the goal.
• Each such clause creates a new recursive call
in which the premise of the clause is added to
the goal stack.
Prolog
• Appending two lists to produce a third:
append([],Y,Y).
append([X|L],Y,[X|Z]) :- append(L,Y,Z).
• query: append(A,B,[1,2]) ?
Knowledge
representation
2
Knowledge Representation
using structured objects
Knowledge Representation
using structured objects
Semantic nets
is a is a is a is a
o s tr ic h p e n g u in c a n a ry r o b in
tr a v e ls _ b y c o lo u r
c o lo u r
w a lk in g y e llo w
tr a v e ls _ b y
re d
in s ta n c e _ o f
in s ta n c e _ o f
O pus
T w e e ty
c o lo u r
w h ite
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Semantic nets
Attempted improvements
building search heuristics into the
network.
more sophisticated logical structure,
involving partitioning.
these improvements meant that the
formalism’s original simplicity was
lost.
Knowledge Representation
using structured objects
Frames
car subclass_of
Name: car Subclass of: thing thing
with
Slots:
wheels: 4,
Name: Value: Restrictions:
moved_by:
engine,
wheels 4 fuel:
moved by engine [value:
unknown,
fuel ? petrol or diesel type:
[petrol,diesel]].
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
‘VW’ subclass_of
Name: VW Subclass of: car car
with
Slots:
made_in:
Name: Value: Restrictions:
‘Germany’.
made in Germany
‘Golf’ subclass_of
Name: Golf Subclass of: VW VW
with
Slots:
top: sunroof.
Name: Value: Restrictions:
top sunroof
‘TDi’ subclass_of
Name: TDi Subclass of: Golf ‘Golf’
with
Slots:
fuel: diesel,
Name: Value: Restrictions:
engine_capacity:
fuel diesel 1.8,
cylinders: 4.
engine
capacity 1.8 litres
cylinders 4
‘C637SRK’
Name: C637SRK Instance of: TDi instance_of
‘TDi’
Slots: with
Name: Value: Restrictions: owner: jp,
top:
owner jp
no_sun_roof.
top no sun-roof
Knowledge Representation
using structured objects
Other varieties of structured object
object
Knowledge representation researchers -
particularly Roger Schank and his
associates - devised some interesting
variations on the theme of structured
objects.
In particular, they invented the idea of
scripts (1973).
A script is a description of a class of
events in terms of contexts, participants,
and sub-events.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Scripts
Knowledge Representation
using structured objects
Practical applications
system
Bank customer advisory system:
Advises customer on opening a bank
account, based on customer's
needs/characteristics. This is a task that
can consume a lot of the bank staff's time.
Deduces customer's intended meaning.
Does not annoy customer by asking for
every detail; uses its knowledge about
people to deduce what the answers must
be. Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Knowledge Representation
using structured objects
The CYC project
Knowledge Representation
using structured objects
Final comments
comments
A knowledge-representation system with
property inheritance should make a
distinction between essential properties
('universal truths') and accidental properties.
Some don't: some allow unrestrained overwriting
of inherited properties.
It's possible to generate incoherent structures in
any of these systems.
It's particularly easy when multiple inheritance is
involved.
Download Useful Materials @ www.rejinpaul.com
Structured objects: final
www.rejinpaul.com
comments
At best, structured objects provide data
& control structures which are more
flexible than those in conventional
languages, and so more suited to
simulating human reasoning.