-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGroundedShkopTest.java
More file actions
32 lines (29 loc) · 1.23 KB
/
Copy pathGroundedShkopTest.java
File metadata and controls
32 lines (29 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package diarg;
import net.sf.tweety.arg.dung.reasoner.SimpleGroundedReasoner;
import net.sf.tweety.arg.dung.semantics.Extension;
import net.sf.tweety.arg.dung.syntax.Argument;
import net.sf.tweety.arg.dung.syntax.DungTheory;
import java.util.ArrayList;
import java.util.Collection;
/**
* Provides nsa grounded Shkop test facilities for DiArg's Shkop reasoner
* grounded Shkop test that ignores self-attacking arguments
* @author Timotheus Kampik
*/
public class GroundedShkopTest extends ShkopTest{
SimpleGroundedReasoner groundedReasoner = new SimpleGroundedReasoner();
@Override
boolean run(DungTheory framework, Extension extension, Argument newArgument) {
Collection<Argument> restrictionArgs = new ArrayList<>();
for(Argument argument: framework.getNodes()) {
if(extension.contains(argument) || framework.existsDirectedPath(newArgument, argument)) {
restrictionArgs.add(argument);
}
}
Extension groundedExtension = groundedReasoner.getModel(Utils.removeSelfAttackedArguments((DungTheory) framework.getRestriction(restrictionArgs)));
if(framework.isAttacked(extension, groundedExtension)) {
return false;
}
return true;
}
}