Ai Fol
Ai Fol
2
Syntax of FOL: Basic
elements
Constants KingJohn, 2, UCI,...
Variables x, y, a, b,...
Connectives , , , ,
Equality =
Quantifiers ,
Propositional logic (PL)
A simple language useful for showing key ideas and
definitions
User defines a set of propositional symbols, like P and Q.
User defines the semantics of each propositional symbol:
P means It is hot
Q means It is humid
R means It is raining
A sentence (well formed formula) is defined as follows:
A symbol is a sentence
If S is a sentence, then S is a sentence
If S is a sentence, then (S) is a sentence
If S and T are sentences, then (S T), (S T), (S T), and (S T)
are sentences
A sentence results from a finite number of applications of the
above rules
5
Some terms
9
User provides
10
FOL Provides
Variable symbols
E.g., x, y, foo
Connectives
Same as in PL: not (), and (), or (),
implies (), if and only if (biconditional )
Quantifiers
Universal x or (Ax)
Existential x or (Ex)
11
Logics in General
Ontological Commitment:
What exists in the world TRUTH
PL : facts hold or do not hold.
FOL : objects with relations between
them that hold or do not hold
Epistemological Commitment:
What an agent believes about facts
BELIEF
Syntax of FOL: Basic
elements
Constant Symbols:
Stand for objects
e.g., KingJohn, 2, UCI,...
Predicate Symbols
Stand for relations
E.g., Brother(Richard, John), greater_than(3,2)...
Function Symbols
Stand for functions
E.g., Sqrt(3), LeftLegOf(John),...
Relations
Some relations are properties: they state
some fact about a single object:
Round(ball), Prime(7).
Student Professor
Intellige Course Populari Teaching-
s-id nce Ranking c-id Rating Difficulty p-id ty a
Jack 3 1 101 3 1 Oliv
Kim 2 1 er 3 1
Paul 1 2 102 2 2 Jim 2 1
Registration
RA Grad Satisfacti
s-id p-id Salary Capability s-id c.id e on
Jack Oliver High 3 Jack 101 A 1
Jack 102 B 2
Kim Oliver Low 1 Kim 102 A 1
Paul Jim Med 2 Pau
l 101 B 1
16
Atomic Sentences
Examples:
LargerThan(2,3) is false.
Brother_of(Mary,Pete) is false.
Married(Father(Richard), Mother(John)) could be true or false
Brother_of(Pete,Brother(Pete)) is True.
logic).
Brother (LeftLeg (Richard ), John ) (Democrat (Bush ))
binary function
relation
objects
connectives
More Examples
Brother(Richard, John) Brother(John, Richard)
King(Richard) King(John)
Allows us to make statements about all objects that have certain properties
Note that
x King(x) Person(x) is not correct!
This would imply that all objects x are Kings and are People
Examples:
x King(x)
x Lives_in(John, Castle(x))
i Integer(i) GreaterThan(i,0)
y x Loves(x,y)
- there is someone (y) who is loved by everyone
In effect:
- is a conjunction over the universe of objects
- is a disjunction over the universe of objects
Thus, DeMorgans rules can be applied
De Morgans Law for Quantifiers
x , Person
We also want (x )things to the KB,
to ASK
ASK(KB, )
9.
10.
11.
12.
Example: A simple genealogy KB by FOL
36
Summary
First-order logic:
Much more expressive than propositional logic
Allows objects and relations as semantic primitives
Universal and existential quantifiers
syntax: constants, functions, predicates, equality,
quantifiers
Knowledge engineering using FOL
Capturing domain knowledge in logical form