How to use Prolog with PHP?


I want to use Prolog with PHP. Is it possible?

8/19/2009 9:20:16 AM

Accepted Answer

There are always the exec-familiy functions to execute/spawn another process.

8/19/2009 9:26:17 AM

As suggested above, you can execute a Prolog interpreter or binary. However, most Prolog implementations also export a C API that can be used to call the Prolog interpreter.

You could create a small PHP module to start an interpreter and execute queries. For instance, the SICStus documentation describes using Prolog from C in detail:

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow