SWI Prolog interpret/compile from command line
I am using Windows, and i want to interpret/compile a prolog file with cmd, is any method to do that?. The purpose is to make a shell to the interpreter/compiler prolog to a file like:
gplc -output C:\a.output -input C:\a.pl
And in the output file to be the answers for my goals. I had read some documentation for swi-prolog.com
and I didn't find.
I had tried with GNU Prolog(and it raise me an error for gcc)
I have this file D:\a.pl
mouther(john).
jiji(ok).
?- jiji(ok).
in CMD I run swipl -s D:\a.pl -o D:\a2.txt
And I want in a2 the answers for m开发者_开发问答y goals, but it isn't.
I cannot check it right now but you could start out with something like
swipl -s file.pl -g "mygoal(3,foo)." -t halt.
This would consult file.pl
, run goal mygoal(3,foo)
and then halt the interpreter without entering interactive mode. Check the command line options for more info.
精彩评论