%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Encoding for stable sets % Input: % arg(y) ... y is an argument % att(x, y)... attack with the name x attacks argument y % mem(x, y)... argument y is part of the attack x % % Output: % in(y) ... argument y is in the extension %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Guess some set in(X) :- arg(X), not out(X). out(X) :- arg(X), not in(X). % See which attacks are blocked, i.e. not possible as some member is out blocked(R) :- mem(R, X), out(X). % Eliminate all sets that do not block every attack that attacks one of its elements :- in(X), att(R, X), not blocked(R). % Eliminate all sets that do not attack all arguments outside :- out(X), #count{R : att(R, X), not blocked(R)} = 0.