Search code examples
pythonprologswi-prolog

Using prolog without the pl file


My python application works well and uses swi_prolog's consult, asserts, and query functions along with a pl file. However, when I call the code via web (I get access error at consult when trying to open the pl file).

So, I thought of using the prolog without the pl file consultation. I just want to embed the pl file content into prolog in a way so that I can use it in a similar way and I can continue with the query steps. Is there anyone who can guide me in doing this?

Thanks in advance, Ferda


Solution

  • The SWI-Prolog manual has a chapter on deploying applications. In particular, it allows you to create so-called saved states of your program. This mechanism allows you to create a stand-alone package from your application, either from inside the application or from the command line.