Least generalizations and greatest specializations of sets of clauses