projog

Prolog interpreter for Java

The open source Projog library can be used to integrate Java with Prolog.
Prolog is a logic programming language where programs are represented as facts and rules.

  • Powerful - provides a range of built-in predicates including support for arithmetic, debugging and input / output.
  • Documented - comprehensive manual contains full list of supported commands with examples.
  • Efficient - automatic argument indexing and tail-recursion optimisation.
  • Interoperable - provides an API for using Prolog from within Java applications.
  • Extendable - provides a mechanism to plug-in new predicates and arithmetic operators written in Java.
  • Cross-platform - as Projog is written in Java it can run anywhere that has a JVM with a minimum version of Java 8.
  • Open source - using Apache License, Version 2.0.
  • Dynamic - includes a console application that allows queries to be entered and immediately evaluated:
?- write('hello, world'), nl.
hello, world

yes

?- W=X, X=1+1, Y is W, Z is -W.
W = 1 + 1
X = 1 + 1
Y = 2
Z = -2

yes

?- include(>(5), [6,5,1,8,7,4,2,9,3], X).
X = [1,4,2,3]

yes

?- [X,Y,Z] ins 7..10, Y#<X, Z#>X+1.
X = 8
Y = 7
Z = 10

yes