For instance, say I have this program (only tested in swi-prolog):
:- use_module(library(clpfd)).
:- use_module(library(lists)).
% Sorted has the same elements as List and is also sorted
clpfd_sort(List, Sorted) :-
same_length(List, Sorted),
chain(Sorted, #=<),
permutation(List, Sorted).
Where could I find enough information on how clpfd works to know whether this is an efficient solution? It might be greedy to ask such a simple solution to be n lg(n) but for all I know it's 10^n.
I've looked at sources such as this and they all do a great job of explaining the magic of clpfd but none of them explain enough of how it's implemented for me to get an idea of which programs will run quickly and which will run slowly. clpfd apparently uses attributes to hook into unification? I don't know enough about attributes to know what that means for the complexity of the programs I write. Is there somewhere I could find out?