I need to define a predicate such that:
?- X = succ(X), nu(X).
false.
How do I do it? It just seems like it won't return anything and just run forever.
I need to define a predicate such that:
?- X = succ(X), nu(X).
false.
How do I do it? It just seems like it won't return anything and just run forever.
You can try like this:
nu(0).
nu(S) :-
acyclic_term(S),
S = succ(X),
nu(X).
The acyclic_term/1 call is necessary to fail in the first query.