Reputation: 51
How to stop the program in prolog? Like if I want to do:
stop(X) :- X =:= 0 -> // (stop the program).
Upvotes: 0
Views: 3175
Reputation: 798
You can use halt/0 predicate:
stop(X) :- X =:= 0 -> halt.
Upvotes: 1