Let Func be a set of function symbols, Pred be a set of predicate symbols, Vars be a denumerable set of variables. f /n denotes an arbitrary function symbol, and capital letters denote variables. Term denotes the set of terms that can be constructed from Func and Vars. t, t i and f (t 1 , • • • , t n) denote arbitrary terms. Atom denotes the set of atoms constructible from Pred, Func and Vars. a 1 and a 2 denote arbitrary atoms. θ and θ i denote substitutions. Let θ be a substitution and V ⊆ Vars. dom(θ) denotes the domain of θ. θ| \ V denotes the restriction of θ to V. As a convention, the function composition operator • binds stronger than | \. For instance, θ 1 • θ 2 | \ V is equal to (θ 1 • θ 2)| \ V. An expression O is a term, an atom, a literal, a clause, a goal etc. vars(O) denotes the set of variables in O. An equation is a formula of the form l = r where either l, r ∈ Term or l, r ∈ Atom. The set of all equations is denoted as Eqn. Let E ∈ ℘(Eqn). E is in solved form if, for each equation l = r in E, l is a variable that does not occur on the right side of any equation in E. For a set of equations E ∈ ℘(Eqn), mgu : ℘(Eqn) → Sub ∪ {fail } returns either a most general unifier for E if E is unifiable or fail otherwise, where Sub is the set of substitutions. mgu({l = r}) is sometimes written as mgu(l, r). Let θ•fail def = fail and fail •θ def = fail for any θ ∈ Sub∪{fail }. There is a natural bijection between substitutions and the sets of equations in solved form. eq(θ) denotes the set of equations in solved form corresponding to a substitution θ. eq(fail) def = fail. We will use a renaming substitution Ψ which renames a variable into a variable that has not been encountered before. Let F : D → ℘(E) be a function. F : ℘(D) → ℘(E) is defined as F (X) def = x∈X F (x).