Hello Milind, I am trying to learn PROLOG, and saw this code.
But in my case, I can see the following output. can you please elaborate the behavior.
[trace] [4] 257 ?- start. Call: (30) start ? creep Call: (31) sum ? creep Exit: (31) sum ? creep Call: (31) nl ? creep
Exit: (31) nl ? creep Exit: (30) start ? creep true .
While my code is as follow.
%predicates start. sum. %clauses
start :- sum, nl.
sum :- write("X = "), readreal(X), write("Y = "), readreal(Y), S = X + Y, write("SUM is = "), write(S). |