I am trying to execute a prolog script from teh command line. I am basing my attempts on what I found at How to run SWI-Prolog from the command line? however that is not working for any non-trivial example (i.e. anything other than that "hello world" example).
:- initialization(main, program).
main :-
parent(pam,bob).
parent(tom,bob).
parent(tom,liz).
parent(bob,ann).
parent(bob,pat).
parent(pat,jim).
parent(X,jim).
halt.
I execute this with $ swipl -q -s temp.p
and get the following errors
Warning: temp.p:10:
Singleton variables: [X]
ERROR: temp.p:11:
No permission to modify static procedure `halt/0'
Defined at /opt/local/lib/swipl/boot/init.pl:3867
How do I execute this from the command line, get the results, but not drop to the repl?