distinctSolutions

Returns a Sequence equivalent to this one, but with every Solution.Yes whose Solution.Yes.solvedQuery equals (structurally) one already emitted earlier in the sequence dropped. Solution.No/Solution.Halt entries are never dropped. Backs the UniqueSolutions flag's on setting -- e.g. member(X, [1, 1, 1]) yields a single yes (X = 1) instead of three.

Lazy and single-pass: safe to use on an infinite/backtracking sequence, at the cost of remembering every distinct solved-query term seen so far for the lifetime of the sequence.