Minimizing Value Set Size
From Knowino
There is a theoretical optimal order for the evaluation of functions. This is the order that minimises the size of the resulting value sets.
[edit] Value Set Size as a cost function
The size of the value set is a cost in two senses,
- The amount of memory required to store the values
- The number of possibilites that need to be iterated over to generate the value set.
Although the cost in memory is significant, it is the cost in time to generate the value set that is significant.
The goal of Constraint Logic Programming is to find actual solutions to problems. Evaluating many values whose values will never be in the final solution set is a waste.
Choosing to evaluate functions with smaller resulting value sets first may then show some Possible Worlds to be empty, which then reduces the amount of effort needed for the evaluation of other functions.