On Establishing Robust Consistency in Answer Set Programs

Answer set programs used in real-world applications often require that the program is usable with different input data. This, however, can often lead to contradictory statements and consequently to an inconsistent program. Causes for potential contradictions in a program are conflicting rules. In this paper, we show how to ensure that a program $\mathcal{P}$ remains non-contradictory given any allowed set of such input data. For that, we introduce the notion of conflict-resolving $\lambda$- extensions. A conflict-resolving $\lambda$-extension for a conflicting rule $r$ is a set $\lambda$ of (default) literals such that extending the body of $r$ by $\lambda$ resolves all conflicts of $r$ at once. We investigate the properties that suitable $\lambda$-extensions should possess and building on that, we develop a strategy to compute all such conflict-resolving $\lambda$-extensions for each conflicting rule in $\mathcal{P}$. We show that by implementing a conflict resolution process that successively resolves conflicts using $\lambda$-extensions eventually yields a program that remains non-contradictory given any allowed set of input data.


Motivation and context
Answer set programs can be used to implement real-world applications like decision support systems that aid knowledge experts whenever crucial decisions based on different rules and conditions have to be made. However, the knowledge bases of such applications are not static but rather very dynamic in the sense that they are adapted to each individual case and can also be prone to various updates. Especially in domains like the medical sector, knowledge bases are expected to yield suitable decisions for each patient where patients can show diverse symptoms (implemented by facts), and the knowledge base is to be updated very often, for example, every month. In addition, physicians are usually faced with some degree of uncertainty and for example have to rely on own experience when they have to reach important decisions (e.g. regarding the treatment of patients) (Ghosh 2004). Imagine a system that outputs the possible treatment plans for a given patient based on a corresponding medical ruleset. For each patient, On establishing robust consistency in answer set programs 3 because all proposed modifications will be technically viable solutions of the conflict, and the expert can then choose from them according to professional standards. Being able to establish the consistency of the problem encoding for every possible instance data without actually requiring the explicit instance has the effect that, in practice, the program does not have to be validated for each instance, which makes it much more robust and reliable.

Main contributions
In order to facilitate the integration of answer set programming in real-world applications, in this paper, we show how to ensure that the problem encoding in a logic program remains consistent given any (allowed) set of consistent instance data. Inspired by Eiter et al . (2002) and Alferes et al . (1998Alferes et al . ( , 2000 and their work on logic program updates, we develop a strategy to extend rules of a logic program such that the derivation of contradictory statements is no longer possible in any admissible case. The presented approach expands previous approaches in two major ways: (1) Programs that are modified following our approach remain consistent for any given input data that do not contain atoms that appear in head literals of the program. For that, we extend the notion of literals and investigate the relationship between the different negated versions of a literal. This enables us to define the characteristics of conflicting and non-conficting rules, and in particular to determine how the body of a rule r i that is in conflict with several rules r j can be extended such that the modified rule r i is no longer conflicting with any rule r j while the extension comprises only informative literals. By informative, we mean that these extensions should only be composed of literals whose atoms appear in the body of the rules involved in the conflict. For that reason, we also adapt the notion of hitting sets for (default) literals in logic program rules. As a result, the meaningfulness of the problem encoding is validated beforehand, eliminating the need for testing the encoding against all possible instances or other precautionary measures for each instance.
(2) Instead of using a technical device to prioritize one statement over another in case of a conflict like causal rejection (Eiter et al. 2002), we show how all informative extensions for a conflicting rule can be computed. As a consequence, a knowledge expert could then be included into the resolution process and choose the suggested rule modification that is most suitable such that the resulting modified program remains professionally adequate. Using informative extensions also maintains the readability of the rules in a program which in turn can simplify subsequent update operations.
(3) The final goal is the construction of a framework for the interactive maintenance of large ASP knowledge bases which can be used by knowledge experts without the need for technical knowledge and where each modification can be overseen by the expert. The approach presented in this paper is a basic building block for such a framework as the computation of all possible informative extensions can be used to resolve each conflict in cooperation with the knowledge expert which in turn guarantees that the resulting knowledge base still contains professionally adequate knowledge. We will also show that the approach follows a pragmatic paradigm which allows various extensions in order to facilitate the conflict resolution process for the expert.

Structure of the paper
The paper is organized as follows: We begin by providing the necessary preliminaries about extended logic programs in Section 2. In Section 3, we present our conflict resolution approach. We start in Section 3.1 by introducing the notion of uniformly noncontradictory program cores and examine the properties of conflicts and non-conflicting rules in Section 3.2 before we connect these results in Section 3.3 by defining the properties of a conflict resolution step. After describing a naïve conflict resolution approach in Section 3.4 by using semi-normal completions (Caminada 2006), we present in Section 3.5 our strategy to compute all appropriate rule modifications of conflicting rules in order to obtain a uniformly non-contradictory program core. In Section 4, we present additional ways to use and extend the conflict resolution approach for the usage in real-world applications. Sections 4.1 and 4.2 show how the presented method can be used to resolve many-to-many conflicts and how inconsistency that can be caused by a specific type of constraints can be prevented. Sections 4.3 and 4.4 outline ways to enhance the handling of λ-extensions in order to facilitate their usage in applications. The paper concludes with a summary and a discussion regarding future work.

Extended Logic Programs
In this paper, we look at non-disjunctive extended logic programs (ELPs) (Gelfond and Lifschitz 1991). An ELP is a finite set of rules over a set A of propositional atoms. First, we discuss the different forms of negation in ELPs and introduce notations. A classical literal L is either an atom A (positive literal ) or a negated atom ¬A (negative literal ). For a literal L, the strongly complementary literal L is ¬A if L = A and A otherwise. For a set S of classical literals, S = {L | L ∈ S} is the set of corresponding strongly complementary literals. Then, Lit A denotes the set A ∪ A of all classical literals over A. A default-negated literal L, called default literal, is written as ∼L. In logic programs, ∼ will be used as a prefix solely for classical literals, symbolyzing the default negation which is usually denoted by the prefix not (Gelfond and Lifschitz 1991). Outside of logic programs, we will use ∼ as a unary junctor in order to describe the default complement of a (default) literal (∼)L, that is, the default complement of L is ∼L and the default complement of ∼L is ∼∼L = L. This reflects the binary characteristic of the default negation which is illustrated in Figure 1. For a set S of classical literals, we define ∼ accordingly, that is, ∼S = {∼L | L ∈ S}. Given a set S of (classical) literals, we say a (classical) literal L is true in S (symbolically S L) iff L ∈ S and ∼L is true in S (symbolically S ∼L) iff L / ∈ S. By an extended literal L * , we either mean a (classical) literal L or a default-negated literal ∼L. The set of all extended literals over a set of atoms A will be denoted by Lit * A , that is, With atom(L * ), we will associate the atom on which the extended literal L * is based on. The underlying atoms of a set X of extended literals is given by the set of atoms Atom(X) = {atom(L * ) | L * ∈ X}. Two extended literals L * ,K * are atom-related if atom(L * ) = atom(K * ). The following definition introduces handy terms to describe the relationships between literals.

Definition 1
Given a classical literal L, we say that • L and ∼L are default complementary, • L and ∼L are dual, and • ∼L and ∼L are reconcilable.
Given two atom-related literals L * , K * with L * = K * , we will say L * and K * are • complementary if L * , K * are strongly or default complementary, and • compatible if L * , K * are reconcilable or dual.
A set of classical literals is inconsistent if it contains strongly complementary literals. A set of extended literals is inconsistent if it contains complementary literals. Figure 2 visualizes the different relationships that two atom-related literals L * ,K * can have. The different negation types and the particular significance of reconcilable literals will be discussed in Section 3.3.
We are now ready to specify the form of ELPs. A rule r is of the form with classical literals L 0 , . . . , L n and 0 ≤ m ≤ n. The literal L 0 is the head of r, denoted by H(r), and {L 1 , . . . L m , ∼L m+1 , . . . ∼L n } is the body of r, denoted by B(r). Furthermore, {L 1 , . . . , L m } is denoted by B + (r) and {L m+1 , . . . , L n } by B − (r). Given a set of rules R ⊆ P, we will denote the set of all extended literals occurring in the rule bodies of R by B * (R), that is, B * (R) = r∈R B(r). A rule r with B(r) = ∅ is called a fact, and r is called a constraint if it has an empty head. For a fact L., we will call the corresponding 6 A. Thevapalan and G. Kern-Isberner literal L a fact literal. A set F of facts is consistent if the set of fact literals in F is consistent. A rule r will be called a complex rule if r is neither a fact nor a constraint. An extended logic program (ELP) is a set of rules of the form (1). The program P + will denote the reduction of P to a normal program (a logic program without classically negated literals) that is obtained by replacing every classically negated literal A in P by a new corresponding atom A (Gelfond and Lifschitz 1991).
A rule r is applicable iff there is a consistent set S of classical literals such that S B(r). For the rest of this paper, we will assume that every rule in a given logic program is applicable. Given a set S of classical literals, a (complex) rule r is true in S (symbolically S r) iff H(r) is true in S whenever B(r) is true in S. In case r is a constraint, r is true in S iff S B(r). Whenever a rule r is true in S we also say that S satisfies r. A rule body B(r) will be called satisfiable if there exists a consistent set S of classical literals such that S B(r). Correspondingly, given a set of rules R = {r 1 , . . . , r n }, the bodies of all rules in R are simultaneously satisfiable whenever there is a set S of classical literals such that S B(r) for every rule r ∈ R. Given an ELP P without default negation, the answer set of P is either (a) the smallest set S ⊆ Lit A such that S is consistent and S r for every rule r ∈ P, or (b) the set Lit A of classical literals. Note that similar to Horn logic programs, each such ELP has exactly one minimal model which might, however, be inconsistent.
In general, an answer set of an ELP P is determined by its reduct. The reduct P S of a program P relative to a set S of classical literals is defined by A set S of classical literals is an answer set of P if it is the answer set of P S (Gelfond and Lifschitz 1991). The set of all answer sets of a program P will be denoted by AS(P). Note that since every inconsistent set of literals that satisfies all rules in P will be replaced by Lit A , every reduct of P is formed relative to either a consistent set S or Lit A . As a consequence, AS(P) can either consist of only consistent sets of literals, only Lit A , or no sets at all. We say a classical literal L is derivable in P iff L ∈ AS(P). For a set T of classical literals, we say all literals in T are simultaneously derivable iff there exists an answer set S ∈ AS(P) such that T ⊆ S. Atoms that occur in the rule bodies of P but not in any rule head will be called external atoms and the set of external atoms will be denoted by E P . Atoms that occur in P that are not external will be called internal atoms. As stated in van Gelder et al . (1991), deductive databases are commonly viewed as logic programs as they consist of an external database, which is a set of facts, and the internal database, which is a set of rules. In software applications, often the same program is used with different input data. This can also be applied to extended logic programs. Similar to the division inside databases and the distinction between problem instance and encoding as mentioned before, we partition an ELP P into a set P F of facts which we will call input, and a set P C of rules which will be called program core. We define that any valid input P F for P C is a consistent set of facts over LitE P and that P C can only comprise complex rules. The set of all valid inputs P F for a program core P C will be denoted by I(P C ). By Π(P C ) = {P C ∪ P F | P F ∈ I(P C )}, we denote the set of all programs P C extended by a valid input P F for P C . In Section 3.1, we will explain why it is necessary to restrict P F to literals in LitE P .
As mentioned above, default negation puts a classical literal L into a binary state w.r.t. a set S of classical literals. Either L is true in S while ∼L is false in S or vice versa. With regard to strong negation however, this is not the case. In Figure 1, this distinction is illustrated by the gap between true and false on the level of A and A. Under three-valued semantics (Przymusinski 1991), this additional state is referred to as undefined. Atoms A and A are undefined in S if neither A nor A are derivable in S. Under answer set semantics, this undefinedness is covered by default literals, that is, both ∼A and ∼A are simultaneously true whenever neither A nor A is derivable. It is for this reason that we introduced the notion of reconcilable literals. Even though for two reconcilable literals ∼A, ∼A, the atoms A, A "inside" the literals are strongly complementary, the default negation allows that both literals are true simultaneously in S, that is, S {∼A, ∼A} whenever A, A / ∈ S.

Consistency
In Gelfond and Lifschitz (1991), an answer set program P over A is inconsistent if P has no answer sets or its only answer set is Lit A . We will specify inconsistency in more detail by using the results in Schulz et al . (2015) where the authors define four different cases how and why an ELP can be inconsistent. There, in the first three cases 1, 2 and 3a, the inconsistency is essentially caused by classically complementary literals in the program, that is, by their simultaneous derivation. In the fourth case 3b, a so called negative dependency path exists that leads to the derivation of default-complementary literals. From a semantic viewpoint, in case 1 and 2, P has no well-founded models. In case 3a, P has a well-founded model, and the normal program P + of P has one or more answer sets. In case 3b, P has a well-founded model but P + has no answer sets. We will say that an inconsistent ELP P is contradictory if the inconsistency is caused by classically complementary literals (case 1, 2 or 3a). Otherwise, P will be called incoherent (case 3b). 1 In this work, we will only consider contradictory programs. The handling of incoherent programs is examined in Thevapalan et al . (2021) as well as in Costantini (2006).
The presented method will guarantee that a modified ELP P is not contradictory with any valid input P F . For this reason, we introduce the notion of uniformly noncontradictory program cores.
Definition 2 (Uniformly Non-Contradictory Program Core) A program core P C of an ELP P over A is uniformly non-contradictory if for every valid input P F for P C , P C ∪ P F is not contradictory.

Corollary 1
Given a uniformly non-contradictory program core P C over A, for every P ∈ Π(P C ) the following holds: either S = Lit A for every S ∈ AS(P), or P is incoherent.
Naturally, given a program core P C , every program P ∈ Π(P C ) is uniformly noncontradictory whenever P C is.

8
A. Thevapalan and G. Kern-Isberner As stated in Gelfond and Lifschitz (1991) and implied by Corollary 1, non-contradictory program cores do not guarantee consistent programs since an ELP that is free of contradictions could potentially still be incoherent. Detecting incoherence and establishing coherence in an ELP, though, is a separate task (see Schulz et al . 2015;Schulz 2017) and outside of the scope of this paper. We, therefore, assume that in the following, any given ELP is coherent if not stated otherwise.

Contradictions
The aim of this paper is to present a method that analyzes program cores and computes possible modifications such that the modified program core becomes uniformly noncontradictory. The presented method will, therefore, ensure that given a program core P C , there is no contradictory ELP P ∈ Π(P C ). To that end, we first identify what may cause contradictions. We will then show how to find the causes (conflict detection) and remove them (conflict resolution). In this section, we will assume that any given program core P C does not contain constraints. The influence of constraints with respect to the consistency of the program will be examined in Section 4.2.

Conflicts
To find rules that could potentially lead to contradictions, one has to look at rules with strongly complementary head literals. We will call two rules with strongly complementary head literals conflicting if both rule bodies are simultaneously satisfiable by a consistent set of classical literals.

Definition 3 (Conflicting Rules, Conflict Thevapalan and Kern-Isberner 2020)
Suppose an ELP P. Two rules r, r ∈ P C , r = r , are conflicting (written as r r ) if H(r) and H(r ) are strongly complementary and there exists a consistent set of classical literals S ⊆ Lit A such that B(r) and B(r ) are true in S. A conflict is a pair (r, r ) of rules such that r, r are conflicting. We will denote the set of all conflicts (r, r ) in an ELP P by Conflicts(P), and correspondingly the set of all conflicts (r, r ) involving a rule r will be denoted by conflicts(r). Furthermore, we will refer to the set of rules r ∈ P that are conflicting with r in P as adversarial rules of r, denoted by Adv(r), that is, Adv(r) = {r | r r , r ∈ P}. We will call two rules r, r non-conflicting (symbolically r r ) iff r r does not hold.
Remark 1: (a) If r, r ⊆ P C are conflicting rules, then there exists a consistent set S of classical literals such that S B(r), B(r ). Consequently, there is a set of facts F (obtained from S in a straighforward way) such that P C ∪ F is contradictory. (b) The identification of two rules as conflicting is done independently of the rest of the program core and especially independently of any set F of currently given facts.

Proposition 1
Given an ELP P over A, its program core P C is uniformly non-contradictory if P C does not contain any conflicts.
L ∈ B + (r ) r r (possibly) r r r r r r (possibly) L ∈ B + (r ) r r r r (possibly) r r (possibly) r r L ∈ B − (r ) r r r r (possibly) r r (possibly) r r (possibly) L ∈ B − (r ) r r (possibly) r r r r (possibly) r r (possibly)

Proof
Assume an ELP P whose core P C is not uniformly non-contradictory. Then, by Definition 2, there exists a valid input P F such that P = P C ∪P F is contradictory. This implies that there exist two complementary literals L, L that are simultaneously derivable in P. L, L are only simultaneously derivable if either (a) {L., L.} ⊆ P F , or (b) L. ∈ P F and there exists a rule r ∈ P C with H(r) = L such that B(r) is satisfied in P, or (c) there exist two rules r, r ∈ P C with H(r) = L, H(r ) = L such that B(r), B(r ) are satisfied in P. Regarding (a): P F cannot contain fact literals L, L because P F has to be consistent by definition. Regarding (b): P F does only contain facts over external atoms. Since, by definition, external atoms do not occur in rule heads of P C , L. cannot be in P F whenever there is a rule in P C with head literal L. Therefore, the only way how L, L could be derived simultaneously is if (c) holds, that is, if there exist two rules r, r in P C with complementary rule heads that are satisfiable in P. Consequently, if P C is not uniformly non-contradictory, then P C contains at least one conflict.
In nonmonotonic logics, the possible occurence of contradictions is often dealt with by restricting the syntax of knowledge representation languages. As mentioned before, restricting the set of possible facts in P F to facts over external atoms of the respective program core limits the expressibility in programs. But this limitation assures that contradictions via a rule in P C and a fact in P F cannot arise even if P C is conflict-free since those kinds of contradictions are not caused by conflicts between complex rules in P C . Therefore, in the following, P F will only consist of fact literals over E P .

Conflict detection
We will now analyze the properties of (non-)conflicting rules. For two rules with complementary heads to be conflicting, both their bodies have to be satisfiable by at least one consistent set of literals. Table 1 shows the different combinations in which an atom A ∈ A can appear as a classical literal L in an ELP P over A in the bodies of two rules r, r with complementary rule heads. For each case, the table states whether both rule bodies can hold simultaneously and consequently, whether L makes the two rules explicitly non-conflicting, or a conflict might be possible. It is easy to see that r, r are nonconflicting whenever the corresponding extended literals in B(r), B(r ) that are based on A are strongly or default complementary. These observations lead to the following conclusion: 10 A. Thevapalan and G. Kern-Isberner Theorem 1 Let P be a program with rules r, r ∈ P C . Two rules r, r are conflicting if and only if

(CP1) H(r), H(r ) are strongly complementary, and
Proof Suppose an ELP P over A, and rules r, r in P C that satisfy (CP1), (CP2), and (CP3). For rules r, r to be conflicting according to Definition 3, their head literals have to be strongly complementary, that is, L = H(r) and L = H(r ). This is satisfied via (CP1). Definition 3 also requires that for r, r to be conflicting, there has to exist a consistent set S ⊆ Lit A of classical literals for which the bodies B(r), B(r ) are true. We show that S = B + (r) ∪ B + (r ) is such a set. By (CP3), S is consistent. In order for S to satisfy both rule bodies B(r), B(r ) simultaneously, S has to have the following properties by definition: ( 3) Due to our assumption (see Remark 1), the first and the last intersection in (3) are empty, and due to (CP2), also the middle ones in (3) are empty. Altogether, we have S ∩ (B − (r) ∪ B − (r )) = ∅ which yields (a). So, (r, r ) is a conflict in P. Conversely, let P be an ELP with conflicting rules r, r ∈ P C . (CP1) holds, since by definition, the head literals of r and r are strongly complementary. Furthermore, there exists a consistent set S of classical literals such that B(r) and B(r ) are true in S. Since S cannot satisfy two classical literals L and ∼L simultaneously, (CP2) holds. As S is consistent, its subset B + (r) ∪ B + (r ) is also consistent. Therefore, (CP3) holds.
Given (CP2) and (CP3) in Theorem 1 and Table 1, we can see that r, r are not conflicting whenever B(r) contains a literal L such that B(r ) contains a literal that is either strongly or default-complementary to L.

Definition 4 (Conflict-Preventing Literals)
Given an ELP P and two rules r, r ∈ P C with complementary heads, two extended literals L * ∈ B(r), K * ∈ B(r ) are conflict-preventing if L * and K * are atom-related and complementary.
This leads us to the following observation:

Proposition 2
Let P be an ELP with two rules r, r ∈ P with complementary heads. The rules r, r are non-conflicting iff there exist two extended literals L * ∈ B(r), K * ∈ B(r) such that L * , K * are conflict-preventing.

Proof
Two conflict-preventing literals L * ∈ B(r), K * ∈ B(r ) are either (a) defaultcomplementary or (b) strongly complementary. In case of (a), the rules r, r will not satisfy https://doi.org/10.1017/S1471068422000357 Published online by Cambridge University Press (CP2) in Definition 3, and in case of (b), (CP3) is not met. On the other hand, if two rules r, r with complementary head literals are non-conflicting, then by Definition 3 either condition (CP2) or (CP3) or both are not met. As shown before, (CP2) (resp. (CP3)) can only be not satisfied by r, r if their bodies contain default-complementary (resp. strongly complementary) literals L * ,K * . In both cases, L * ,K * are conflict-preventing literals.

Example 1
Consider the ELP P 1 : P 1 has two conflicts: (r 1 , r 4 ) and (r 1 , r 5 ). The rules r 1 , r 2 violate (CP2) and have the conflict-preventing literals b, ∼b. The rules r 1 , r 3 violate (CP3) and have the conflictpreventing literals a, a.

Conflict resolution
Next, we will show how to resolve conflicts in an ELP P. To resolve all conflicts in P, one or both rules of each conflict in Conflicts(P) have to be modified such that P C becomes uniformly non-contradictory. We will call the modification of P to P a conflict resolution step whenever at least one conflict is resolved and a sequence of conflict resolution steps P (1) , P (2) , . . . , P (n) will be called conflict resolution process. We present an approach to compute possible solutions to resolve a conflict in P such that the following properties hold: (P1) The conflict resolution process is successful. By that, we mean that a conflict resolution process where in each step a computed resolution option is applied will eventually lead to a non-contradictory program core, that is, a finite sequence of conflict resolution steps P (1) , . . . , P (n) such that Conflicts(P (n) ) = ∅. (P2) Each conflict resolution step is minimally invasive as it only consists of extending the body of a conflicting rule. This means, for every rule r ∈ P C with conflicts(r) = ∅, the corresponding modified rule r ∈ P C satisfies that H(r ) = H(r) and B(r ) ⊇ B(r), and for every other rule r, it holds that r = r. (P3) Each rule that is modified during the resolution process remains applicable.
Given an ELP P over a set of atoms A and a rule r i ∈ P C with a non-empty set conflicts(r i ), we want to modify r i to a rule r i such that every conflict in conflicts(r i ) is resolved, that is, conflicts(r i ) = ∅. For that, our approach analyzes how the extended literals Lit * A of P jointly appear in the rules of Adv(r i ), and computes conflict-resolving extensions for r i .

Definition 5
Given an ELP P over A and a rule r i ∈ P, a λ-extension λ(r i ) for r i is a set of extended literals L * ∈ LitE P such that Atom(λ(r i )) ∩ Atom(B(r i )) = ∅. A rule r i of the form 12 A. Thevapalan and G. Kern-Isberner (4) will be called a λ-extended rule w.r.t. λ(r i ).
To resolve all conflicts (r i , r j ) ∈ conflicts(r i ) of a rule r i ∈ P, we want to gather those λ-extensions λ(r i ) for r i such that the λ-extended rule r i w.r.t. λ(r i ) and each r j are not conflicting, that is, conflicts(r i ) = ∅.

Definition 6
Given an ELP P over A and a rule r i ∈ P with Adv( We say a conflict-resolving λ-extension for r i resolves all conflicts in conflicts(r i ) simultaneously.
Hence, in order to obtain a uniformly non-contradictory program core P C , we resolve all conflicts in P C by extending the bodies of particular conflicting rules by a respective conflict-resolving λ-extension.
We can show that extending a rule in P by a λ-extension does not lead to additional conflicts.

Proposition 3
Let P τ = P\{r i } be the set of all rules in P other than r i . Let furthermore r i be the λ-extended rule w.r.t. a λ-extension λ(r i ) and Proof Suppose a rule r j ∈ P such that r i r j holds. Then by Proposition 2, B(r j ) and B(r i ) do not contain conflict-preventing literals. Since B(r i ) ⊆ B(r i ), this implies that B(r j ) and B(r i ) do not contain conflict-preventing literals either and, therefore, r j r i holds. Consequently, if a λ-extended rule r i w.r.t. a λ-extension λ(r i ) is in conflict with another rule r j ∈ P, then r i and r j are already conflicting.
Note that Proposition 3 holds for general λ-extensions and not exclusively for conflictresolving ones.
Extending B(r i ) with a subset-minimal λ-extension λ(r i ), therefore, constitutes a cautious change in P. As a consequence, a uniformly non-contradictory program core P C is obtained by applying changes to P C that are justified in the technical and logical sense.

A Naïve approach: Semi-normal completion
Preventing the derivation of contradictions is a well-known problem. In default logic for example, normal default theories in Reiter (1980) provide a solution to this problem by restricting the form of defaults. In normal default theory, every default has to be of the form α:β β , meaning that β can only be concluded if α is explicitly true and β can be assumed to be true. This guarantees that the default theory has at least one extension. This idea was adapted for rules of logic programs by Caminada in Caminada (2006), Caminada and Sakama (2006). In Caminada (2006), semi-normal defeasible rules are introduced. These rules have the following form: https://doi.org/10.1017/S1471068422000357 Published online by Cambridge University Press On establishing robust consistency in answer set programs 13 Obviously, if a program core P C only consists of semi-normal defeasible rules, P C is also uniformly non-contradictory. The transformation of a program core P C to a uniformly non-contradictory core SN (P C ) using semi-normal defeasible rules can, therefore, be defined in a straightforward way. The semi-normal completion SN (P C ) of P C arises from the extension of the body of each rule r ∈ P C by the literal that is dual to the head literal of r.

Definition 7
Given a rule r: L ← B(r)., the semi-normal completion sn(r) of r is a rule of the following form: In case there is a conflict in the initial program core P C , this conflict is prevented by the additional literals in the rule bodies of the conflicting rules which are dual to the respective head literal.
It is easy to see that when using a semi-normal completed program core P C over A, the restriction that a valid input P F for P C can only consist of literals over E P becomes void. Instead, it would allow the input P F for P C to be over A. However, this type of automated conflict-prevention does not explicitly resolve the underlying problems, that is, the actual contradictions that are modelled by the rules of the initial P C .

Example 2
Consider the following program core: SN (P C,2 ): r 1 : allergicToPeanuts ← ∼allergicEvent. r 2 : allergicToPeanuts ← testedPositivePA. r 3 : canEatPeanuts ← allergicToPeanuts. P C,2 states that if someone never had an allergic event, they are not allergic to peanuts. If someone is tested positive for a peanut allergy, they are indeed allergic to it. If someone is explicitly not allergic to peanuts, they are allowed to eat peanuts. The semi-normal completion of P 2,C yields: Assume the input P F = {testedPositivePA.} for SN (P C,2 ). For P F ∪ SN (P C,2 ), we get the answer sets S 1 = {testedPositivePA, allergicToPeanuts}, and Clearly, S 2 shows that P C,2 contains wrong information or lacks crucial information. For example, in this case, r 1 only looks at allergic events without considering the possibility that one never consumed a peanut and therefore never had a reaction to begin with. 14 A. Thevapalan and G. Kern-Isberner Semi-normal completions of conflicting rules rather "bypass" potential contradictions as the complementary statements are just considered separately instead of at the same time, which, of course, leads to contradictions. This, in turn, means that given a program core P C with conflicting rules, solving programs P ∈ Π(SN (P C )) with the semi-normal completed program core will in fact yield answer sets that are not adequate in the professional sense as at least one of the answer sets will represent unintended conclusions as we have seen in Example 2. From a functional perspective, such an effect is not desirable whatsoever. Semi-normal completions can, therefore, be in fact regarded as quickfixes in order to assure consistent answer sets regardless of what the resulting answer sets actually represent. Example 2 illustrates that semi-normal program cores do not suffice if one wants to establish a knowledge base that represents adequate information and their relations in the professional sense. To incrementally repair the knowledge base, one has to analyze conflicting rules and explicitly add, remove, or modify rules in order to get rid of all conflicts.

Conflict resolution with informative extensions
In the following, we present an approach to obtain uniformly non-contradictory program cores by computing conflict-resolving λ-extensions for rules r i . Since λ-extensions only comprise literals whose atoms occur in the bodies of the adversaries r j ∈ Adv(r i ) and that do not contain literals that are atom-related to H(r i ), the extensions are informative in the sense that they utilize the body literals of the rules that are involved in the conflicts of r i without introducing new atoms or using the head literal. Semi-normal completions are, in comparison, a purely technical device to prevent contradictions and thus not informative.
According to Theorem 1, for every rule r j ∈ Adv(r i ), λ(r i ) has to contain at least one conflict-preventing literal, that is, an extended literal L * such that there exists an extended literal K * ∈ B(r j ) and L * , K * are complementary. This means that a conflictresolving λ-extension for r i can be obtained by finding a set β of literals that contains at least one body literal of each rule r j ∈ Adv(r i ) and that does not contain any literals that occur in the body of r i . This set β can then be transformed into a conflict-resolving λ-extension λ(r i ) by negating each literal in this set. It is easy to see that in order for the λ-extended rule r i to remain applicable, each computed conflict-resolving λ-extension and therefore each such β has to meet additional constraints which we will explore next.
In order to compute these sets β, we will first adapt the notion of hitting sets (Berge 1989) as follows: Let AB(r i ) = {B(r j ) | r j ∈ Adv(r i )} be the collection of all rule bodies in P C whose rules are in conflict with r i . A hitting set of AB(r i ) is a subset h ⊆ Lit * A that meets every set in AB(r i ), that is, B(r j ) ∩ h = ∅ for every B(r j ) ∈ AB(r i ). A hitting set h is minimal if there does not exist a proper subset of h that is also a hitting set. It is easy to see that minimal hitting sets of AB(r i ) provide a good starting point to attain suitable conflict-resolving extensions λ(r i ) since every hitting set shares at least one extended literal with the body of every rule r j ∈ Adv(r i ). One could assume that to compute a set of conflict-preventing literals, it suffices to just take any minimal hitting set of AB(r i ) and simply default-or strongly negate each extended literal of that hitting set. But as mentioned before, not every hitting set can be used to compute conflict-resolving extensions as there are some more conditions that have to be met. We have to ensure that a λ-extended rule r i of r i is still applicable. The applicability is not given if (a) the conflict-resolving extension itself is already inconsistent or (b) the extended rule body B(r i ) becomes inconsistent. Case (a) applies if a hitting set h contains complementary or reconcilable literals L * , K * as every combination of their strongly and default negated complement is also complementary. 2 To ensure that (b) does not apply, we only consider those hitting sets that do not comprise literals that are atom-related to literals in B(r i ). Hence, hitting sets that contain complementary or reconcilable literals and hitting sets that share common underlying atoms with B(r i ) will not be used to compute conflictresolving λ-extensions.
Remark 2: The restriction emerging from (b) is a bit stricter than necessary as rules with atom-related literals in their bodies are still satisfiable if these atom-related literals are compatible. But in order to avoid unnecessary technicalities, we will omit this special case here.
All these restrictions lead us to the following extension of hitting sets called blankets which we will use to compute proper conflict-resolving λ-extensions: Definition 9 (Blanket) A blanket β for Adv(r i ) is a non-empty, ⊆-minimal, consistent set of extended literals L * ∈ Lit * A without reconcilable literals such that Atom(β) ∩ Atom(B(r i )) = ∅ and for each r j ∈ Adv(r i ), there exists an extended literal L * ∈ β with L * ∈ B(r j ). We denote the set of all blankets for Adv(r i ) by blankets(Adv(r i )).

Example 3
Suppose the following rules: Consider the following ELP: P 3 = {r 1 , r 2 }. For Adv(r 1 ) in P 3 , there does not exist a blanket since every body literal of r 2 also occurs in the body of r 1 . Now, consider the ELP P 3 = {r 1 , r 3 , r 4 }. The only body literals of r 3 , r 4 that do not occur in r 1 are ∼e, ∼e. Since a blanket for Adv(r 1 ) in P 3 must not contain reconcilable literals, there does not exist a blanket for Adv(r 1 ).
Likewise, for the ELP P 3 = {r 1 , r 3 , r 5 }, we observe the following: The only body literals of r 3 , r 5 that do not occur in r 1 are ∼e, e. Since a blanket for Adv(r 1 ) in P 3 must not contain complementary literals, there does not exist a blanket for Adv(r 1 ).

16
A.  Suppose an ELP P 4 with the following rules: Program P 4 describes the following scenario: Suppose a therapy X that was developed for patients with condition A. Currently only patients with an advanced form of condition A are eligible (r 1 ). Furthermore, imagine a specific laboratory value L in a patient's body that can only be determined via an invasive test which is why such a test can only be done once every 6 months at most. Recently completed long-term studies now indicate that there are some exceptions where X must not be recommended to a patient with advanced A. The therapy should not be used on a patient if it is unknown whether they currently have a high or low L-count and if it is also unknown if they were treated with drug N sometime in the past (r 2 ). If the usage of a substance R is not contraindicated andthe patient has a low L-count, treatment X must also not be recommended (r 3 ). Finally, if patient has a high L-count, they should not receive treatment X if it cannot be concluded that the patient was treated with drug M in the past (r 4 ).
Rule r 1 is in conflict with every other rule: The literals of the rule bodies in Adv(r 1 ) do not share any common underlying atoms with the literals in the body of r 1 . The set blankets(Adv(r 1 )) of all blankets for Adv(r 1 ) consists of the sets β 1 , β 2 , β 3 , β 4 , β 5 where For the remainder of this paper, we will assume that for any rule r i with Adv(r i ) = ∅, there exists at least one blanket for Adv(r i ). This particularly implies that for any given conflict pair (r i , r j ), Atom(B(r j )) − Atom(B(r i )) = ∅ has to hold. We will assume that r i will be chosen such that this condition is satisfied. If this is not possible in practice, one or both rules have to be modified more individually, for example, by introducing new atoms to P. Other solutions will be discussed in Section 3.6. Now, we will describe how to compute all possible conflict-resolving λ-extensions λ(r i ) given a blanket β for Adv(r i ).
In order to use a blanket β ∈ blankets(Adv(r i )) to resolve all conflicts (r i , r j ) in conflicts(r i ), the literals in β have to be negated such that for each conflict pair, the addition of the negated literals to the body of r i leads to the violation of either property (CP2) or (CP3) in Theorem 1. Due to the fact that default and strong negation cannot be used interchangeably as default literals cannot be strongly negated, we propose the following neg-operator, which for an extended literal L * with atom(L * ) = A, outputs the set of literals that are complementary to L * : Therefore, the neg-operator can be used to compute the proper conflict-preventing literals. In fact, we want to extend the neg-operator such that the application of the resulting operator on a blanket for r i will yield the set of all corresponding conflict-resolving λ-extensions λ(r i ). For this purpose, we have to ensure that the negations of all literals in a blanket yield extended rules of the form (4) that are still applicable. Consequently a blanket must not contain complementary literals. Dual literals however are allowed in a blanket since their negation via the neg-operator leads to non-complementary literals.
Additionally, since we want minimal sets of conflict-resolving literals, given a blanket with dual literals L * , K * , we only want to consider those negated forms that both L * , K * have in common. Therefore, we extend our neg-operator such that the negation of atom-related literals only yields the negated form that both literals have in common, that is, where X is a set of extended literals. Applied on a blanket and their literals, the resulting literals uphold a crucial property:

Example 5
Suppose the following sets X 1 = {a, b, ∼b}, X 2 = {a, b, b}, and X 3 = {a, b, ∼b}. The negation of these sets via the neg-operator yields The negation of dual literals in X 1 leads to the output of the common literal b whereas complementary literals like in X 2 and X 3 do not share common negated forms.
Example 5 illustrates why blankets are allowed to contain dual literals since they share a common negated form, but must not have complementary literals. When looking at the negation of X 2 in Example 5, one can see that strongly negated literals still have negated forms that are not complementary, viz., the reconcilable literals ∼b, ∼b. In contrast to complementary literals, reconcilable literals in a rule body will not inhibit the satisfiability of the rule. The examples, therefore, demonstrate that by requesting common negated 18 A. Thevapalan and G. Kern-Isberner forms, our approach is prima facie stricter than necessary. But in order to keep this approach simple while guaranteeing that conflict-resolving λ-extensions maintain the satisfiability of the extended rule, we will only allow combinations of atom-related literals whose negations are guaranteed to be non-complementary.

Lemma 1
Let an ELP P and a rule r ∈ P be given. For each extended literal L * in a blanket β for Adv(r), neg β (L * ) is a non-empty set of extended literals which are complementary to L * .

Proof
Since the neg-operator as defined in (6) returns a non-empty set for any extended literal L * , neg β (L * ) can only be an empty set if β contains some distinct atom-related liter- In all other cases, neg(K * 1 ) ∩ neg(K * 2 ) = ∅. Let therefore K * 1 , K * 2 be dual literals. For any K * 3 , it is easy to see that by (6) holds. This is due to the fact that in every set of at least three different atom-related literals, there are at least two literals that are not dual. Consequently, neg β (L * ) = ∅ if β contains more than two atom-related literals or if there exist two atom-related literals K * 1 , K * 2 ∈ β such that K * 1 , K * 2 are not dual. A blanket does not contain complementary or reconcilable literals by definition and only allows atom-related literals that are dual. This implies that for each extended literal K * 1 in β, there exists at most one other extended literal K * 2 in β such that K * 1 , K * 2 are atom-related, and all atom-related literals in β are dual. Thus, for each extended literal L * ∈ β, neg β (L * ) is not empty. More precisely, neg β (L * ) always contains either L or ∼L or both. If β does not contain literals that are atom-related to L * , then neg β (L * ) = neg(L * ) holds.
For a set X of extended literals L * , we define Neg(X) as the set of all possible sets T where T contains every literal of X in a negated form, that is, Neg(X) = {T | T ⊆ L * (X), T contains exactly one element of each non-empty set neg X (L * ), L * ∈ X}, where L * (X) = L * ∈X neg X (L * ). Due to Lemma 1, there always exists at least one such set T .
Example 6 (Example 5 continued ) Continuing Example 5, we get Neg(X 2 ) = Neg(X 3 ) = {a}, {∼a} since neg X2 (a) = neg X3 (a) = {a, ∼a}, and the negation of all other literals yields an empty set. For X 1 , however, we get Neg(X 1 ) = {a, b}, {∼a, b} because as for X 2 , X 3 , the negation of a produces two different possible negations and additionally b and ∼b have the common negated form b.

Lemma 2
Let an ELP P, a rule r ∈ P and a blanket β for Adv(r) be given. Furthermore, let λ ∈ Neg(β). For each extended literal L * ∈ β, λ contains exactly one extended literal K * such that L * , K * are complementary.

Proof
Lemma 1 states that for each L * ∈ β, neg β (L * ) consists of either one or two extended literals and each of them is complementary to L * . Consequently, it follows by (8) that each λ contains a literal K * for each L * in β such that L * ,K * are complementary. With Corollary 2, there exists exactly one such extended literal K * ∈ λ for each L * ∈ β.
Due to the fact that blankets(Adv(r i )) is a set of sets, we will extend the Neg-operator to also consider sets X = {X 1 , . . . , X n } of sets X 1 , . . . , X n of extended literals. For such a set X , N (X ) shall therefore output the set of all negated form variations in all sets X 1 , . . . , X n ∈ X , that is, Lemma 3 Let an ELP P and a rule r ∈ P be given. Each λ ∈ N (blankets(Adv(r))) does not contain any complementary literals.

Proof
Since every λ consists of a literal L * ∈ neg β (L * ) for every literal L * ∈ β, λ can only contain complementary literals if there are complementary literals between sets neg β (L * ). By Corollary 2, this is not possible since β itself does not contain complementary or 20 A. Thevapalan and G. Kern-Isberner reconcilable literals. Consequently, for each λ ∈ N (blankets(Adv(r))), it holds that λ does not contain complementary literals.

Proposition 4
Every λ-extended rule r i of the form of a rule r i ∈ P is applicable.

Proof
Suppose a λ-extended rule r i w.r.t. a λ-extension λ(r i ). Rule r i is not applicable if (a) r i is not applicable, (b) λ(r i ) is not satisfiable, or (c) B(r i ) ∪ λ(r i ) is not satisfiable. Case (a) is not possible due to our initial assumption that all rules in a given logic program are applicable. Case (b) can only hold if λ(r i ) contains complementary literals. By Lemma 3, this is not possible for any conflict-resolving extension λ(r i ). Then, case (c) can only hold if there exist complementary literals between B(r i ) and λ(r i ). By Definition 9, a blanket for r i cannot contain literals that are atom-related to any literals in B(r i ). Consequently, any conflict-resolving extension λ(r i ) for r i does also not contain any literals that are atom-related to a literal in B(r i ). Therefore, any λ-extended rule of the form (10) is applicable.
We are now ready to relate conflict-resolving λ-extensions to blankets.

Proposition 5
Every λ(r i ) ∈ N (blankets(Adv(r i ))) is a conflict-resolving λ-extension for r i , that is, for every rule λ-extended rule r i w.r.t. λ(r i ), it holds that conflicts(r i ) = ∅ in P = P\{r i } ∪ {r i }.

Proof
Assume, by way of contradiction, that there exists a rule r j ∈ Adv(r i ) such that the λextended rule r i w.r.t. λ(r i ) and r j are conflicting, that is, r i r j . Then by Theorem 1, (CP2) and (CP3) hold, that is, B + (r i ) ∩ B − (r j ) = B + (r j ) ∩ B − (r i ) = ∅, and B + (r i ) ∪ B − (r j ) and B − (r i ) ∪ B + (r j ) are consistent. Let β be a blanket on which λ(r i ) is based on, that is, β ∈ blankets(Adv(r i )) and λ(r i ) ∈ Neg(blankets(Adv(r i ))). According to (9), this also means that λ(r i ) ∈ Neg(β) holds. By Definition 9, there exists an extended literal L * ∈ β such that L * ∈ B(r j ). If L ∈ B + (r j ), then by Lemma 2 either L ∈ λ(r i ) or ∼L ∈ λ(r i ). This consequently means that if L ∈ B + (r j ), then either L ∈ B + (r i ), which means condition (CP3) cannot hold or L ∈ B − (r i ), which in turn means that (CP2) cannot hold. On the other hand, if L ∈ B − (r j ), then by Lemma 2 and (4) L ∈ B + (r i ), and thus (CP2) cannot hold. In any case, λ(r i ) adds an extended literal to the body of r i such that (CP2) or (CP3) cannot hold for rules r i , r j . Therefore, r i and r j cannot be conflicting.
Looking at the result in Example 8, it becomes apparent that the N -operator for sets of sets does not necessarily output ⊆-minimal sets, that is, N (blankets(Adv(r 1 ))) contains {highLCount, preTreatedM } and two of its supersets {highLCount ctrIndR, preTreatedM } and {highLCount, preTreatedN , preTreatedM }. Since {highLCount, preTreatedM } already contains literals of every adversarial rule of r 1 in a negated form, additional literals become obsolete. Consequently, any superset of a set in N (blankets(Adv(r 1 ))) can be safely omitted. Therefore, for an ELP P with a rule r i , we denote the set of all ⊆-minimal sets in N (blankets(Adv(r i ))) by N min (blankets(Adv(r i ))).

Corollary 3
All conflicts in conflicts(r i ) are resolved simultaneously if r i is replaced by Every λ(r i ) ∈ N min (blankets(Adv(r i ))) is, therefore, a minimal conflict-resolving λ-extension for r i .
Note that if multiple conflicts are resolved simultaneously where the adversarial rules contain more than one literal, the inclusion of a knowledge expert can be crucial. In Example 10, any possible λ-extension for r 1 proposes a restriction on the eligibility for therapy X that is slightly stricter than the requirements that are implictly imposed by the adversarial rules. That is, the extension by λ 1 leads indeed to the resolution of the conflict. Now however, for instance patients that have a low L-count while being allergic to substance R cannot receive the treatment which is not explicitly specified in the original program. One reason for these stricter suggestions is that λ-extension are built to minimally cover the adversarial body literals in order to keep the approach simple and pragmatic. It is up to the knowledge expert to decide if the new knowledge that is represented in a λ-extension is justifiable w.r.t. to its professional adequacy. If the knowledge expert wants to adapt r 1 according to all adversarial rules such that r 1 "mirrors" them, they can consider accepting more than one suggestion which in this case would result in replacing r 1 by multiple λ-extended rules r 1 that guarantee that specific literal combinations are not overlooked, viz., an additional λ-extended rule of r 1 would have to be added where λ = {highLCount, preTreatedN , ctrIndR} if the knowledge expert wants patients with a low L-count to receive treatment X where substance R is contraindicated.
Once all λ-extensions for a conflict are computed, the corresponding λ-extended rules are presented to the expert. They can analyze the suggestions and apply the most suitable solution. Due to their expertise, the presented suggestions can hint to the underlying cause which can make the decision on the solution straightforward.
Moreover, though it demands for some technical knowledge, the framework could also allow the expert to refine a suggestion and then apply it. Even though, as shown above, all computed solutions are minimal and guarantee the resolution of the considered conflict, refining a solution based on the expert's knowledge can reinforce the robustness of the solution, that is, possible future conflicts after consecutive updates can be prevented.
Example 11 (Example 10 continued ) Suppose the knowledge expert has to decide on the solution for the conflict of rule r 1 . They are presented with the following suggestions: On establishing robust consistency in answer set programs 23 Presume the following scenario: Treatment X is applied when the therapy options for advanced condition A that were administered up to now has been exhausted. Contrary to treatment M , which is a more common therapy in this scenario, treatment N is a therapy that is recommended when the standard therapy options have not been effective since N is known to be more complicated and not without risks. Therefore, the knowledge expert decides that the solution for this conflict should include preTreatedN rather than preTreatedM to reflect that therapy X is only to be recommended if nothing else worked out. This leaves the expert with rules r (4) 1 and r (5) 1 as potential candidates. As therapy X itself is also not without risks, the expert wants to emphasize that any other requirements for this therapy should be defined as strictly as possible, for example, the physicians have to explicitly confirm that specific drugs are not contraindicated. Accordingly, before suggesting therapy X, it should be explicitly known whether the patient has indeed a low L-count. Therefore, rule r (4) 1 as a solution is the most fitting candidate. Example 11 highlights the fact that generally the suitability of a solution relies on knowledge that is not necessarily reflected in the program.
The following example illustrates that even in cases where a custom solution is required, the computed solutions can used as a basis for fitting solutions.
Example 12 (Example 11 continued ) Now suppose that at the time of the conflict resolution, studies revealed that in order to prescribe treatment X, the patient must not have an allergy towards a substance S. As r (4) 1 was found to be the most suitable suggestion, it suffices to add literal ctrIndS to B(r (4) 1 ) in order to require that substance S is not contraindicated. Thus, the expert yields eligX ← highLCount, preTreatedN , ctrIndR, ctrIndS .
as the final solution to solve all conflicts of r 1 in P 4 . This modification constitutes a refinement of a suggested λ-extension.
In Sections 4.3 and 4.4, we will show that the problem of knowledge gaps will also pertain to other aspects of conflict resolution. We propose to alleviate these shortcomings by implementing suitable interaction mechanisms between the system and the expert.
In the following, we will illustrate a complete conflict resolution step with two more examples. Example 13 comprises both short and long conflict-resolving extensions. Example 14 shows how redundant extensions are removed via N min .

A. Thevapalan and G. Kern-Isberner
The set blankets(Adv(r 1 )) of blankets for Adv(r 1 ) consists of the sets β 1 , β 2 , β 3 , β 4 , with The negation of each blanket in blankets(Adv(r 1 )) results in the following sets: Therefore, all conflicts in conflicts(r 1 ) can be resolved by replacing r 1 with a rule r 1 : a ← x, y, λ(r 1 ), where λ(r 1 ) ∈ N (blankets(Adv(r 1 ))) = N min (blankets(Adv(r 1 ))) = {d}, {∼d}, {b, c}, {∼b, c}, {b, e}, {∼b, e}, {c, e} . From a technical point of view, choosing λ(r 1 ) ∈ {d, ∼d} as a conflict-resolving extension for r 1 may seem as the most suitable choice prima facie, seeing that the addition of a single literal resolves all three conflicts of r 1 simultaneously. However, depending on what the rules actually represent, it is possible that a corresponding knowledge expert does not regard d and ∼d as viable options for resolving the conflicts of r 1 , and, instead, picks an extension that contains more than one literal.
The set blankets(Adv(r 1 )) of blankets for Adv(r 1 ) consists of the sets Note that literal ∼a does not appear in any blankets of r 1 by reason of atom(∼a) ∈ Atom(B(r 1 )).
The negation of each blanket in blankets(Adv(r 1 )) yields the following sets: This results in N (blankets(Adv(r 1 ))) =
Therefore, all conflicts in conflicts(r 1 ) can be resolved by replacing r 1 with a rule where λ(r 1 ) ∈ N min (blankets(Adv(r 1 ))) = {c, d}, {∼c, d}, {c, ∼d}, {∼c, ∼d}{c, b}, {∼c, b}, {c, f }, {∼c, f }, {b, d}, {∼b, d}, {b, ∼d}, {∼b, ∼d}, {b, e}, {∼b, e, f } . In summary, the results show that implementing a conflict resolution step via conflictresolving λ-extensions and blankets yields a conflict resolution process that possesses the properties (P1)-(P3) that were postulated earlier. By Proposition 5, given a rule r i ∈ P, every λ(r i ) ∈ N (blankets(Adv(r i ))) is a conflict-resolving λ-extension for r i . Since by every such conflict resolution step, the number of conflicts is reduced, for the final program P (n) of the conflict resolution process, it holds that Conflicts(P (n) ) = ∅. Moreover, we have shown that for the proposed conflict resolution process P (1) , P (2) , . . . , P (n) it even holds that Conflicts(P (i+1) ) Conflicts(P (i) ) for 1 ≤ i < n. Thus, (P1) holds. As every conflict resolution step consists of solely replacing a conflicting rule with its λ-extension of the form (10), (P2) holds. By Proposition 4, property (P3) holds also. Therefore, a conflict resolution process using conflict-resolving λ-extensions leads to a uniformly non-contradictory program core in a minimally invasive manner. Including a domainspecific expert into the selection of the most suitable λ-extensions can furthermore ensure that the resulting non-contradictory program core maintains its professionally adequate knowledge base.

Missing λ-extension
Under some circumstances, no λ-extensions can be generated for a rule r ∈ P. In these cases a blanket for Adv(r) cannot be found. Determining whether a blanket for Adv(r) exists can become quite cumbersome and complex since the relationships of atom-related literals between all adversarial rules have to be examined. A small fraction of such possible literal interactions that can make the finding of a blanket impossible will be illustrated in the following example.

Example 15
Suppose the following program P 15 : Program P 15 has conflicts (r 1 , r 2 ), (r 1 , r 3 ), (r 1 , r 4 ) and there does not exist a blanket for r 1 . This can be easily shown by looking at each potential candidate literal: Literal a is already in B(r 1 ) and can therefore not be in a blanket. Since atom b (resp. c) appears in B(Conflicts(r 1 )) as default (resp. classically) complementary literals, viz. r 2 , r 4 (resp. r 3 , r 4 ), b (resp. c) cannot be part of a blanket either.
There are several workarounds that allow the resolution of such conflicts nevertheless. One possible way to resolve such conflicts can be the partitioning of conflicts, that is, given a rule r with several adversaries Adv(r), one could first determine a subset Adv ⊂ Adv(r) for which a blanket can be computed. This procedure can be repeated until all conflicts of r are resolved. The following example illustrates how partitioning can be used to obtain a solution if a specific rule of the program (in this case r 1 ) should primarily be modified.
Example 16 (Example 15 contd.) Suppose program P 15 from Example 15. First, conflicts (r 1 , r 2 ) and (r 1 , r 3 ) can be resolved simultaneously by generating λ-extensions from the blankets for Adv = {r 2 , r 3 }. Two of the resulting extensions are λ 1 = {∼b, ∼c} and λ 2 = {∼b, c}. Applying λ 1 to P 15 results in program P 15 : Then, the remaining conflict (r 1 , r 4 ) can be resolved by applying the unique solution λ 3 = {∼c} which in turn results in program P 15 : Note that the reason that a solution like λ = {∼b, ∼c, ∼c} cannot be obtained with the general conflict resolution approach is because of the restriction that blankets cannot contain multiple literals of the same atom even though reconcilable literals do not interfer with the applicability of a rule (as can be seen in Example 15). But in order to keep the resolution approach simple and pragmatic, such a restriction on blankets was deemed necessary.
However, whenever conflicts are separately resolved, the final outcome can very much depend on the actual partitions, the order in which the different conflicts are resolved, and the choice of the respective λ-extensions along the way. pointers to potential conflicts. Consequently, the satisfaction of a constraint of form (12) can be ensured by treating every pair of rules r, r in P with H(r) = L, H(r ) = K as implicit conflicts (r, r ) and resolving them using the method for the resolution of conflicts via λ-extensions.

Example 21
Suppose the following program P 21 with internal atoms a, d and external atoms b, c, e, f : Then, (r 3 , r 1 ) and (r 3 , r 2 ) can be interpreted as conflicts. To resolve these two conflicts simultaneously, {∼b} can be added as a λ-extension to r 3 . The modified program P 21 then has the following rules: It is easy to see that a constraint of form (12) can be omitted once the implicit conflicts of the constraint are resolved with fitting λ-extensions. Thus, rule r 4 is redundant in program P 21 , but one has to keep in mind that future, more comprehensive updates can lead to answer sets that contain literals a and d.

Conflict order
As stated at the beginning, the presented approach is a basic method that can be extended in many respects depending on the requirements of the user. A useful functionality regarding the workflow of conflict resolution is the order in which the conflicts are presented to the expert. It is important that the knowledge expert understands how the order of the conflicts is generated as any enhancement in the proposed framework must not negatively influence the actual decision regarding a resolution but rather aid the expert in finding the most suitable solution efficiently. One easily comprehensible implementation utilizes the affected rule count (inspired by Abdelhalim et al . 2009) of the conflicting literals that reflects how many rules are potentially affected by a specific rule. For that, we first define the set R of all rules that are affected by a rule r 1 and compute the rule impact of r 1 by counting its affected rules.

Definition 10 (Affected Rules and Affected Rule Count)
The set R r1 of rules affected by a rule r 1 ∈ P is defined as The affected rule count AR(r 1 ) of r 1 is then defined by the number of affected rules, viz.

30
A. Thevapalan and G. Kern-Isberner In P 22 , rules r 5 and r 7 are affected by r 1 . Rule r 6 is not affected as B(r 1 ) and B(r 6 ) are not consistent due to atom condAAdv, that is, literal condAAdv occurs in B + (r 1 ) and in B − (r 6 ). Ergo for r 1 , we yield the affected rule count AR(r 1 ) = 2.
The affected rule count can provide the expert with a first impression (or possibly confirm own conjectures) of the possible impact that the given conflict and consequently the changes made to one of the conflicting rules have within the program. It can contribute additional information to the expert to anticipate the effect of a possible solution. Hence when using this order-criterion, it is on the expert to decide which conflict they want to solve first, for example, they can handle those conflicts with the least impact on other rules first. Additionally, such computed values can also help to decide which rules of a conflict to modify, for example, given a rule r ∈ P, it can be beneficial to modify one rule in conflicts(r) first and then modify r in order to resolve all remaining conflicts of r (see Section 4.1).

λ-scores
In the previous section, we presented a method that aims to improve the user's first major task during the resolution process which is choosing a conflict out of all detected conflicts. In the next step, the user has to decide on a solution for a picked conflict. To facilitate the finding of a most suitable solution for a chosen conflict (r, r ), an ordering of the computed suggestions can be established. For that one can assign a score to each λ-extension that is calculated using different criteria. In this section, we will outline one prototypical enhancement that adds a numerical value to each generated λ-extension named λ-score. We will present a basic approach to compute λ-scores by utilizing the previously introduced affected rule count to quantify the effect a rule modification can have. Suppose a conflict (r 1 , r 2 ) and a solution r 1 which can either be a computed solution (λ-extended rule) or a modified custom solution, respectively, for this conflict. In order to reflect the effect this solution can have on the overall program, one can look at the size of the difference between the affected rules of r 1 and the λ-extended rule r 1 which we will call the effect of the modification of r 1 to r 1 .
Definition 11 (Effect) Let (r 1 , r 2 ) be a conflict in P and r 1 a generated, λ-extended rule of r 1 . Let furthermore R r1 and R r 1 be the respective sets of affected rules. Then, the effect Eff (r 1 , r 1 ) of this modification is defined by Note that as λ-extended rules always expand the body of the original rule and therefore are more specific, any generated solution will affect the same rules or a subset of the rules that are affected by the original rule, that is, R r 1 ⊆ R r1 holds. The higher the effect of a solution, the more rules are not affected anymore after the modification w.r.t. the rules affected by the original rule. The effect of a suggested modification can therefore be used as the λ-score of the suggestion. If for example an expert wants to examine the most cautious solutions, the solutions with the least effect can be presented first.
Example 23 (Example 10 continued ) Suppose, the expert wants to resolve the conflict in P 22 by changing r 1 to r 1 with r 1 : eligX ← highLCount, preTreatedN , ctrIndR.
The effect of a modification tells the expert how impactful a change is regarding the affected rules, that is, how many additional and less rules are affected after the changes. The interpretation of the effect of modifications that is offered at this point can be seen as a first proposal to produce the λ-scores. The corresponding method for their computation can thus serve as groundwork where individual enhancements and modifications are possible. The presented definition of modification effects is an illustrative example to show how λ-extensions can hypothetically be ordered. For a given conflict, the user can inspect the suggestions sorted by their effect, starting with those that have the least effect. This way, they can look for and prioritize solutions that have the least impact on the program.
In analogue to the previously described method for ordering conflicts, any implementation for the computation of λ-scores must not negatively influence the expert regarding their decisions, that is, enhancements like ordering conflicts and suggestions should not incentivize the expert to choose solutions with the sole intention to resolve all conflicts in the technically easiest and quickest way possible without considering the underlying errors and problems that led to the conflict, nor should it bias the expert's thought process in any other negative way. In other words, the goal of such enhancements is to improve the finding of solutions that reflect the actual professional expertise best and simultaneously provide robustness for future updates (i.e. mitigate the potential for future conflicts), while not compromising any decision on a solution during the process.
Establishing a score for each suggestion allows to generate an order over all suggestions which in turn can be used to show the knowledge expert those suggestions first that are more relevant according to their criteria. If a semi-automated approach is wanted, the knowledge expert could also define a specific score threshold so that suggestions can be applied without the expert's involvement. Then, if there exist suggestions λ with a score below such a threshold, the conflict can be resolved directly by using every λ with the lowest score as a solution. Enhancements like these that gather and use additional metadata can help to add a highly customizable abstraction layer between the knowledge expert and the actual knowledge base where the expert can input information about the program elements in order to resolve a conflict without the need for any technical knowledge about answer set programming while ensuring that the resulting rules are still representing correct knowledge in the professional sense.

Conclusion and future work
In this paper, we proposed a method to modify answer set programs such that they remain consistent given any (allowed) instance data. We provided an analysis how contradictions in a program can arise and discussed the necessary requirements rules have to satisfy in order to prevent contradictions while keeping the degree of change to a minimum. Based A. Thevapalan and G. Kern-Isberner on that, we arrived at the notion of λ-extensions and we presented a strategy that gathers all conflict-resolving λ-extensions for a conflicting rule that comprise the atoms occurring in the conflicting rules. Extending a rule by a corresponding conflict-resolving λ-extension resolves all conflicts of this rule simultaneously. As a consequence, a conflict resolution process that uses the proposed strategy for computing conflict-resolving λ-extensions eventually yields a uniformly non-contradictory program core.
The presented approach constitutes crucial groundwork for the implementation of a larger (application) framework for updating and maintaining answer set programs. It enables the knowledge expert to inspect contradictory statements in a program and update rules interactively in view of new information given by an update. The suggestions that are generated by this algorithm can be viewed as a baseline for modifications. As mentioned in Example 10, applying a suggested λ-extension to a rule r can lead to a "stricter" λ-extended rule r . Whether this makes sense or not, is highly dependent on the professional meaning of these rules. Our approach allows the knowledge expert to decide whether a suggested enhancement should be applied as is or additional (manual) modifications should follow the applied suggestion. But as shown with Proposition 5, every λ-extension satisfies the minimal requirement of resolving the corresponding conflicts simultaneously and can therefore used as a reliable starting point.
This paper adresses one part of an interactive solution for conflict resolution in logic programs as proposed in Thevapalan and Kern-Isberner (2020). The running example illustrates that the proposed framework can pose a highly beneficial tool in the medical sector and other domains. We argue that any area where experts face complex decisions based on knowledge that is not solely comprised of facts but also on practical knowledge (experience) and continually growing and changing (adapted) expertise can highly profit from such a framework to efficiently build up and maintain an adequate knowledge base.
The ideas and results discussed in this paper can be adapted and extended in various ways. In Thevapalan et al . (2022), the authors show how conflicts can be resolved in cases where the actual conflicting rules shall remain unchanged. For that, the concept of λ-extensions is picked up to generate solutions that restore consistency. Aside from contradictions, extended logic program can also become inconsistent due to incoherence. A method to pinpoint the causes of incoherence in logic programs and strategies to reestablish coherence in a program are developed in Thevapalan et al . (2021).
Since in the presented conflict resolution strategy, the body of one of the conflicting rules is extended, one possible extension of the approach is the compilation of strategies for the remaining types of program modifications, namely reduction of rule bodies, replacing body literals, removing rules as a whole and adding new rules.
As outlined Section 4, we see numerous ways to extend the presented approach. In the future, we want to adapt the method of conflict resolution to resolve many-to-many conflicts in a more convenient way that generates λ-extensions based on all involved rules that at best does not require the repeated use of a resolution.
Additionally, we want to work out methods to interactively compute λ-scores (Section 4.4) in order to find suitable solutions more efficiently.
In each conflict resolution step during a conflict resolution process, solutions for a conflict are computed independently of other conflicts. In order to contemplate dependencies between conflicts, future work will also include the development of suitable heuristics to determine which rules of a conflict to modify (since a conflict-relation is symmetrical) and refine the order in which the different conflicts should be resolved. Besides taking into account the connections between conflicts, such heuristics could also consider individual preferences and conditions given by the expert, for example, a set of rules that shall not be modified, rule weights etc.
The other major functionality that is part of our ongoing work is the actual interaction process between the expert and the framework. These interactions must tackle two problems: explaining the cause of the respective conflict to the user and choosing the most suitable solution for it. Instead of burden the user with all available information, we suggest a dialogical approach where the user can reach an informed decision after a back-and-forth dialogue with the framework. Using argumentative dialogue theories (Caminada 2017;Modgil and Caminada 2009;Walton and Krabbe 1995) could enable the framework to "communicate" with the user where they can ascertain the underlying causes of the conflict and successively attain the most suitable suggestion.