Matthew Skala wrote: > > When I ran into a similar situation, where I wanted a "neither of these > sets is a subset of the other" constraint in ic_sets, I ended up > adding a customized constraint like this: This can also be expressed by combining other constraints, e.g. set-difference and cardinality: not_subsets(X, Y) :- #(X\Y) #>= 1, #(Y\X) #>= 1. The overhead would be higher than with Matthew's passive checking, but it produces propagation (which may or may not be worthwhile): ?- X in_set_range [1, 2] .. [1, 2, 3, 4], Y in_set_range [1, 2, 3] .. [1, 2, 3, 4], not_subsets(X, Y). X = [1, 2, 4] Y = [1, 2, 3] Yes (0.00s cpu) -- JoachimReceived on Thu Jan 13 2011 - 04:44:51 CET
This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST