update between/3 to allow inf as upper bound
:- use_module(library(error)).
between(Lower, Upper, X) :-
+ ( Upper == inf ->
must_be(integer, Lower),
+ can_be(integer, X),
+ enumerate_nats(Lower, X)
+ ; must_be(integer, Lower),
must_be(integer, Upper),
can_be(integer, X),
- between_(Lower, Upper, X).
+ between_(Lower, Upper, X)
+ ).
between_(Lower, Upper, Lower) :-
Lower =< Upper.
