3.4 Unification
3.4 Unification
Example: Find the MGU (Most General Unifier) for Unify {King(x),
King (John)}
o The UNIFY algorithm is used for unification, which takes two atomic
sentences and returns a unifier for those sentences (If any exist).
o Unification is a key component of all first-order inference algorithms.
o It returns fail if the expressions do not match with each other.
o The substitution variables are called Most General Unifier or
MGU.
E.g. Let's say there are two different expressions, P(x, y), and
P(a, f(z)).
Unification Algorithm:
Algorithm: Unify(Ψ1, Ψ2)
For Example: - The Query is Knows (John, x) whom does John Know?
Some answers to the above query can be found by finding all sentences in the KB that
unify with knows (John, x)
Knows (x, Elizabeth) means “Everyone knows Elizabeth” from this we able to infer
that John knows Elizabeth.
This can be avoided by using standardizing apart one of the two sentences being
unified (i.e.) renaming is done to avoid name clashes.
For Example:-
UNIFY (Knows (john, x), knows (x1, Elizabeth)) = {x/Elizabeth,
Advantages:-
The scheme works very well whenever the lattice contains a small number of nodes.
For a predicate with n arguments, the lattice contains O(2n) nodes.
Disadvantages:-
If function symbols are allowed, the number of nodes is also exponential in the size of
the terms in the sentence to be stored. This can lead to a huge number of indices.
At some point, the benefits of indexing are outweighed by the costs of storing and
maintaining all the indices.
More Examples: