next up previous
Next: Unification and Eliza Up: l6 Previous: Unifiers

Most General Unifier

Unifier $b_1$ is more general than unifier $b_2$ if for every expression $p$, $p b_2$ is an instance of $p b_1$ (or $p b_1 \alpha$ = $p b_2$)

((?x ?y)) is more general than ((?x foo) (?y foo)), because (f ?x) ((?x ?y)) ((?y foo)) = (f ?x) ((?x foo) (?y foo))

If two expressions are unifiable, then there exists an mgu (most general unifier)

The code we designed returns an mgu.

    Q(F(?x), ?z, A) and Q(?a, ?z, ?y)
    Unifiable?
    Yes!  substitution list = ((?a F(?x)) (?y A))

    P(?x) and P(A)?
    P(F(?x, G(A,?y)), G(A,?y)) and   P(F(?x,?z), ?z)?
    Q(?x, ?y, A)   and   Q(B, ?y, ?z)?
    R(?x)   and   R(F(?x))?