Some Scripts for ASPARTIX
Here I collect some (short) scripts which have been usefull for me when working with the Argumentation system ASPARTIX (see
ASPARTIX-System).
Labellings with ASPARTIX
The ASPARTIX computes extensions of Argumentation frameworks.
If one is interested in labellings of AFs ( as defined in [M.W.A. Caminada and Dov M. Gabbay. A Logical Account of Formal Argumentation. Studia Logica 93(2-3):109-145 (2009]) ) the following scripts are appropiate.
Compute Labellings
Using the file
labels.dl one can compute the labellings of an AF as follows:
dlv inputAF.dl semantic.dl labels.dl -filter=in,label_out,label_undec
dlv example01.dl stable.dl labels.dl -filter=in,label_out,label_undec
Each answer set represents a different labelling function, represented by the relations in, label_out, label_undec.
labels.dl:
label_out(Y):- in(X),defeat(X,Y).
label_undec(Y):- out(Y), not label_out(Y).
Compute the Justification Status
To compute the justification status of arguments with respect to complete semantics (as defined in Yining Wu, Martin Caminada, Mikolaj Podlaszewski. A Labelling Based Justification Status of Arguments. NMR 2010) one can use the ASP-program juststate.dl, which is based on the ASPARTIX framework.
dlv juststate.dl -silent -n=1 -filter=strong_accept,weak_accept,borderlineIOU,
borderlineU,weak_reject,strong_reject
Translate Argumentation Frameworks
Here I provide some dlv-complex programs that implement translations between different argumentation semantics
(Thus you have to use DLV-complex instead of DLV).
The idea of such a translation T is that, given an Argumentation Framework F and two semantics (for instance complete and preferred), we create an Argumentation Framework T(F) such that the complete extensions of F conincides with the preferred extensions of T(F). For further information you may have a look at our paper W. Dvořák and S. Woltran - On the Intertranslatability of Argumentation Semantics ( NONMON@30).
USAGE:
dlv-complex -MAXNL=1 -nofdcheck -silent inputAF.dl translation.dl
dlv-complex -MAXNL=1 -nofdcheck -silent example01.dl adm2pref.dl
dlv-complex -MAXNL=1 -nofdcheck -silent inputAF.dl translation.dl semantic.dl
dlv-complex -MAXNL=1 -nofdcheck -silent example01.dl adm2pref.dl prefex.dl
Here the parameters
-MAXNL=1 -nofdcheck are crucial for the correct execution of the program.
adm2pref.dl
adm2stable_arg(bar(X)) :- arg(X).
arg(X) :- adm2stable_arg(X).
att(X,bar(X)) :- arg(X).
att(bar(X),X) :- arg(X).
arg(clause(X,Y)) :- att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y).
att(clause(X,Y),Z) :- arg(Z), att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y), not adm2stable_arg(Z).
att(clause(X,Y),clause(X,Y)) :- att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y).
att(bar(Y),clause(X,Y)) :- att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y).
att(X,clause(Y,Z)) :- att(X,Y), att(Y,Z), not adm2stable_arg(X), not adm2stable_arg(Y), not adm2stable_arg(Z).
adm2stable.dl
adm2stable_arg(bar(X)) :- arg(X).
arg(X) :- adm2stable_arg(X).
att(X,bar(X)) :- arg(X).
att(bar(X),X) :- arg(X).
arg(clause(X,Y)) :- att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y).
att(clause(X,Y),clause(X,Y)) :- att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y).
att(bar(Y),clause(X,Y)) :- att(X,Y), not adm2stable_arg(X), not adm2stable_arg(Y).
att(X,clause(Y,Z)) :- att(X,Y), att(Y,Z), not adm2stable_arg(X), not adm2stable_arg(Y), not adm2stable_arg(Z).
comp2stable.dl
comp2stable_arg(bar(X)) :- arg(X).
comp2stable_arg(prime(X)) :- arg(X).
att(prime(X),prime(X)) :- arg(X).
comp2stable_arg(plus(X)) :- arg(X).
comp2stable_arg(barplus(X)) :- arg(X).
arg(X) :- comp2stable_arg(X).
att(X,bar(X)) :- arg(X), not comp2stable_arg(X).
att(bar(X),X) :- arg(X), not comp2stable_arg(X).
att(X,prime(X)) :- arg(X).
att(prime(X),prime(X)) :- arg(X).
att(barplus(X),plus(X)) :- arg(X), not comp2stable_arg(X).
att(X,barplus(Y)) :- arg(X), att(X,Y), not comp2stable_arg(X), not comp2stable_arg(Y).
arg(clause(X,Y)) :- att(X,Y), not comp2stable_arg(X), not comp2stable_arg(Y).
att(clause(X,Y),clause(X,Y)) :- att(X,Y), not comp2stable_arg(X), not comp2stable_arg(Y).
att(barplus(X),prime(Y)) :- att(X,Y), not comp2stable_arg(X), not comp2stable_arg(Y).
att(plus(X),clause(X,Y)) :- att(X,Y), not comp2stable_arg(X), not comp2stable_arg(Y).
att(bar(Y),clause(X,Y)) :- att(X,Y), not comp2stable_arg(X), not comp2stable_arg(Y).
pref2semi.dl
arg(bar(X)) :- arg(X).
att(X,bar(X)) :- arg(X).
att(bar(X),bar(X)) :- arg(X).
stable2adm.dl
arg(bar(X)) :- arg(X).
att(X,bar(X)) :- arg(X).
att(X,bar(Y)) :- att(X,Y).
att(bar(X),bar(X)) :- arg(X).
att(bar(X),Y):-arg(X), arg(Y).
% The admissible extension {} does not refer to a stable extension
stable2adm_ok :-in(X).
:- not stable2adm_ok.
stable2stage.dl
arg(t).
att(t,X) :- arg(X), X!=t.
att(X,t) :- arg(X), X!=t.
% The stage / semi-stable extension {t} does not refer to a stable extension
:-in(t).
stage2semi.dl
stage2semi_arg(bar(X)) :- arg(X).
arg(X):-stage2semi_arg(X).
att(X,bar(X)) :- arg(X).
att(Y,X) :- att(X,Y), not stage2semi_arg(X), not stage2semi_arg(Y).
att(X,bar(Y)) :- att(X,Y), not stage2semi_arg(X), not stage2semi_arg(Y).
att(bar(X),bar(X)) :- arg(X).
att(X,Y) :- arg(X), att(Y,Y), not stage2semi_arg(X), not stage2semi_arg(Y).