Implement custom order for tallying.
This commit does three things :
-
Add the possibility to pass a custom order (given as an ordered list of variables) to the tallying procedure.
Whenever a constraint s < a < t is added to a constraint set, we add s < a < any and empty < a < t in sequence, checking whether s (resp. t) is a positive or negative variable. If s is a variable b, then it is checked against a with the custom order to add one of : ~b < a < any or b < a < any (if a is a smaller variable than b) or empty < b < a or ~a < b < any (if a is a larger variable than b)
Constraint sets are maps from variables to (inf, sup) bounds, using the custom order as ordering, so when traversing a constraint set, variables are chosen in increasing order of the custom variable ordering.
-
One can now use the syntax:
debug tallying ([ 'a 'c 'b ] [ 'd'] [ ('a -> 'c, 'd -> 'b) ]);;
to pass the custom order in the toplevel for the debug tallying directive. the version without the order is still accepted.
-
Fix the tallying of record types. The tallying of record types was erroneously dropping some constraints too early declaring the whole constraint set unsatisfiable.