Incremental Version
About
I²DLV is intended as the incremental version of the intelligent grounder I-DLV: as its standard version, I²DLV is an Answer Set Programming (ASP) instantiator that natively supports the ASP-Core-2 standard language.
The I²DLV instantiation mechanism allows repeated “shots” in which previous instantiations are reused and updated according to the so-called “overgrounding technique”.
Download
You can download a beta release of I²DLV, here.
How to execute
It is possible to use the I²DLV system in different ways:
Run the system without any command-line options. The system will wait for user input. The default incremental grounding policy is the one described in the TPLP2019 paper.
./i2dlv
Forces output to be printed in textual format (see all the available options below).
./i2dlv -t
Run the system enabling simplification and desimplification steps as described in the ICLP2020 submission. The system will wait for user input.
./i2dlv --isd
Run the system with an associate XML file containing a set of instructions that has to be executed. The output will be printed in textual format.
./i2dlv -t < file.xml
How to Cite I²DLV
Francesco Calimeri, Giovambattista Ianni, Francesco Pacenza, Simona Perri, Jessica Zangari: Incremental Answer Set Programming with Overgrounding. TPLP 2019: 957-973
Giovambattista Ianni and Francesco Pacenza and Jessica Zangari: Incremental maintenance of overgrounded logic programs with tailored simplifications. TPLP 2020: 719-734
Syntax
Command
XML Command Scripts
I²DLV is intended to be executed as a process which is kept alive in memory. Users can communicate with the process by simply piping XML commands specifying the desired tasks. A permanent in-memory instantiation can be created, updated and piped to a given ASP solver.
Currently, the following XML commands are available:
Load Command
The tag
loadcan be used to form an XML element that requests to load input programs or data; the admitted attribute is:patha file path pointing to the data to be loaded, in ASP-Core-2 format.Example of load tag:
<load path="./recursion.0.asp"/>
Ground Command
The tag
groundcan be used to form an XML statement that instructs I²DLV to ground/update the current logic program and, possibly, send the current instantiation to a solver; the admitted attributes are:run_mode, which can be set to the following 3 values:print: the current ground program is updated and the result is printed on stdout (default);updateonly: the current ground program is updated in memory and no output is provided;solve: the current ground program is updated in memory and, then, piped to a solver. By default, the ground program is sent to thewaspsolver (it is assumed thatwaspis reachable in the default userPATH). The solver output will be printed on stdout.solve_with: the default solver and its command-line options can be overriden when this value is specified.
Example of ground tag:
I²DLV updates the ground program and prints the result on stdout:
<ground/>
I²DLV produces the ground program without printing the result:
<ground run_mode="updateonly"/>
I²DLV produces the ground and pipes the result to a solver (
waspin this example).
Note
Note that --mode=wasp and --printonlyoptimum are options of the dlv2 system.
<ground run_mode="solve" solve_with="./dlv2 --mode=wasp --printonlyoptimum"/>
Reset Command
The tag
resetcan be used to form an XML element that requests to reset all data loaded so far. No attribute is admitted.
Example of reset tag:
<reset/>
Exit command
The tag
exitcan be used to form an XML element that requests to close the process. No attribute is admitted.
Example of exit tag:
<exit/>
Command-line Options
Grounding Options
--isd,--incremental-simpl-desimplenable simplification and desimplification steps during grounding.
Output Options
-t,--textualprints in textual mode (same behaviour of--output=1), instead of the default numeric.--filterfilters the specified predicates with the specified arity.Example:
--filter=p1/2,p2/3.
--print-rewritingprints in STDERR the rewritten program as preprocessed by IDLV.
Statistics Options
--timethe system prints the grounding time of each rule.--istatsthe system displays incremental grounding statistics.
General Options
--helpthe system prints this guide and exit.--stdinthe system reads input from standard input (default).--modeset the execution mode:0 = Console: the user provides commands via standard input.1 = Server: the user provides commands via a connection over the IP and port numbers at which the system is reachable.
Note
By default
--modeis set to0.--portset the port number in server mode (by default, it is set to4790).
Example
A zip archive with a full working example can be downloaded, here. The File included in the zip archive are listed in the following.
The test folder containing:
recursion/recursion.*.asp: ASP files given in input to I2DLV. disjunction/disjunction.*.asp: ASP files given in input to I-DLV Incremental. template.xml: it is an XML file containing all the instructions that have to be executed by I2DLV.
solver folder containing:
dlv2: binaries of systems that integrate an ASP solver.
Disjunction
How to execute
./idlv-incremental/i2dlv < test/disjunction/template.xml
Recursion
How to execute
./idlv-incremental/i2dlv < test/recursion/template.xml