Tools for the (de)composition and modular processing of ground logic program modules.
modlist
. This creates
a stream of modules which can be either stored in a file
or forwarded for other tools in a pipeline.
modrun
which reads modules in one at a time and runs the given
command on that module (fed as standard input).
lpcat
.
The respective binaries are available for
download. For further command line
options of the tools, please check lists provided by the
--help
option of each individual tool
(except for modun
which has no options
due to its nature).
The typical use cases are illustrated by the following command lines.
The file program.lp
is assumed to contain the ASP encoding
as well as instance data (if appropriate).
$ gringo program.lp | modlist | modrun "len -r" | sort
$ gringo program.lp | modrun lp2normal2 | lpcat -r | clasp
$ (for p in *.lp; do gringo $p; done) | lpcat -r | clasp
The first example simply computes the number of rules in each module and sorts them to analyze the size distribution. The second example performs normalization module-by-module and links the normalized modules together before solving. The third example illustrates modular grounding and, again, the resulting program slices are put together.
E. Oikarinen and T. Janhunen. Modular Equivalence for Normal Logic Programs. In the Proceedings of the 17th ECAI 2006, p. 412-416. IOS Press.
T. Janhunen. Modular Construction of Ground Logic Programs using LPCAT. Presented at LaSh'10.