
1.4. FD Constraints 19
3. The third group demands to find all the solutions (all) or only one solution to
maximize (resp. minimize) the domain of a variable X in L (toMinimize
X) (resp. toMaximize X).
4. The fourth group controls the number of assumptions K (choices) made
during the search (assumptions K).
• Example at the TOY(FD) command level:
Next goal looks (by backtracking) for assignments to all variables in list L and
follows a first fail strategy.
TOY> L == [X,Y], domain L 1 3 == T,
labeling [ff] L == true
yes
L == [ 1, 1 ]
X == 1
Y == 1
T == true
Elapsed time: 0 ms.
more solutions (y/n/d) [y]?
yes
L == [ 1, 2 ]
X == 1
Y == 2
T == true
Elapsed time: 0 ms.
more solutions (y/n/d) [y]?
......
1.4.7 Statistics Constraints
TOY(FD) also provides a set of constraints that allow to recover information about
constrained FD variables and their associated domains during the solving of a goal. In
this group we have the statistics constraints to generate execution statistics that are
useful in many forms as, for example, to provide information about the solving of a goal.
A remark about statistics constraints. Statistics functions pose no problem for
our functional logic programming framework since they behave as usual TOY functions,
returning values that, in general, depend on the computation state.
fd statistics’/0
• Type declaration:
Kommentare zu diesen Handbüchern