Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Examples Example
1
Checking interpretations Proofs – natural deduction
Example Example
2
Example solution Example solution
z Although the third sentence is entailed by the first two, we needed an z In FOL, variables refer to things in the world.
explicit symbol, R, to represent an individual, Confucius, who is a The variables can be quantified – talk about
member of the classes “person” and “mortal”
all of them or some of them without naming
z To represent other individuals we must introduce separate symbols for
each one, with some way to represent the fact that all individuals who
them specifically.
are “people” are also “mortal”
3
FOL motivation FOL
z Statements that cannot be made in PL:
z When a block is being painted with a green paint,
it becomes green.
z In PL a statement about every single block will be
needed as general statements about all blocks cannot
be made.
z When a jar is sterilized, all bacteria are dead.
z In FOL we talk about all bacteria without naming them
explicitly.
z A person is allowed in the Portal if they have
access.
z If the car belongs to John, then it is green. z Winston did not write Hamlet.
~write( winston, hamlet)
∀X car( X) ∧ owns(john, X) → color(X, green)
z Nobody wrote Hamlet.
z John plays the piano or the violin
~∃X write( X, hamlet)
plays(john, piano) ∨ plays(john, violin)
z Some people like snakes. z Every city has a dogcatcher who has been bitten by every
∃X (person(X) ∧ likes(X, snakes)) dog in town
∃X (person(X) ∧ ∀Y (snake(Y) → likes(X, Y))) ∀X {city(X) →∃Y{dogcatcher(Y, Z) ∧ ∀Z{[dog(Z)
z All students take exams ∧ live- in(Z, X)] → bit(Z, Y)}}}
∀X student(X) → take-exam(X) Try X=NY, Y=Dan,
Z=Fido
∀X student(X) → (∃Y exam(Y) ∧ take (X, Y))
4
FOL semidecidability
z Semidecidability of predicate logic
z (∀xP(x) ⇒ ∃yP(y)) is a tautology (statement always true
regardless of its components);
z its negation, (∀xP(x) ∧ —∃yP(y)) is an inconsistency.
z A formula is consistent if, and only if, it is true under at least one
interpretation. Every tautology is a consistent formula, but not
vice versa.
z In predicate logic: infinite number of domains; infinite number of
elements; infinite number of interpretations of a formula. Cannot
show that a formula is a tautology or an inconsistency by
evaluating it under all interpretations. In predicate logic there
exists no general proof procedure that will prove a goal G if G is
a theorem, and that will disprove G if G is not a theorem. So
predicate logic is said to be semidecidable.
z Introduction
if P is true and Q is true
then P ∧ Q is true
Unification Substitution
z In propositional calculus, two expressions match or are the z To make, say p( X, X) and p( Y, Z) match, we may use
same only if they are syntactically identical: X/ Y - X substitute for Y
e. g., P ∧ (Q ∨ R) → S = P ∧ (Q ∨ R) → S X/ Z - X substitute for Z
≠ P ∧ (S ∧ Q) → R
z variables in predicate calculus complicates matters. sometimes, we may need to substitute a function for a variable:
human(X) = human(socrates) if X=socrates e. g., human( X) → mortal( X)
human(father_ of( plato))
z Unification is an algorithm for determining the substitutions father_ of( plato)/ X
needed to make two predicate calculus expressions match.
z Unification and inference rules allows us to make inferences human(father_ of( plato)) → mortal(father_ of( plato))
on a set of logical assertions. To do this, the logical data
base must be expressed in an appropriate form.
5
Substitution (cont.) Substitution (cont.)
Substitution (cont.)
6
Continuation to conversion Conversion
z Step four is to skolemize, named after a logician called Thoralf
Skolem.
z Imagine that you have a sentence that looks like: there exists an
x such that P(x). The goal here is to somehow arrive at a
representation that doesn't have any quantifiers in it.
z The Skolem insight is that when you have an existential
quantification like this, you're saying there is such a thing as a
unicorn, let's say that P means "unicorn". There exists a thing
such that it's a unicorn. You can just say, all right, well, if there is
one, let's call it Fred. That's it. That's what Skolemization is.
z So instead of writing exists an x such that P(x), you say P(Fred).
The trick is that it absolutely must be a new name. It can't be any
other name of any other thing that you know about. If you're in
the process of inferring things about John and Mary, then it's not
good to say, oh, there's a unicorn and it's John --because that's
adding some information to the picture. So to Skolemize, in the
simple case, means to substitute a brand-new name for each
existentially quantified variable.
Substitutions Unifications
7
Most general unifier Unifications
z In unification, we are interested in ways of
making expressions equivalent, in every
interpretation of the constant and function
symbols.