|
24 | 24 | import org.tweetyproject.arg.eaf.syntax.EpistemicArgumentationFramework; |
25 | 25 |
|
26 | 26 | /** |
27 | | - * |
| 27 | + * Demonstrates how epistemic preferences can be encoded within |
| 28 | + * an {@link EpistemicArgumentationFramework} using logical implication |
| 29 | + * and justification state preferences. |
| 30 | + * |
| 31 | + * <p>This example illustrates: |
| 32 | + * <ul> |
| 33 | + * <li>How preferences over arguments can be modeled using constraints like {@code [](in(a) => in(r))}</li> |
| 34 | + * <li>How justification state preferences can be expressed, e.g., requiring {@code und(a)} to be accepted if {@code in(a)} is accepted</li> |
| 35 | + * <li>How epistemic constraints influence the resulting labellings under different semantics</li> |
| 36 | + * </ul> |
| 37 | + * |
| 38 | + * <p>The scenario is based on a simple Dung theory with two mutually attacking arguments. |
28 | 39 | */ |
29 | 40 | public class EafPreferenceRepresentationExample { |
30 | 41 |
|
31 | | - /** |
32 | | - * @param args |
33 | | - */ |
| 42 | + /** |
| 43 | + * Entry point for the example demonstrating the encoding of preferences |
| 44 | + * in an epistemic argumentation framework using logical implication over |
| 45 | + * acceptance and justification states. |
| 46 | + * |
| 47 | + * <p>Three different EAFs are created with varying constraints to express: |
| 48 | + * <ul> |
| 49 | + * <li>Simple preference over arguments (e.g., "if a is accepted, then r should be accepted")</li> |
| 50 | + * <li>Conditional preference (e.g., "if a is accepted or undecided, then r should be accepted")</li> |
| 51 | + * <li>Preference over justification states (e.g., "in(a) implies und(a)")</li> |
| 52 | + * </ul> |
| 53 | + * The resulting epistemic labelling sets under different semantics (complete, stable) are printed to the console. |
| 54 | + * |
| 55 | + * @param args command-line arguments (not used). |
| 56 | + */ |
34 | 57 | public static void main(String[] args) { |
35 | 58 | Argument a = new Argument("a"); |
36 | 59 | Argument b = new Argument("b"); |
37 | 60 | Argument c = new Argument("c"); |
38 | 61 | Argument d = new Argument("d"); |
39 | 62 | Argument r = new Argument("r"); |
40 | | - |
| 63 | + |
41 | 64 | DungTheory af = new DungTheory(); |
42 | | - |
| 65 | + |
43 | 66 | af.add(a); |
44 | 67 | af.add(r); |
45 | | - |
| 68 | + |
46 | 69 | af.addAttack(a,r); |
47 | 70 | af.addAttack(r,a); |
48 | 71 |
|
49 | 72 |
|
50 | 73 | String constEAF1 = "[](in(a)=>in(r))"; |
51 | | - EpistemicArgumentationFramework eaf1 = new EpistemicArgumentationFramework(af, constEAF1); |
52 | | - |
| 74 | + EpistemicArgumentationFramework eaf1 = new EpistemicArgumentationFramework(af, constEAF1); |
| 75 | + |
53 | 76 | System.out.println("Preference over arguments can be represented using the implication operator, where [](in(a)=>in(r)) means that the preferred argument r should be accepted, whenever a is accepted."); |
54 | 77 | System.out.print("The EAF: \n"+ eaf1.prettyPrint() +"\n\nhas the following stable labelling set:"); |
55 | 78 | System.out.println(eaf1.getWEpistemicLabellingSets(Semantics.ST)); |
56 | 79 | System.out.print("This EAF has the following complete labelling set:"); |
57 | 80 | System.out.println(eaf1.getWEpistemicLabellingSets(Semantics.CO)); |
58 | 81 | System.out.println(); |
59 | | - |
| 82 | + |
60 | 83 | String constEAF2 = "[](in(a)||und(a)=>in(r))"; |
61 | 84 | EpistemicArgumentationFramework eaf2 = new EpistemicArgumentationFramework(af, constEAF2); |
62 | 85 | System.out.print("The EAF: \n"+ eaf2.prettyPrint() +"\n\nhas the following complete labelling set:"); |
63 | 86 | System.out.println(eaf2.getWEpistemicLabellingSets(Semantics.CO)); |
64 | | - |
| 87 | + |
65 | 88 | System.out.println("\nPreference over justification states can be represented using the implication operator."); |
66 | 89 | System.out.println("For example, [](in(a) => und(a)) means that the less preferred justification state in(a) is only acceptable if the preferred state und(a) is also accepted."); |
67 | 90 | String constEAF3 = "[](in(a)=>und(a)) && [](out(a)=>und(a)) && [](in(r)=>und(r)) && [](out(r)=>und(r))"; |
68 | 91 | EpistemicArgumentationFramework eaf3 = new EpistemicArgumentationFramework(af, constEAF3); |
69 | | - |
| 92 | + |
70 | 93 | System.out.print("The EAF: \n"+ eaf3.prettyPrint() +"\n\nhas the following complete labelling set:"); |
71 | 94 | System.out.println(eaf3.getWEpistemicLabellingSets(Semantics.CO)); |
72 | 95 |
|
|
0 commit comments