Professional Documents
Culture Documents
Reasoning Programs
English English
generation understanding
English Representation
Representation using
Mathematical Logic
Fact
English : Spot is a dog.
Logic : Dog(Spot) …… (1)
English : All dogs have tails
Logic : x Dog(x) hastail(x) ….. (2)
Using (1) and (2), we can derive a
new knowledge
Logic : hastail(Spot)
English : Spot has a tail.
Propositional Logic Representation
Confucius is a person.
Confucius is mortal.
Examples:
Objects: Students, lectures, companies, cars ...
Relations: Brother-of, bigger-than, outside, part-of, has-
color, occurs-after, owns, visits, precedes, ...
Properties: blue, oval, even, large, ...
Functions: father-of, best-friend, second-half, one-more-
than ...
User provides
father-of(Mary) = John
color-of(Sky) = Blue
greater(5,3)
green(Grass)
color(Grass, Green)
FOL Provides
Variable symbols
E.g., x, y, foo
Connectives
Universal x or (Ax)
Existential x or (Ex)
Quantifiers
Universal quantification
(x)P(x) means that P holds for all values of x in
the domain associated with that variable
E.g., (x) dolphin(x) mammal(x)
Existential quantification
( x)P(x) means that P holds for some value of x in
the domain associated with that variable
E.g., ( x) mammal(x) lays-eggs(x)
Permits one to make a statement about some
object without naming it
Sentences are built from terms and atoms
S(x) is a P(x)
necessary (x) P(x) => S(x)
S(x)
condition of P(x)
S(x) is a S(x)
sufficient (x) P(x) <= S(x)
P(x)
condition of P(x)
S(x) is a P(x)
necessary and (x) P(x) <=> S(x)
sufficient S(x)
condition of P(x)
Example: A simple genealogy KB
Predicates:
parent(x, y), child(x, y), father(x, y), daughter(x, y),
etc.
spouse(x, y), husband(x, y), wife(x,y)
ancestor(x, y), descendant(x, y)
male(x), female(y)
relative(x, y)
Facts:
husband(Joe, Mary), son(Fred, Joe)
spouse(John, Nancy), male(John), son(Mark, Nancy)
father(Jack, Nancy), daughter(Linda, Jack)
daughter(Liz, Linda)
etc.
Example: A simple genealogy KB
(x,y) parent(x, y) ↔ child (y, x)
(x,y) father(x, y) ↔ parent(x, y) male(x) (similarly for mother(x, y))
(x,y) daughter(x, y) ↔ child(x, y) female(x) (similarly for son(x, y))
(x,y) husband(x, y) ↔ spouse(x, y) male(x) (similarly for wife(x, y))
(x,y) spouse(x, y) ↔ spouse(y, x) (spouse relation is symmetric)
(x,y) parent(x, y) ancestor(x, y)
(x,y)(z) parent(x, z) ancestor(z, y) ancestor(x, y)
(x,y) descendant(x, y) ↔ ancestor(y, x)
(x,y)(z) ancestor(z, x) ancestor(z, y) relative(x, y)
(related by common ancestry)
(x,y) spouse(x, y) relative(x, y) (related by marriage)
(x,y)(z) relative(z, x) relative(z, y) relative(x, y) (transitive)
(x,y) relative(x, y) ↔ relative(y, x) (symmetric)
Semantics of FOL
Interpretation I: includes
Assign each constant to an object in M
Define each function of n arguments as a mapping Mn => M
Define each predicate of n arguments as a mapping Mn => {T,
F}
Therefore, every ground predicate with any instantiation will
have a truth value
In general there is an infinite number of interpretations because
|M| is infinite
Universal instantiation
x P(x) P(A)
Universal generalization
P(A) P(B) … x P(x)
Existential instantiation
x P(x) P(F) skolem constant F
Existential generalization
P(A) x P(x)
Universal instantiation
Example:
Example:
(x) eats(Ziggy, x) eats(Ziggy, Stuff)
Example
All
instances of the given constant symbol are
replaced by the new variable symbol
1. P Q Modus Ponens
2. P V Q
1. P VQ Q Merge
2. P V Q
1. P VQ Q V Q Tautologies
2. P V Q P V P
1. P Empty Clause
2. P
1. P V Q P V R Chaining
2. Q V R
Rule based System
This system represent knowledge in
terms of a brunch of rules.
This rules tells us what to do in
different situations.
Consists of brunch of IF-Then rules, a
brunch of facts and some interpreter
controlling the application of the rules.
Two Types…
Forward chaining system: Starts
with the initial facts, keeps using the
rules to draw new conclusions.
It is data driven
Backward chaining system: starts
with some goal and then keeps
looking for rules that allow to
conclude the goal.
It is goal driven.
For example,
“If sun shines then weather is fine”
Knowledge representation in first-order
logic:
A - ”sun shines”
B - ”weather is fine”
AB
• Knowledge representation as
IF...THEN... rule:
IF sun shines THEN weather is
fine
Semantic NET
Semantic net or semantic network
is used as a form of knowledge
representation.
It is a directed graph consisting of
vertices represents concepts and
edges represents semantic relations
between concepts.
animal
Is_a Is_a
Has part
Is_a
elephant
Is_instance_of
Clyde
56
Nodes and Arcs
Arcs define binary relations which hold between
objects denoted by the nodes.
mother age
Sue John 5
w age (john, 5)
ife
hu father father (John, max)
age s ba
nd age (max, 34)
…
34 Max
Non-binary relations
object
book
Advantages
Easy to visualize
Formal definitions of semantic networks
have been developed.
Efficient in space requirements
Objects represented only once
Relationships handled by pointers
Conceptual Graph
Fi Conceptual relations of different types.
Graph of “Mary gave John the book.”
Conceptual graph indicating that the dog named Emma is brown.
62
Conceptual graph of a person with three names.
Conceptual graph of the proposition “There are no pink dogs.”
Frames
Frames are record like structures that
have slots and slot values for an
entity.
A slot in a frame specify a character
of the entity and it contains
information as attribute-value pair,
default value etc.
Using frames the knowledge about an
object/event can be stored as a unit.
Example
(Parrot
(Species (value Bird))
(Color (value Yellow))
(Activity (value Fly)))
Employee Details
(Richa
(professon (value teacher))
(EmpID (value t0015))
(Subject (value Computer)))
Advantages…
Makes programming easier by
grouping related knowledge
Easily understood by non-developers
Expressive power
Easy to set up slots for new
properties and relations
Easy to include default information
and detect missing values
Unification in predicate logic
In order to determine contradiction, the unification
procedure is used.
It compares two literals and discovers whether
there exists a set of substitution that makes them
identical.
A recursive procedure, called the unification
algorithm is used.
Man(John) and ¬Man(John) is contradiction
Man(John) and ¬Man(spot) is not.