Explicit representation of terms defined by counter examples

Anti-unification guarantees the existence of a term which is an explicit representation of the most specific generalization of a collection of terms. This provides a formal basis for learning from examples. Here we address the dual problem of computing a generalization given a set of counter examples. Unlike learning from examples an explicit, finite representation for the generalization does not always exist. We show that the problem is decidable by providing an algorithm which, given an implicit representation will return a finite explicit representation or report that none exists. Applications of this result to the problem of negation as failure and to the representation of solutions to systems of equations and inequations are also mentioned.