The Language of First Order Logic (FOL) - PowerPoint PPT Presentation

1 / 50
About This Presentation
Title:

The Language of First Order Logic (FOL)

Description:

We will not concentrate on FOL's 'lexical stock' but will rather address its ... We need metaphysics and mental modeling for. more than that. ... – PowerPoint PPT presentation

Number of Views:69
Avg rating:3.0/5.0
Slides: 51
Provided by: sergeini
Category:

less

Transcript and Presenter's Notes

Title: The Language of First Order Logic (FOL)


1
The Language of First Order Logic (FOL)
2
FOL is the simplest formal language in which to
encode knowledge. We will not concentrate on
FOLs lexical stock but will rather address
its syntax What expressions in FOL are
well-formed? What subset of these
expressions are FOL sentences (and not, say,
noun phrases)? semantics What do the
well-formed expressions mean? What idea about
the real world is
expressed? pragmatics How are meaningful
expressions in FOL used? Its cold here
might be a statement or an implicit
request.
3
  • Syntax
  • FOL has logical and nonlogical symbols.
  • Logical symbols include
  • punctuation (parentheses and a period)
  • connectives (,?,?,?,?, is
    logical equality)
  • variables (x, y, etc.)

4
  • Nonlogical symbols are
  • function symbols (written in
    uncapitalized mixed case,
  • e.g., bestFriend)
  • predicate symbols (written in
    capitalized mixed case,
  • e.g., Between)
  • Nonlogical symbols have an arity, the number of
    arguments they take.
  • Function symbols of arity 0 are called constants.
  • Predicate symbols of arity 0 are sometimes called
    propositional symbols.

5
For example, Dog is a predicate symbol of
arity 1. OlderThan is a predicate symbol of arity
2. bestFriend is a function symbol of arity
1. johnSmith is a function symbol of arity 0, a
constant
6
  • Legal Syntactic Expressions in FOL terms and
    formulas.
  • Terms refer to elements of the world. Formulas
    express propositions.
  • Terms are defined as follows
  • every variable is a term
  • if t1, , tn are terms and f is a
    function symbol of arity n,
  • then f(t1, , tn) is a term
  • Formulas are defined as follows
  • if t1, , tn are terms and P is a
    predicate symbol of arity n, then P(t1,
    , tn) is a formula
  • if t1 and t2 are terms, then t1 tn is a
    formula
  • if ? and ? are formulas, and x is a
    variable, then ?, (? ? ?), (? ? ?),
    ?x.? and ?x.? are formulas.
  • The first two types of formulas are are atoms.

7
The propositional subset of FOL is a language
with no terms, no quantifiers and using only
propositional symbols (predicates of arity
0). For example, (P ?(Q ?R), where P, Q and
R are propositional symbols, would be a formula
in it. Abbreviations (? ? ?) is a shorthand
for (? ? ?), (? ? ?) is a shorthand for ((? ?
?) ? (? ? ?))
8
Scope of Quantifiers A variable occurrence is
bound in a formula is bound if it lies within
the scope of a quantifier and free otherwise.
That is, x is bound if it appears in a
subformula ?x.? or ?x.? of the formula. For
example, in the formula ?y.P(x) ? ?xP(y) ?
Q(x), the first occurrence of the variable x is
free and the final two are bound (though the x
right after the existential quantifier should
probably not count as an occurrence).
9
A sentence of FOL is any formula without free
variables.
10
Semantics The question is what do the
sentences in FOL mean? This FOL cannot answer
because the meaning of nonlogical symbols cannot
be determined in FOL. So, the most that FOL
semantics can do in analyzing the semantics of
Happy(john) is to say that there is an individual
named John (it could be somebodys car) and that
it has the property Happy (which can be defined
as having 4 wheels). Logical semantics
specifies meanings of sentences as a function of
the interpretation of the predicates and function
symbols. This interpretation is extraneous to
the logic world.
11
An interpretation is a pair D, I, where D is
any nonempty set of objects called the domain of
interpretation and I is the interpretational
mapping from the nonlogical symbols to functions
and relations over D. For predicate symbols,
IP is an n-ary relation (n being the arity of
the predicate symbol) over D e.g., IDog is
some subset of D - quite possibly (but not
necessarily!) the set of all dogs in D. For
function symbols, IP is an n-ary function over
D e.g., IbestFriend will be a function that
might map a person to his or her best friend
(and does something reasonable with nonpersons).
For the propositional subset of FOL one can
ignore D completely and think of an
interpretation as being a mapping from
propositional symbols to a very simple world
where only true and false exist.
12
  • Denotation
  • Given an interpretation D,I we can specify
    which elements of D are
  • denoted by any variable-free term of FOL. To find
    the object(s) denoted
  • by the term bestFriend(johnSmith) in the
    interpretation, we first determine
  • what function is denoted by bestFriend in I and
    then apply that function
  • to the element of D denoted by johnSmith. The
    result will be some element
  • of D.
  • If we want to interpret terms that include
    variables, we need to carry
  • out variable assignment over D, that is, a
    mapping from the variables of FOL
  • to the elements of D. So, if ? is a variable
    assignment and x is a variable,
  • ?(x) will be some element of the domain.
  • Given an interpretation D,I and a variable
    assignment ?, the denotation of
  • term t, written tD,I, ? is defined as
    follows
  • if x is a variable, then xD,I,? ?(x)
  • if t1, , tn are terms and f is a function of
    arity n, then

13
What sentences in FOL are true and what sentences
are false according to an interpretation? Heres
how its formulated Dog(bestFriend(johnSmith)))
is true in an interpretation only if when we use
the interpretational mapping I to get hold of the
subset of D denoted by Dog and, separately, of
the subset of D denoted by (bestFriend(johnSmith))
, then these subsets are the same set. In
general, we talk about formulas being satisfied
in an interpretation, given an interpretation
and a variable binding. The corresponding
symbol is D,I,? a means that a is
satisfied in the interpretation and the
variable binding.
14
When the formula a is a sentence, satisfaction
does not depend on a given variable assignment
(sentences dont have free variables). In this
case, we write D,I a and say that a is true
in the interpretation. (Otherwise, a will be
false). In the propositional subset of FOL
truth/falsity is sometimes written using 0 for
false and 1 for true. Another notation is D,I
S, where S is a set of sentences. This
means that all sentences in S are true in the
interpretation. In this case, we say that D,I
is a logical model of S.
15
Pragmatics How do we use FOL to represent
knowledge? How does a system reason about
concepts like DemocraticCountry unless it is
somehow given the intended interpretation? How
does one give a realistic interpretation to a
complex world? Well, the real answer is that
logic gives only a stylized answer to these
questions. We need metaphysics and mental
modeling for more than that. BL proceed to
discuss the above questions by introducing
the notion of logical consequence.
16
Logical Consequence While semantic
interpretation rules depend on the
external interpretation of nonlogical symbols,
there are connections among sentences of FOL that
do not depend on the meaning of those symbols.
For example, if a and b are any two sentences
of FOL and g is the sentence (b ?a) and ? is
any interpretation in which a is true, then g is
also true under ?. This finding does not depend
on the meaning of any nonlogical symbol in any
of the formulas. We say that g is a logical
consequence of a or that a logically entails g.
An alternative definition of entailment is that
there is no interpretation ? where ? S ? a,
or that the set S ? a is unsatisfiable.
17
Our goal is a system that can reason. We want a
system that, given the fact that Fido is a dog,
would be able to conclude that Fido is a
mammal, a carnivore, etc. In other words, if
the system is given that the sentence Dog(fido)
is true in some user-intended interpretation, it
will assert other sentences that are true in this
interpretation. But a knowledge-based system
cannot directly access an interpretation of
non-logical symbols. It will not be able to
decide on truth or falsity of a set of sentences
and this information is impossible to give it
from the outside (in part, because there is an
infinite set of such sentences). What the system
does know is that if a set of sentences S entails
a sentence a, then - whatever the interpretation
- if S is true in it then so is a. If Dog(fido)
is true, then Dog(fido) ? happy(John) is true,
too.
18
Well, problem is, such conclusions are not very
exciting or useful Logical entailment gets us
nowhere since all we are doing is
finding sentences that are already implicit in
what we were told. Indeed, what we seek are not
logical entailments -- concluding, e.g., that
Fido is a mammal given that Fido is a dog. There
can be interpretations in which Dog(fido) is
true and Mammal(fido) is false (BL p.24). To
get to the desired state of affairs, we need to
include within the set of sentences S a statement
logically connecting the nonlogical symbols
involved ?x.Dog(x) ? Mammal(x)
19
This way we can make lots of nonlogical knowledge
into logical knowledge. The more knowledge like
this is added to S (S will be known from now on
as the knowledge base), the more unintended
interpretations will be eliminated. By and by,
logical consequence will start behaving much more
like truth in the intended interpretation.
20
The fundamental tenet of knowledge representation
(according to BG) Reasoning based on logical
consequence only allows safe, logically guaranteed
conclusions to be drawn. However, by starting
with a rich collection of sentences as given
premises, including not only facts about
particulars of an intended application but also
those expressing connections among the
nonlogical symbols involved, the set of entailed
conclusions becomes much richer, closer to the
set of sentences true in the intended
interpretation. Calculating these entailments
thus becomes more like a form of reasoning we
would expect of someone who understood the
meaning of the terms involved. We will extend
this tenet later to include the idea of modeling
the meaning of terms.
21
Explicit and Implicit Belief The role of a
knowledge representation system is to calculate
entailments in a knowledge base (KB). The KB
contains the beliefs of the system that are
explicitly listed. Entailments can thus be viewed
as beliefs that are listed implicitly.
Calculating implicit beliefs is not a trivial
task.
22
Query Is there a green block on top of a
nongreen block?
a
Answer is not immediately obvious. Let a, b, and
c be the blocks. Let G be a predicate symbol
meaning green Let O be a predicate symbol
meaning on The facts in S (the KB) are S
O(a,b), O(b,c), G(a), G(c) We claim that S
a, where a is ?x?y. G(x) ? G(y) ? O(x,y)
b
?
c
not green
23
To prove this, we need to show that any
interpretation that satisfies S also satisfies a.
Let ? be any interpretation, and assume that ?
S. Case 1. Suppose ? G(b). then ? G(b)
? G(c) ? O(b,c) (because G(c)
and O(b,c) are also in S). It
follows that ?x?y. G(x) ? G(y) ? O(x,y) Case 2.
Suppose that it is not the case that ? G(b).
This means that ? G(b). Since
G(a) and O(a,b) are in S, ? G(a) ? G(b) ?
O(a,b). It follows that ?x?y. G(x) ? G(y) ?
O(x,y) Therefore, a is a logical consequence of
S.
24
Even this simple example shows that calculating
implicit knowledge is not trivial. It is well
known that for FOL the problem of determining
whether one sentence is a logical consequence of
others is in general unsolvable. No automated
procedure can decide validity in all cases.
25
Knowledge-Based Systems Summary For KR, we will
start with a KB representing what is explicitly
known by a KBS - either by having been told or
through perception and learning. Our goal is to
learn to influence the behavior of the overall
system on the basis of what is implicit in the
KB. This will require reasoning. The preferred
logical method is deductive inference, which is
the process of calculating the entailments of a
KB. A reasoning process is logically sound if
every conclusion it makes is a logical
consequence. Nothing that is not strictly
entailed counts. Cf. precision in IR. A
reasoning process is logically complete if it is
guaranteed to produce a whenever a is entailed.
Cf. recall in IR. One problem is that sound and
complete reasoning processes are usually not very
useful in practice
26
FOL is simple and should be viewed as a first
step in the study of reasoning. FOL is
computationally complex, which has led to
considering other KR solutions. Another source
of dissatisfaction with FOL is that it does
not address the meaning of terms.
27
(No Transcript)
28
(No Transcript)
29
(No Transcript)
30
(No Transcript)
31
(No Transcript)
32
(No Transcript)
33
(No Transcript)
34
(No Transcript)
35
(No Transcript)
36
(No Transcript)
37
(No Transcript)
38
(No Transcript)
39
(No Transcript)
40
(No Transcript)
41
(No Transcript)
42
(No Transcript)
43
(No Transcript)
44
(No Transcript)
45
(No Transcript)
46
(No Transcript)
47
(No Transcript)
48
(No Transcript)
49
(No Transcript)
50
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com