Executing prolog code on an iPhone

后端 未结 5 1471
感动是毒
感动是毒 2021-02-04 04:46

I currently have the need to execute prolog code in an application I am making. I am aware that Apple probably never would allow something like this in the App Store, but that i

5条回答
  •  南方客
    南方客 (楼主)
    2021-02-04 05:08

    FYI, you can quite easily bi-directionally make calls between Java and SWI-Prolog if you use JPL:

    http://www.swi-prolog.org/packages/jpl/

    It is also fully re-entrant, so you can instantiate prolog code from java, which in turn instantiates java code etc...

    I did this for a number of commercial projects a few years ago when I was required to connect a Prolog based Reasoning Engine to a lot of Java code.

    It does use JNI (the Java Native Interface), so you need to be careful about how you compile and link to the native api. Though if you compile it appropriately for each platform you can make it work cross platform. I had it working on OS-X, Windows, Linux & Solaris.

提交回复
热议问题