AI07
AI07
Propositional logic
not expressive enough
needs a huge amount of rules
for even for the simple 4x4 wumpus world
previous examples on chapter 7
For logic?
it’s like a function: one-to-one mapping.
New concepts
Relations
are the links among objects
can be functions – only one output for a given input
Examples:
Objects: people, houses, number, colors, baseball,
centuries
Relations: either unary (property) or n-ary
unary: tall, large, small, red, round, prime, boring
n-ary: brother of, greater than, part of, inside, after, is
Functions: father of, best friend, one more than
Almost any fact (assertion) can be thought
of a combination of
objects
and properties or relations
Function: plus
A name of the object
obtained by applying the
function plus to the
objects one and two
“Squares neighboring the wumpus are
smelly.”
Objects: Squares, wumpus
Property: smelly Not a function because
many squares may satisfy
Relation: neighboring
the constraints, but there
is only one three
FOL is important
almost any of our concept/knowledge
can be expressed as FOL
Pros & Cons of FOL
Drawback
first-order logic doesn't have the things
Categories / Classification
Time (Temporal Logic)
Events
Advantage
it can express
anything that can be programmed
Prolog
Difference of FOL and PL
PL
consider the facts: True or False
use compositionality to see
whether the sentence is true or false
FOL
consider the RELATIONS with OBJECTS:
True or False
also use compositionality
Models for FOL
What is a model?
in PL: A B => C
then how many possible combinations?
this set of truth values = a model for this world
only True or False exists
in FOL, a model contains more.
objects
domain of an FOL model
= set of objects (domain elements) it contains
There are five objects in this model
two binary relations
three unary relations
Atomic sentences
the facts in Prolog
= Predicate symbol + Terms
= Relation + Objects
x the crown
x y Loves (x, y)
meaning?
Everybody x loves somebody y
any difference?
Somebody y, whom is loved by
everybody x.
Problem?
Quantifiers are not commutative
The order cannot be interchanged
Similar to a query
Height, …
Checking?
membership of an element
whether it is a set or other objects
Hence we want to define the followings
Constant symbol:
{}
Predicates:
Set, Member, Subset
Functions:
Adjoining, Union, Intersection
The domain of lists
Lists are similar to sets
difference?
Lists are ordered
An element can appear more than once
and so on.
and so on.
Defining environments
Objects in the environment
squares
pits