This library module provides some means of generating integers. Exported predicates:
between(+Lower, +Upper, -Number)
is true when Lower, Upper, and Number are integers, and Lower =< Number =< Upper. If Lower and Upper are given, Number can be tested or enumerated. If either Lower or Upper is absent, there is not enough information to find it, and an error will be reported.
is true when N is a natural number. If N is a variable, it will enumerate the natural numbers 0,1,2,... and of course not terminate. It is not meant to be applied to anything but integers and variables.
is true when I is an integer. If I is a variable, it will enumerate the integers in the order 0, 1, -1, 2, -2, 3, -3, &c. Of course this sequence has no end. It is not meant to be applied to anything but integers and variables.
(where N is a non-negative integer) succeeds exactly N times. You can only understand it procedurally, and really it is only included for compatibility with some other Prologs.
is true when List is the list of integers [1, ..., Upper].
L = [1,2,3].
numlist(?Lower, ?Upper, ?List)
is true when List is [Lower, ..., Upper], Lower and Upper integers.
numlist(1, 3, L) binds
L = [1,2,3].
numlist(?Lower, ?Step, ?Upper, ?Length, ?List)
is true when List is the list of integers [Lower, Lower+Step, ..., Upper] and
of length Length.
L=1, S=4, U=7, X=3, U=5, Z=7.