开发者

How to use prolog in java? [duplicate]

开发者 https://www.devze.com 2023-03-13 16:42 出处:网络
This question already has answers here: 开发者_如何学Go How use Prolog from Java? (6 answers) Closed 2 years ago.
This question already has answers here: 开发者_如何学Go How use Prolog from Java? (6 answers) Closed 2 years ago.

Please, someone help me with an example. I would like to create a simple Prolog program, that adds two numbers together, and the Java program writes it to the console! So the Prolog is adding, and the a Java program is writing the result. I can write the adding in prolog, but I don't know how to invoke the prolog program in java. =( Please, someone, who can create this little example, write it here! Thanks!!


You can try to use the the GNU Prolog for Java. Running an existing prolog file appears straight-forward described here. I haven't tried myself, but would be interested to see if it works.


The easiest way I have found to use Prolog from Java is to use tuProlog which is a Prolog implementation in Java. http://www.alice.unibo.it/xwiki/bin/view/Tuprolog/ It is actively developed.

Unfortunately, tuProlog's performance is not as good as some much faster native Prologs (e.g. Yap,etc), so if speed is a concern, this might not work out for you.


Consider X-Prolog which is pretty evolved and quite fast.


also there is open source JProl library which can be use for Prolog learning

0

精彩评论

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