Operationally: the elements in all three collections are constrained such that their domains are consistent with the declarative meaning.
Two of the three arguments can be uninstantiated or partial lists at call time.
Any input variables which is not already a domain variable will be turned into a domain variable with default bounds.
Note that the gecode implementation of the constraint use positions starting from 0. An extra dummy element smaller than all the elements in List is added so that the position returned correspond to the usual ECLiPSe index starting from 1. In addition, the complexity of the algorithm used by gecode is linear in time with respect to Max - Min, where Max and Min are the Maximum and Minimum possible values for elements in List, respectively. Therefore, this constraint will behave badly for variables with large domain widths. For a version of this constraint that uses native Gecode indexing, see sorted_g/3.
ConsistencyModule is the optional module specification to give the consistency level for the propagation for this constraint: gfd_bc for bounds consistency.
This constraint is known as sort_permutation in the global constraint catalog, and is implemented using Gecode's sorted() constraint.
[eclipse 2]: length(Xs,4),Xs :: 1 .. 100,sorted(Xs, Ys, Ps),Xs = [8, 20|_]. Xs = [8, 20, _715{[1 .. 100]}, _735{[1 .. 100]}] Ys = [_804{[1 .. 8]}, _824{[1 .. 20]}, _844{[8 .. 100]}, _864{[20 .. 100]}] Ps = [_969{[1 .. 3]}, _989{[2 .. 4]}, _1009{[1 .. 4]}, _1029{[1 .. 4]}]