[eclipse-clp-users] ic_sets question: negated set constraints

From: Daniel Jozsef <daniel.jozsef_at_...6...>
Date: Sun, 18 Sep 2016 10:15:17 +0200

I'm trying to wrap my head around the ic_sets library, and it feels
extremely limited in its abilities. Specifically something I'd need for a
model I'm working on is to be able to define a "A is NOT a subset of B"

Given how the only constraint that has a reified form is the simple
membership, no trivial solution seems to present itself. I came up with the
following solution, it works but I don't really like it:

notsubset(SetA, SetB) :-
SetA :: []..[1,2,3,4],
ic_sets:union(SetA, SetB, U),
#(U, UCard),
#(SetA, ACard),
ACard #< UCard.

Any idea how this could be done in a more elegant way?

Thanks ;)
Received on Sun Sep 18 2016 - 08:15:24 CEST

This archive was generated by hypermail 2.2.0 : Mon Jul 09 2018 - 02:05:30 CEST