Here we provide a system, i.e., ASP encodings, to compute the extensions of and reasoning with SETAFs. The system is independent of the core ASPARTIX system, however we follow the same approach of encoding the SETAF as input database and the semantics as fixed query. Thus the encodings provided here and their usage have a similar flavor as the core ASPARTIX system.
SETAFs extend Dung AFs by allowing for collective attacks, i.e., attacks where a non-empty set S of arguments attacks an argument a. The attack is active only if all of the arguments of S an argument is defendeed against a collective attack (S,a) by an extensions E if at least one of the arguments in S is attacked by E. We also call S the support of the attack and a the target.
SETAFs are encoded by a sequence of statements that either encode an argument, the target of an attack, or the support of an attack.
SETAF | Input File |
---|---|
SETAF F=(A,R) with
That is we have three arguments a,b,c and three attacks r1=({a,b},c), r2=({a,c},b), r3=({b,c},a). |
arg(a).
arg(b).
arg(c).
att(r1,c).
mem(r1,a).
mem(r1,b).
att(r2,b).
mem(r2,a).
mem(r2,c).
att(r3,a).
mem(r3,b).
mem(r3,c).
|
For the execution of the programs one needs a disjunctive ASP solver and the encodings are tested with Clingo (see Potassco).
$ clingo input.af semantics.lp filter.lp 0
The filter.lp file filters out the predicates in(.) which denote the arguments contained in the extension.
To just enumerate a fixed number of extensions, say 6, use the following command$ clingo input.af semantics.lp filter.lp 6
$ clingo input.af semantics.lp filter.lp -e brave
$ clingo input.af semantics.lp filter.lp -e cautious
In the following we provide the encodings for all semantics. Sometimes, beside the standard encoding, we also provide a "basic encoding" that avoids more advanced constructs in the ASP-language of gringo and thus can be easily adapted for other ASP solver.
[25] |
Evaluating SETAFs via Answer-Set Programming Wolfgang Dvořák, Alexander Greßler, and Stefan Woltran SAFA 2018: 10-21 [paper] |
[24] |
Evaluating SETAFs via Answer-Set Programming Wolfgang Dvořák, Alexander Greßler, and Stefan Woltran Technical Report DBAI-TR-2018-112, Technische Universität Wien, 2018. [ .pdf ] |