Reputation: 3273
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 some other logic/constraint programming language, instead of Java, as I believe the resulting code will be significantly simpler and more maintainable.
I googled for embedded Java implementations on Prolog, and found number of them, each with very little documentation. My (modest) selection criteria are:
What choices do I have and what are their advantages and disadvantages?
Upvotes: 45
Views: 11005
Reputation: 60024
Prof. Paul Tarau made available from his page several implementations
Upvotes: 3
Reputation: 31
You can also take a look at the Prol engine that I created. It allows you to embed Prolog into your Java programs (but it is not very fast one)
Upvotes: 3
Reputation: 7504
According to Wikipedia, the following versions of Prolog have Java interfaces. I've linked to the main pages for them:
Good luck with your search!
Upvotes: 23
Reputation: 4014
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.
Upvotes: 5
Reputation: 10102
Two commercial Prologs written in Java: Minerva by IF Computer Japan and Jekejeke. Both are very close to ISO.
Upvotes: 1
Reputation: 121
There are a number of Prolog implementations in Java. They are not terribly fast, but convenient to use from within Java. Examples are: TuProlog or PrologCafe You can also have a look at the following Bachelor's thesis on the subject of Execution and Analysis of Prolog Programs in Java.
Upvotes: 1
Reputation: 3273
Another worthwhile option I recently came across is JSetL. It's not a Prolog, but a constraint programming library for Java, with support for logic variables, unification, constraint solving and non-determinism.
http://prmat.math.unipr.it/~gianfr/JSetL/index.html
Upvotes: 1
Reputation: 21
LPA does offer the LPA Intelligence Server as a way of embedding its Prolog engine within a whole variety of mainstream languages including Java, .Net etc
Clive
Upvotes: 2
Reputation: 11837
There's Mini-Kanren for Scala, which gives you a native JVM implementation of a lean, hackable, modern Horn-clause based logic programming language.
Upvotes: 1
Reputation: 11
Prova 3.0 http://www.prova.ws is nearing completion. It is, however, not just another Prolog but a mix of programming styles, particularly, useful for easy bi-directional Java integration, reactive agent programming, integration with ESB's, workflow logic, and event processing. This version is a complete rewrite from zero so some older features, like OWL integration, are missing, but are bound to return in the next revision.
Upvotes: 1
Reputation: 30023
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.
Upvotes: 7
Reputation: 103135
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.
Upvotes: 4
Reputation: 20485
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.
Upvotes: 9