From: Terrance S. <ts...@us...> - 2007-11-20 19:07:23
|
Update of /cvsroot/xsb/XSB/syslib In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv10254 Modified Files: basics.P basics.H Log Message: Adding compatability predicate between/3. Index: basics.P =================================================================== RCS file: /cvsroot/xsb/XSB/syslib/basics.P,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- basics.P 16 Apr 2007 16:15:33 -0000 1.20 +++ basics.P 20 Nov 2007 19:07:22 -0000 1.21 @@ -300,6 +300,17 @@ fordown(H,H,L) :- H >= L. fordown(I,H,L) :- H > L, H1 is H-1, fordown(I,H1,L). + +% Compatability w. SWI and others (also error checking) +between(L,U,B):- + check_integer(L,between/3,1), + check_integer(U,between/3,2), + L =< U, + between_1(L,U,B). + +between_1(L,_U,L). +between_1(L,U,Res):- L < U,L1 is L + 1,between_1(L1,U,Res). + /* --------------------- end of file basics.P ------------------------- */ Index: basics.H =================================================================== RCS file: /cvsroot/xsb/XSB/syslib/basics.H,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- basics.H 26 Jan 2007 18:28:14 -0000 1.13 +++ basics.H 20 Nov 2007 19:07:22 -0000 1.14 @@ -25,7 +25,7 @@ :- export append/3, copy_term/2, flatten/2, ground/1, ith/3, length/2, member/2, memberchk/2, subset/2, subseq/3, reverse/2, select/3, - for/3. + for/3, between/3. :- export log_ith/3, log_ith_bound/3. :- export logk_ith/4. :- export comma_memberchk/2, abscomma_memberchk/2, comma_to_list/2, @@ -34,3 +34,4 @@ :- import term_type/2 from machine. :- import integer/1, is_list/1 from standard. :- import arg/3, functor/3 from standard. +:- import check_integer/3 from error_handler. |