Remove AllDifferent after being specified

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Remove AllDifferent after being specified

dcd8
Let say you have 2 individuals (indA, indB)

We assert that they are AllDifferent(indA, indB)
Is there a way to then remove that assertion?

Reply | Threaded
Open this post in threaded view
|

Re: Remove AllDifferent after being specified

Jiba
Administrator
Hi,

I think the best option is to iterate over all AllDifferents, find the right one, and destroy it, e.g.:

for all_different in onto.different_individuals():
  if set(all_different.entities) == { indA, indB }:
    all_different.destroy()

Jiba