Академический Документы
Профессиональный Документы
Культура Документы
Knowledge Representation
Introduction
Knowledge base = set of sentences in a formal
language.
Declarative approach to building an agent (or other
system):
Tell it what it needs to know
Logic
Mathematical logic formalizes certain kinds of reasoning
in terms of operations on mathematical formulas.
It is important for people working in A.I. to know logic for
several reasons:
Theory: Logic has a sound mathematical foundation; things can
be proved about it.
Applications: For certain classes of applications (e.g., proving
correctness of programs) logic is the representation of choice.
Comparison with Other Methods: Other representation
methods are often reducible to logic. Knowing logic helps in
understanding other methods and may help prevent reinvention
of old techniques.
Logic
Logics are formal languages for representing
information such that conclusions can be drawn.
Syntax defines the sentences in the language.
Semantics define the "meaning" of sentences;
i.e., define truth of a sentence in a world
Example
E.g., the language of arithmetic
x+2 y is a sentence; x2+y > {} is not a
sentence.
x+2 y is true iff the number x+2 is no less
than the number y.
x+2 y is true in a world where x = 7, y = 1
x+2 y is false in a world where x = 0, y = 6.
Simple Statements
p
p is true
assertion
p is false
negation
pq
disjunction
pq
conjunction
p q
implication
pq
equivalence
Logical equivalence
Two sentences are logically equivalent} iff true in same
models: iff and
A A, A A, (A (A B)) B
Inference Rules
Modus Ponens
From an implication and the premise of the implication we can infer
the conclusion.
,
And Elimination
From a conjunction we can infer any of the conjuncts.
1 2, n
i
And-Introduction
From a list of sentences we can infer their conjunction.
1, 2,, n
1 2, n
Inference Rules
Or-Introduction
From a sentence we can infer its disjunction with anything else at all.
i
12,, n
Double- Negation Elimination
From a doubly negated sentence we can infer a positive sentence.
Unit Resolution
From a disjunction, if one of the disjuncts is false, then we can infer
the other one is true.
,
Clauses
We define a clause as the disjunction of a
number of literals. A ground clause is one in
which no variables occur in the expression. A
Horn clause is a clause with at most one positive
literal.
2.
3.
4.
5.
6.
7.
People only try to assassinate rulers they are not loyal to.
8.
People only try to assassinate rulers they are not loyal to.
Reasoning
1. Marcus was a Pompeian.
2. All Pompeians died when the volcano
erupted in 79 A.D.
3. It is now 2008 A.D.
Is Marcus alive?
Reasoning
1.
2.
3.
Reasoning
1.
2.
3.
Resolution
The basic ideas
KB |
KB |false
Resolution
The basic ideas
KB |
KB |false
( ) ( )
( )
Resolution
The basic ideas
KB |
KB |false
( ) ( )
sound and complete
( )
Resolution in Propositional
Logic
1. Convert all the propositions of KB to clause
form (S).
2. Negate and convert it to clause form. Add it
to S.
3. Repeat until either a contradiction is found or
no progress can be made.
a. Select two clauses ( P) and ( P).
b. Add the resolvent ( ) to S.
Resolution in Propositional
Logic
Example:
KB = {P, (P Q) R, (S T) Q, T}
=R
Eliminate .
P Q P Q
2.
3.
5.
Eliminate (Skolemization).
x: P(x) P(c) Skolem constant
x: y P(x, y) x: P(x, f(x)) Skolem function
6.
Drop .
x: P(x) P(x)
7.
8.
9.
Eliminate .
2.
3.
4.
Move all quantifiers to the left without changing their relative order.
5.
Eliminate (Skolemization).
6.
Drop .
7.
8.
9.
Unification
Unification Algorithm
Example of Unification
Literal 1
parents(x, father(x),
mother(Bill))
parents(x, father(x),
mother(Bill))
parents(x, father(x),
mother(Jane))
Literal 2
Result of Unify
parents(Bill, father(Bill), y)
{x/Bill, y/mother(Bill)}
parents(Bill, father(y),
mother(y))
Failure
Semantic Nets
The major idea is that:
The meaning of a concept comes from its
relationship to other concepts, and that,
The information is stored by interconnecting
nodes with labelled arcs.
Fundamental Components
Lexical part
nodes denoting objects
links denoting relations between objects
labels denoting particular objects and relations
Structural part
the links and nodes form directed graphs
the labels are placed on the links and nodes
Semantic part
meanings are associated with the link and node labels
Procedural part
AND/OR Trees
IS-A Hierarchy
IS-PART Hierarchy
Frames
A basic idea of frames is that people make use of
stereotyped information about typical features of objects,
images, and situations.
Such information is assumed to be structured in large
units representing the stereotypes, and these units are
what are referred to as ``frames''.
Frames (or something similar) are important because
they allow deep understanding of new situations about
which only minimal information is directly available.
They represent our understanding of regularities in the
universe that allow intelligent action based on minimal
clues.
Frames
Frames can inherit slots from parent frames. For example, FIDO (an
individual dog) might inherit properties from DOG (its parent class)
or MAMMAL (a parent class of DOG).
Advantages of Frames
Disadvantages of Frames
Frames encourage baroque representations;
little guide to good structuring of a domain.
Some things that can be represented in logic
cannot be represented well or at all in frames.
Slot fillers must be ``real'' data.
It is not possible to quantify over slots.
It is necessary to repeat the same information to
make it usable from different viewpoints, since
methods are associated with slots or particular object
types.
Conceptual Dependency
Conceptual Dependency originally developed to
represent knowledge acquired from natural
language input.
The goals of this theory are:
To help in the drawing of inference from sentences.
To be independent of the words used in the original
input.
That is to say: For any 2 (or more) sentences that are
identical in meaning there should be only one
representation of that meaning.
PTRANS
-- Transfer of the physical location of an object. e.g. go.
PROPEL
-- Application of a physical force to an object. e.g. push.
MTRANS
-- Transfer of mental information. e.g. tell.
MBUILD
-- Construct new information from old. e.g. decide.
Scripts
A script is a structure that prescribes a set of
circumstances which could be expected to follow
on from one another.
It is similar to a thought sequence or a chain of
situations which could be anticipated.
It could be considered to consist of a number of
slots or frames but with more specialised roles.
Beneficiaries of Scripts
Events tend to occur in known runs or patterns.
Causal relationships between events exist.
Entry conditions exist which allow an event to
take place
Prerequisites exist upon events taking place.
Components of Script
Entry Conditions
these must be satisfied before events in the script can occur.
Results
Conditions that will be true after events in script occur.
Props
Slots representing objects involved in events.
Roles
Persons involved in the events.
Track
Variations on the script. Different tracks may share components of the
same script.
Scenes
The sequence of events that occur. Events are represented
in conceptual dependency form.
Disadvantages:
Less general than frames.
May not be suitable to represent all kinds of
knowledge.
Disadvantages
There is a lack of precise semantics for the
rules.
The systems are not always efficient.
Forward Chaining
Given some facts, work forward through
inference net.
Discovers what conclusions can be derived from
data.
Backward Chaining
To determine if a decision should be made, work
backwards looking for justifications for the
decision.
Eventually, a decision must be justified by facts.