I'm newbie to prolog and trying to understand this prolog code.
next_truth_value([0|R],[1|R]).
next_truth_value([1|R],[0|S]) :- next_truth_value(R,S).
Through my research I found that predicate contains two lists. If I query this I get a answer like this...
?- next_truth_value([0,0], NEXT).
NEXT = [1,0]
Please someone explain this code, I'm totally helpless about understanding what this really meant. Thank You.
?- trace.
on the top-level, although many people consider tracing a Prolog program a sign of weakness). – user1812457