Skip to content

Single interface to multitude of Prolog implementations

License

Notifications You must be signed in to change notification settings

hurufu/prolog-all

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Common CLI to run Prolog code snippets using different engines

Portable interface to multitude of Prolog implementations. The main purpose is to help with spotting differences and facilitate comparison in behavior for test snippets of code during development for Prolog engine maintainers.

This program doesn't provide engines themselves, you need to install them separately. The easiest way is to get this package from AUR with all optional dependencies.

Otherwise you can try a containerized variant.

🚧 This project was tested only on Arch Linux, but there is nothing here to fail, it just re-arranges arguments and calls an actual Prolog executable. That means that if you have installed Prolog system-wide it should just work for you too.

Usage examples

Run foo,bar from file.pl with all available prologs (both variants do the same):

prologs -g foo -g bar file.pl
prologs -p all -g foo,bar 'my file with spaces.pl'

Read its help prologs -h for more options.

The program is implemented in Make, that means that it supports parallel execution out-of-the box. This will run main from my_prject.pl with Scryer and Trealla Prologs simultaneously:

prologs -p scryer -p trealla -j2 -O -g main -- my_project.pl

You can use remake(1) to compare execution time of different implementations:

env MAKE=remake prologs -g run --profile bench.pl

Or alternatively in the future you would be able to use biomake to run your code on distributed cluster using queueing engine:

env MAKE=biomake prologs -g run bench.pl -j -Qpbs

Currently working

B, Bin, C#Prolog, Ciao, DGKS, Doge (JavaScript, Python, Java), ECLiPSe, GNU Prolog, Poplog, Projog, Scryer, SICStus1, SWI, Trealla, Tau, Tu, XSB, Yap.

Notes on some less known Prologs

  • C# Prolog – doesn't support cyclic terms and has non-standard exception handling.
  • DGKS Prolog – Looks like a someone's toy project from late 90', no CLI interface without writing custom Java code, can't handle operators correctly.

Tried and wouldn't be supported

  • JLog – only GUI. JScriptLog has stuck in unfinished state from 2007, it runs, but it seems to support only hardcoded KB – some development is required.
  • LPA-Prolog – commercial license is needed.
  • Brain Aid Prolog – can't find sources.
  • Strawberry Prolog – full IDE no easy way to integrate into CLI.
  • Turbo Prolog – can't find sources and it seems to be a lot of pain anyways. Links:
  • Quintus Prolog – sources are paywalled, no real reason to use because it's successor SICStus is available.
  • Minerva Prolog – source code is unobtainium now.
  • Amzi! Prolog – looks like a complete IDE, hard to compile.
  • Jinni Prolog – code is freely availvable, but I don't have stamina to fix all compilation issues.
  • IF/Prolog – there are some very old sources, it might work or might not.
  • BIM Prolog – A lot of information, but no sources nor executables.
  • Jekejeke Prolog – I have found archived page, but .jar file wasn't archived and I don't like downloading it from random sites on internet.

Still needs research

Footnotes

  1. You need to have a legally obtained copy installed in /opt/SICStus

About

Single interface to multitude of Prolog implementations

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published