Let's assume I have a variable V
and value of V
can be any number from the range 0..5
. However, some values are more preferred than other others therefore it would help me to specify the domain of V
as an ordered sequence.
Can I do it in SICStus Prolog?
Example:
% PSEUDOCODE
%
% 3 is more preferred than 4; 4 is more preferred than 2; and so on..
% So I would write something like this:
V in {3,4,2,5,1,0},
getDomainAsList(V, List), % the predicate do not exist
% and the List would be: [3,4,2,5,1,0] and not [1,2,3,4,5]
I read the manual and I did not find anything that would help. I can solve the problem by custom labeling (i.e., convert the domain of V to a list, sort it and assign a value to V
) but I expect worse performance.