-
Notifications
You must be signed in to change notification settings - Fork 0
Incremental IDLV
I2DLV is intended as the incremental version of the intelligent grounder I-DLV: as its standard version, I2DLV is an Answer Set Programming (ASP) instantiator that natively supports the ASP-Core-2 standard language. The I2DLV instantiation mechanism allows repeated "shots" in which previous instantiations are reused and updated according to the so-called "overgrounding technique".
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
Please, refer to this page for the additional material related to ICLP 2020 paper.
You can download a beta release of I2DLV here.
It is possible to use the I2DLV 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
I2DLV 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:
The tag load
can be used to form an XML element that requests to load input programs or data; the admitted attribute is:
-
path
a file path pointing to the data to be loaded, in ASP-CORE-2 format.
<load path="./recursion.0.asp"/>
The tag ground
can be used to form an XML statement that instructs I2DLV 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 thewasp
solver (it is assumed thatwasp
is 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.
-
-
-
I2DLV updates the ground program and prints the result on stdout:
<ground/>
-
I2DLV produces the ground program without printing the result
<ground run_mode="updateonly"/>
-
I2DLV produces the ground and pipes the result to a solver (
wasp
in this example).
Note that--mode=wasp
and--printonlyoptimum
are options of thedlv2
system.<ground run_mode="solve" solve_with="./dlv2 --mode=wasp --printonlyoptimum"/>
The tag reset
can be used to form an XML element that requests to reset all data loaded so far. No attribute is admitted.
<reset/>
The tag exit
can be used to form an XML element that requests to close the process. No attribute is admitted.
<exit/>
-
--isd
,--incremental-simpl-desimpl
enable simplification and desimplification steps during grounding.
-
-t
,--textual
prints in textual mode (same behaviour of--output=1
), instead of the default numeric. -
--filter
filters the specified predicates with the specified arity. Example: --filter=p1/2,p2/3. -
--print-rewriting
prints in STDERR the rewritten program as preprocessed by IDLV.
-
--time
the system prints the grounding time of each rule. -
--istats
the system displays incremental grounding statistics.
-
--help
the system prints this guide and exit. -
--stdin
the system reads input from standard input (default). -
--mode
set 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.By default
--mode
is set to0
.
-
-
--port
set the port number in server mode (by default, it is set to4790
).
A zip archive with a full working example can be download here. File included in the zip archive are listed in the following.
-
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.
-
<load path="test/disjunction/disjunction.0.asp"/>
<load path="test/disjunction/disjunction.1.asp"/>
<ground run_mode="solve" solve_with="./solver/dlv2 --mode=wasp --silent -n0"/>
<load path="test/disjunction/disjunction.2.asp"/>
<ground run_mode="solve" solve_with="./solver/dlv2 --mode=wasp --silent -n0"/>
<load path="test/disjunction/disjunction.3.asp"/>
<ground run_mode="solve" solve_with="./solver/dlv2 --mode=wasp --silent -n0"/>
<load path="test/disjunction/disjunction.4.asp"/>
<ground run_mode="solve" solve_with="./solver/dlv2 --mode=wasp --silent -n0"/>
<reset/>
<exit/>
<load path="test/recursion/recursion.0.asp"/>
<ground run_mode="updateonly"/>
<load path="test/recursion/recursion.1.asp"/>
<ground run_mode="solve" solve_with="./solver/dlv2 --mode=wasp --silent"/>
<load path="test/recursion/recursion.2.asp"/>
<ground run_mode="solve" solve_with="./solver/clingo5.4 --mode=clasp --verbose=0"/>
<reset/>
<exit/>
./idlv-incremental/i2dlv < test/disjunction/template.xml
./idlv-incremental/i2dlv < test/recursion/template.xml
For more details about benchmarks performed with I2DLV check the GitHub wiki page I2DLV
The benchmarks Pacman-10
, Pacman-20
and Pacman-30
differ in the extension of the predicate distance, which is limited to a grid of respectively 10x10, 20x20 and 30x30 tiles. Results of the benchmark Pacman-30
are those presented in our paper.
I2DLV | I2DLV+SOLVER |
---|---|
PROGRAM SIZE |
---|
Detailed mmedia.csv file can be downloaded here.
I2DLV | I2DLV+SOLVER |
---|---|
PROGRAM SIZE |
---|
Detailed pacman10.csv file can be downloaded here.
I2DLV | I2DLV+SOLVER |
---|---|
PROGRAM SIZE |
---|
Detailed pacman20.csv file can be downloaded here.
I2DLV | I2DLV+SOLVER |
---|---|
PROGRAM SIZE |
---|
Detailed pacman30.csv file can be downloaded here.
I2DLV+SOLVER WITH SIMPLIFICATIONS | I2DLV+SOLVER WITHOUT SIMPLIFICATIONS |
---|---|
The encodings used in the plots are available online - Download encodings
All the data used in the plots can be found at the following links.
- Francesco Calimeri
- Giovambattista Ianni
- Francesco Pacenza
- Simona Perri
- Jessica Zangari
For further information, contact [email protected].