0% found this document useful (0 votes)
191 views

Predicate Logic

This document provides an introduction to predicate logic and how it can be used to represent facts and knowledge. It discusses: 1) How predicate logic uses predicates and variables to represent relationships between entities, allowing for more complex knowledge representation than propositional logic. 2) An example knowledge base about Marcus and Caesar is presented and represented in predicate logic format. 3) Issues like ambiguity in language and choice of knowledge representation are discussed. Additional facts may need to be assumed for effective logical reasoning. 4) The importance of representing relationships like greater-than through computable predicates and functions, rather than listing out every fact individually, due to the large number of possible facts.

Uploaded by

Saidur Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
191 views

Predicate Logic

This document provides an introduction to predicate logic and how it can be used to represent facts and knowledge. It discusses: 1) How predicate logic uses predicates and variables to represent relationships between entities, allowing for more complex knowledge representation than propositional logic. 2) An example knowledge base about Marcus and Caesar is presented and represented in predicate logic format. 3) Issues like ambiguity in language and choice of knowledge representation are discussed. Additional facts may need to be assumed for effective logical reasoning. 4) The importance of representing relationships like greater-than through computable predicates and functions, rather than listing out every fact individually, due to the large number of possible facts.

Uploaded by

Saidur Rahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 64

Predicate Logic

Introduction
• Representing Facts-the language of logic
• Logical formalism is appealing because it immediately suggests a
powerful way of deriving new knowledge from old
-mathematical deduction
 a new statement is true by proving that it follows from the
statements that are already known.
 Deductions as a way of deriving answers to questions & solutions
to problems
 (and)
Logic symbols:  (for all)
  (material implication) `  : ( there exist )
  (not)
  (or)
Logic in general
• Logics are formal languages for representing information
such that conclusions can be drawn
• Syntax defines the sentences in the language
• Semantics define the “meaning” of sentences;
i.e., define truth of a sentence in a world
E.g., the language of arithmetic
x + 2 y is a sentence; x2 + y > is not a sentence
x + 2  y is true in the number x + 2 is no less than the number y
x + 2  y is true in a world where x=7; y =1
x + 2  y is false in a world where x=0; y =6
Entailment
• Entailment means that one thing follows from another:
• KB ╞ α

• Knowledge base (KB) entails sentence α if and only if α


is true in all worlds where KB is true

– E.g., the KB containing “the Giants won” and “the Reds won”
entails “Either the Giants won or the Reds won”
– E.g., x+y = 4 entails 4 = x+y

– Entailment is a relationship between sentences (i.e., syntax)
that is based on semantics
Models
• Logicians typically think in terms of models, which are formally structured
worlds with respect to which truth can be evaluated

We say m is a model of a sentence


α if α is true in m
M(α) is the set of all models of α

Then KB ╞ α iff M(KB)  M(α)


E.g. KB = Giants won and Reds
won α = Giants won
Propositional logic: Syntax
• Propositional logic is the simplest logic – illustrates basic ideas

• The proposition symbols P1, P2 etc are sentences

If S is a sentence, S is a sentence (negation)



– If S1 and S2 are sentences, S1  S2 is a sentence (conjunction)

– If S1 and S2 are sentences, S1  S2 is a sentence (disjunction)

– If S1 and S2 are sentences, S1  S2 is a sentence (implication)

– If S1 and S2 are sentences, S1  S2 is a sentence (biconditional)
Propositional logic: Semantics
Each model specifies true/false for each proposition symbol

E.g. P1,2 P2,2 P3,1


false true false

(With these symbols, 8 possible models, can be enumerated automatically)

Rules for evaluating truth with respect to a model m:

S is true iff S is false


S1  S2 is true iff S1 is true and S2 is true
S1  S2 is true iff S1is true or S2 is true
S1  S2 is true iff S1 is false or S2 is true
i.e., is false iff S1 is true and S2 is false
S1  S2 is true iff S1S2 is true and S2S1 is true

Simple recursive process evaluates an arbitrary sentence, e.g.,

P1,2  (P2,2  P3,1) = true  (true  false) = true  true = true


Truth tables for connectives
Logical equivalence
• Two sentences are logically equivalent iff true
in same models: α ≡ ß iff α╞ β and β╞ α
Validity and satisfiability
A sentence is valid if it is true in all models,
e.g., True, A A, A  A, (A  (A  B))  B

Validity is connected to inference via the Deduction Theorem:


KB ╞ α if and only if (KB  α) is valid

A sentence is satisfiable if it is true in some model


e.g., A B, C

A sentence is unsatisfiable if it is true in no models


e.g., AA

Satisfiability is connected to inference via the following:


KB ╞ α if and only if (KB α) is unsatisfiable
Representing Simple Facts in Logic
• Propositional Logic (PPL): a way of
representing real world knowledge
• Appealing because it is simple to deal with & a
decision procedure for it exists
• Real world facts can be represented easily
using prepositions logic
• Written as well-formed formulas (wff’s)
An Example
• It is raining: RAINING

• It is sunny: SUNNY

• It is windy: WINDY

• If it is raining, then it is not sunny


RAININGSUNNY
Limitation of PPL
• Socrates is a man: SOCRATESMAN
• Plato is a man: PLATOMAN
• Which would be a totally separate assertion,
-not be able to draw any conclusions about the
similarities between Socrates & Plato
• Much better Structure of the representation
reflects the structure of the
MAN(SOCRATES) knowledge itself
MAN(PLATO)
Limitation of PPL
• to use predicates applied to arguments.
• More difficult:
All men are mortal: MORTALMAN
-fails to capture the relationship between any individual
being a man & that individual being a mortal
-need variables & quantification unless we are willing to
write separate statements about the morality of every
known man
 Predicate logic (First order predicate logic-FOPL) is needed
to represent fact
Predicate Logic
• Providing a way of deducing new statements
from old ones
• Not decidable, semi-decidable
• Despite the theoretical undecidability of PL, it
can still serve as a useful way of representing &
manipulating some of the kinds of knowledge
Predicate Logic: Example
1. Marcus was a man
2. Marcus was a Pompeian
3. All Pompeian's were Roman
4. Caesar was a ruler
5. All Romans were either loyal to Caesar or hated him
6. Everyone is loyal to someone
7. People only try to assassinate rulers they are not loyal to
8. Marcus tried to assassinate Caesar

Was Marcus loyal to Caesar?


Answer Please!!!
1. Marcus was a man
2. Marcus was a Pompeian
3. All Pompeian's were Roman
4. Caesar was a ruler
5. All Romans were either loyal to Caesar or hated him
6. Everyone is loyal to someone
7. People only try to assassinate rulers they are not loyal to
8. Marcus tried to assassinate Caesar
1. man (Marcus) Predicate Logic
2. Pompeian (Marcus)
3. x: Pompeian(x) Roman (x)
4. ruler (Caesar)
[Inclusive or-OR]
5. x : Roman (x) loyal to (x, Caesar)  hate (x, Caesar)
x: Roman (x)[(loyal to [Exclusive
(x, Caesar)  hate (x, Caesar))  (loyal to (x, Caesar)  hate
or-XOR]
(x, Caesar))]
y :
6. x: y : loyal to (x,y)
7. x: Person (x)  ruler (y)  tryassassinate (x,y)  loyalto (x,y)
8. tryassassinate (Marcus, Caesar)
Predicate Logic: Example
Q: Was Marcus loyal to Caesar?
loyalto(Marcus, Caesar)
 In order to prove the goal, we need to use the rules of
inference to transform it into another goal (or set of
goals) that can in turn be transformed,
- so on, until there are no unsatisfied goals remaining.
 AND-OR graph may be used
-when there are alternative ways of satisfying
individual goals
Predicate Logic: Example
loyalto(Marcus, Caesar)
• Attempt to produce a
 (7, substitution)
proof of the goal by
person(Marcus)ruler(Caesar)
reducing the set of Tryassassinate(Marcus, Caesar)
necessary but as yet  (4)
unattained goals to
person(Marcus)
the empty set. Tryassassinate(Marcus, Caesar)

• Fails to satisfy the goal  (8)


Person(Marcus)
person (Marcus)
Fig. an attempt to prove
loyalto(Marcus, Caesar)
Predicate Logic: Example
• person (Marcus): no info is given
• Marcus was a man & Marcus was a person
• Add the representation of another fact to our
system:
9. All men are people
x: man(x)person(x)
 Now we can satisfy the last goal & produce a
proof that Marcus was not loyal to Caesar
03 Important Issues
1. Many English sentences are ambiguous (5/6/7). Choosing the
correct interpretation may be difficult
2. There is often a choice of how to represent the knowledge.
Simple representation is desirable, but they may preclude certain
kinds of reasoning. The expedient representation for a particular
set of sentences depends on the use to which the knowledge
contained in the sentences will be put
3. Even in very simple situations, a set of sentences is unlikely to
contain all the info necessary to reason about the topic at hand.
In order to able to use a set of statements effectively, it is usually
necessary to have access to another set of statements that
represents facts that people consider too obvious to mention.
Computable Functions & Predicates

• All simple facts expressed as combinations of


individual predicates
tryassassinate (Marcus, Caesar)
 Fine if the number of facts is not very large or
if the facts themselves are sufficiently
unstructured that there is little alternative
Computable Functions & Predicates
• Greater-than & less-than relationship
gt(1,0) lt(0,1)
gt(2,1) lt(1,2)
Gt(3,2) lt(2,3)
. .
-clearly we do not want to have to write out the representation of each of these
facts individually
-there are infinitely many of them
-but even if we only consider the finite number of them that can be represented,
-using a single machine word/number, it would be extremely inefficient to
store explicitly a large set of statements

-Thus it becomes useful to augment representation by these computable


predicates
Computable Functions & Predicates

• We can simply invoke a procedure, which we


will specify in addition to our regular rules,
that will evaluate it & return true/false
• It is often useful to have computable functions
as well as computable predicates.
gt(2+3,1)
 First compute the value of the plus function &
then send the arguments 5 & 1 to gt
Computable Functions & Predicates: Example
1. Marcus was a man: man(Marcus)
2. Marcus was a Pompeian: Pompeian(Marcus)
3. Marcus was born in 40 A. D.: born(Marcus, 40)
4. All men are mortal: x: man(x)mortal(x)
5. All Pompeians died when the volcano erupted in 79 A. D.
erupted(volcano, 79)x: [Pompeian(x) died(x,79)]
6. No mortal lives longer than 150 years
x :t1 :t2 : mortal (x)  born(x,t1)  gt(t2-t1,150)  dead(x,t2)
7. It is now 2013: now=2013
8. Alive means not dead
x :t1 : [alive(x,t)   dead(x,t)]  [ dead(x,t)  alive (x,t)
9. If someone dies, then he is dead at all later times
 x :t1 :t2 : died(x,t1)  gt(t2, t1)  dead(x,t2)
Computable Functions & Predicates
1. man(Marcus)
2. Pompeian(Marcus)
3. born(Marcus, 40)
4. x: man(x)mortal(x)
5. x: [Pompeian(x) died(x,79)]
6. erupted(volcano, 79)
7. x :t1 :t2 : mortal (x)  born(x,t1)  gt(t2-t1,150)  dead(x,t2)
8. now=2013
9. x :t1 : [alive(x,t)   dead(x,t)]  [ dead(x,t)  alive (x,t)
10.  x :t1 :t2 : died(x,t1)  gt(t2, t1)  dead(x,t2)
Computable Functions & Predicates
alive(Marcus, now)
• Is Marcus  (9, substitution)
alive? Dead(Marcus, now)
 (10, substitution)
alive(Marcus, Died(Marcus, t1) gt(now,t1)
now)  (5, substitution)
Pompeian(Marcus)  gt(now,79)
(2)
gt(now,79)
 (8, substitute equals)
gt(2013, 79)
 (compute gt)
nil
alive(Marcus, now)
 (9, substitution)
nil: list of conditions remaining Dead(Marcus, now)
to be proved is empty (7, substitution)
-the proof has succeeded mortal(Marcus) 
born(Marcus, t1) 
gt (now-t1, 150)

 (4, substitution)

man(Marcus) born (Marcus,t1)  gt(now-t1,150)


Two things: (1)
1. Even every simple conclusions born(Marcus,t1)  gt(now-t1,150)
Can require many steps to prove  (3)
2. A variety of processes (matching, gt(now-40,150)
Substitution, modus pones) are (8)
Involved in the production of proof gt(2013-40, 150)
-It would be worse if we had implications
(Compute minus)
With more than a single term
On the right/with complicated gt(1979, 150)
Expressions involving ands and ors
(compute gt)
On the left

nil
Resolution
• A procedure, which gains its efficiency from the
fact that it operates on statements that have
been converted to a very convenient standard
form.
• Resolution produces proofs by refutation
• To prove a statement, resolution attempts to
show that the negation of the statement
produces a contradiction with the known
statement
Conversion to Clause Form
• All Romans who know Marcus either hate Caesar or think that
anyone who hates anyone is crazy
x: [Roman(x) know(x,Marcus)]
z :
[hate(x,Caesar) (y: (y,z)thinkcrazy(x,y))]
-to use this formula in a proof requires a complex matching
process
-if the formula were in a simpler form, this process would be
much easier.
-the formula would be easier to work with if
 It were flatter, i.e., there was less embedding of components
 The quantifiers were separated from the rest of the formula
so that they did not need to be considered
Conversion to Clause Form
• Conjunctive normal form (CNF) has both of these properties.
• CNF: Roman(x) know(x,Marcus) 
hate(x,Caesar)  hate(y,z)  thinkcrazy(x,z)
 For Resolution, need to reduce a set of wff’s to a set of
clauses
-a clause is defined to be a wff in CNF but with no instances of
the connector 
-to do this, by first converting each wff into conjunctive normal
form
-then breaking apart each such expression into clauses, one for
each conjunct.
Algorithm: Convert to Clause Form
1. Eliminate , using the fact that ab is equivalent to ab
x: [Roman(x)  know(x,Marcus)] 
hate(x,Caesar)  (y: ( hate(y,z))  thinkcrazy(x,y))]
z :
2. Reduce the scope of each  to a single term, using the fact that  (
p)=p, deMorgan’s Lawas
[ (a  b)= a   b and (a  b)= a  b]
Correspondences between quantifiers
[ x: P(x)=  x : P(x) and x : x: P(x)]
P(x)=
x: [Roman(x)  know(x,Marcus)] 
hate(x,Caesar)  (y: z: (hate(y,z))  thinkcrazy(x,y))]
Algorithm: Convert to Clause Form
3. Standardize variables so that each quantifier
binds a unique variable.
x: P(x)  x: Q(x) converted to
x: P(x)  y: Q(y)
4. Move all quantifiers to the left of the formula
without changing their relatives order.
x: y: z: [Roman(x) know(x,Marcus)]
[hate(x,Caesar)( hate(y,z)thinkcrazy(x,y))]
Algorithm: Convert to Clause Form
5. Eliminate existential quantifiers.
x : President(x) transformed to President(S1)

S1-function with no arguments that somehow


produces a value that satisfies President
6. Drop the prefix
[Roman(x)  know(x,Marcus)] 
[hate(x,Caesar)  ( hate(y,z)  thinkcrazy(x,y))]
Algorithm: Convert to Clause Form
7. Convert the matrix into a conjunction of disjuncts . Associative: [a  (b 
c)=(a  b)  c] & remove the parentheses
Roman(x)  know(x,Marcus) 
hate(x,Caesar)   hate(y,z)  thinkcrazy(x,y)
 Distributive: [(a  b)  c = (a  c) (b c)]
(winterwearingboots)  (summer  wearingsandals)
-[winter  (summer  wearingsandals)]  [wearingboots  (summer 
wearingsandals)]
-(winter  summer) 
(winter  wearingsandals) 
(wearingboots  summer) 
(wearingboots  wearingsandals)
Algorithm: Convert to Clause Form
8. Create a separate clause corresponding to each conjunct. In
order for wff to be true, all the clauses that are generated
from it must be true.
9. Standardize apart the variables in the set of clauses
generated in step 8.
-rename the variables so that no two clauses make reference
to the same variable.
(x: P(x)Q(x))= x: P(x)  x: Q(x)
 After applying entire procedure to a set of wff’s, we will have
a set of clauses each of which is a disjunction of literals.
The Basis of Resolution
• The resolution procedure is a simple iterative process: at each step, two
clauses (parent clause) are compared (resolved), yielding new clause that
has been inferred from them.
• The new clause represents ways that the two parent clauses interact with
each other.
winter  summer
Ø winter  cold
-both clauses must be true (the clauses, although they look independent,
are really conjoined)
-if winter is true, then cold must be true to guarantee the truth of the 2nd
clause
-if  winter is true, the summer must be true to guarantee the truth of the
1st clause
We can Deduce: summer  cold
The Basis of Resolution
• Resolution operates by taking two clauses that each
contain the same literal (winter)
• The literal must occur in positive form in one clause & in
negative form in the other
• The resolvent is obtained by combining all of the literals
of the two parent clauses except the ones that cancel
• If the clause that is produced is the empty clause, then a
contradiction has been found.
winter
winter
-will produce empty clause
Basis of Resolution in Predicate Logic
• Herbrand’s theorem [Chang and Lee, 1973]
1. To show that a set of clauses S is
unsatisfiable, it is necessary to consider only
interpretation over a particular set, called the
Herbrand universe of S
2. A set of clauses S is unsatisfiable if and only if
a finite subset of ground instances (in which
all bound variables have had a value
substituted for them) of S is unsatisfiable.
Algorithm: Propositional Resolution
1. Convert all the propositions of F to clause form
2. Negate P & convert the result to clause form. Add it to the set of
clauses obtained in step 1
3. Repeat until either a contradiction is found or no progress can be
made:
a) Select two clauses. Call these the parent clauses
b) Resolve them together (Resolvent).
Exception: if there are any pairs of literals L & L such that one of the parent
clauses contains L & the other contains L, then select one such pair &
eliminate both.
c) If the resolvent is the empty clause, then a contradiction has been
found. If it is not, then add it to the set of clauses available to the
procedure
Example: prove R
Given Axioms Converted to Clause Form
P P (1)
(PQ)R PQR (2)
(ST) Q SQ (3)
TQ (4)
T T (5)

-First convert the axioms to clause form, then negate R for R


-then selecting pairs of clauses to resolve together
Example: prove R

P  QR R
-There is no way for all of these
clauses to be true in a single
P  Q P interpretation
-This is indicated by the empty
clause
T Q Q

T T
Unification
• In PPL, it is easy to determine that two literals
cannot both be true at the same time.
• In Predicate Logic, matching process is more
complicated since the arguments of the
predicates must be considered
man(John) and man(John) is a contradiction
While man(John) and man(Spot) is not
Unification
• In order to determine contradictions,
-need a matching procedure that compares two literals
- discovers whether there exists a set of substitutions
that makes them identical
• There is a straightforward recursive procedure,
called unification algorithm.
• Idea: first check if their initial predicate symbols are
the same
-if so, proceed. Otherwise, there is no way they can be
unified, regardless of their arguments.
Unification
• tryassassinate(Marcus, Caesar)
hate(Marcus, Caesar)
-cannot be unified
-if the predicate symbols match, then check the
arguments one pair at a time
-if the first matches, continue with the 2nd, & so on
-to test each argument pair, simply call the unification procedure
recursively
-different constants/predicates cannot match; identical ones can
-A variable can match another variable, any constant, or a predicate
expression, with the restriction that the predicate expression must not
contain any instances of the variable being match
Unification
• Complication: must find a single, consistent substitution for the
entire literal, not separate ones for each piece of it.
• To do this, we must take each substitution that we find & apply it to
remainder of the literals before we continue trying to unify them.
P(x,x)
P(y,z)
-two instances of P match, fine
-next compare x & y,
-decide that if we substitute y for x, they could match
-y/x
-z/x
-cannot substitute both y & z for x
-no consistent substitution has produce
Unification
-after first substitution
P(y,y)
P(y,z)
-attempt to unify arguments y & z, which succeeds with
substitution z/y
-entire unification process has now succeeded with a
substitution that is the composition of the two
substitutions.
(z/y)(y/x)
-(a1/a2, a3/a4,….)(b1/b2, b3/b4,……)…means to apply most
list, then take the result & apply all ones of the next list, &
so forth, until all substitutions have been applied
unification
• The object of unification is to discover at least one substitution
that causes two literals to match
• Usually, if there is one such substitution there are many
hate(x,y)
hate(Marcus, z)
Could be unified:
(Marcus/x, z/y)
(Marcus/x, y/z)
(Marcus/x, Caesar/y, Caesar/z)
(Marcus/x, Polonius/y, Polonius/z)
-first 02 are equivalent except for lexical variation
-2nd two, although they produce a match, also produce a substitution
that is more restrictive than absolutely necessary for the match
Algorithm: Unify (L1,L2)
1. If L1 or L2 are both variables or constants, then:
a) If L1 & L2 are identical, then return NIL
b) Else if L1 is a variable, then if L1 occurs in L2 then return {FAIL},
else return (L2/L1)
c) Else if L2 is a variable then if L2 in L1 then return {FAIL}, else
return (L1/L2)
d) Else return {FAIL}
2. If the initial predicate symbols in L1 & L2 are not identical, then
return {FAIL}
3. If L1 & L2 have a different number of arguments, then return
{FAIL}
4. Set SUBST to NIL (at the end of this procedure, SUBST will
contain all the substitutions used to unify L1 & L2)
Algorithm: Unify (L1,L2)
5. For i  1 to number of arguments in L1:
a) Call Unify with the ith argument of L1 & the ith
argument of L2, putting result in S
b) If S contains FAIL then return {FAIL}
c) If S is not equal to NIL then:
i. Apply S to the remainder of both L1 & L2
ii. SUBST: = APPEND(S, SUBST)
6. Return SUBST
Resolution in Predicate Logic
• Easy way of determining that two literals are contradictory—they are if one
of them can be unified with the negation of the other
• man(x) and man(Spot) are contradictory
-since man(x) & man(Spot) can be unified
1. man(Marcus)
2. man(x1)mortal(x1)
-the literal man(Marcus) can be unified with man(x1): Marcus/x1 (for
x1=Marcus,  man(Marcus) is false
-we cannot cancel out the two man literals.
-clause 2 says that for a given x1, either  man(x1) or mortal (x1).
So, for it to be true, we can now conclude only that
mortal (Marcus) must be true.

-the resolvent generated by Clauses 1 & 2 must be mortal(Marcus), which we


get by applying the result of the unification process to the resolvent
Algorithm: Resolution
• Assuming a set of given statements F & a statement to be
proved P:
1. Convert all the statements of F to clause form
2. Negate P & convert the result to clause form. Add it to the
set of clauses obtained in 1
3. Repeat until either a contradiction is found, no progress
can be made, or a predetermined amount of effort has
been expected.
a) select two clauses (parent clause)
b) Resolve them together
-the resolvent will be the disjunction of all the literal of both
parent clauses with appropriate substitutions performed
Algorithm: Resolution
Exception: if there is one pair of literals T1 & T2 such that
one of the parent clauses contains T2 & the other contains
T1 &
if T1 & T2 are unifiable, then neither T1 nor T2 should appear
in the resolvent.
-We call T1 & T2 complementary literals
-If there is more than one pair of complementary literals, only
one pair should be omitted from the resolvent.
c) If the resolvent is the empty clause, then a contradiction has
been found. If it is not, then add it to the set of clauses
available to the procedure.
Strategies for Speed Up Process
• If the choice of clauses to resolve together at each step is
made in certain systematic ways, then the resolution
procedure will find a contradiction if one exists.
• However, it may take a very long time.
1. Only resolve pairs of clauses that contain complementary
literals, since only such resolutions produce new clauses
that are harder to satisfy than their parents.
To facilitate this, index clauses by the predicates they contain,
combined with an indication of whether the predicate is
negated.
Then, a given a particular clause, possible resolvents that
contain a complementary occurrence of one of its
predicates can be located directly.
Strategies for Speed Up Process
2. Eliminate certain clauses as soon as they are generated so that
they cannot participate in later resolutions. Two kinds of clauses
should be eliminated: tautologies (which can never be unsatisfied)
and clauses that are subsumed by other clauses (they are easier
to satisfy).
-P V Q is subsumed by P
3. Whenever possible, resolve either with one of the clauses that is
part of the statement we are trying to refute or with a clause
generated by a resolution with such a clause.
This is called the set-of-support strategy & corresponds to the
intuition that the contradiction we are looking for must involve
the statement we are trying to prove.
Any other contradiction would say that the previously believed
statements were inconsistent
Strategies for Speed Up Process
4. Whenever possible, resolve with clauses that
have a single literal.
Such resolutions generate new clauses with
fewer literals than the larger of their parent
clauses & thus are probably closer to the goal
of a resolvent with zero items.
-This method is called the unit-preference
strategy.
An Example
Prove: hate(Marcus,Caesar)

hate(Marcus,Caesar) 5
Marcus/x2 1. man(Marcus)
3 Roman(Marcus)  loyalto(Marcus,Caesar) 2. Pompeian(Marcus)
Marcus/x1 3. Pompeian(x1) Roman(x1)
Pompeian(Marcus)  loyalto(Marcus,Caesar) 2 4. ruler(Caesar)
7 loyalto(Marcus,Caesar) 5.  Roman(x2)  loyalto(x2,
Marcus/x4, Ceasar/y1 Caesar)  hate(x2, Caesar)
1 man(Marcus)   ruler(Caesar)   tryassassinate(Marcus,Ceasar)
6. loyalto(x3, f1(x3))
 ruler(Caesar)   tryassassinate(Marcus,Ceasar) 4
7. man(x4)   ruler(y1)  
 tryassassinate(Marcus,Ceasar) 8
tryassassinate(x4,y1) 
loyalto(x4,y1)
8. tryassassinate(Marcus,Caesar)
An Example
• hate(Maucus, Caesar)
• Did Marcus hate Caesar?
Prove:  hate(Maucus, Caesar)
Add: hate(Maucus, Caesar) to the set of available clauses & begun
resolution process
-no clauses that contain a literal  hate
-since the resolution process can only generate new clauses that are
composed of combinations of literals form already existing clauses,
we know that no such clause can be generated & thus we conclude
that
 hate(Marcus, Caesar) will not produce a contradiction with the
known statements.
Unsuccessful attempt at Resolution

Prove: loyalto(Marcus,Caesar)
9. persecute(x5,y2)hate(y2,x5)
loyalto(Marcus,Caesar) 5 10.  hate(x6,y3)  persecute(y3,x6)
Marcus/x2
3 Roman(Marcus)  hate(Marcus,Caesar)
Marcus/x1
Pompeian(Marcus)  hate(Marcus,Caesar) 2 hate(Marcus,Caesar) 10
Marcus/x6,Caesar/y3
hate(Marcus,Caesar) persecute(Marcus,Caesar) 9
Marcus/x4, Ceasar/y1
Marcus/x5, Caesar/y2
hate(Marcus,Caesar)
-
9. persecute(x,y)hate(y,x) -
10. hate(x,y)  persecute(y,x) -
An Example
• Now to detect that there is no contradiction
we must discover that the only resolvents that
can be generated have been generated before.
• In other words, although we can generate
resolvents, we can generate no new ones.
An Example
• In its pure form, resolution requires all the
knowledge it uses to be represented in the
form of clauses.
• It is more efficient to represent certain kinds
of info in the form of computable functions,
computable predicates, & equality
relationships
An Example
Prove:  alive(Marcus,now)

alive(Marcus,now) 9a 1. man(Marcus)
Marcus/x4, now/t3 2. Pompeian(Marcus)
dead(Marcus,now) 10 3. born(Marcus,40)
Marcus/x6, now/t6 4. man(x1)  mortal(x1)
5 dead(Marcus,t5)   gt(now,t5)
5. Pompeian(x2) died(x2,79)
Marcus/x2, 79/t5
Pompeian(Marcus)   gt(now,79) 6. erupted(volcano,79)
Substitute equals 7.  mortal(x3)   born(x3,t1)
Pompeian(Marcus)   gt(2014,79)  gt(t2-t1,150)  dead(x3,t2)
reduce 8. now=2014
 Pompeian(Marcus)
2 9a.  alive(x4,t3)  dead(x4,t3)
9b. dead(x5, t4)  alive(x5, t4)
10. died(x6, t5)   gt(t6, t5) 
dead(x6,t6)
Using resolution with equality & reduce
Two ways of generating new clauses in
addition to the resolution rule
1. substitution of one value for another to which
it is equal
2. Reduction of computable predicates. If the
predicate evaluates to FALSE, it can simply be
dropped, since adding V FALSE to a disjunction
cannot change its truth value.
-If the predicates evaluates to TRUE, then the
generated clause is a tautology & cannot lead to
a contradiction
Chapter Summary
• Logic: Propositional Logic & Predicate Logic
• Facts to Predicated logic (CNF)
• Computable functions & Predicates
• Resolution
• Unification

You might also like