First Order Logic - PowerPoint PPT Presentation

1 / 51
About This Presentation
Title:

First Order Logic

Description:

Can't directly talk about properties of individuals or relations between individuals. ... Objects, which are things with individual identities ... – PowerPoint PPT presentation

Number of Views:85
Avg rating:3.0/5.0
Slides: 52
Provided by: JeanClaud83
Category:
Tags: first | identities | logic | order | pis

less

Transcript and Presenter's Notes

Title: First Order Logic


1
First Order Logic
  • Russell and Norvig
  • Chapters 8 and 9
  • CMSC421 Fall 2005

2
Propositional logic is a weak language
  • Hard to identify individuals. E.g., Mary, 3
  • Cant directly talk about properties of
    individuals or relations between individuals.
    E.g. Bill is tall
  • Generalizations, patterns, regularities cant
    easily be represented. E.g., all triangles have 3
    sides
  • First-Order Logic (abbreviated FOL or FOPC) is
    expressive enough to concisely represent this
    kind of situation.
  • FOL adds relations, variables, and quantifiers,
    e.g.,
  • Every elephant is gray ? x (elephant(x) ?
    gray(x))
  • There is a white alligator ? x (alligator(X)
    white(X))

3
Example
  • Consider the problem of representing the
    following information
  • Every person is mortal.
  • Confucius is a person.
  • Confucius is mortal.
  • How can these sentences be represented so that we
    can infer the third sentence from the first two?

4
Example cont.
  • In PL we have to create propositional symbols to
    stand for all or part of each sentence. For
    example, we might do
  • P person Q mortal R Confucius
  • so the above 3 sentences are represented as
  • P gt Q R gt P R gt Q
  • Although the third sentence is entailed by the
    first two, we needed an explicit symbol, R, to
    represent an individual, Confucius, who is a
    member of the classes person and mortal.
  • To represent other individuals we must introduce
    separate symbols for each one, with means for
    representing the fact that all individuals who
    are people are also "mortal.

5
Problems with the propositional Wumpus hunter
  • Lack of variables prevents stating more general
    rules.
  • E.g., we need a set of similar rules for each
    cell
  • Change of the KB over time is difficult to
    represent
  • Standard technique is to index facts with the
    time when theyre true
  • This means we have a separate KB for every time
    point.

6
First-order logic
  • First-order logic (FOL) models the world in terms
    of
  • Objects, which are things with individual
    identities
  • Properties of objects that distinguish them from
    other objects
  • Relations that hold among sets of objects
  • Functions, which are a subset of relations where
    there is only one value for any given input
  • Examples
  • Objects Students, lectures, companies, cars ...
  • Relations Brother-of, bigger-than, outside,
    part-of, has-color, occurs-after, owns, visits,
    precedes, ...
  • Properties blue, oval, even, large, ...
  • Functions father-of, best-friend, second-half,
    one-more-than ...

7
A BNF for FOL
  • S ltSentencegt
  • ltSentencegt ltAtomicSentencegt
  • ltSentencegt ltConnectivegt ltSentencegt
  • ltQuantifiergt ltVariablegt,... ltSentencegt
  • "NOT" ltSentencegt
  • "(" ltSentencegt ")"
  • ltAtomicSentencegt ltPredicategt "(" ltTermgt, ...
    ")"
  • ltTermgt "" ltTermgt
  • ltTermgt ltFunctiongt "(" ltTermgt, ... ")"
  • ltConstantgt
  • ltVariablegt
  • ltConnectivegt "AND" "OR" "IMPLIES"
    "EQUIVALENT"
  • ltQuantifiergt "EXISTS" "FORALL"
  • ltConstantgt "A" "X1" "John" ...
  • ltVariablegt "a" "x" "s" ...
  • ltPredicategt "Before" "HasColor" "Raining"
    ...
  • ltFunctiongt "Mother" "LeftLegOf" ...

8
Domain of Discourse
  • Constant symbols, which represent individuals in
    the world
  • Mary
  • 3
  • Green
  • Function symbols, which map individuals to
    individuals
  • father-of(Mary) John
  • color-of(Sky) Blue
  • Predicate symbols, which map individuals to truth
    values
  • greater(5,3)
  • green(Grass)
  • color(Grass, Green)

9
FOL Syntax
  • Variable symbols
  • E.g., x, y, foo
  • Connectives
  • Same as in PL not (), and (), or (v), implies
    (gt), if and only if (ltgt)
  • Quantifiers
  • Universal ?x or (Ax)
  • Existential ?x or (Ex)

10
Quantifiers
  • Universal quantification
  • (?x)P(x) means that P holds for all values of x
    in the domain associated with that variable
  • E.g., (?x) dolphin(x) gt mammal(x)
  • Existential quantification
  • (? x)P(x) means that P holds for some value of x
    in the domain associated with that variable
  • E.g., (? x) mammal(x) lays-eggs(x)
  • Permits one to make a statement about some object
    without naming it

11
Sentences and WFFs
  • A term (denoting a real-world individual) is a
    constant symbol, a variable symbol, or an n-place
    function of n terms.
  • x and f(x1, ..., xn) are terms, where each xi is
    a term.
  • A term with no variables is a ground term
  • An atomic sentence (which has value true or
    false) is either
  • an n-place predicate of n terms, or, term term
  • A sentence is
  • an atomic sentence
  • P(x) , P(x) ? Q(y), P(x) Q(y), P(x) gtQ(y),
    P(x) ltgt Q(y) where P(x) and Q(y) are sentences
  • if P (x) is a sentence and x is a variable, then
    (?x)P(x) and (?x)P(x) are sentences
  • A well-formed formula (wff) is a sentence
    containing no free variables. i.e., all
    variables are bound by universal or existential
    quantifiers.
  • (?x)R(x,y) has x bound as a universally
    quantified variable, but y is free.

12
Quantifiers
  • Universal quantifiers are often used with
    implies to form rules
  • (?x) student(x) gt smart(x) means All students
    are smart
  • Universal quantification is rarely used to make
    blanket statements about every individual in the
    world
  • (?x)student(x)smart(x) means Everyone in the
    world is a student and is smart
  • Existential quantifiers are usually used with
    and to specify a list of properties about an
    individual
  • (?x) student(x) smart(x) means There is a
    student who is smart
  • A common mistake is to represent this English
    sentence as the FOL sentence
  • (?x) student(x) gt smart(x)

Whats the problem?
13
Quantifier Scope
  • Switching the order of universal quantifiers does
    not change the meaning
  • (?x)(?y)P(x,y) ltgt (?y)(?x) P(x,y)
  • Similarly, you can switch the order of
    existential quantifiers
  • (?x)(?y)P(x,y) ltgt (?y)(?x) P(x,y)
  • Switching the order of universals and existential
    does change meaning
  • Everyone likes someone (?x)(?y) likes(x,y)
  • Someone is liked by everyone (?y)(?x) likes(x,y)

14
Connections between All and Exists
  • We can relate sentences involving ? and ? using
    De Morgans laws
  • (?x) P(x)ltgt (?x) P(x)
  • (?x)P(x) ltgt (?x) P(x)
  • (?x) P(x) ltgt (?x) P(x)
  • (?x) P(x) ltgt (?x) P(x)

15
Translating English to FOL
  • Every gardener likes the sun.
  • (?x) gardener(x) gt likes(x,Sun)
  • All purple mushrooms are poisonous.
  • (?x) (mushroom(x) purple(x)) gt poisonous(x)
  • No purple mushroom is poisonous.
  • (?x) purple(x) mushroom(x) poisonous(x)
  • (?x) (mushroom(x) purple(x)) gt poisonous(x)
  • There are exactly two purple mushrooms.
  • (?x)(?y) mushroom(x) purple(x) mushroom(y)
    purple(y) (xy) (Az) (mushroom(z)
    purple(z)) gt ((xz) v (yz))
  • Harry is not tall.
  • tall(Harry)
  • X is above Y if X is on directly on top of Y or
    there is a pile of one or more other objects
    directly on top of one another starting with X
    and ending with Y.
  • (?x)(?y) above(x,y) ltgt (on(x,y) v (?z) (on(x,z)
    above(z,y)))
  • You can fool some of the people all of the time.
  • (?x) (?t) can-fool(x,t)
  • (?x) (person(x) ((?t)( time(t) gt
    can-fool(x,t))))
  • You can fool all of the people some of the time.
  • (?x)(?t) can-fool(x,t)
  • (?x) (person(x) gt ((?t) time(t)
    can-fool(x,t)))

16
Axioms, definitions and theorems
  • Axioms are facts and rules that attempt to
    capture all of the (important) facts and concepts
    about a domain axioms can be used to prove
    theorems
  • Mathematicians dont want any unnecessary
    (dependent) axioms ones that can be derived from
    other axioms
  • Dependent axioms can make reasoning faster,
    however
  • Choosing a good set of axioms for a domain is a
    kind of design problem
  • A definition of a predicate is of the form p(X)
    ltgt and can be decomposed into two parts
  • Necessary description p(x) gt
  • Sufficient description p(x) lt
  • Some concepts dont have complete definitions
    (e.g., person(x))

17
Axioms for Set Theory in FOL
  • 1. The only sets are the empty set and those made
    by adjoining something to a set
  • ?s set(s) ltgt (sEmptySet) v (?x,r Set(r)
    sAdjoin(s,r))
  • 2. The empty set has no elements adjoined to it
  • ?x,s Adjoin(x,s)EmptySet
  • 3. Adjoining an element already in the set has no
    effect
  • ?x,s Member(x,s) ltgt sAdjoin(x,s)
  • 4. The only members of a set are the elements
    that were adjoined into it
  • ?x,s Member(x,s) ltgt ?y,r (sAdjoin(y,r) (xy
    ? Member(x,r)))
  • 5. A set is a subset of another iff all of the
    1st sets members are members of the 2nd
  • ?s,r Subset(s,r) ltgt (?x Member(x,s) gt
    Member(x,r))
  • 6. Two sets are equal iff each is a subset of the
    other
  • ?s,r (sr) ltgt (subset(s,r) subset(r,s))
  • 7. Intersection
  • ?x,s1,s2 member(X,intersection(S1,S2)) ltgt
    member(X,s1) member(X,s2)
  • 8. Union
  • ?x,s1,s2 member(X,union(s1,s2)) ltgt member(X,s1)
    ? member(X,s2)

18
Aside Higher-order logic
  • In FOL, variables can only range over objects
  • HOL allows us to quantify over relations
  • More expressive, but undecidable
  • Example
  • two functions are equal iff they produce the
    same value for all arguments
  • ?f ?g (f g) ltgt (?x f(x) g(x))
  • Example
  • ?r transitive( r ) ltgt (?x?y?z r(x,y) r(y,z) gt
    r(x,z))

19
Tarskis World
  • http//www-csli.stanford.edu/hp/Tarski1.html

20
Notational differences
  • Different symbols for and, or, not, implies, ...
  • ? ? ? ? ? ? ? ? ?
  • p v (q r)
  • p (q r)
  • etc
  • Prolog
  • cat(X) - furry(X), meows (X), has(X, claws)
  • Lispy notations
  • (forall ?x (implies (and (furry ?x)
  • (meows ?x)
  • (has ?x claws))
  • (cat ?x)))

21
Inference in first-order logic
  • Inference rules
  • Forward chaining
  • Backward chaining
  • Resolution
  • Unification
  • Proofs
  • Clausal form
  • Resolution as search

22
Inference rules for FOL
  • Inference rules for propositional logic apply to
    FOL as well
  • Modus Ponens, etc.
  • New (sound) inference rules for use with
    quantifiers
  • Universal elimination
  • Existential introduction
  • Existential elimination
  • Generalized Modus Ponens (GMP)

23
Universal elimination
  • If (?x) P(x) is true, then P(c) is true, where c
    is any constant in the domain of x
  • Example
  • (?x) eats(Ziggy, x)
  • eats(Ziggy, IceCream)
  • The variable symbol can be replaced by any ground
    term, i.e., any constant symbol or function
    symbol applied to ground terms only

24
Existential introduction
  • If P(c) is true, then (?x) P(x) is inferred.
  • Example
  • eats(Ziggy, IceCream)
  • (?x) eats(Ziggy,x)
  • All instances of the given constant symbol are
    replaced by the new variable symbol
  • Note that the variable symbol cannot already
    exist anywhere in the expression

25
Existential elimination
  • From (?x) P(x) infer P(c)
  • Example
  • (?x) eats(Ziggy, x)
  • eats(Ziggy, Stuff)
  • Note that the variable is replaced by a brand-new
    constant not occurring in this or any other
    sentence in the KB
  • Also known as skolemization constant is a skolem
    constant
  • In other words, we dont want to accidentally
    draw other inferences about it by introducing the
    constant
  • Convenient to use this to reason about the
    unknown object, rather than constantly
    manipulating the existential quantifier

26
Generalized Modus Ponens (GMP)
  • Apply modus ponens reasoning to generalized rules
  • Combines And-Introduction, Universal-Elimination,
    and Modus Ponens
  • E.g, from P(c) and Q(c) and (?x)(P(x) Q(x)) gt
    R(x) derive R(c)
  • General case Given
  • atomic sentences P1, P2, ..., PN
  • implication sentence (Q1 Q2 ... QN) gt R
  • Q1, ..., QN and R are atomic sentences
  • substitution subst(?, Pi) subst(?, Qi) for
    i1,...,N
  • Derive new sentence subst(?, R)
  • Substitutions
  • subst(?, a) denotes the result of applying a set
    of substitutions defined by ? to the sentence a
  • A substitution list ? v1/t1, v2/t2, ...,
    vn/tn means to replace all occurrences of
    variable symbol vi by term ti
  • Substitutions are made in left-to-right order in
    the list
  • subst(x/IceCream, y/Ziggy, eats(y,x))
    eats(Ziggy, IceCream)

27
Automated inference for FOL
  • Automated inference using FOL is harder than PL
  • Variables can potentially take on an infinite
    number of possible values from their domains
  • Hence there are potentially an infinite number of
    ways to apply the Universal-Elimination rule of
    inference
  • Godel's Completeness Theorem says that FOL
    entailment is only semidecidable
  • If a sentence is true given a set of axioms,
    there is a procedure that will determine this
  • If the sentence is false, then there is no
    guarantee that a procedure will ever determine
    thisi.e., it may never halt

28
Completeness of some inference techniques
  • Truth Tabling
  • is not complete for FOL because truth table size
    may be infinite
  • Generalized Modus Ponens
  • is not complete for FOL
  • Generalized Modus Ponens is complete for KBs
    containing only Horn clauses
  • Resolution Refutation
  • is complete for FOL

29
Horn clauses (again)
  • A Horn clause is a sentence of the form
  • (?x) P1(x) P2(x) ... Pn(x) gt Q(x)
  • where
  • there are 0 or more Pis and 0 or 1 Q
  • the Pis and Q are positive (i.e., non-negated)
    literals
  • Equivalently P1(x) ? P2(x) ? Pn(x) where the
    Pis are all atomic and at most one of them is
    positive
  • Prolog is based on Horn clauses
  • Horn clauses represent a subset of the set of
    sentences representable in FOL

30
Horn clauses II
  • Special cases
  • P1 P2 Pn gt Q
  • P1 P2 Pn gt false
  • true gt Q
  • These are not Horn clauses
  • p(a) ? q(a)
  • P Q gt R ? S

31
Unification
  • Unification is a pattern-matching procedure
  • Takes two atomic sentences as input
  • Returns Failure if they do not match and a
    substitution list, ?, if they do
  • That is, unify(p,q) ? means subst(?, p)
    subst(?, q) for two atomic sentences, p and q
  • ? is called the most general unifier (mgu)
  • All variables in the given two literals are
    implicitly universally quantified
  • To make literals match, replace (universally
    quantified) variables by terms

32
Unification algorithm
  • procedure unify(p, q, ?)
  • Scan p and q left-to-right and find the
    first corresponding
  • terms where p and q disagree (i.e., p
    and q not equal)
  • If there is no disagreement, return ?
    (success!)
  • Let r and s be the terms in p and q,
    respectively,
  • where disagreement first occurs
  • If variable(r) then
  • Let ? union(?, r/s)
  • Recurse and return unify(subst(?, p),
    subst(?, q), ?)
  • else if variable(s) then
  • Let ? union(?, s/r)
  • Recurse and return unify(subst(?, p),
    subst(?, q), ?)
  • else return Failure
  • end

33
Unification Remarks
  • Unify is a linear-time algorithm that returns the
    most general unifier (mgu), i.e., the
    shortest-length substitution list that makes the
    two literals match.
  • In general, there is not a unique minimum-length
    substitution list, but unify returns one of
    minimum length
  • A variable can never be replaced by a term
    containing that variable
  • Example x/f(x) is illegal.
  • This occurs check should be done in the above
    pseudo-code before making the recursive calls

34
Unification examples
  • Example
  • parents(x, father(x), mother(Bill))
  • parents(Bill, father(Bill), y)
  • x/Bill, y/mother(Bill)
  • Example
  • parents(x, father(x), mother(Bill))
  • parents(Bill, father(y), z)
  • x/Bill, y/Bill, z/mother(Bill)
  • Example
  • parents(x, father(x), mother(Jane))
  • parents(Bill, father(y), mother(y))
  • Failure

35
Forward chaining in FOL
  • Proofs start with the given axioms/premises in
    KB, deriving new sentences using GMP until the
    goal/query sentence is derived
  • This defines a forward-chaining inference
    procedure because it moves forward from the KB
    to the goal
  • Inference using GMP is complete for KBs
    containing only Horn clauses

36
Forward Chaining Example
  • KB
  • If allergies(X) then sneeze(X)
  • If cat(Y) and allergic-to-cats(X) then
    allergies(X)
  • cat(Felix)
  • allergic-to-cats(Lise)
  • Conclude
  • sneeze(Lise)

37
Forward chaining algorithm
38
Backward chaining in FOL
  • Backward-chaining deduction using GMP is complete
    for KBs containing only Horn clauses
  • Proofs start with the goal query, find
    implications that would allow you to prove it,
    and then prove each of the antecedents in the
    implication, continuing to work backwards until
    you arrive at the axioms, which we know are true

39
Backward Chaining Example
  • KB
  • If allergies(X) then sneeze(X)
  • If cat(Y) and allergic-to-cats(X) then
    allergies(X)
  • cat(Felix)
  • allergic-to-cats(Lise)
  • Goal
  • sneeze(Lise)

40
Backward chaining algorithm
41
Completeness of GMP for HC
  • GMP (using forward or backward chaining) is
    complete for KBs that contain only Horn clauses
  • It is not complete for simple KBs that contain
    non-Horn clauses
  • The following entail that S(A) is true
  • (?x) P(x) gt Q(x)
  • (?x) P(x) gt R(x)
  • (?x) Q(x) gt S(x)
  • (?x) R(x) gt S(x)
  • If we want to conclude S(A), with GMP we cannot,
    since the second one is not a Horn form
  • It is equivalent to P(x) ? R(x)

42
Resolution
  • Resolution is a sound and complete inference
    procedure for FOL
  • Resolution Rule for PL
  • P1 ? P2 ? ... ? Pn
  • P1 ? Q2 ? ... ? Qm
  • Resolvent P2 ? ... v Pn ? Q2 ? ... ? Qm
  • Examples
  • P and P ? Q, derive Q (Modus Ponens)
  • (P ? Q) and (Q ? R), derive P ? R
  • P and P, derive False contradiction!
  • (P ? Q) and (P ? Q), derive True

43
FOL resolution
  • Given sentences
  • P1 ? ... ? Pn
  • Q1 ? ... ? Qm
  • where each Pi and Qi is a literal, i.e., a
    positive or negated predicate symbol with its
    terms, if Pj and Qk unify with substitution list
    ?, then derive the resolvent sentence
  • subst(?, P1 ?... ? Pj-1 ? Pj1 ... Pn ? Q1 ?
    Qk-1 ? Qk1 ?... ? Qm)
  • Example
  • From clause P(x, f(a)) ? P(x, f(y)) ? Q(y)
  • and clause P(z, f(a)) ? Q(z),
  • derive resolvent clause P(z, f(y)) ? Q(y) ? Q(z)
  • using ? x/z

44
Resolution refutation proofs
  • Given a consistent set of axioms KB and goal
    sentence Q, show that KB Q
  • Proof by contradiction Add Q to KB and try to
    prove false.
  • i.e., (KB - Q) ltgt (KB ? Q - False)
  • Resolution can establish that a given sentence Q
    is entailed by KB, but cant (in general) be used
    to generate all logical consequences of a set
    sentences
  • Also, it cannot be used to prove that Q is not
    entailed by KB.
  • Resolution wont always give an answer since
    entailment is only semidecidable
  • And you cant just run two proofs in parallel,
    one trying to prove Q and the other trying to
    prove Q, since KB might not entail either one

45
Procedure
  • procedure resolution(KB, Q)
  • KB is a set of consistent, true FOL
    sentences, Q is a goal sentence
  • to derive. Returns success if KB -
    Q, and failure otherwise
  • KB union(KB, Q)
  • while false ? KB do
  • Choose 2 sentences, S1 and S2, in KB
    that contain
  • literals that unify
  • if none, return Failure
  • resolvent resolution-rule(S1, S2)
  • KB union(KB, resolvent)
  • return Success
  • end

46
Refutation resolution proof tree
P(w) v Q(w)
Q(y) v S(y)
y/w
P(w) v S(w)
P(x) v R(x)
w/x
S(x) v R(x)
R(z) v S(z)
z/x
S(A)
S(x)
x/A
false
47
Resolution issues
  • Resolution is only applicable to sentences in
    clausal form, e.g.
  • P1 ? P2 ?... ? Pn
  • where Pis are negated or non-negated atomic
    predicates
  • Issues
  • Can we convert every FOL sentence into this form?
  • Yes as we will see shortly
  • How to pick which pair of sentences to resolve?
  • Determines the search strategy of the prover
  • How to pick which pair of literals, one from each
    sentence, to unify?
  • Again, part of the search strategy

48
Example proof, cont. Did Curiosity kill the cat?
  • Convert to implicative normal form
  • A1. True gt Dog(D)
  • A2. True gt Owns(Jack,D)
  • B. Dog(y) Owns(x, y) gt AnimalLover(x)
  • C. AnimalLover(x) Animal(y) Kills(x,y) gt
    False
  • D. True gt Kills(Jack,Tuna) v
    Kills(Curiosity,Tuna)
  • E. True gt Cat(Tuna)
  • F. Cat(x) gt Animal(x)
  • Add the query
  • Q. Kills(Curiosity, Tuna) gt False

49
Example proof III Did Curiosity kill the cat?
  • The Proof
  • G. A1, B, y/D Owns(x,D) gt AnimalLover(x)
  • H. A2, G, x/Jack True gt AnimalLover(Jack)
  • I. E,F, x/Tuna True gt Animal(Tuna)
  • J. C,I, y/Tuna AnimalLover(x) Kills(x,Tuna)
    gt False
  • K. H,J x/Jack Kills(Jack,Tuna) gt False
  • L. D,Q True gt Kills(Jack,Tuna)
  • M. L,K True gt False

50
Curiosity Killed the Cat
51
Converting to clausal form
  • The canonical (standard) form for resolution is
    Conjunctive Normal Form (conjunction of
    disjunctions)
  • Example If Johns house is big, then it is a lot
    of work, unless he has a housekeeper and does not
    have a garden
  • FOL
  • Big(h) House(h,j) gt Work(h) ? (Cleans(c,h)
    Garden(g,h))
  • Implicative Normal Form
  • Big(h) House(h,j) gt Work(h) ? Cleans(c,h)
  • Big(h) House(h,j) Garden(g,h) gt Work(h)

52
Converting FOL sentences to clausal form
  • 1. Eliminate all ltgt connectives
  • (P ltgt Q) gt ((P gt Q) (Q gt P))
  • 2. Eliminate all gt connectives
  • (P gt Q) gt (P v Q)
  • 3. Reduce the scope of each negation symbol to a
    single predicate
  • P gt P
  • (P v Q) gt P Q
  • (P Q) gt P v Q
  • (?x)P gt (?x)P
  • (?x)P gt (?x)P
  • 4. Standardize variables rename all variables so
    that each quantifier has its own unique variable
    name

53
Converting sentences to clausal form Skolem
constants and functions
  • 5. Eliminate existential quantification by
    introducing Skolem constants/functions
  • (?x)P(x) gt P(c)
  • c is a Skolem constant (a brand-new constant
    symbol that is not used in any other sentence)
  • (?x)(?y)P(x,y) gt (?x)P(x, f(x))
  • since ? is within the scope of a universally
    quantified variable, use a Skolem function f to
    construct a new value that depends on the
    universally quantified variable
  • f must be a brand-new function name not occurring
    in any other sentence in the KB.
  • E.g., (?x)(?y)loves(x,y) gt (?x)loves(x,f(x))
  • In this case, f(x) specifies the person that x
    loves

54
Converting FOL sentences to clausal form
  • 6. Remove universal quantifiers by (1) moving
    them all to the left end (2) making the scope of
    each the entire sentence and (3) dropping the
    prefix part
  • Ex (?x)P(x) gt P(x)
  • 7. Distribute v over
  • (P Q) ? R gt (P ? R) (Q ? R)
  • (P ? Q) ? R gt (P ? Q ? R)
  • 8. Split conjuncts into a separate clauses
  • 9. Standardize variables so each clause contains
    only variable names that do not occur in any
    other clause

55
An example
  • (?x)(P(x) gt ((?y)(P(y) gt P(f(x,y)))
    (?y)(Q(x,y) gt P(y))))
  • 2. Eliminate gt
  • (?x)(P(x) ? ((?y)(P(y) ? P(f(x,y)))
    (?y)(Q(x,y) ? P(y))))
  • 3. Reduce scope of negation
  • (?x)(P(x) ? ((?y)(P(y) ? P(f(x,y)))
    (?y)(Q(x,y) P(y))))
  • 4. Standardize variables
  • (?x)(P(x) ? ((?y)(P(y) ? P(f(x,y)))
    (?z)(Q(x,z) P(z))))
  • 5. Eliminate existential quantification
  • (?x)(P(x) ?((?y)(P(y) ? P(f(x,y))) (Q(x,g(x))
    P(g(x)))))
  • 6. Drop universal quantification symbols
  • (P(x) ? ((P(y) ? P(f(x,y))) (Q(x,g(x))
    P(g(x)))))

56
Example
  • 7. Convert to conjunction of disjunctions
  • (P(x) ? P(y) ? P(f(x,y))) (P(x) ? Q(x,g(x)))
    (P(x) ? P(g(x)))
  • 8. Create separate clauses
  • P(x) ? P(y) ? P(f(x,y))
  • P(x) ? Q(x,g(x))
  • P(x) ? P(g(x))
  • 9. Standardize variables
  • P(x) ? P(y) ? P(f(x,y))
  • P(z) ? Q(z,g(z))
  • P(w) ? P(g(w))

57
Example proof Did Curiosity kill the cat?
  • Jack owns a dog. Every dog owner is an animal
    lover. No animal lover kills an animal. Either
    Jack or Curiosity killed the cat, who is named
    Tuna. Did Curiosity kill the cat?
  • The axioms can be represented as follows
  • A. (?x) Dog(x) Owns(Jack,x)
  • B. (?x) ((?y) Dog(y) Owns(x, y)) gt
    AnimalLover(x)
  • C. (?x) AnimalLover(x) gt (?y) Animal(y) gt
    Kills(x,y)
  • D. Kills(Jack,Tuna) ? Kills(Curiosity,Tuna)
  • E. Cat(Tuna)
  • F. (?x) Cat(x) gt Animal(x)

58
Example Did Curiosity kill the cat?
  • Dog(spike)
  • Owns(Jack,spike)
  • Dog(y) v Owns(x, y) v AnimalLover(x)
  • AnimalLover(x1) v Animal(y1) v Kills(x1,y1)
  • Kills(Jack,Tuna) v Kills(Curiosity,Tuna)
  • Cat(Tuna)
  • Cat(x2) v Animal(x2)

59
Example Did Curiosity kill the cat?
  • Dog(spike)
  • Owns(Jack,spike)
  • Dog(y) v Owns(x, y) v AnimalLover(x)
  • AnimalLover(x1) v Animal(y1) v Kills(x1,y1)
  • Kills(Jack,Tuna) v Kills(Curiosity,Tuna)
  • Cat(Tuna)
  • Cat(x2) v Animal(x2)
  • Kills(Curiosity,Tuna) negated goal
  • Kills(Jack,Tuna) 5,8
  • AnimalLover(Jack) V Animal(Tuna) 9,4
    x1/Jack,y1/Tuna
  • Dog(y) v Owns(Jack,y) V Animal(Tuna) 10,3
    x/Jack
  • Owns(Jack,spike) v Animal(Tuna) 11,1
  • Animal(Tuna) 12,2
  • Cat(Tuna) 12,7 x2/Tuna
  • False 14,6

60
FOL in the Realworld
  • Simons prediction 40 years ago In the next 10
    years, a computer will prove a major mathematical
    theorem.
  • Achieved last year
  • Using extended Resolution Theorem
    prover,scientists at Argonne National Labs
    recently proved the first major open theorem by a
    computer
  • TP used general heuristics such as preference for
    proving simple statements and using resolution
    steps that worked in other cases.
  • After 8 days running on workstation, were able to
    find proof
  • Computers had been used in the past to solve
    theorems, but not ones that people had been
    unable to solve. Exception 4-coloring problem.
    However, in that case computer enumerated all
    possibilities.

61
FOL Summary
  • Syntax - terms, WFF, quantifiers
  • New Inference rules for quantifiers
  • Unification
  • Horn clauses - FC, BC
  • Resolution Refutation
  • Converting to clausal form
Write a Comment
User Comments (0)
About PowerShow.com