How to use prolog in java?

徘徊边缘 提交于 2020-01-11 09:29:06

问题


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!!


回答1:


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.




回答2:


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.




回答3:


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




回答4:


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



来源:https://stackoverflow.com/questions/6395163/how-to-use-prolog-in-java

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!