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

From: Tallys Yunes <thyunes_at_gmail.com>
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.2.0 : Thu Feb 02 2012 - 02:31:58 CET