1
votes

I want to write a rule to exit prolog but how can I do this?
What should I do so that I can exit the program? I tried something like this do(exit):-halt, but halt does not work.

1
Can you give an example of how you want to use this? - lurker
halt works: g(X) :- a(X), halt. ?- g(X). % exits from swipl - nessuno
Could you give more details about your issue? - abarisone
halt works but it exit the prolog. I just I want exit the program but stay in the prolog terminal. - Qingjiang Yin
try abort. It may work - Rishabh Jain

1 Answers

0
votes

try and use halt(0). this also finishes swi-pl.