2P-Kt
| infoinfo | peoplepeople | tagstags | linkslinks |
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.
- the Web IDE runs in a browser with nothing installed — tuprolog.github.io/2p-kt/web-ide
- the desktop IDE is a runnable jar on the release page, built on Swing
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.
| module | what it provides |
|---|---|
| core | logic terms and clauses |
| unify | unification |
| theory | in-memory indexing and storage of theories |
| solve | the generic API for resolving queries — solve-classic and solve-streams target ISO Prolog |
| solve-plp | probabilistic logic programming, with solve-problog over the bdd module |
| solve-concurrent | OR-concurrent resolution |
| dsl-* | a Prolog-like domain specific language inside Kotlin |
| parser-core, parser-theory | parsing terms, and theories |
| serialize-core, serialize-theory | (de)serialising terms, and theories |
| repl | Prolog from the command line |
| ide, ide-plp | Prolog, 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.
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.
Documents
The documentation of 2P-Kt is published from the project's own sources:
- tuprolog.github.io/2p-kt — the documentation site
- the Web IDE guide, which is the Web IDE itself
- the repository's README, which carries the project map, the module list and the instructions for Gradle, Maven and NPM users
- the API documentation, published with each release
The 262-page tuProlog Guide describes the Java engine, not this one; it is kept on the tuProlog pages.
Downloads
2P-Kt and its modules are released under the Apache 2.0 License through
- GitHub releases — the executables, including the self-contained 2p-ide-<version>-redist.jar
- Maven Central — group id it.unibo.tuprolog, for Kotlin, JVM and Android
- NPM — the @tuprolog organisation, for JavaScript; every module is published as @tuprolog/2p-<module>, with the 2p- prefix, so the whole library is @tuprolog/2p-full
- GitHub Packages — the same modules from an ad hoc Maven repository
The Web IDE
Nothing needs downloading at all to use 2P-Kt as a Prolog IDE: the Web IDE runs in the browser, at tuprolog.github.io/2p-kt/web-ide.
To serve it yourself, the release page carries an ide-web-<version>.zip asset: unzip it, serve the folder with any static file server — which is what its own end-to-end tests do — and open index.html in a modern browser.
The desktop IDE
The desktop IDE ships as a runnable jar. Beside the all-in-one 2p-ide-<version>-redist.jar the release carries platform-specific variants — -win, -linux, -mac, -mac-aarch64. On Apple Silicon use the mac-aarch64 variant: the all-in-one jar cannot carry the native libraries of both macOS architectures, since they share file names, so it ships the Intel ones and fails on an ARM JVM.
The old Java engine has its own downloads, under a different licence: see the tuProlog pages.