Here I list the mature alternatives which I found to integrate the prolog program with another system. Expert system run in the backend and the user usually interacts with a web or GUI application.
You can expose your Prolog logic as an HTTP service using the built-in HTTP libraries in SWI-Prolog.
- Webconsole: Pack to show a prolog console on a browser Priority to test: 1
- Tutorial on how to use SWI-Prolog's web framework
- simple-template: Templating for web applications
- simple_web: Microframework for building websites
- weblog: Another web application framework
- Pengines: Web Logic Programming Made Easy Priority to test: 2
- The pack openapi can generate prolog predicates from an OPENAPI definition Priority to test: 3
- HTTP JSON Plugin module
I didn't find any pack (library) to create one.
- slack_prolog provides a Prolog interface to Slack
- MQTT allows to integrate using this messaging protocol
SWI-Prolog supports websockets but they are usually for real-time communication. This is particularly useful for web applications that require a persistent connection to the server for real-time updates.
It is possible to use sockets, shared memory, or even files for communication between your Prolog program and other applications but I don't have experience with IPC.
Popular languages have modules which integrate Prolog code like Drools for Java. I have experience extending code using Drools and Drools is difficult to debug, error-prone, there is no logging. At the end, this type of integration leads to an black box module which Java developers cannot understand.