Yifdaddy
Yifdaddy

Reputation: 51

How to stop the program in Prolog?

How to stop the program in prolog? Like if I want to do:

stop(X) :- X =:= 0 -> // (stop the program).

Upvotes: 0

Views: 3175

Answers (1)

code_x386
code_x386

Reputation: 798

You can use halt/0 predicate:

stop(X) :- X =:= 0 -> halt.

Upvotes: 1

Related Questions