The Language of First-Order Logic
The Language of First-Order Logic
The Language of
First-order Logic
KR & R
17
Declarative language
Before building system
before there can be learning, reasoning, planning,
explanation ...
18
Alphabet
Logical symbols:
Punctuation: (, ), .
Connectives: , , , , , =
Variables: x, x1, x2, ..., x', x", ..., y, ..., z, ...
Fixed meaning and use
like keywords in a programming language
Non-logical symbols
Note: not treating = as a predicate
KR & R
19
Grammar
Terms
1. Every variable is a term.
2. If t1, t2, ..., tn are terms and f is a function of arity n,
then f(t1, t2, ..., tn) is a term.
Wffs
1. Every atomic wff is a wff.
2. If and are wffs, and v is a variable, then , (), (), v., v.
are wffs.
20
Notation
Occasionally add or omit (,), .
Use [,] and {,} also.
Abbreviations:
( ) for ( )
safer to read as disjunction than as if ... then ...
Non-logical symbols:
Predicates: mixed case capitalized
Person, Happy, OlderThan
Functions (and constants): mixed case uncapitalized
fatherOf, successor,
johnSmith
KR & R
21
Variable scope
Like variables in programming languages, the variables in FOL
have a scope determined by the quantifiers
Lexical scope for variables
P(x) x[P(x) Q(x)]
free
bound
occurrences of variables
22
Semantics
How to interpret sentences?
what do sentences claim about the world?
what does believing one amount to?
So:
make clear dependence of interpretation on non-logical symbols
Logical interpretation:
specification of how to understand predicate and function symbols
Can be complex!
DemocraticCountry, IsABetterJudgeOfCharacterThan,
favouriteIceCreamFlavourOf, puddleOfWater27
KR & R
23
24
Interpretations
Two parts: = D, I
D is the domain of discourse
can be any non-empty set
not just formal / mathematical objects
e.g. people, tables, numbers, sentences, unicorns, chunks of peanut butter,
situations, the universe
I is an interpretation mapping
If P is a predicate symbol of arity n,
I[P] DD...D
25
Denotation
In terms of interpretation , terms will denote elements of the
domain D.
will write element as ||t||
Rules of interpretation:
1. ||v||, = (v).
and
KR & R
di = ||ti||,, recursively
26
Satisfaction
In terms of an interpretation , sentences of FOL will be either
true or false.
Formulas with free variables will be true for some values of the
free variables and false for others.
Notation:
will write as , =
is satisfied by and
or = , when is a sentence
is true under interpretation
27
Rules of interpretation
1. , = P(t1, t2, ..., tn) iff d1, d2, ..., dn R
where R = I[P]
and di = || ti ||,, as on denotation slide
iff I[p] {}
28
Entailment defined
Semantic rules of interpretation tell us how to understand all wffs
in terms of specification for non-logical symbols.
But some connections among sentences are independent of the
non-logical symbols involved.
e.g. If is true under , then so is (),
no matter what is, why is true, what is, ...
S {} is unsatisfiable
iff
|= (1 2 ... n)
29
Why do we care?
We do not have access to user-intended interpretation of nonlogical symbols
But, with entailment, we know that if S is true in the intended
interpretation, then so is .
If the user's view has the world satisfying S, then it must also satisfy .
There may be other sentences true also; but is logically guaranteed.
KR & R
x[Dog(x) Mammal(x)]
Knowledge bases
KB is set of sentences
explicit statement of sentences believed (including any assumed
connections among non-logical symbols)
KB |=
explicit knowledge: KB
implicit knowledge: { | KB |= }
A
B
C
green
non-green
31
A formalization
S = {On(a,b), On(b,c), Green(a), Green(c)}
all that is required
Case 2: | Green(b).
|= Green(b)
|=
KR & R
QED
32
Knowledge-based system
Start with (large) KB representing what is explicitly known
e.g. what the system has been told or has learned
KR & R
33