[eclipse-users] Domain intersection in lib(ic)

From: Tallys Yunes <thyunes_at_...6...>
Date: Thu, 10 Jan 2008 00:16:11 -0500
Hi,

I'm trying to figure out what would be the best way to
do the equivalent of lib(fd)'s dom_intersection/4 in lib(ic).
Say I want the domain of X to become itself intersected
with the domain of Y (I'm implementing a constraint propagator).

I thought of using is_in_domain/2 and exclude/2 from lib(ic_kernel) like this:

1) get_domain_as_list(X,Lx)
2) for each element E in Lx, if not is_in_domain(Y,E), exclude(X,E).

Does this look like a good approach?

Thank you!
Tallys
Received on Thu Jan 10 2008 - 05:16:16 CET

This archive was generated by hypermail 2.3.0 : Wed Sep 25 2024 - 15:13:20 CEST