Embedded Prolog Interpreter/Compiler for Java

前端 未结 13 1904
野性不改
野性不改 2020-12-04 16:51

I\'m working on an application in Java, that needs to do some complex logic rule deductions as part of its functionality. I\'d like to code my logic deductions in Prolog or

相关标签:
13条回答
  • 2020-12-04 17:16

    According to Wikipedia, the following versions of Prolog have Java interfaces. I've linked to the main pages for them:

    • BProlog
    • Ciao Prolog
    • SICStus Prolog
    • SWI Prolog
    • TuProlog (implemented in Java)
    • LPA Prolog

    Good luck with your search!

    0 讨论(0)
  • 2020-12-04 17:16

    SWI prolog A very popular implementation seems to have a Java interface as does SiCStus which would be easier than using JNI to instantiate an instance in your Java Process. I've used both from C quite a while ago and do recommend them. My prefference would be SWI as it is open-source and from my experience the de facto implementation.

    The documentation for SWI's Java interface seems to be adequate, and the embedding process quite straight forward.

    0 讨论(0)
  • 2020-12-04 17:19

    I've needed to do the same 2 years ago. I used SWI interface which is called JPL. It lets you load a Prolog file, assert on it and query on it. It does required an installation of SWI Prolog but that's not problem at all. SWI Prolog is available for many platforms.

    I've also tried alternatives that were 100% implemented in Java and didn't required external programs. All them were buggy or hard to use. Don't waste your time.

    0 讨论(0)
  • 2020-12-04 17:19

    Amzi prolog has been around for a while. I have used it briefly but not the embedded version. however they do have good documentation and support can be bought. They have Java port so it might be worth a look.

    0 讨论(0)
  • 2020-12-04 17:19

    Clojure is a JVM based Lisp-like language with a library (core.logic) supporting logic and constraint based programming. Clojure also has a large number of facilities for generating java classes and working with java code, so inter-op between the two languages is trivial.

    0 讨论(0)
  • 2020-12-04 17:24

    Prof. Paul Tarau made available from his page several implementations

    Jinni Prolog

    Kernel Prolog

    0 讨论(0)
提交回复
热议问题