Warning: platypus is no longer maintained. This page exists for archival purposes only.


Platypus is a extensible distributed platform for answer set programming (ASP) developed at Potsdam University. It utilizes different distribution mechanisms such as forking and MPI and runs either single- or multi-threaded. Platypus is very flexible and may one day support your own answer set solver. Currently Platypus supports smodels and nomore++ as propagation engines. Platypus relies on lparse to provide it with ground logic programs.


The examples below show some common settings for Platypus. The full set of options is available on the option page.

The simplest case

Platypus was designed to be as easy to use as smodels, yet provide easy access to its rich functionality. Hence Platypus’ input language is lparse output. To run Platypus like smodels issue

lparse test.lp | platypus

at the command line. This will run Platypus using the single-threaded core, the smodels expander and no distribution. Also, without any option, Platypus will compute one answer set for the logic program. To calculate all answer sets start Platypus like this

lparse test.lp | platypus -a 0

The numeric parameter to the -a (answer sets) option indicates to Platypus the number of answer sets to calculate. By default this parameter is one.

Switching the expander

Besides smodels Platypus supports nomore++ as propagation engine. To switch to the nomore++ expander issue

lparse test.lp | platypus -e nomore

Note that using the nomore++ expander requires the logic program to either contain only normal rules or to be translated to one containing but normal rules.

Using threads

To enable Platypus’ multi-threaded core using, say 3 threads, start Platypus like this

lparse test.lp | platypus -e nomore -t 3

Giving a value for the -t option (threads) which exceeds 1 implicitly causes Platypus’ multi-threaded core to be run. By default the value for -t is 1. If the multi-threaded core is not explicitly requested, Platypus will interpret the 1 as a hint to run the single-threaded core. To run the multi-threaded core with only one thread, type

lparse test.lp | platypus -e nomore -t 1 -c mt

Platypus can distribute the search across several machines depending on the distribution mechanisms implemented for a given platform. On a Unix system distribution via fork/POSIX IPC is always supported. Start Platypus using this distribution scheme with 4 processes by typing

lparse test.lp | platypus -m fork -p 4

In this setting, the parameter fork to the -m (distribution mode) option causes Platypus to load the forking distribution code. The -p options is only valid in conjunction with -m fork. When given, the option specifies the number of processes to use.

Useful options

Probably the most useful option of all is the -h (help) option. When given, it will make Platypus print a list of the options it understands. To suppress the printing of answer sets, pass the -s option to the Platypus executable. To make Platypus read from a file rather than STDIN, pass the -f option along with a filename. Calling Platypus like indicated below

platypus -s -f test.lparse

will cause Platypus to calculate one answer set for the representation of the logic program in the file test.lparse as output by lparse. The calculated answer set is not printed.