prolog - How to assign value to a variable in CLPFD? -


there predicate indomain/1 in manual assigns values variable (let's call x) in increasing order via backtracking.

i change order of values assigned variable x try writing custom labeling predicate. i've come code:

fd_set(x, x_as_set), fdset_to_list(x_as_set, x_as_list), % have domain of variable x in form of list % sort x_as_list in way , return changed list x_as_list2 member(val, x_as_list2),  x = val   % assign value clpfd variable 

but don't know if correct or not. moreover, i'm not sure if proper way how it.

that's fine way of doing it.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Socket.connect doesn't throw exception in Android -

iphone - How do I keep MDScrollView from truncating my row headers and making my cells look bad? -