/* mybetween(I,J,K) :- K is an integer between the integers I and J inclusive. */ mybetween(I,J,I) :- I =< J. mybetween(I,J,K) :- I < J, I1 is I + 1, mybetween(I1,J,K). % Program 8.5 Generating a range of integers