$ echo tests. | sicstus -l fdtest.pl
% compiling /home/joe/fdpred_semantics/fdtest.pl...
%  loading /usr/local/lib/sicstus-3.9.1/library/clpfd.po...
%  module clpfd imported into user
%   loading /usr/local/lib/sicstus-3.9.1/library/atts.po...
%   module attributes imported into clpfd
%    loading /usr/local/lib/sicstus-3.9.1/library/lists.po...
%    module lists imported into attributes
%    loaded /usr/local/lib/sicstus-3.9.1/library/lists.po in module lists, 0 msec 11248 bytes
%   loaded /usr/local/lib/sicstus-3.9.1/library/atts.po in module attributes, 10 msec 24908 bytes
%   loading /usr/local/lib/sicstus-3.9.1/library/assoc.po...
%   module assoc imported into clpfd
%    module lists imported into assoc
%   loaded /usr/local/lib/sicstus-3.9.1/library/assoc.po in module assoc, 10 msec 11096 bytes
%   module lists imported into clpfd
%   loading /usr/local/lib/sicstus-3.9.1/library/ordsets.po...
%   module ordsets imported into clpfd
%   loaded /usr/local/lib/sicstus-3.9.1/library/ordsets.po in module ordsets, 0 msec 12320 bytes
%   loading /usr/local/lib/sicstus-3.9.1/library/ugraphs.po...
%   module ugraphs imported into clpfd
%    module ordsets imported into ugraphs
%    module lists imported into ugraphs
%    module assoc imported into ugraphs
%    loading /usr/local/lib/sicstus-3.9.1/library/random.po...
%    module random imported into ugraphs
%     module assoc imported into random
%     loading foreign resource /usr/local/lib/sicstus-3.9.1/library/x86-linux-glibc2.1/random.so in module random
%    loaded /usr/local/lib/sicstus-3.9.1/library/random.po in module random, 0 msec 5992 bytes
%   loaded /usr/local/lib/sicstus-3.9.1/library/ugraphs.po in module ugraphs, 20 msec 47024 bytes
%   loading foreign resource /usr/local/lib/sicstus-3.9.1/library/x86-linux-glibc2.1/clpfd.so in module clpfd
%  loaded /usr/local/lib/sicstus-3.9.1/library/clpfd.po in module clpfd, 70 msec 449996 bytes
%  module lists imported into user
%  compiling /home/joe/fdpred_semantics/fdpred.pl...
%   module fd_semantics imported into user
%   module clpfd imported into fd_semantics
%   module lists imported into fd_semantics
%  compiled /home/joe/fdpred_semantics/fdpred.pl in module fd_semantics, 80 msec 22280 bytes
% compiled /home/joe/fdpred_semantics/fdtest.pl in module user, 200 msec 483852 bytes
SICStus 3.9.1 (x86-linux-glibc2.1): Thu Jun 27 22:53:07 CEST 2002
Licensed to IQSOFT
Checking indexicals within predicate:
'x=<y=<z?'(X,Y,Z) +:
    Y in min(X)..max(Z),Z in min(Y)..sup,X in inf..max(Y).
using interval 1..3 ...
Semantics of the first indexical:
      'x=<y=<z?'(1,1,1).
      'x=<y=<z?'(1,1,2).
      'x=<y=<z?'(1,1,3).
      'x=<y=<z?'(1,2,2).
      'x=<y=<z?'(1,2,3).
      'x=<y=<z?'(1,3,3).
      'x=<y=<z?'(2,2,2).
      'x=<y=<z?'(2,2,3).
      'x=<y=<z?'(2,3,3).
      'x=<y=<z?'(3,3,3).
Indexicals with different semantics:
Semantics of indexical 2 in clause 1:
      'x=<y=<z?'(1,1,1).
      'x=<y=<z?'(1,1,2).
      'x=<y=<z?'(1,1,3).
      'x=<y=<z?'(1,2,2).
      'x=<y=<z?'(1,2,3).
      'x=<y=<z?'(1,3,3).
      'x=<y=<z?'(2,1,1).
      'x=<y=<z?'(2,1,2).
      'x=<y=<z?'(2,1,3).
      'x=<y=<z?'(2,2,2).
      'x=<y=<z?'(2,2,3).
      'x=<y=<z?'(2,3,3).
      'x=<y=<z?'(3,1,1).
      'x=<y=<z?'(3,1,2).
      'x=<y=<z?'(3,1,3).
      'x=<y=<z?'(3,2,2).
      'x=<y=<z?'(3,2,3).
      'x=<y=<z?'(3,3,3).
Semantics of indexical 3 in clause 1:
      'x=<y=<z?'(1,1,1).
      'x=<y=<z?'(1,1,2).
      'x=<y=<z?'(1,1,3).
      'x=<y=<z?'(1,2,1).
      'x=<y=<z?'(1,2,2).
      'x=<y=<z?'(1,2,3).
      'x=<y=<z?'(1,3,1).
      'x=<y=<z?'(1,3,2).
      'x=<y=<z?'(1,3,3).
      'x=<y=<z?'(2,2,1).
      'x=<y=<z?'(2,2,2).
      'x=<y=<z?'(2,2,3).
      'x=<y=<z?'(2,3,1).
      'x=<y=<z?'(2,3,2).
      'x=<y=<z?'(2,3,3).
      'x=<y=<z?'(3,3,1).
      'x=<y=<z?'(3,3,2).
      'x=<y=<z?'(3,3,3).
----------------------------------------------------------------------
Checking indexicals within predicate:
'x\\=y'(X,Y) +:
    X in\{Y},Y in\{X}.
'x\\=y'(X,Y) -:
    X in dom(Y),Y in dom(X).
'x\\=y'(X,Y) +?
    X in\dom(Y).
'x\\=y'(X,Y) -?
    X in{Y}.
using interval 1..3 ...
Semantics of the first indexical:
      'x\\=y'(1,2).
      'x\\=y'(1,3).
      'x\\=y'(2,1).
      'x\\=y'(2,3).
      'x\\=y'(3,1).
      'x\\=y'(3,2).
All other indexicals have the same semantics
----------------------------------------------------------------------
Comparing indexical X in inf..max(Z)-1
   with relation Z>max(X,Y), 
   using interval 1..3 ...
   'z>max(x,y)'(1,2,2) holds,         while 2>max(1,2) is not true
   'z>max(x,y)'(1,3,2) holds,         while 2>max(1,3) is not true
   'z>max(x,y)'(1,3,3) holds,         while 3>max(1,3) is not true
   'z>max(x,y)'(2,3,3) holds,         while 3>max(2,3) is not true
Comparing indexical Z in min(Y)..sup
   with relation X=<Y,Y=<Z, 
   using interval 1..3 ...
   'x=<y=<z'(2,1,1) holds,         while 2=<1,1=<1 is not true
   'x=<y=<z'(2,1,2) holds,         while 2=<1,1=<2 is not true
   'x=<y=<z'(2,1,3) holds,         while 2=<1,1=<3 is not true
   'x=<y=<z'(3,1,1) holds,         while 3=<1,1=<1 is not true
   'x=<y=<z'(3,1,2) holds,         while 3=<1,1=<2 is not true
   'x=<y=<z'(3,1,3) holds,         while 3=<1,1=<3 is not true
   'x=<y=<z'(3,2,2) holds,         while 3=<2,2=<2 is not true
   'x=<y=<z'(3,2,3) holds,         while 3=<2,2=<3 is not true
Comparing indexical X in{1}
   with relation Z>max(X,Y), 
   using interval 0..2 ...
   'z>max(x,y)'(1,0,0) holds,         while 0>max(1,0) is not true
   'z>max(x,y)'(1,0,1) holds,         while 1>max(1,0) is not true
   'z>max(x,y)'(1,1,0) holds,         while 0>max(1,1) is not true
   'z>max(x,y)'(1,1,1) holds,         while 1>max(1,1) is not true
   'z>max(x,y)'(1,2,0) holds,         while 0>max(1,2) is not true
   'z>max(x,y)'(1,2,1) holds,         while 1>max(1,2) is not true
   'z>max(x,y)'(1,2,2) holds,         while 2>max(1,2) is not true
   'z>max(x,y)'(0,0,1) does not hold, while 1>max(0,0) is true
   'z>max(x,y)'(0,0,2) does not hold, while 2>max(0,0) is true
   'z>max(x,y)'(0,1,2) does not hold, while 2>max(0,1) is true
----------------------------------------------------------------------
Comparing indexical X in dom(Z)-dom(Y)
   with relation X+Y=:=Z, 
   using interval 0..9 ...
   ... No discrepancy found.
Comparing indexical X in(4..card(Y))?(inf..sup)\/unionof(A,dom(Y),\{A,A+1,A-1})
   with relation X=\=Y,X=\=Y+1,X=\=Y-1, 
   using interval 0..9 ...
   ... No discrepancy found.
Comparing indexical Z in((inf..max(Y))/\dom(X))?(min(Y)..sup)
   with relation X=<Y,Y=<Z, 
   using interval 0..9 ...
   ... No discrepancy found.
Comparing indexical A1 in unionof(A,dom(X)mod 2,switch(A,[0-dom(Y),1-dom(Z)]))
   with relation X mod 2=:=0->A1=Y;A1=Z, 
   using interval 0..9 ...
   ... No discrepancy found.
yes
