Background for Unification


Simple Implementation Background
type term = Variable of string 
                | Const of (string * term list)
let x = Variable "a";; 
let tm = Const ("2", []);;

let rec subst var_name residue term = 
    match term with Variable name -> 
        if var_name = name then residue else term 
    | Const (c, tys) -> 
        Const (c, List.map (subst var_name residue) tys);;
Unification Problem

Given a set of pairs of terms (“equations”)

{(s1,t1),(s2,t2),...,(sn,tn)}

(the unification problem does there exist

a substitution σ(the  unification solution)

of terms for variables such that

σ(si)=σ(ti)

for all i=1,...,n?

Uses for Unification
Unification Algorithm