1 Machine Query Interface Overview
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
    • Packages
      • mqi -- Python and Other Programming Languge Integration for SWI Prolog
        • Machine Query Interface Overview
          • Installation Steps for Python
          • Installation Steps for Other Languages
          • Prolog Language Differences from the Top Level
          • Embedded Mode: Integrating the Machine Query Interface Into a New Programming Language
          • Standalone Mode: Debugging Prolog Code Used in an Application
          • Machine Query Interface Messages

1.2 Installation Steps for Other Languages

In general, to use the Machine Query Interface with any programming language:

  1. Install SWI Prolog itself on the machine the application will run on.
  2. Check if your SWI Prolog version includes the MQI by launching it and typing ?- mqi_start([]). If it can't find it, see below for how to install it.
  3. Ensure that the system path includes a path to the swipl executable from that installation.
  4. Make sure the application (really the user that launches the application) has permission to launch the SWI Prolog process. Unless your system is unusually locked down, this should be allowed by default. If not, you'll need to set the appropriate permissions to allow this.
  5. Install (or write!) the library you'll be using to access the MQI in your language of choice.

If your SWI Prolog version doesn't yet include the MQI:

  1. Download the mqi.pl file from the GitHub repository.
  2. Open an operating system command prompt and go to the directory where you downloaded mqi.pl.
  3. Run the command below. On Windows the command prompt must be run as an administrator. On Mac or Linux, start the command with sudo as in sudo swipl -s ....
swipl -s mqi.pl -g "mqi:install_to_library('mqi.pl')" -t halt