Unit 3 - Part 4 - Inference in FOL-Unification and Lifting
Unit 3 - Part 4 - Inference in FOL-Unification and Lifting
Artificial Intelligence
Unit 3
Part 4
Inference in First Order Logic
Unification and Lifting
Hemamalini S
Page 1
Inference in Propositional logic
Page 2
Biconditional elimination
Page 3
Page 4
MONOTONICITY
One final property of logical systems is monotonicity, which says that the set of entailed
sentences can only increase as information is added to the knowledge base. For any
sentences α and β,
if KB |= α then KB ∧ β |= α .
Nonmonotonic logics, which violate the monotonicity property, capture a common property
of human reasoning:
changing one’s mind
Proof by Resolution
Resolution- yields a complete inference algorithm when coupled with any complete search
algorithm.
Let us consider the steps leading up to Figure 7.4(a): the agent returns from [2,1] to [1,1]
and then goes to [1,2], where it perceives a stench, but no breeze. We add the following
facts to the knowledge base:
Page 5
Page 6
Page 7
Page 8
Page 9
Page 10
Page 11
Page 12
Completeness of Resolution:
we now show why PL-RESOLUTION is complete.
RESOLUTION CLOSURE
To do this, we introduce the resolution closure RC(S) of a set of clauses S, which
is the set of all clauses derivable by repeated application of the resolution rule to
clauses in S or their derivatives.
The resolution closure is what PL-RESOLUTION computes as the final value of
the variable clauses. It is easy to see that RC(S) must be finite, because there are only
finitely many distinct clauses that can be constructed out of the symbols P1, . . . , Pk
that appear in S. (Notice that this would not be true without the factoring step that
removes multiple copies of literals.)
Page 13
GROUND RESOLUTION THEOREM
Hence, PL-RESOLUTION always terminates. The completeness theorem for
resolution in propositional logic is called the ground resolution theorem: If a set of
clauses is unsatisfiable, then the resolution closure of those clauses contains the
empty clause.
The completeness of resolution makes it a very important inference method.
In many practical situations, however, the full power of resolution is not needed.
Some realworld knowledge bases satisfy certain restrictions on the form of
sentences they contain,which enables them to use a more restricted and efficient
inference algorithm.
Page 14
DEFINITE CLAUSE
One such restricted form is the definite clause, which is a disjunction of literals of which
exactly one is positive. For example, the clause (¬L1,1 ∨¬Breeze ∨B1,1) is a definite clause,
whereas (¬B1,1 ∨ P1,2 ∨ P2,1) is not.
HORN CLAUSE
Slightly more general is the Horn clause, which is a disjunction of literals of which at
most one is positive.
GOAL CLAUSES
So all definite clauses are Horn clauses, as are clauses with no positive literals; these are
called goal clauses. Horn clauses are closed under resolution: if you resolve two Horn
clauses, you get back a Horn clause.
Page 15
Reduction to Propositional Inference
Page 16
Example
Page 17
Problems
Page 18
Unification and Lifting
Page 19
First Order Inference Rule
Page 20
Example of Generalized Modus Ponens
Page 21
Unification
Page 22
Examples of Unification
Page 23
Unification
Page 24
Unification Algorithm
Page 25
Storage and Retrieval
Page 26
Storage and Retrieval
Page 27
Storage and Retrieval
Page 28
Forward Chaining
Page 29
First Order Definite Clauses
Page 30
Example
Page 31
Example contd..
Page 32
Forward Chaining Algorithm
Page 33
Proof of Forward Chaining
Page 34
Proof of Forward Chaining
Page 35
Proof of Forward Chaining
Page 36
Properties of Forward Chaining
Page 37
Efficiency of Forward Chaining
Page 38
Pattern Matching
Page 39
Map-coloring Problem
Page 40
Incremental Forward Chaining
Page 42
Example of Incremental Forward Chaining
Page 43
Backward Chaining
Page 44
Backward Chaining
Page 45
Backward Chaining
Page 46
Backward Chaining
Page 47
Backward Chaining
Page 48
Backward Chaining
Page 49
Backward Chaining
Page 50
Backward Chaining
Page 51
Backward Chaining
Page 52
Backward Chaining
Page 53
Prolog
Page 36
Prolog
Page 37
Prolog
Page 38
Constraint Logic Programming
Page 39
Resolution
Page 40
Resolution
Page 41
Resolution
Page 42
Resolution
Page 43
Page 44
Page 45
Page 19
Page 20
Page 21
Example Proofs
Page 22
COMPLETENESS
- We show that resolution is refutation-complete, which means that if a
set of sentences is unsatisfiable, then resolution will always be able to
derive a contradiction.
- Resolution cannot be used to generate all logical consequences of a set
of sentences, but it can be used to establish that a given sentence is
entailed by the set of sentences.
- Hence, it can be used to find all answers to a given question, Q(x), by
proving that KB ∧ ¬Q(x) is unsatisfiable.
- any sentence in first-order logic (without equality) can be rewritten
as a set of clauses in CNF.
- Our goal therefore is to prove the following: if S is an unsatisfiable set
of clauses, then the application of a finite number of resolution steps to S
will yield a contradiction.
Page 23
Proof sketch follows Robinson’s original proof:
1. First, we observe that if S is unsatisfiable, then there exists a
particular set of ground instances of the clauses of S such that this set is
also unsatisfiable (Herbrand’s theorem).
2. We then appeal to the ground resolution theorem given in Chapter 7,
which states that propositional resolution is complete for ground sentences.
3. We then use a lifting lemma to show that, for any propositional
resolution proof using the set of ground sentences, there is a corresponding
first-order resolution proof using the first-order sentences from which the
ground sentences were obtained.
Page 24
To carry out the first step, we need three new concepts:
• Herbrand universe: If S is a set of clauses, then HS, the Herbrand universe
of S, is the set of all ground terms constructable from the following:
a. The function symbols in S, if any.
b. The constant symbols in S, if any; if none, then the constant symbol A.
For example, if S contains just the clause ¬P(x, F(x,A))∨¬Q(x,A)∨R(x,B),
then HS is the following infinite set of ground terms:
{A,B, F(A,A), F(A,B), F(B,A), F(B,B), F(A,F(A,A)), . . .} .
• Saturation: If S is a set of clauses and P is a set of ground terms, then P(S),
the saturation of S with respect to P, is the set of all ground clauses
obtained by applying all possible consistent substitutions of ground terms
in P with variables in S.
Page 25
- There is always a resolution proof involving some finite subset of the
Herbrand base of S, the next step is to show that there is a resolution proof
using the clauses of S itself, which are not necessarily ground clauses.
- We start by considering a single application of the resolution rule.
Robinson stated this lemma:
Page 28
Rather than repeat the proof here, we simply illustrate the lemma:
From this fact, it follows that if the empty clause appears in the resolution
closure of S
Page 29
Resolution Strategies
Page 30
Resolution Strategies
Page 31
Summary
Page 32