I'm trying to implement something like a while loop in prolog but when the X > Y is false it breaks and does nothing else.
Example:
loop(X, Y):-
X > Y,
Y1 is Y +1,
loop(X,Y1),
write(Y), tab(1).
Is there any way of making it work wihout changing the loop and the write?