I would appreciate your help after struggling 4 hours to the problem:
I need to create an exe file (on windows) from prolog script. For example, main.pl has inside:
day(monday).
day(tuesday).
day(wednesday).
day(thursday).
day(friday). % let's stop here
I would like to compile this script, produce prog.exe file and then be able to do the following runs:
$ prog.exe --term sunday
false
$ prog.exe --term monday
true
$ prog.exe --goal day(friday)
true
$ prog.exe --goal fun(foo)
false
if flags are difficult non flag version with input goals will be also very helpful for me.
I tried to read compiling pages on swi-prolog page but got confused. I can not print anything on the standard output stream. Also I did not understand how flags works.
tried the example they have on swi-prolog site but I dont understand why nothing is printed. With the below script I can create exe file with command save(prog), but then while running prog.exe nothing is printed out.
:- ['main'].
main :-
pce_main_loop(main).
main(Argv) :-
write('hello word').
save(Exe) :-
pce_autoload_all,
pce_autoload_all,
qsave_program(Exe,
[ emulator(swi('bin/xpce-stub.exe')),
stand_alone(true),
goal(main)
]).