0
votes

I'm running a Prolog program that I wrote (a proof tester in natural deduction), and when I run the program (run_all_tests('proof_tester.pl').) the program runs, prints stuff from my program in the console(I barely have time to see what), and then closes SWI Prolog. It just disappears, without a warning or error message or anything. What could this possibly be?

1
You're probably overflowing the stack with a predicate that is recursing to deeply and/or trying to use more than the available memory for the size of a generated list.lurker
This clearly should never occur and may be a mistake for example in the engine or the console code. Please report it on the SWI mailing list. The system should never crash like this. If it runs out of a resource, it should throw an exception, as it does in the cases mentioned by @mbratch.mat
Are you sure that the program crashes? Could there be a call to halt/0or halt/1 in the program that halts execution when the computations end? Could be that the output is supposed to be redirected to a file?Paulo Moura
There was a "halt" at the end of the program, and when I removed it the program worked and didn't crash the console. However, I have another solution to the same problem(also without the halt) which still crashes the console. I had enough time to see 2-3 red warnings, but nothing else.Rickard
Maybe you can redirect the program output to a text file and post those warnings for further advice?Paulo Moura

1 Answers

1
votes

When the console closes due to halt being invoked, it is not a "crash".

If you run the program swipl -s proof_tester.pl from a command line rather than the console, then if the code executes halt, your output will still be in the "terminal" window.

You may prefer to redirect messages from SWI-Prolog to a text file (Windows, Linux), which you can then read at your leisure, using a text editor or other means.