2P-Kt

2P-Kt (tuProlog in Kotlin) is a multi-platform ecosystem in Kotlin for logic programming and symbolic artificial intelligence: the current implementation of tuProlog, built on a minimal core that is extended by modules rather than configured by options

What 2P-Kt is

2P-Kt is

  • the current implementation of tuProlog, written afresh in Kotlin as a multi-platform project targetting the JVM, JS — server- and browser-side — and Android
  • built on a minimal, layered core — terms and clauses, unification, theories, resolution — extended by modules rather than configured by options
  • meant to give intelligent systems engineers a general-purpose, extensible, open ecosystem for symbolic AI, and not a Prolog interpreter alone
  • open source, released under the Apache 2.0 License

The two IDEs

The same Prolog IDE exists in two incarnations, sharing model and controller and differing only in the toolkit that draws them.

Editing, syntax highlighting, diagnostics and query solving behave the same way in both. They part company on storage: in the browser, New, Open, Save and Save as keep pages in the browser's own local storage, so they survive a reload without touching the file system, while Upload and Download are what read and write a theory file on disk.

The modules

2P-Kt is a family of modules, each a separate artefact, layered so that an application takes only what it needs.

modulewhat it provides
corelogic terms and clauses
unifyunification
theoryin-memory indexing and storage of theories
solvethe generic API for resolving queries — solve-classic and solve-streams target ISO Prolog
solve-plpprobabilistic logic programming, with solve-problog over the bdd module
solve-concurrentOR-concurrent resolution
dsl-*a Prolog-like domain specific language inside Kotlin
parser-core, parser-theoryparsing terms, and theories
serialize-core, serialize-theory(de)serialising terms, and theories
replProlog from the command line
ide, ide-plpProlog, and probabilistic logic programming, through a graphical interface

The architecture is deliberately unopinionated: it is meant to carry other sorts of symbolic AI than Prolog — answer set programming, tabled resolution, concurrent logic programming — as further modules. And because the project is pure Kotlin, committed to the common library alone, it stays small and portable: JVM, JS and Android today, Kotlin/Native in principle.

Warning

Found a problem with 2P-Kt? Please open an issue on the GitHub Issues page.

Releases

Versions, release notes and artefacts live with the code, on GitHub. These pages do not track them: what is current is best read there.

The engine it replaces

2P-Kt is a reboot, not a port: the Java engine it replaces is a project in its own right, with twenty years of its own history, and has its own pages here — tuProlog.

Logo

downloads

sources

documentation