0% found this document useful (0 votes)
79 views125 pages

Unit3 AI - Rejinpaul

This document discusses knowledge representation in artificial intelligence, including: - Ontological engineering and defining general frameworks of concepts like actions, time, and beliefs using an "upper ontology". - Representing categories and objects using first-order logic, including defining category membership, subclass relationships, and properties of categories. - Relations between categories such as disjointness, exhaustive decomposition, and partitions. - Representing natural kinds that may not have clear-cut definitions. - Representing physical composition and part-whole hierarchies using the transitive "part of" relation.

Uploaded by

sanjay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views125 pages

Unit3 AI - Rejinpaul

This document discusses knowledge representation in artificial intelligence, including: - Ontological engineering and defining general frameworks of concepts like actions, time, and beliefs using an "upper ontology". - Representing categories and objects using first-order logic, including defining category membership, subclass relationships, and properties of categories. - Relations between categories such as disjointness, exhaustive decomposition, and partitions. - Representing natural kinds that may not have clear-cut definitions. - Representing physical composition and part-whole hierarchies using the transitive "part of" relation.

Uploaded by

sanjay
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 125

Artificial Intelligence

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

Ontological Engineering The Upper Ontology of the World


ƒ How to create more general and flexible
representations.
• Concepts like actions, time, physical objects and
beliefs
• Operates on a bigger scale than knowledge
engineering
ƒ Define general framework of concepts
• Upper ontology
ƒ Limitations of logic representation
• Red, green and yellow tomatoes: exceptions and
uncertainty
3 4

Differences with Special-Purpose


Categories and Objects
Ontologies
ƒ A general-purpose ontology should be ƒ KR requires the organization of objects into
applicable in more or less any special-purpose categories
domain. • Interaction at the level of the object
• Add domain-specific axioms • Reasoning at the level of categories
ƒ In any sufficiently demanding domain ƒ Categories play a role in predictions about
diff
differentt areas off knowledge
k l d needd to
t be
b objects
unified. • Based on perceived properties
• Reasoning and problem solving could involve several ƒ Categories can be represented in two ways by
areas simultaneously first-order logid (FOL)
ƒ What do we need to express? • Predicates: apple(x)
• Categories, Measures, Composite objects, Time, Space, • Reification of categories into objects: apples
Change, Events, Processes, Physical Objects, ƒ Category = set of its members
Substances, Mental Objects, Beliefs 5 6

Download Useful Materials @ www.rejinpaul.com 1


Artificial Intelligence
www.rejinpaul.com

Category Organization FOL and Categories


ƒ Relation = inheritance: ƒ An object is a member of a category
• MemberOf(BB12,Basketballs)
• All instance of food are edible, fruit is a subclass of ƒ A category is a subclass of another category
food and apples is a subclass of fruit then an apple is • SubsetOf(Basketballs,Balls)
edible. ƒ All members of a category have some properties
ƒ Defines a • ∀ x (MemberOf(x,Basketballs)
(MemberOf(x Basketballs) ⇒ Round(x))
ƒ All members of a category can be recognized by
taxonomy some properties
• ∀ x (Orange(x) ∧ Round(x) ∧
Diameter(x)=9.5in ∧ MemberOf(x,Balls) ⇒
MemberOf(x,BasketBalls))
ƒ A category as a whole has some properties
• MemberOf(Dogs,DomesticatedSpecies)
7 8

Relations Between Categories Relations Between Categories


ƒ Two or more categories are disjoint if they ƒ A partition is a disjoint exhaustive
have no members in common: decomposition:
• Disjoint(s)⇔(∀ c1,c2 c1 ∈ s ∧ c2 ∈ • Partition(s,c) ⇔ Disjoint(s) ∧
s ∧ c1 ¹ c2 ⇒ Intersection(c1,c2) E.D.(s,c)
={})
• Example:
• Example; Disjoint({animals,
Disjoint({animals P titi ({M l
Partition({Males,Females},Persons)
F l } P )
vegetables})
ƒ Is ({Americans, Canadian,
ƒ A set of categories s constitutes an
exhaustive decomposition of a category c if Mexicans}, NorthAmericans) a
all members of the set c are covered by partition?
categories in s: ƒ Categories can be defined by providing
• E.D.(s,c) ⇔ (∀ i, i ∈ c ⇒ ∃ c2 c2 necessary and sufficient conditions for
∈ s ∧ i ∈ c2) 9
membership
10

E l E h ti D iti

Natural Kinds Physical Composition


ƒ Many categories have no clear-cut definitions ƒ One object may be part of another:
(chair, bush, book) • PartOf(Bucharest,Romania)
• PartOf(Romania,EasternEurope)
ƒ Tomatoes: sometimes green, red, yellow, black. • PartOf(EasternEurope,Europe)
Mostly round. ƒ The PartOf predicate is transitive (and irreflexive),
ƒ One solution: category Typical(Tomatoes). so we can infer that PartOf(Bucharest,Europe)
• ∀ x,
x x ∈ Typical(Tomatoes) ⇒ Red(x) ∧ ƒ More generally:
Spherical(x). • ∀ x PartOf(x,x)
ƒ We can write down useful facts about categories • ∀ x,y,z PartOf(x,y) ∧ PartOf(y,z) ⇒ PartOf(x,z)
without providing exact definitions. ƒ Often characterized by structural relations among
parts.
ƒ What about “bachelor”? Quine challenged the • E.g. Biped(a) ⇒
utility of the notion of strict definition. We might
question a statement such as “the Pope is a
bachelor” 11 12

Download Useful Materials @ www.rejinpaul.com 2


Artificial Intelligence
www.rejinpaul.com

Measurements Actions, Events and Situations


ƒ Objects have height, mass, cost, .... ƒ Reasoning about the
Values that we assign to these are measures outcome of actions is
ƒ Combine Unit functions with a number: central to KB-agent
Length(L1) = Inches(1.5) = Centimeters(3.81)
ƒ How can we keep track of
ƒ Conversion between units:
∀ i Centimeters(2.54
i ( x i) = Inches(i).
h (i)
location in FOL?
• Remember the multiple copies
ƒ Some measures have no scale: Beauty, in PL.
Difficulty, etc.
• Most important aspect of measures: is that they are ƒ Representing time by
orderable situations (states resulting
• Don't care about the actual numbers from the execution of
E.g. An apple can have deliciousness .9 or .1.
actions).
13 14
• Situation calculus

Situation Calculus ƒ Results of action


ƒ Actions are logical terms sequences are determined
ƒ Situations are logical terms by the individual actions
consiting of
ƒ Projection task: an SC
• The initial situation I
• All situations resulting from the agent should be able to
action on I ((=Result(a
Result(a,s))
s)) deduce the outcome of a
ƒ Fluents are functions and sequence of actions
predicates that vary from
one situation to the next. ƒ Planning task: find a
• E.g. ¬Holding(G1, S0) sequence that achieves a
ƒ Eternal predicates are also desirable effect
allowed
• E.g. Gold(G1) 15 16

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

Download Useful Materials @ www.rejinpaul.com 3


Artificial Intelligence
www.rejinpaul.com

The Frame Problem Other Problems


ƒ For F fluents and A actions we need ƒ How to deal with secondary (implicit)
A*F frame axioms to describe other objects effects?
which are stationary unless they are held • If the agent is carrying the gold and the agent
• Must write down the effect of each action moves then the gold moves too.
• Ramification problem
ƒ Solution - describe how each fluent changes
over time ƒ How to decide efficiently whether fluents
• Successor-state axiom:
hold in the future?
- Pos(a,s) ⇒ (At(Agent,y,Result(a,s)) ⇔ • Inferential frame problem
(a = Go(x,y)) ∨ (At(Agent,y,s) ∧ a ≠
Go(y,z))
ƒ Extensions
• Note that next state is completely specified by current
• Event calculus (when actions have a duration)
state. 19 • Process categories 20

E h ti ff t i ti d l

Mental Events and Objects The Internet Shopping World


ƒ So far, KB agents can have beliefs and deduce new ƒ A Knowledge Engineering example
beliefs
ƒ What about knowledge about beliefs? ƒ An agent that helps a buyer to find product
ƒ What about knowledge about the inference proces? offers on the internet.
• Requires a model of the mental objects in someone’s head and the • IN = product description (precise or ¬precise)
processes that manipulate those objects
ƒ Relationships between agents and mental objects: • OUT = list of webpages that offer the product for sale
believes, knows, wants, …
• Believes(Lois,Flies(Superman)) with Flies(Superman) being a
ƒ Environment = WWW
function … a candidate for a mental object (reification)
ƒ Percepts = web pages (character strings)
ƒ Agent can now reason about the beliefs of agents
• Extracting useful information required

21 22

24

Find Relevant Product Offers Find Relevant Product Offers, cont


ƒ RelevantOffer(page,url,query) ⇔ ƒ Require rich category vocabulary
Relevant(page, url, query) ∧
• synonymy
Offer(page)
• ambiguity
ƒ Write axioms to define Offer(x)
ƒ How to retrieve pages: GetPage(url) ?
ƒ Find relevant pages: Relevant(x,y,z)
Relevant(x y z) ? • Procedural attachment
• Start from an initial set of stores.
ƒ Compare offers (information extraction)
• What is a relevant category?
• What are relevant connected pages?

23

Download Useful Materials @ www.rejinpaul.com 4


Artificial Intelligence
www.rejinpaul.com

Reasoning systems for Categories Semantic Networks


How to organize and reason with ƒ Logic vs. semantic networks
categories? ƒ Many variations
ƒ Semantic networks • All represent individual objects, categories of
• Visualize knowledge-base objects and relationships among objects.
• Efficient algorithms for category membership
inference ƒ Allows for inheritance reasoning
ƒ Description logics • Female persons inherit all properties from person.
• Formal language for constructing and combining • Cfr. OO programming.
category definitions ƒ Inference of inverse links
• Efficient algorithms to decide subset and superset • SisterOf vs. HasSister
relationships between categories.
25 26

Semantic Network Example Semantic networks


ƒ Drawbacks
• Links can only assert binary relations
• Can be resolved by reification of the proposition
as an event
ƒ Representation
R t ti off default
d f lt values
l
• Enforced by the inheritance mechanism

27 28

Description Logics Reasoning with Default Information


ƒ Are designed to describe defintions and ƒ “The following courses are offered: ICS101,
properties about categories ICS110, ICS111, EE160”
• A formalization of semantic networks ƒ Four (db)
ƒ Principal inference task is • Assume that this information is complete (not asserted
ground atomic sentences are false)
• Subsumption: checking if one category is the
• = CLOSED WORLD ASSUMPTION
subset of another by comparing their definitions
• Assume that distinct names refer to distinct objects
• Classification: checking whether an object belongs
• = UNIQUE NAMES ASSUMPTION
to a category.
• Consistency: whether the category membership ƒ Between one and infinity (logic)
criteria are logically satisfiable • Does not make these assumptions
29 • Requires completion. 30

Download Useful Materials @ www.rejinpaul.com 5


Artificial Intelligence
www.rejinpaul.com

Truth Maintenance Systems Summary


ƒ Many inferences have default status ƒ Ontological engineering
rather than being absolutely certain ƒ Categories and objects
• Inferred facts can be wrong and need to be
retracted = belief revision.
ƒ Actions, situations and events
• Assume KB contains sentence P and we want ƒ Mental events and mental objects
to execute TELL(KB, ¬P)
ƒ The internet shopping world
- To avoid contradiction: RETRACT(KB,P)
- But what about sentences inferred from P? ƒ Reasoning systems for categories
ƒ Truth maintenance systems are designed ƒ Reasoning with default information
to handle these complications. ƒ Truth maintenance systems
31

Download Useful Materials @ www.rejinpaul.com 6


www.rejinpaul.com

First-Order Logic

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Difference between
Propositional Logic and 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.

Download Useful Materials @ www.rejinpaul.com


Pros and cons of propositional www.rejinpaul.com

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

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Special purpose logics


• Make further ontological commitment
• Special purpose logic
– Temporal logic (Facts that hold at a particular
time)
– Higher-order logic (functions and relations by
first-order logic with objects)
Epistemological commitments possible states (
true, false, unknown)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Different Logics
LANGUAGES Ontological Commitment Epistemological
Commitment

PROPOSITIONAL Facts True / False / Unknown


LOGIC
FIRST-ORDER LOGIC Facts, Objects, Relations True / False / Unknown

TEMPORAL LOGIC Facts, Objects, Relations, True / False /Unknown


Times

PROBABILITY Facts Degree of belief (0,1)


THEORY
FUZZY LOGIC Facts with degree of truth Known interval value

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
First-order logic
• Whereas propositional logic assumes the world
contains facts,
• first-order logic (like natural language)
assumes the world contains

– Objects: people, houses, numbers, colors, baseball


games, wars, …
– Relations: red, round, prime, brother of, bigger
than, part of, comes between, …
– Functions: father of, best friend, one more than,
plus, …

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Syntax of FOL: Basic elements


• Constants KingJohn, 2,...
• Predicates Brother, >,...
• Functions Sqrt, LeftLegOf,...
• Variables x, y, a, b,...
• Connectives , , , , 
• Equality =
• Quantifiers , 

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Models for FOL: Example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Atomic sentences
Atomic sentence = predicate (term1,...,termn)
or term1 = term2

Term = function (term1,...,termn)


or constant or variable

• E.g., Brother(John,Richard)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Complex sentences
• Complex sentences are made from atomic sentences using
connectives
S, S1  S2, S1  S2, S1  S2, S1  S2,

E.g. Sibling(John,Richard)  Sibling(Richard,John)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Symbols and Interpretations


• Sentences are true with respect to a model and an interpretation

• Model contains objects (domain elements) and relations among


them

• Interpretation specifies referents for


constant symbols → objects

predicate symbols → relations

function symbols → functional relations

• An atomic sentence predicate(term1,...,termn) is true


iff the objects referred to by term1,...,termn
are in the relation referred to by predicate
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com

Universal quantification
• <variables> <sentence>
Everyone in cse is smart:
x (x,cse)  Smart(x)

• x P is true in a model m iff P is true with x being each


possible object in the model

• Roughly speaking, equivalent to the conjunction of


instantiations of P
in(John,cse)  Smart(KingJohn)
 in(Richard,cse)  Smart(Richard)
 in(Sam,cse)  Smart(Sam)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

A common mistake to avoid


• Typically,  is the main connective with 

• Common mistake: using  as the main connective


with :
x in(x,cse)  Smart(x)
means “Everyone is in cse and everyone is smart”

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Existential quantification
• <variables> <sentence>
• Someone in cse is smart:
• x (x,cse)  Smart(x)

• x P is true in a model m iff P is true with x being some


possible object in the model

• Roughly speaking, equivalent to the disjunction of


instantiations of P

in(KingJohn,cse)  Smart(John)
 in(Richard,cse)  Smart(Richard)
 in(Sam,cse)  Smart(Sam)
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com

Another common mistake to avoid


• Typically,  is the main connective with 

• Common mistake: using  as the main connective


with :
x in(x,cse)  Smart(x)

is true if there is anyone who is not in cse!

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Properties of quantifiers

• x y is the same as y x

• x y is the same as y x

• x y is not the same as y x

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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”

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Quantifier duality

Quantifier duality: each can be expressed using


the other

• x Likes(x,IceCream) = x Likes(x,IceCream)


• x Likes(x,icecream) = x Likes(x,icecream)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Unification
• We can get the inference immediately if we can find a substitution θ
such that King(x) and Greedy(x) match King(John) and Greedy(y)

θ = {x/John,y/John} works

• Unify(p,q) = θ where SUBST(θ,p)= SUBST(θ,q)


p q θ
Knows(John,x) Knows(John,Jane) {x/Jane}
Knows(John,x) Knows(y,Bill) {x/Bill,y/John}
Knows(John,x) Knows(y,Mother(y)) {y/John,x/Mother(John)}
Knows(John,x) Knows(x,Elizabeth) fail

• Standardizing apart eliminates overlap of variables, e.g.,


Knows(z,Elizabeth)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Unification
• To unify Knows(John,x) and Knows(y,z),

θ = {y/John, x/z } or θ = {y/John, x/John, z/John}

• The first unifier is more general than the second.

• There is a single most general unifier (MGU) that is


unique up to renaming of variables.
• MGU = { y/John, x/z }

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
The unification algorithm

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

The unification algorithm

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Generalized Modus Ponens


p1', p2', … , pn', ( p1  p2  …  pn q) where pi'θ = pi θ for all i


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)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

• Definite Clauses
Ex:- situation Response
Definite clauses are useful for systems that
make inferences in responses to newly arrived
information.

• To build a KB using definite clauses


• Reasoning with forward chaining is much
more efficient.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

• To apply forward chaining to first-order


definite clauses
• First-order definite clauses are disjunctions or
conjunctions of literals.

ex:- for first-order definite clauses


King (x)  Greedy (x)  Evil(x)
King(john)
Greedy(y)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

• Datalog KB: set of first-order definite clauses


with no function symbols or quantifiers.
– The absence of function symbols makes inference
much easier.

• What will the forward chaining algorithm do?


-Starts from the known facts,
-it triggers all the rules whose premises are
satisfied,
- adding their conclusions to the known facts.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

• The process repeats until the query is answered


or no new facts are added.
• Renaming – one sentence is a renaming of
another if they are identical except the name of
the variables.
Ex:- likes(x,icecream)
likes(y,icecream)

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Forward chaining algorithm

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Example knowledge base


• The law says that it is a crime for an American
to sell weapons to hostile nations. The country
Nono, an enemy of America, has some
missiles, and all of its missiles were sold to it
by SAM, who is American.

• Prove that SAM is a criminal

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Example knowledge base contd.


... it is a crime for an American to sell weapons to hostile nations:
American(x)  Weapon(y)  Sells(x,y,z)  Hostile(z)  Criminal(x)

Nono … has some missiles, i.e., x Owns(Nono,x)  Missile(x):


Owns(Nono,M1) and Missile(M1)

… all of its missiles were sold to it by SAM


Missile(x)  Owns(Nono,x)  Sells(sam,x,Nono)

Missiles are weapons:


Missile(x)  Weapon(x)

An enemy of America counts as "hostile“:


Enemy(x,America)  Hostile(x)

SAM, who is American …


American(sam)

The country Nono, an enemy of America …


Enemy(Nono,America)
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com

Forward chaining proof Tree

American(x)  Weapon(y)  Sells(x,y,z)  Hostile(z)  Criminal(x)


Missile(x)  Owns(Nono,x)  Sells(sam,x,Nono)
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com

Properties of forward chaining


• Sound and complete for first-order definite clauses

• 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

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Efficiency of forward chaining


Incremental forward chaining: no need to match a rule
on iteration k if a premise wasn't added on iteration k-
1  match each rule whose premise contains a newly added
positive literal

Matching itself can be expensive:


Database indexing allows O(1) retrieval of known facts

– e.g., query Missile(x) retrieves Missile(M1)

Forward chaining is widely used in deductive databases

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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.

Incompleteness theorem:- sentences that are


entailed, but have no finite proof within the
system.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Conjunctive Normal Form
Everyone who loves all animals is loved by someone.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

The resolution inference rule

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

BINARY RESOLUTION
• Resolution rule that resolves exactly two
literals.
• The binary resolution rule by itself does not
yield a complete inference procedure.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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

• Completeness:-Resolution can be used to


establish that a given sentence is entailed by
the set of sentences.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Resolution Strategies
• Resolution inference rule will eventually find a
proof if one exists

• Resolution Strategies that help find proofs


efficiently.
1. Unit preference
2. Set of support
3. Input resolution
4. Sub-sumption

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Unit Preference
• Prefer inferences that produce shorter
clauses.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Set of support

• It starts by identifying a subset of the sentences


called the set of support.
• Every resolution combines a sentence from the
set of support with another sentence and adds
the resolvent into the set of support.
• If the set of support is small relative to the
whole knowledge base, the search space will
be reduced dramatically.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining algorithm

-Algorithm uses composition of substitutions


SUBST(COMPOSE(θ1, θ2), p) = SUBST(θ2, SUBST(θ1, p))

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Backward chaining example

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Properties of backward chaining


• Depth-first recursive proof search: space is linear in
size of proof.
• Incomplete due to infinite loops
–  fix by checking current goal against every goal on stack
• Inefficient due to repeated sub-goals (both success
and failure)
–  fix using caching of previous results (extra space)
• Widely used for logic programming

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Logic programming: Prolog
• Algorithm = Logic + Control

• Program = set of clauses = head :- literal1, … literaln.

criminal(X) :- american(X), weapon(Y), sells(X,Y,Z), hostile(Z).

• Depth-first, left-to-right backward chaining


• Built-in predicates for arithmetic etc., e.g., X is Y*Z+3
• Built-in predicates that have side effects (e.g., input and output
• predicates, assert/retract predicates)
• Closed-world assumption ("negation as failure")
– e.g., given alive(X) :- not dead(X).
– alive(joe) succeeds if dead(joe) fails

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

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]) ?

• answers: A=[] B=[1,2]


A=[1] B=[2]
A=[1,2] B=[]

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Knowledge
representation
2

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Knowledge Representation
using structured objects

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Knowledge Representation
using structured objects
Semantic nets

Download Useful Materials @ www.rejinpaul.com


c o v e re d _ b y www.rejinpaul.com
a n im a l
tr a v e ls _ b y s k in
fly in g
is a is a
tr a v e ls _ b y
b ir d fis h
fe a th e rs
c o v e re d _ b y s w im m in g

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

knowledge is represented as a collection


of concepts, represented by nodes
(shown as boxes in the diagram),
connected together by relationships,
represented by arcs (shown as arrows in
the diagram).
certain arcs - particularly isa arcs - allow
inheritance of properties.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Semantic nets

Problems with semantic nets


logical inadequacy - vagueness about what
types and tokens really mean.
heuristic inadequacy – finding a specific
piece of information could be chronically
inefficient.
trying to establish negation is likely to lead
to a combinatorial explosion.
"spreading activation" search is very
inefficient, because it is not knowledge-
guided.
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.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Semantic nets

Developments of the semantic nets idea:


psychological research into whether
human memory really was organised in
this way.
used in the knowledge bases in certain
expert systems: e.g. PROSPECTOR.
special-purpose languages have been
written to express knowledge in semantic
nets.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com

Knowledge Representation
using structured objects
Frames

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Frames

Devised by Marvin Minsky, 1974.


Incorporates certain valuable human
thinking characteristics:
Expectations, assumptions, stereotypes.
Exceptions. Fuzzy boundaries between
classes.
The essence of this form of knowledge
representation is typicality, with
exceptions, rather than definition.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Frames

The idea of frame hierarchies is very


similar to the idea of class hierarchies
found in object-orientated programming.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
How frames are organised

A frame system is a hierarchy of frames


Each frame has:
a name.
slots: these are the properties of the entity
that has the name, and they have values.
A particular value may be:
a default value
an inherited value from a higher frame
a procedure, called a daemon, to find a
value
a specific value, which might represent
an exception.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
How frames are organised

In the higher levels of the frame


hierarchy, typical knowledge about the
class is stored.
The value in a slot may be a range or a
condition.
In the lower levels, the value in a slot
may be a specific value, to overwrite the
value which would otherwise be
inherited from a higher frame.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
How frames are organised

An instance of an object is joined to its


class by an 'instance_of' relationship.
A class is joined to its superclass by a
'subclass_of' relationship.
Frames may contain both procedural
and declarative knowledge.
Slot values normally amount to declarative
knowledge, but a daemon is in effect a
small program. So a slot with a daemon in it
amounts to procedural knowledge.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
How frames are organised

Note that a frames system may allow


multiple inheritance but, if it does so, it
must make provision for cases when
inherited values conflict.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Frames: some examples

The following is an exploration of


Minsky's frames, using simple
examples.
Note that this is not exactly the way
Minsky described frames in his original
paper, but it is the way the idea has
come to be used in practice.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Frames: some examples

First I provide a verbal description of some


concept;
then I show a diagram representing the
resulting frame;
beside this is a bit of programming which
implements this frame in a suitable
knowledge representation programming
language - in this case, the MIKE package
written by knowledge engineering
specialists at the Open University.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Frames: some examples

We will start with a simple piece of


information: there is a category of things
called cars.
Given this information, we can start to
build a frame:

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Name: car Subclass of: thing

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

More information: a car has 4 wheels, is


moved by an engine, and runs on petrol
or diesel.
We can now add three slots to the
frame.
The last of these has a restriction rather
than a specific value.

Download Useful Materials @ www.rejinpaul.com


“a car has 4 wheels, is moved by an engine,
www.rejinpaul.com

and runs on petrol or diesel.”

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

More information: there is a particular


type of car called a VW, manufactured in
Germany.
We can add a second frame to our
system, with one slot. We don’t need to
repeat the slots and values in the
previous frame: they will be inherited.

Download Useful Materials @ www.rejinpaul.com


“there is a particular type of car called
www.rejinpaul.com
a VW,
manufactured in Germany.”

‘VW’ subclass_of
Name: VW Subclass of: car car
with
Slots:
made_in:
Name: Value: Restrictions:
‘Germany’.
made in Germany

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

More information: there is a particular


type of VW called a Golf, which has a
sun-roof.
We can add a third frame to our system,
with one slot. Once again, we don’t
repeat the slots in the previous frames,
because they will be inherited.

Download Useful Materials @ www.rejinpaul.com


“there is a particular type of VW calledwww.rejinpaul.com
a Golf,
which has a sunroof.”

‘Golf’ subclass_of
Name: Golf Subclass of: VW VW
with
Slots:
top: sunroof.
Name: Value: Restrictions:

top sunroof

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

More information: there is a particular


type of Golf called a TDi, which runs on
diesel. A TDi has 4 cylinders, and an
engine capacity of 1.8 litres.
We can add a fourth frame to our
system, with three slots. One of the slots
(fuel) was already in the system, but
appears here because it now has a
specific value rather than a restriction.
Download Useful Materials @ www.rejinpaul.com
“there is a particular type of Golf called a TDi,
www.rejinpaul.com
which runs on diesel, has 4 cylinders, and has a 1.8
litre engine.”

‘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

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

More information: my car, called


C637SRK, is a Golf Tdi. It hasn’t got a
sun-roof.
We can add a fifth frame to our system,
with two slots. Unlike all the previous
frames, this one is an instance frame.
One of the slots (top) was already in the
system, but appears here because the
value contradicts (overwrites) the value
which would otherwise be inherited.
Download Useful Materials @ www.rejinpaul.com
“There is a car called C637SRK which is an
www.rejinpaul.com

instance of a Golf TDi etc.”

‘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

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

More information: to calculate a car’s


cylinder size, you divide the total engine
capacity by the number of cylinders.
We can now add another slot to the car
frame. It’s a daemon, which discovers
the information required, if the user asks
what the value in the slot is.

Download Useful Materials @ www.rejinpaul.com


“to calculate a car’s cylinder size, you divide the
www.rejinpaul.com
total engine capacity by the number of
cylinders.”

car subclass_of thing


with
Name: car Subclass of: thing wheels: 4,
moved_by: engine,
Slots: fuel: [value: unknown,
type: [petrol,diesel]],
Name: Value: Restrictions: cylinder_size:
wheels 4 [value: unknown,
moved by engine access_rule:
fuel ? petrol or diesel. (if the
cylinder size ? find total engine engine_capacity of
?self is E & the
capacity, find cylinders of ?self is
no.of cylinders, C & Ans := E/C
divide first by then make_value
second.
Download Useful Materials Ans)].
@ www.rejinpaul.com
www.rejinpaul.com

Knowledge Representation
using structured objects
Other varieties of structured object

Download Useful Materials @ www.rejinpaul.com


Other varieties of structured
www.rejinpaul.com

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

Rather similar to frames: uses inheritance


and slots; describes stereotypical
knowledge, (i.e. if the system isn't told
some detail of what's going on, it assumes
the "default" information is true), but
concerned with events.
Somewhat out of the mainstream of
expert systems work. More a development
of natural-language-processing research.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Scripts

Why represent knowledge in this way?


Because real-world events do follow
stereotyped patterns. Human beings use
previous experiences to understand verbal
accounts; computers can use scripts instead.
Because people, when relating events, do
leave large amounts of assumed detail out of
their accounts. People don't find it easy to
converse with a system that can't fill in
missing conversational detail.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Scripts

Scripts predict unobserved events.


Scripts can build a coherent account from
disjointed observations.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Scripts

Commercial applications of script-like


structured objects: work on the basis that a
conversation between two people on a pre-
defined subject will follow a predictable
course.
Certain items of information need to be
exchanged.
Others can be left unsaid (because both people
know what the usual answer would be, or can
deduce it from what's been said already), unless
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
Scripts

This sort of knowledge representation has


been used in intelligent front-ends, for
systems whose users are not computer
specialists.
It has been employed in story-
understanding and news-report-
understanding systems.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Conceptual graphs

In 1984, John Sowa published his


conceptual graph approach.
This is something like the semantic net
approach described earlier.
It is more sophisticated in the way in
which it represents concepts
It is much more precise regarding what
the objects in the graphs mean in real-
world terms.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com

Knowledge Representation
using structured objects
Practical applications

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
KBSs using structured objects

Two more examples of KBSs using


structured objects for knowledge
representation

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
Explorer

Explorer is a natural-language interface


for a database relating to oil-wells:
Contains geological knowledge,
organised as structured objects.
Interfaced to a graphics package that
can draw oil-exploration maps.
The geologist can converse with the
program in unconstrained natural
language, and in geological jargon.
Download Useful Materials @ www.rejinpaul.com
Bank customer advisory
www.rejinpaul.com

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

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
The CYC Project

A very large scale commercial research


project designed to represent a large
body of common-sense knowledge.
Headed by Lenat and Guha, and based
in Austin, Texas
Has been making steady progress since
1984

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com
The CYC Project

It now ‘knows’ a huge collection of


fragments of real-world knowledge such
as:
Mothers are older than their children.
You have to be awake to eat.
You can usually know people’s noses, but
not their hearts.
If you cut a lump of peanut butter in half,
each half is a lump of peanut butter, but if
you cut a table in half, neither half is a table.
Download Useful Materials @ www.rejinpaul.com
www.rejinpaul.com
The CYC Project

The ultimate objective is to give it enough


knowledge to understand ordinary books,
so that it can read them and expand its
own knowledge.
So far, it’s got to a stage where, when
asked to find photos of “risky activities”, it
located photos of people climbing
mountains and doing white-water rafting.

Download Useful Materials @ www.rejinpaul.com


www.rejinpaul.com

Knowledge Representation
using structured objects
Final comments

Download Useful Materials @ www.rejinpaul.com


Structured objects: final
www.rejinpaul.com

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.

Download Useful Materials @ www.rejinpaul.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy