% Problem: to generate all possible pairs of natural numbers in turn
% The typical nested for loop structure
% int(I)...., int(J).....,fail
% generates I=1 and all the J's, without getting to I=2.
% Cantor is a famous developer of set theory who specialized in infinities
% for statement from T Van Le 92
for(I,I,N):-I =< N.
for(I,M,N):-M < N, M1 is M+1, for(I,M1,N).
int(1).
int(I):-int(J), I=J+1.
cantor(I,J):- int(N), N1 is N-1,for(I,1,N1), J is N-I.
go(Fraction):-cantor(I,J), Fraction= I/J .
:-print('test with go(Fraction). '),nl.