Reorder matches to consider more specialised versions first.
Reorder matches to consider more specialised versions first.

Keep in mind that var(X) matches a variable as well as an integer. We
should write a subsumption checker for these patterns, to find such
things automatically! With this commit, the following benchmark is
fast again:

   run(N) :- X in 0..N, run(X, N).

   run(X, N) :-
           X #< N,
           N1 is N - 1,
           run(X, N1).

   %?- time(run(3000)).
   %@ % 489,116 inferences, 0.08 CPU in 0.09 seconds (87% CPU, 6113950 Lips)
   %@ false.

koryonik/swipl-devel,jn7163/swipl-devel,mndrix/swipl-devel,koryonik/swipl-devel,koryonik/swipl-devel,edechter/swipl-devel,koryonik/swipl-devel,jn7163/swipl-devel,edechter/swipl-devel,edechter/swipl-devel,mndrix/swipl-devel,mndrix/swipl-devel,jn7163/swipl-devel,edechter/swipl-devel,mndrix/swipl-devel,mndrix/swipl-devel,jn7163/swipl-devel,koryonik/swipl-devel,edechter/swipl-devel,jn7163/swipl-devel