Switching away from DFS: yet another beginner mystified

We could use clpfd to represent evens

That is what we did in the case of our logtalk implementation of sets.

:- object(evens, imports(default_set_behaviour), implements(set)).
   :- use_module(library(clpfd)).
   member(X) :- (integer(X); var(X)), X mod 2 #= 0.
:- end_object.

as an example. I have no problem with sets being problem-specific but I do want unions and intersections to be general enough that one could theoretically write sets which would behave well under combinations of union and intersection

If the sets are intended to only contain integers, then clpfd already contains set-related features such as in/2 which should be very helpful.

I’m continuing to ask for a mock-up of a useful predicate, because I think that would make development of the set predicates easier. Even if the set predicates are intended to be a generic library.