• No results found

5.7 The LABAS Justifier

5.7.1 Functionality

On the home page (see Figure 5.17), the user can either input a logic program manually in a text box or upload a logic program as a “.lp” file, as required by the ASP solver clingo [GKK+11, GKKS14].

2

Figure 5.18: Main justification interface of the LABAS Justifier.

As is standard for ASP solvers, the implication (←) in clauses is written as “:-” and every clause has to be followed by a full stop. Furthermore, facts such as a ← are written without implication symbol as “a.”, explicit negation ¬ is denoted by “-” and NAF not by “not”. Note that the LABAS Justifier currently does not support logic programs with variables.

After uploading a logic program, the user is taken to the main justification interface, shown in Figure 5.18. It displays the answer sets of the given logic program and allows the user to specify the desired justifications to be constructed:

❼ LABAS Justifications versus Attack Trees: By default, LABAS Justifications are constructed. The user can choose Attack Trees instead by clicking the respective button.

❼ Answer Set: By default, justifications are constructed w.r.t. “Answer Set 1”. A different answer set can be chosen in the “Select Answer Set” drop-down menu. ❼ Number of justifications: By default, all justifications for a chosen literal w.r.t. the

selected answer set are constructed, no matter if the literal is or is not contained in the answer set. In the “Generate all” drop-down menu, the user can choose a maximum of 1, 5, 10, or 20 justifications to be constructed instead.

❼ Similarity of justifications: If various justifications are constructed for a literal, justifications with successive indices are often more similar than justifications with non-successive indices, as will be discussed in Section 5.7.4. The user can thus choose to only view justifications with odd or even indices in the “Generate odd and even” drop-down menu (by default both odd and even justifications are displayed). ❼ Justified literal: The user has to type in the literal to be justified in the “Choose

Figure 5.19: Attack Tree constructed by the LABAS Justifier.

Literal” text box. The format used is the same as previously described for logic programs.

The only input required from the user is thus the literal to be justified. All other options have a default value and do therefore not require any action from the user.

After clicking the “Build Justification” button, Attack Trees or LABAS Justifications are constructed as specified by the user and the first justification is displayed below the main justification interface. The top part of the justification (see top of Figure 5.19) provides some basic information, in particular, which literal is being justified w.r.t. which answer set, how many justifications were computed, and which justification is currently displayed (by default, the first justification is displayed). A drop-down menu is used to select which of the computed justifications to display. Note that in contrast to our theory of justifications, we construct all justifications (unless a different number is chosen) even for a literal contained in the chosen answer set, since the user may be interested to investigate alternative justifications.

Attack Trees

An example Attack Tree created by the LABAS Justifier is displayed in Figure 5.19. The LABAS Justifier uses the colours green and red, respectively, rather than the labels ✬+✬ and✬−✬ for nodes in Attack Trees. To provide the user with some additional information about the structure of arguments, the clauses used to construct an argument are given in addition to its premises. For example, “r2” in argument “A3” in Figure 5.19 refers to

the second clause in the given logic program shown in Figure 5.18, where facts are not counted when indexing the clauses3.

To simplify large Attack Trees and focus on important parts, nodes in an Attack Tree can be collapsed by clicking on them. Collapsed nodes can be expanded by clicking on them again. The “Reset Attack Tree” button is used to re-create the original state of the Attack Tree, where no nodes are collapsed.

Infinite Attack Trees are indicated by dots labelling the last node of an Attack Tree, as shown on the right of Figure 5.20. We chose to always indicate infinite Attack Trees after a node labelled✬+✬ (green) has been repeated.

Note that in theory there may be infinitely many Attack Trees for a chosen literal. However, for simplicity the LABAS Justifier does not construct infinitely many Attack Trees if these trees follow the same repetitive pattern, as illustrated by Example 5.14. Example 5.14. Let P12be the following logic program, whose only answer set is S = {a}:

{ a ← not b; b ← not a; a ← }

The LABAS Justifier constructs three Attack Trees for a w.r.t. S, illustrated in Figure 5.20. However, in theory there are infinitely many Attack Trees, which repeat arguments A2 and A3 different numbers of times before ending with argument A1, for example A2 – A3 – A2 – A3 – A1, A2 – A3 – A2 – A3 – A2 – A3 – A1, A2 – A3 – A2 – A3 – A2 – A3 – A2 – A3 – A1, and so on (where each argument has one child node, namely the succeeding argument, similar to the Attack Trees in Figure 5.20).

LABAS Justifications

Due to the advantages of LABAS Justifications over BABAS Justifications discussed in Section 5.6.2, the LABAS Justifier only constructs LABAS Justifications. Similarly to Attack Trees, the colours red and green are used to respectively indicate the + and − labels of literals and relations in LABAS Justifications.

As given by our theory, the LABAS Justifier constructs LABAS Justifications from Attack Trees. It may thus seem surprising that the LABAS Justifier is able to construct all LABAS Justifications, even though not all Attack Trees are created. This is due to the fact that each Attack Tree that is not constructed by the LABAS Justifier repeats parts of itself, parts which are also present in an Attack Tree constructed by the LABAS Justifier not comprising these repetitions. Since LABAS Justifications are constructed by extract- ing information from arguments in Attack Trees, the LABAS Justifications of a repetitive

3

“r” stands for “rule” since the clauses of a logic program are referred to as “rules” in the translated ABA framework.

Figure 5.20: The three Attack Trees constructed by the LABAS Justifier for literal a in Example 5.14.

Attack Tree not constructed by the LABAS Justifier is the same as the LABAS Justifica- tion of some non-repetitive Attack Tree constructed by the LABAS Justifier. For example, the LABAS Justifications shown in Figure 5.21 are extracted from the three Attack Trees in Figure 5.20. These are the only LABAS Justifications of literal a w.r.t. the answer set S (see Example 5.14) since the additional Attack Trees mentioned in Example 5.14 all yield the third LABAS Justification.

The literal nodes of a LABAS Justification can be dragged horizontally, enabling the user to customise the layout of the justification. Vertical dragging is not allowed to ensure that the hierarchical structure of the LABAS Justification is preserved, with the top node being the justified literal. Similarly to Attack Trees, the “Reset LABAS Justification” button is used to recreate the initial layout of the LABAS Justification.