开发者

SWI Prolog interpret/compile from command line

开发者 https://www.devze.com 2023-04-06 22:50 出处:网络
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:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消