%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Encoding for preferred sets % Input: % arg(x, c) ...x is an argument with claim c % att(c, x) ...claim c attacks argument x % % Output: % in(c) ...claim c is in the extension %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Guess a set S of arguments inArg(X) :- not outArg(X), arg(X, _). outArg(X) :- not inArg(X), arg(X, _). in(C) :- inArg(X), arg(X, C). % S has to be conflict-free :- inArg(X), in(C), att(C, X). % admissible :- inArg(Y), att(C, Y), arg(X, C), not in(C1) : att(C1, X). % verify that every proper supset of arguments is not admissible non_trivial :- outArg(_). % try to extend the current guess eArgIn(X) :- inArg(X), non_trivial. eArgIn(X) : outArg(X) :- non_trivial. eIn(C) :- eArgIn(X), arg(X, C), non_trivial. % verify that the extended guess is conflict-free fail :- eIn(C), eArgIn(X), att(C, X), non_trivial. % verify that the extended guess is admissible fail | eArgIn(Z) : att(C1, Y), arg(Z, C1) :- eArgIn(X), att(C, X), arg(Y, C), non_trivial. % saturize eArgIn(X) :- fail, arg(X, _), non_trivial. eIn(C) :- fail, arg(_, C), non_trivial. :- not fail, non_trivial. #show in/1.