ALGORITHM FOR UNIFICATION IN EQUATIONAL THEORIES