<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Resolving Constraint-Induced Inconsistencies in ASP Using lambda-Extensions</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Andre Thevapalan</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Gabriele Kern-Isberner</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>TU Dortmund</institution>
          ,
          <addr-line>Otto-Hahn-Straße 12, 44227 Dortmund</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Designing reliable logic programs becomes especially challenging when constraints are involved, i.e., rules that must never be violated, no matter the input. Therefore, constraints may induce conflicts with other rules that derive the literals in their bodies, causing constraint-induced inconsistencies (CI-inconsistencies). In this paper, we introduce a new consistency notion for answer set programming: robust CI-consistency, which ensures that a program's constraints are respected under all admissible sets of facts. Our focus lies on positive constraints, a natural and intuitive class that avoids default negation and expresses hard requirements on the program's output. To support knowledge engineers in early stages of modelling, we present a method that allows the expert to define general constraints and selectively refines only the rules that could lead to violations. This is achieved by extending the idea of  -extensions, originally developed for handling contradictions caused by strong negation. By systematically identifying problematic rule combinations and adjusting them just enough to prevent conflicts caused by future instance data, our approach yields encodings that are correct by design in any case-without deleting rules or depending on specific data. This framework helps bridge the gap between early, intuitive modelling and robust, instance-independent correctness.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Answer Set Programming</kwd>
        <kwd>Inconsistency</kwd>
        <kwd>Constraints</kwd>
        <kwd>lambda-Extensions</kwd>
        <kwd>Conflicts</kwd>
        <kwd>Program Repairs</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Answer Set Programming (ASP) is a declarative paradigm for knowledge representation and reasoning,
well-suited to solving combinatorial problems. In practice, an ASP program is usually divided into two
components: the encoding, which defines the general rules of the problem, and the instance, which
provides concrete input data as facts. This separation enables a single encoding to be applied to multiple
instances, akin to executing software with diferent input data.</p>
      <p>However, in high-stakes applications such as medical decision support systems, it is critical to ensure
that an encoding behaves reliably across all admissible instances (e.g., patient data). Constraints can
play a vital role in such contexts–for example, by preventing the recommendation of therapies or drugs
with known adverse interactions. Domain experts may define hard constraints to enforce compliance
with clinical guidelines or to block recommendations involving harmful combinations. While such
constraints are essential for ensuring correctness, they can inadvertently introduce inconsistencies
if the encoding fails to anticipate rare or exceptional cases. This, in turn, may cause the program to
become inconsistent, rendering the encoding unusable for certain instances.</p>
      <p>
        Prior works [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ] have addressed the challenge of maintaining robust consistency of encodings,
i.e., ensuring that the combination of encoding and instance does not lead to inconsistency when the
source of inconsistency are strongly complementary literals. In that context, a method was introduced
to construct encodings that remain consistent under all admissible instances, efectively shielding the
program from inconsistency due to such literals and ensuring its applicability in all contexts.
      </p>
      <p>In this work, we extend this approach to constraint-induced inconsistencies (CI-inconsistencies). We
enable knowledge engineers to define problem encodings in a more general way, without needing to
account for every exception or rare case individually in the first place. The system will check if any
23rd International Workshop on Nonmonotonic Reasoning, November 11–13, 2025, Melbourne Australia
* Corresponding author.
$ andre.thevapalan@tu-dortmund.de (A. Thevapalan); gabriele.kern-isberner@cs.tu-dortmund.de (G. Kern-Isberner)
0000-0001-5679-6931 (A. Thevapalan); https://orcid.org/0000-0001-8689-5391 (G. Kern-Isberner)</p>
      <p>© 2025 Copyright for this paper by its authors. Use permitted under Creative Commons License Attribution 4.0 International (CC BY 4.0).
admissible instances lead to the activation of constraints. If such instances arise, the system signals the
issue, allowing the engineer to fine-tune the relevant rules in the encoding. This ability to dynamically
refine encodings while maintaining the integrity of the constraints makes the approach particularly
well-suited for complex, real-world scenarios, ensuring robust, consistent, and tailored solutions. Our
approach motivates the usage of constraints by emphasising their critical role in ensuring that the
program behaves as intended. Instead of manually handling each potential inconsistency, engineers
can specify constraints that act as strict guards, preventing undesired answer sets. This allows them to
focus on creating flexible, reusable encodings, while leaving the responsibility of ensuring correctness
to the constraints, which guide the system in preventing unintended behaviours.</p>
      <p>
        The remainder of this paper is structured as follows. Section 2 introduces the necessary preliminaries
on answer set programming to establish the formal background. In Section 3, we review related
work and summarise the existing approach in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], which addresses inconsistency arising from strongly
complementary literals through conflict-resolving  -extensions. Section 4 presents our novel method for
achieving robust CI-consistency in problem encodings by systematically resolving constraint-induced
inconsistencies using a refined extension of the  -framework. Finally, Section 5 concludes the paper
and outlines directions for future research.
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <p>
        In this paper, we examine the propositional fragment of non-disjunctive extended logic programs
(ELPs) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ], which are finite sets of rules defined over a set of atoms . A literal  is either an atom  ∈ 
or its strong negation ¬. For a literal , the strongly complementary literal  is defined to be ¬ if  = ,
and  otherwise. The set ℒ =  ∪ { |  ∈ } denotes the set of all literals based on .
      </p>
      <sec id="sec-2-1">
        <title>A default-negated literal , also referred to as a default literal, is written as ∼ . An extended literal</title>
        <p>⋆ is either a literal  or its default negation ∼ . We also extend ∼ to sets: for a set  of literals,
∼ = {∼ |  ∈ } . We will use ∼ as a unary junctor in order to describe the default complement of
an extended literal: for an extended literal ⋆, the default-complementary literal ∼ ⋆ is defined as ∼ if
⋆ = , and  otherwise.</p>
        <p>A set of extended literals is said to be inconsistent if it contains strongly or default-complementary
literals. Two extended literals ⋆ and ⋆ are referred to as mutually exclusive if they are strongly
complementary or default-complementary.</p>
        <sec id="sec-2-1-1">
          <title>For each extended literal ⋆, we write (⋆) to denote the atom on which ⋆ is based. The</title>
          <p>underlying set of atoms in a set  of extended literals is denoted by () = {(⋆) | ⋆ ∈ }.</p>
          <p>A rule  is of the form:
 () ← 
+(), ∼ − ().</p>
          <p>(1)
where  (), called the head of , is either a singleton set {} for some literal , or the empty set ∅. The
sets +() and − (), called the positive and negative body of , respectively, are (possibly empty) sets
of literals. The body of  is defined as () =  +() ∪ ∼ − ().</p>
          <p>A rule  is called a fact if () = ∅ , and a constraint if  () = ∅. A constraint  is said to be positive
if − () = ∅; note that positive constraints may still contain strong negation.</p>
          <p>An extended logic program (ELP) is a set of rules of the form (1). In the remainder of this paper, we
assume that any ELP  is over the set  of atoms occurring in  .</p>
          <p>Given an ELP  , we distinguish the following components: the set Φ  of facts, referred to as the
problem instance of  ; the set Ψ  of constraints; and set Π  of all remaining rules, referred to as the
problem encoding of  . To each problem encoding Π , we associate its set of external atoms, denoted by
ℰ (Π) ⊆ , defined as the set of atoms that occur in Π but not in the head of any rule in Π.</p>
          <p>We illustrate the components of an ELP using the following running example.</p>
          <p>Example 1. Consider a simplified medical decision-support system that recommends treatments based on
suspected diagnoses, which we use as a running example.</p>
          <p>1: leuk ← anem, ∼abnSk .</p>
          <p />
          <p>2: mela ← lesn, ∼swLn.
3: chem ← leuk , imsp.
5: ← chem, imtx .</p>
          <p>4: imtx ← mela, ∼aid .</p>
          <p>This program models the diagnosis and treatment process for leukaemia (leuk ) and melanoma (mela),
two cancers that typically do not occur together except in rare cases. If a patient has anaemia (anem) and
no visible skin abnormalities (abnSk ), leukaemia is suspected. If the patient has a lesion (lesn) but no
swollen lymph nodes (swLn), melanoma is diagnosed. If leukaemia is confirmed and the patient is not
immunosuppressed (imsp), chemotherapy (chem) is prescribed. If melanoma is diagnosed and there is no
autoimmune disorder (aid ), immunotherapy (imtx ) is recommended.</p>
          <p>The integrity constraint in 5 ensures that both therapies are not prescribed together. This is because
chemotherapy and immunotherapy target diferent mechanisms and may have adverse interactions if used
in combination, making their joint application inappropriate for the patient’s safety.</p>
          <p>The rules 1–4 form the problem encoding Π 1, while Ψ 1 = {5} defines the constraint set, preventing
the simultaneous prescription of both therapies. Possible problem instances Φ 1 are facts corresponding to
subsets of the external atoms ℰ (Π 1) = {anem, abnSk , lesn, swLn, imsp, aid }.</p>
          <p>We now move on to the semantics of ELPs.</p>
          <p>Let  be a set of literals. A literal  is said to be true in  if  ∈ , false in  if  ∈ , and unknown
otherwise. A rule is applicable under  if +() ⊆  and − () ∩  = ∅. The set  satisfies the body
() of a rule  if  is applicable under . The set  satisfies a rule  if and only if () ∩  ̸= ∅
whenever  satisfies (). A set  of literals supports a rule  if  is applicable and satisfied under .
We say  is unsatisfiable if there exists no consistent set  of literals s.t.  is applicable under .</p>
          <p>Note: If  is a constraint, then  satisfies  if  does not satisfy (). Conversely, if  satisfies the
body of a constraint, we say that  violates .</p>
          <p>In general, an answer set of an ELP  is determined by its reduct. The reduct  of a program 
relative to a set  of literals is defined as:
 = {() ←</p>
          <p>+(). |  ∈ , − () ∩  = ∅}.</p>
          <p>Note that any reduct contains no default negation.</p>
          <p>
            For programs  without default negation, we define the closure Cl () of  as the smallest subset
 ⊆ ℒ  such that  satisfies all rules in . Notably, similar to Horn logic programs, each ELP without
default negation has exactly one closure Cl (), which may, however, be inconsistent (cf. [
            <xref ref-type="bibr" rid="ref4">4</xref>
            ]).
          </p>
          <p>Let  be an ELP over , and assume  contains no default negation. The answer set of  is defined
as follows:
(a) if Cl () is consistent, then Cl () is the unique answer set of ;
(b) otherwise, the answer set of  is defined to be ℒ , i.e., the complete set of literals over .</p>
          <p>
            A set  of literals is an answer set of an ELP if it is the answer set of the reduct  [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ]. Specifically, a
consistent set  is an answer set of  if:
 = Cl ().
(2)
We denote the set of all answer sets of  by ().
          </p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Example 2 (Example 1 contd.). Let 2 be a program consisting of problem encoding Π 1 and constraints</title>
        <p>Ψ 1 from Example 1, and the following problem instance Φ 2 = {anem.}. Then, 2 has the unique answer
set 1 = {anem, leuk , chem}.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Previous and Related Work</title>
      <p>
        The authors in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] propose a stepwise debugger for extended logic programs, enabling users to trace
derivations incrementally. This, among other things, reveals that a constraint remains inactive either
because other rules derive literals that falsify its body, or because the required literals for activation are
absent.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], the author introduces the notion of minimal diagnoses for inconsistent ELPs by identifying
conflict sets, that is, collections of mutually incompatible constraints, such that restoring consistency
amounts to disabling one constraint from each set, thereby treating constraints as candidates for
removal.
      </p>
      <p>
        The authors in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] introduce DWASP, an interactive debugger for non-ground ELPs that inserts
marker atoms into both the encoding and its instance and poses user queries over the fully grounded
program. Constraints are tested dynamically to reveal which ones are violated, and user interaction
helps isolate the rules responsible for these violations.
      </p>
      <p>
        The authors in [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] present SPOCK, a declarative meta-programming technique that rewrites the
original rules and constraints into a single meta-program. The answer sets of this meta-program explain
why certain constraints are always or never violated. This approach relies on syntactic rewriting of the
complete, ground program.
      </p>
      <p>
        On an implementation level, constraints are transformed in such a way that their constraint violation
results in an incoherent program, that is, a program without any answer sets due to cyclic dependencies.
In [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], the authors propose semi-equilibrium models, which allow the examination of programs even in
the presence of incoherence.
      </p>
      <p>In contrast to these methods, which rely on constraint deletion, instance-specific grounding, or
syntactic meta-rewriting, our framework operates directly on the problem encoding. It treats constraints
as semantic sources of inconsistencies with derivable literals and resolves these inconsistencies via
constraint-guarding -extensions, rather than through removal or instance-dependent diagnosis.</p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], the authors introduce work that is most closely aligned with the topic of this paper. Their
approach addresses inconsistency arising from the derivation of strongly complementary literals. To
avoid confusion with other forms of inconsistency, we introduce the term SC-inconsistency to refer
specifically to this type of inconsistency. In the cited works, such inconsistency is simply referred to as
“inconsistency”.
      </p>
      <p>Definition 1 (SC-Consistency and SC-Inconsistency). Let  be an ELP. The program  is said to be
SC-inconsistent (strong complementarity inconsistent) if every set  ⊆ ℒ  satisfying (2) is inconsistent,
i.e., contains a pair of strongly complementary literals  and . Otherwise,  is said to be SC-consistent.
Example 3. Suppose the following program 3:
1:  ← .
4:  ← ∼.</p>
      <p>2:  ← .</p>
      <p>5: .</p>
      <p>3:  ← ∼.</p>
      <p>6: .</p>
      <p>Only  = {, , , , } satisfies condition (2). Hence,  3 is SC-inconsistent.</p>
      <p>Intuitively, a program is SC-inconsistent if strongly complementary literals can be derived from ;
otherwise, it is SC-consistent.</p>
      <p>Note that the term SC-inconsistency is not used in the original papers by Thevapalan and
KernIsberner; we introduce it here to clearly distinguish this particular form of inconsistency from others.</p>
      <p>
        A problem encoding Π is said to be robustly SC-consistent if it remains SC-consistent when combined
with any admissible problem instance Φ , that is, any instance constructed using atoms in ℰ (Π) . In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ],
the authors describe how problem encodings Π can be modified in a minimally invasive manner to
achieve robust SC-consistency. To this end, they introduce the notion of conflicts:
Definition 2 (SC-Conflict
constitutes a conflict if:
      </p>
      <p>
        1; cf. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]). Let  be an ELP containing rules ,′. The rule set  = {,  ′}
1. there exists a consistent set of literals that satisfies the bodies of both  and  ′, and
2. the head literals of  and ′ are strongly complementary.
      </p>
      <p>The rules in  are referred to as conflicting and Γ</p>
      <p>() denotes the set of all conflicts in  involving .</p>
      <p>We illustrate the notion of conflicts with the following example.</p>
      <p>Example 4. In Example 3, 3 contains the conflicts  1 = {1, 2},  2 = {1, 3}, and  3 = {1, 4}.</p>
      <p>
        We now briefly recall the fundamental conflict-resolution techniques introduced in [
        <xref ref-type="bibr" rid="ref1 ref10">1, 10</xref>
        ]. Based on
the notion of conflicts, a problem encoding Π is systematically modified to ensure consistency across
all admissible problem instances. To this end, conflict-resolving -extensions are introduced.
      </p>
      <p>
        We begin by recalling the characterisation of conflicts as provided in [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]:
      </p>
      <sec id="sec-3-1">
        <title>Theorem 1 ([10]). Let  be an ELP. Two rules , ′ ∈  are conflicting if and only if the following</title>
        <p>conditions hold:
(CP1)  (),  (′) are strongly complementary;
(CP2) +(1) ∩ − (2) = ∅ for 1, 2 ∈ {, ′}, 1 ̸= 2;
(CP3) +() ∪ +(′) is consistent.</p>
        <p>
          Conditions (CP2) and (CP3) imply that such conflicts can be resolved by modifying the rule bodies to
prevent their simultaneous applicability under any consistent set of literals. This motivates the notion
of conflict-preventing literals:
Definition 3 (Conflict-Preventing Literals; cf. [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). Let  be an ELP, and let , ′ ∈  be rules with
strongly complementary head literals. Two extended literals ⋆ ∈ (), ⋆ ∈ (′) are said to be
conflictpreventing if (⋆) = (⋆) and ⋆,⋆ are mutually exclusive.
        </p>
        <p>
          Conflict-preventing literals make it possible to resolve conflicts, as formalised in the following
proposition:
Proposition 1 ([
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). Two rules , ′ with strongly complementary head literals are non-conflicting if and
only if there exist extended literals ⋆ ∈ (), ⋆ ∈ (′) such that ⋆, ⋆ are conflict-preventing.
        </p>
        <p>Hence, the addition of conflict-preventing literals yields rules that are no longer simultaneously
applicable. This leads to the notion of conflict-resolving -extensions.</p>
        <p>
          Definition 4 (  -Extension; cf. [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). Let  be an ELP over , and let  ∈  . A  -extension () for  is a
set of extended literals over  such that:
(1) (()) ∩ (()) = ∅, and
(2) (() ∩ ( ())) = ∅ 2.
        </p>
        <p>
          The corresponding -extended rule w.r.t. () is:
⋆:  () ← (), ().
(3)
1In the original literature, the term conflict is used. We adopt the prefix SC- to distinguish this notion from conflicts that are
induced by constraints.
2Note that this condition is an additional requirement not present in the original definition of  -extensions [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. The inclusion
of this condition ensures that the resulting  -extensions are more informative and useful which is a feature that will prove
crucial in subsequent stages of this work.
        </p>
        <p>To resolve all conflicts involving , suitable -extensions can be applied.</p>
        <p>A  -extension () is conflict-resolving if for every conflict
⋆ ∈ () and  ⋆</p>
        <p>∈ (′) such that ⋆ and ⋆ are conflict-preventing.</p>
        <p>
          Definition 5 (Conflict-Resolving
 -Extension; cf. [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). Let  be an ELP and  ∈  such that Γ  () ̸= ∅.
        </p>
        <p>
          {, ′} ∈ Γ  (), there exist extended literals
In [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], a procedure is proposed for systematically constructing conflict-resolving -extensions.
        </p>
        <p>We continue Example 3 to illustrate the concept.</p>
        <p>Example 5 (Example 3 contd.). For the rule 1 in Π 3, two conflict-resolving -extensions exist:
 1(1) = {∼, ,  },</p>
        <p>2(1) = {, ,  }.</p>
        <p>
          -extensions are informative, as they aim to preserve the original knowledge as far as possible, rather
than simply disabling conflicting rules entirely or enforcing rigid prioritisation schemes. Instead, 
extensions extend existing rule bodies in a minimal way, using only atoms directly related to the specific
conflict. As argued in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], traditional approaches such as semi-completion [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] can be understood as
workaround strategies that syntactically suppress conflicts but fail to reflect the underlying knowledge
structure. This may lead to unintended or counterintuitive answer sets, highlighting the need for more
principled methods, such as  -extensions, that address inconsistency in a constructive and transparent
manner.
        </p>
        <p>
          Example 6 ([
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). Consider the instance Φ = {pos_test .} and the encoding Π
6
:
p_algy ← ∼algy _react .
        </p>
        <p>p_algy ← pos_test .</p>
        <p>eat _p ←
p_algy .</p>
        <p>This program treats an individual as non-allergic if they did not experience an allergic reaction, and
explicitly allergic if they tested positive. Those not allergic can eat peanuts.</p>
        <p>
          According to [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ], the semi-completed program Π ′6 is:
p_algy ← ∼algy _react , ∼p_algy . p_algy ← pos_test , ∼
p_algy . eat _p ← p_algy , ∼ eat _p.
with a confirmed peanut allergy can eat peanuts. This counterintuitive result is clearly not intended.
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>One possible answer set of Π ′6∪Φ is {pos_test , p_algy , eat _p}, i.e., the program predicts that an individual</title>
        <p>
          Following the approach in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ], one possible outcome is Φ ∪ Π
′6′ with Π ′6′ given by:
p_algy ← ∼algy _react , ∼pos_test .
        </p>
        <p>p_algy ← pos_test .</p>
        <p>eat _p ←
p_algy .
Φ ∪ Π</p>
        <p>′6′ yields the intended answer set {pos_test , p_algy }.</p>
        <p>
          The notion of conflicts is closely linked to SC-inconsistency. Specifically, whenever a program
SC-inconsistent, then for any set  of literals satisfying (2), there exists a conflict  in  such that both
bodies of  are simultaneously satisfied by . Consequently, the absence of such conflicts guarantees
that strongly complemementary literals cannot be derived.
 is
Proposition 2 (cf. [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]). Let Π be a problem encoding without conflicts. Then, Π is robustly SC-consistent.
        </p>
        <p>
          In summary, the framework proposed in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] provides a systematic method for resolving
SCinconsistency in ELPs by identifying conflicts between rules with strongly complementary heads
and applying conflict-resolving  -extensions to prevent their simultaneous applicability. While that
work focuses on inconsistencies caused by strong negation, the present paper addresses a
complementary form of inconsistency–namely, constraint-induced inconsistency. Our goal is to establish robust
consistency with respect to constraints, independently of the problem instance, by adapting the
mechanics of informative  -extensions to systematically resolve constraint-related issues at the encoding
level.
To generalise the  -extension approach to logic programs that include constraints, we propose an
approach designed to ensure CI-consistency, i.e., a notion of consistency that explicitly accounts for
inconsistencies induced by constraints. The method supports practical modelling in ASP by enabling a
development workflow that begins with coarse-grained rule encodings and refines them iteratively,
taking into account conflicts that may arise from the addition of facts representing (future) problem
instances.
        </p>
        <p>
          In the following, we make some assumptions on the programs to be considered that help us focus on
repairing CI-inconsistencies. First, we assume that programs are not SC-inconsistent (Definition 1), as
such inconsistencies have already been addressed in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] and can be resolved accordingly beforehand.
Second, each rule must make sense in its own, i.e., each rule must be not contradictory and applicable
to some consistent set of literals. That is, we exclude rules like  ← ∼. and  ← , ∼. because such
rules can be easily found in a preprocessing step, and fixed or removed. With regard to constraints, in
this paper, we allow only positive ones, that is, constraints without default negation, consisting of at
least two literals in the body. In the context of ELPs, this will allow us to deal with CI-inconsistencies in
a homogeneous way, generalizing the approach presented in [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. The treatment of CI-inconsistencies
caused by general constraints also involving default negation will be left for future work.
        </p>
        <p>While syntactically simple, positive constraints are semantically strict: they are violated as soon as
their body is satisfied, and, due to their monotonic nature, such violations persist. This makes them
particularly brittle in dynamic, instance-driven settings, where they often constitute a primary source
of inconsistency.</p>
        <p>At the same time, positive constraints are particularly well-suited for practical ASP development.
They ofer a declarative and intuitively interpretable way to specify global properties of desired answer
sets, and we demonstrate that they align naturally with established methods such as conflict resolution
via -extensions.</p>
        <p>By providing a mechanism to assess whether a constraint is violated under certain instances, our
approach enables domain experts to fine-tune the conditions under which specific rules apply. In this
way, rules can initially be specified in coarse form, without encoding every possible exception, and
refined later as needed by considering concrete possible cases to ensure consistency w.r.t. constraints.</p>
        <p>This promotes a modular and iterative modelling paradigm: positive constraints serve not only to
enforce properties of answer sets, but also as diagnostic tools for identifying and resolving problematic
interactions between the encoding and instance data.</p>
        <p>We now adapt the notion of conflicts to the setting of positive constraints. The answer sets of an ELP
 are determined by constructing those of Π  ∪ Φ  and verifying that they satisfy all constraints in
Ψ  . While Φ  ∪ Π  generates candidate answer sets, the constraints in Ψ  act as filters that eliminate
those violating specific conditions. Notably, constraint satisfaction can be evaluated after the solving of
answer sets for the unconstrained part of the program.</p>
      </sec>
      <sec id="sec-3-3">
        <title>Proposition 3 (cf. [12]). Let  be an ELP. A set  of literals is an answer set of  if and only if  is an</title>
        <p>answer set of Π  ∪ Φ  that satisfies all constraints from Ψ  .</p>
      </sec>
      <sec id="sec-3-4">
        <title>Corollary 1. Let  be a program where all constraints are positive. Then, for each answer set  ∈ (Π  ∪ Φ  ), we have:  ∈ () if and only if there is no constraint  ∈ Ψ  such that () ⊆  .</title>
        <p>Using these results, we can now define the notion of CI-(in)consistency:</p>
      </sec>
      <sec id="sec-3-5">
        <title>Definition 6 (CI-Consistency). Let  be a logic program comprising the problem instance Φ  , the problem</title>
        <p>encoding Π  and the set of constraints Ψ  .  is CI-inconsistent (integrity constraint inconsistent) if
there exists at least one answer set  = Cl ((Φ  ∪ Π  )), but each such set violates at least one constraint
in Ψ  . Conversely,  is called CI-consistent if there exists an answer set  = Cl ((Π  ∪ Φ  )) that
satisfies all constraints from Ψ  .</p>
        <p>CI-(in)consistency is determined based on Corollary 1: fixpoints of the program without constraints
are computed first, and each resulting answer set is then checked for constraint violation.</p>
        <p>Thus, each constraint  ∈ Ψ  acts as a safeguard that eliminates undesired answer sets from Φ ∪ Π .
This mechanism allows the knowledge engineer to formulate general rules in Π  , while relying on
constraints to rule out unintended outcomes.</p>
        <p>Example 7 (Example 1 contd.). Let Π 1 be the problem encoding and Ψ 1 the set of constraints as described
in Example 1. Consider the problem instance Φ 7 = {anem., lesn.} The program 7 = Π 1 ∪ Φ 7 has
the unique answer 7 = {anem, lesn, leuk , mela, chem, imtx }. However, when the constraint in Ψ 1 is
included, the resulting program 7′ = Π 1 ∪ Φ 7 ∪ Ψ 1 has no answer sets because of constraint 5, which
eliminates 7 as an answer set.</p>
      </sec>
      <sec id="sec-3-6">
        <title>The constraint 5 ∈ Ψ 1 prohibits the simultaneous recommendation of chemotherapy and immunother</title>
        <p>apy. While each treatment rule is valid in isolation, certain combinations of external atoms (e.g., facts
asserting leuk and mela) may lead to both chem and imtx being derived, thereby activating the constraint
and eliminating the answer set. From a clinical view, such constraints are critical safeguards against
harmful treatment recommendations.</p>
        <p>To ensure that a problem encoding remains consistent across diferent input data, we define admissible
problem instances as those that do not directly violate any constraint in the encoding. For example, for an
encoding with the constraint ‘← ,  ’, any problem instances containing both  and  are inadmissible.
Specifically, while instance literals may appear in constraint bodies, each constraint must retain a
suficient dependency on the encoding. That is, constraints should not be violated merely due to the
presence of certain input facts, but should require the derivation of literals through the program’s rules.</p>
      </sec>
      <sec id="sec-3-7">
        <title>Definition 7 (Admissible Problem Instance). Given a program  with a set Ψ  of (positive) constraints,</title>
        <p>a problem instance Φ  is said to be admissible w.r.t. Ψ  if for each constraint  ∈ Ψ  the following
holds: () ∩ ⋃︀∈Φ () = ∅.</p>
        <p>This ensures that each constraint requires all body literals must be derived through the encoding,
thereby linking constraint violations to the behaviour of the program rather than the input.</p>
        <p>Using the notion of admissible problem instances, we define robustly CI-consistent problem encodings:
Definition 8 (Robust CI-Consistency). Let Π be a problem encoding and Ψ a set of (positive) constraints.
The encoding Π is referred to as robustly CI-consistent if, for every admissible problem instance Φ , the
combined program Π ∪ Φ ∪ Ψ is CI-consistent.</p>
        <p>
          Remark: The notion of robust consistency is related to the concept of super-coherence [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ], which
guarantees that a program without strong negation admits an answer set for any extension with facts
by preventing inconsistencies due to negative dependency cycles. Our approach pursues a diferent
but complementary goal: we address inconsistencies caused by constraints and ensure CI-consistency
across all admissible problem instances.
        </p>
        <p>
          In the remainder of this paper, we demonstrate how a problem encoding can be systematically
transformed to ensure robust CI-consistency across all admissible instances. Our approach builds
on and extends existing methods by addressing inconsistencies that arise through the interaction of
the encoding with integrity constraints, with a particular emphasis on constraint-induced violations.
This complements the work in [
          <xref ref-type="bibr" rid="ref1 ref10">1, 10</xref>
          ] which focuses on resolving inconsistencies due to strongly
complementary literals.
        </p>
        <p>In the following, a rule set refers to a set of at least two rules, such that every rule in the set has a
non-empty head3. To support several definitions introduced later in this paper, we additionally introduce
the notion of body-compatible and compatible rule sets.</p>
        <p>Definition 9 ((Body-)Compatible Rule Sets). A rule set
if there exists a set  of literals such that
ℛ is called body-compatible (resp., compatible)
3Singleton rule sets are excluded, as our approach explicitly examines the interactions between multiple rules.
(1)  is consistent, and
(2) for every rule  ∈ ℛ,  satisfies () (resp.,  satisfies () ∪  ()).</p>
        <p>Otherwise, we call ℛ body-incompatible (resp., incompatible).</p>
        <p>Note that any compatible rule set is, in particular, body-compatible.
(body-)compatible rule set ℛ is downward closed, i.e., every subset ℛ ⊆ ℛ
′
(body-)compatible.</p>
        <p>Furthermore, we obtain the following characterisation:</p>
        <p>Furthermore, any
with |ℛ′| ≥ 2 is also</p>
      </sec>
      <sec id="sec-3-8">
        <title>Theorem 2. Let ℛ be a rule set. Then ℛ is compatible if and only if the following conditions hold:</title>
        <p>(BC1) For all rules , ′ ∈ ℛ the sets +() and − (′) are disjoint, i.e., +() ∩ − (′) = ∅.
(BC2) The union of the positive bodies of the rules in ℛ is consistent, i.e., ⋃︀∈ℛ +() is consistent.
(BC3) For all rules , ′ ∈ ℛ, no head literal appears as a negative body literal in ℛ, i.e.,  ()∩− (′) = ∅
Proof. Let ℛ ⊆  .
(⇒) Assume that ℛ is compatible. Then, by Definition 9, there exists a consistent set  such that 
supports  ∈ ℛ. We now show that (BC1), (BC2), and (BC3) hold.
• (BC1): Assume, for contradiction that there exist , ′ ∈ ℛ such that there exists a literal  ∈
+() ∩ − (′). Since  satisfies (), we have  ∈ . However, for  to satisfy (′), it must hold
that  ∈/ , leading to a contradiction. Hence, (BC1) holds.
• (BC2): Let  := ⋃︀∈ℛ +(). Suppose, for contradiction, that  is inconsistent. Then there exists an
atom  such that both  and ¬ occur in  , implying that no consistent set  can satisfy all +(),
contradicting the assumption that ℛ is compatible. Hence,  is consistent and (BC2) holds.
• (BC3): Suppose, for contradiction, that there exist rules , ′ ∈ ℛ such that there exists a literal
 ∈  () ∩ − (′). Since  satisfies (), the head literal  must be in . But since  ∈ − (′),
satisfying (′) requires  ∈/ , again yielding a contradiction. Therefore (BC3) holds.
(⇐) Conversely, suppose a rule set ℛ ⊆  that satisfies (BC1), (BC2) , and (BC3). To show that ℛ is
compatible, define the set  := ⋃︀∈ℛ +() ∪ ⋃︀∈ℛ  ().</p>
        <p>Consistency of : This follows directly from (BC2), which ensures that the union of positive bodies is
consistent, and from the assumption that  is robustly SC-consistent.</p>
        <p>Support of rules in ℛ: To show that  satisfies all rules in ℛ, we must verify for each  ∈ ℛ that (S1)
+() ⊆  and (S2)  − () ∩  = ∅. Condition (S1) holds by construction of , since  includes all
positive body literals. For condition (S2), fix  ∈ ℛ. For any ′ ∈ ℛ, we know from (BC1) that +(′) ∩
− () = ∅, and (BC3) that  (′) ∩ − () = ∅. Hence, since  ⊆ ⋃︀′∈ℛ +(′) ∪ ⋃︀′∈ℛ  (′), it
follows that − () ∩  = ∅. Therefore, all rules in ℛ are supported under the consistent set , and
thus ℛ is compatible.</p>
        <p>The notion of (body-)compatibility is introduced to identify rule sets that may jointly violate a
constraint, thereby serving as a basis for detecting potential constraint violations. This enables the
application of constraint-guarding techniques–akin to the use of conflict-preventing literals–to strategically
mitigate such interactions.</p>
        <p>Example 8. Suppose the following problem encoding Π 8:
1:  ← , ∼.</p>
        <p>2:  ← , ∼ℎ.</p>
        <p>3:  ← , ∼.</p>
      </sec>
      <sec id="sec-3-9">
        <title>All sets ℛ ⊆ Π 8 with |ℛ| ≥ 2 are compatible, as there exists a consistent set of literals, e.g., {, ,  }, under which all rules in ℛ are supported simultaneously.</title>
        <p>Rather than removing or modifying constraints, we examine the rules whose interactions lead to
their violation. To this end, we introduce the notion of CI-conflicts:
Definition 10 (Constraint-Induced Conflicts (CI-Conflicts)). Let Π be a problem encoding and  a
positive constraint over  with at least two literals. A rule set ℛ ⊆ Π is called a constraint-induced
conflict (CI-conflict) w.r.t.  if (1) each literal in () appears as the head literal of exactly one rule in ℛ,
and (2) ℛ is compatible. The rules in an CI-conflict w.r.t.   are said to violate the positive constraint .</p>
      </sec>
      <sec id="sec-3-10">
        <title>Example 9 (Example 1 contd.). Let Π 1 and Ψ 1 be defined as above. Then, the set {3, 4} is a CI-conflict</title>
        <p>w.r.t. 5.</p>
        <p>CI-conflicts explain how the body of a constraint might be satisfied. Their absence guarantees that
no positive constraint is violated.</p>
        <p>Theorem 3. Let Π be a problem encoding, and Ψ a set of positive constraints. If Π contains no
CIconflicts w.r.t. any  ∈ Ψ , then for any admissible problem instance Φ w.r.t. Π , we have (Π ∪ Φ) =
(Π ∪ Φ ∪ Ψ).</p>
        <p>Proof. Let  := Π ∪ Φ , and let ′ := Π ∪ Φ ∪ Ψ . By Proposition 3, (′) = { ∈ () |
 satisfies all constraints in Ψ}. Assume that Π contains no CI-conflict w.r.t. any  ∈ Ψ . We aim to
show that under this assumption, every answer set  ∈ () satisfies all constraints in Ψ.</p>
        <p>Suppose, for contradiction, that there exists  ∈ () violating some  ∈ Ψ . Since  is positive,
() ⊆  . Hence, for each literal  ∈ (), there exists a rule  with () = {} such that  is
applicable under , i.e.,  was used to derive .</p>
        <p>Moreover, since Φ is an admissible problem instance and contains no facts for deriving literals
in the bodies of constraints, the derivation of literals in () relies solely on rules from Π and Φ .
Consequently, there exists a set ℛ ⊆ Π such that for every  ∈ (), some  ∈ ℛ has () = {}
and  is supported under . The rules in ℛ are compatible, implying that ℛ constitutes a CI-conflict
w.r.t. , contradicting our assumption.</p>
        <p>Hence, every  ∈ () satisfies all constraints   ∈ Ψ, and thus () = ( ′).</p>
        <p>As a direct consequence of Theorem 3 and Definition 10, we obtain the following characterisation:
Corollary 2. Let Π be a problem encoding and Ψ a set of positive constraints such that Π contains
no CI-conflicts w.r.t. any positive constraint  ∈ Ψ . Then, Π is robustly CI-consistent, that is, for any
admissible problem instance Φ, the combined program Π ∪ Φ ∪ Ψ is CI-consistent.</p>
        <p>By modifying the rules in a CI-conflict ℛ such that their bodies cannot become satisfied, unintended
constraint violations can be prevented.</p>
        <p>To introduce the notion of constraint-guarding  -extensions (CG  -extensions), we now return to the
running example:
Example 10 (Example 1 contd.). Let Π 10 be derived from Π 1 by replacing rule 3 with
3′: chem ← leuk , imsp, ∼mela. Then, the program 10 = Π 10 ∪ {imsp, anem, lesn} ∪ {5} has the
unique answer set {imsp, anem, lesn, leuk , mela, imtx }.</p>
        <p>The modification of 3 ensures that chemotherapy is only recommended if melanoma is not suspected.
From a medical perspective, this change reflects a prioritisation of melanoma treatment. When both
cancers are present–a rare but critical scenario–immunotherapy takes precedence, as it is more sensitive
to treatment timing and potential interaction. By adding ∼mela , the system avoids recommending
chemotherapy in such cases, preserving clinical safety.</p>
        <p>This anticipatory adjustment disables the application of 3 when conflicting statements arise due to
(often rare, but) admissible problem instances, without compromising the intended logic of individual
rules. This fine-tuning of the program helps the expert to avoid overlooking critical cases while still
enabling the formalisation of their knowledge in generic (default) rules.</p>
        <p>As a result, the program remains consistent across all admissible problem instances.</p>
        <p>These observations lead us to the following definition.</p>
        <p>Definition 11 (Constraint-guarding  -Extension (CG  -Extension)). Let Π be a problem encoding, Ψ a
set of constraints, and  ∈ Ψ a positive constraint. Let ℛ ⊆ Π be a CI-conflict w.r.t. . A  -extension
() ∈ ℛ is referred to as a constraint-guarding  -extension (CG  -extension) w.r.t.  if there exist
two extended literals ⋆ in () and ⋆ in some rule ′ ∈ ℛ such that ⋆, ⋆ are mutually exclusive. The
extended literal ⋆ ∈ () is then referred to as a guard literal.</p>
        <p>Lemma 1 (Condition for Existence of Constraint-Guarding  -Extensions). Let  be a rule in an ELP
, and suppose there exists a CI-conflict ℛ w.r.t. some positive constraint such that  ∈ ℛ. The exists
a CG  -extension () if there is a rule ′ ∈ ℛ and an extended literal ⋆ ∈ (′) ∖ () such that
(⋆) ∈/ (()), and (⋆) ∈/ (()).</p>
        <p>Proof. We prove the contrapositive: Suppose that for all ′ ∈ ℛ and all ⋆ ∈ (′) ∖ (), either
(⋆) ∈/ (()), or (⋆) ∈/ (()). Then no CG -extension () exists.</p>
        <p>Assume that for every ′ ∈ ℛ, every extended literal ⋆ ∈ (′) ∖ () satisfies (⋆) ∈
(()) ∪ (()). This implies there exists no literal in (′) ∖ () whose atom is disjoint
from both the body and the head of .</p>
        <p>Suppose we attempt to construct a CG  -extension () . To do so, we must add a guard literal ∼ ⋆
(alternatively ⋆) to the body of , aiming to make  body-incompatible with some ′ ∈ ℛ while leaving
′ unafected. This requires that ⋆ occurs in (′) but not in (), and (⋆) does not appear in
() ∪ (), to ensure ∼ ⋆ is a valid guard and does not interfere with the existing semantics of ′.
However, by our assumption, every candidate literal ⋆ ∈ (′) ∖ () fails this requirement as its atom
is already present in . Hence, any attempt to use ∼ ⋆ as a guard literal either introduces redundancy, or
creates self-blocking behaviour (if the atom occurs in ()), or results in no incompatibility with ′ at
all. Consequently, no valid guard literal exists to distinguish  from ′, and thus no constraint-guarding
-extension () exists. This completes the contraposition and proves the lemma.</p>
        <p>Given an encoding Π with a CI-conflict ℛ w.r.t. a positive constraint, we say ℛ is guardable if there
exists a CG -extension for ℛ.</p>
        <p>Constraint-guarding  -extensions allow for the construction of problem encodings that remain
consistent across all admissible instances.</p>
      </sec>
      <sec id="sec-3-11">
        <title>Proposition 4. Let Π be a problem encoding, Ψ a set of constraints. Let  ∈ Ψ be a positive constraint,</title>
        <p>and let ℛ ⊆ Π be a CI-conflict w.r.t. . Suppose  ∈ ℛ, and let () be a CG  -extension of  w.r.t. . Let
′′ be the resulting  -extended rule w.r.t. () . Then, the set ℛ ∖ {} ∪ {′′} is no longer a CI-conflict w.r.t.
.</p>
        <p>Proof. Assume that ℛ ∈ Π is a CI-conflict w.r.t. a positive constraint  . By Definition 10, this implies
that ℛ is compatible. Let  ∈ ℛ and let () be a CG  -extension for  w.r.t. . Denote by ′′ the 
extended rule w.r.t. () , and define ℛ′ := ℛ ∖ {} ∪ {′′}. By Definition 11, () is constraint-guarding
in ℛ′, implying that ℛ′ is not body-compatible Consequently, ℛ′ is not compatible and therefore not a
CI-conflict w.r.t.  .</p>
        <p>Hence, robust CI-consistency can be achieved in a problem encoding by iteratively resolving all
CI-conflicts through appropriate constraint-guarding -extensions.</p>
        <p>Proposition 5. Let Π 0 be a (potentially CI-inconsistent) problem encoding and and let Ψ be a set of
positive constraints. Furthermore, let all CI-conflicts in Π 0 be guardable. Then there exists a finite sequence
of encodings Π 0, Π 1, . . . , Π  such that for each  &lt; :
• a CI-conflict ℛ ⊆ Π</p>
        <p>w.r.t. some positive constraint  ∈ Ψ is identified, and
• Π +1 is obtained from Π  by applying a CG  -extension for a rule  ∈ ℛ w.r.t.  to , yielding a
modified rule  ′ that weakens  w.r.t. the constraint-induced inconsistencies.</p>
        <p>This process terminates after finitely many steps. The final encoding Π  is then robustly CI-consistent,
meaning that no constraint in Ψ can be violated under any admissible instance, and that all such
constraintinduced inconsistencies have been resolved without the removal of any rule from the original encoding.
Proof. We proceed by induction over the CI-conflicts in Π w.r.t. some positive constraint in Ψ.</p>
        <p>Let Π 0 = Π. If Π 0 is already robustly CI-consistent, we are done.</p>
        <p>Otherwise, there exists a constraint  ∈ Ψ and a CI-conflict ℛ ⊆ Π 0 such that the rules in ℛ
collectively allow a derivation of a set of literals that violate  under some admissible instance. By
assumption, not all rules in ℛ share the same body, so at least one rule  ∈ ℛ admits a CG  -extension
( ) for  w.r.t. .</p>
        <p>We apply ( ) to weaken  w.r.t. the derivation that violates , obtaining ′. The next encoding is
defined as Π 1 = Π 0 ∖ {} ∪ {′}.</p>
        <p>This modification eliminates the particular potential constraint violation associated with the
derivation of . Moreover, because the  -extension reduces the derivational strength of , it cannot
reintroduce the same conflict.</p>
        <p>This process is repeated iteratively. At each step , we select a remaining unresolved CI-conflict
ℛ ⊆ Π  and choose a rule  ∈ ℛ that can be individually weakened due to the assumption that ℛ is
guardable. This guarantees progress by resolving at least one distinct conflict per step.</p>
        <p>Since the total number of conflicts is finite (due to the finiteness of Π , Ψ , and possible derivations),
the process must terminate after finitely many steps.</p>
        <p>Let Π  be the final encoding. By construction, it is robustly CI-consistent w.r.t. all constraints in Ψ
(cf. Corollary 2), and every rule from the original encoding is either unchanged or replaced by a weaker
version (i.e., extended rule body), without any deletions.</p>
        <p>Algorithm 1 Constructing -Extensions for Guardable CI-conflicts
Require: Encoding Π  , constraint set Φ  , guardable CI-conflict ℛ ⊆ Π
Ensure: -extension () for some  ∈ ℛ
1: Select two distinct rules , ′ ∈ ℛ
2:  ← ( ′) ∖ ()
3:  ← { ⋆ ∈  | (⋆) ∈/ (), (⋆) ∈/ ()}
4: if  = ∅ then
5: abort: no valid extended literal found
6: end if
7: Select * ∈ 
8: Define  1() := {∼ ⋆} and  2() := {⋆}
9: Construct two -extended rules w.r.t. :
10: ∼ := () ← (),  1().
11: ¬ := () ← (),  2().
12: Select either ∼ or ¬ to replace  in Π 
 w.r.t.  ∈ Ψ</p>
        <p>To systematically enforce incompatibility within a CI-conflict, Algorithm 1 constructs a CG 
extension for a selected rule  ∈ ′, where ℛ ⊆ Π is a guardable CI-conflict. The procedure begins
by selecting a second rule ′ ∈ ℛ that the expert intends to render incompatible with  (line 1). The
algorithm then identifies literals ⋆ ∈ (′)∖() that do not appear in the head or body of  (lines 2– 3).</p>
        <sec id="sec-3-11-1">
          <title>These literals form the candidate set  , from which the expert selects a literal ⋆ (line 7). Based on this</title>
          <p>choice, the algorithm constructs two possible -extensions:  1() = {∼ ⋆}, and  2() = {⋆} (line 8).
These generate two  -extended rule variants of , denoted by ∼ and ¬, which respectively enforce
incompatibility with ′ via strong or default negation of ⋆ (lines 10–11). The expert then selects one of
these  -extended rules to replace the original rule  (line 12). This process ensures that any resulting
answer set avoids satisfying the bodies of both rules simultaneously, thereby resolving the potential
constraint violation through strategic weakening.</p>
          <p>Let us illustrate Algorithm 1 using the following example:
Example 11. Let Π 11 be a problem encoding consisting of the following rules:
1:  ← , ∼.</p>
          <p>2:  ← .</p>
          <p>3:  ← , ∼ℎ.</p>
          <p>4:  ← , .</p>
          <p>5:  ← , ∼.</p>
          <p>Additionally, consider the following set Ψ 11 of constraints:
6: , , .</p>
          <p>7: , .</p>
          <p>The encoding Π 11 contains two CI-conflicts: ℛ 1 = {1, 2, 3} w.r.t. 6 and ℛ2 = {4, 5} w.r.t. 7.</p>
          <p>Since the rules within each CI-conflicts do not share any atoms, both CI-conflicts are guardable.</p>
          <p>To resolve the potential constraint violation in ℛ1, the expert selects the rule pair 1, 2, and extends
1. We define 1 = (2) ∖ (1) = { }, and thus obtain 1 = { }. Selecting  , we construct possible
 -extensions for 1, namely  1,1 = {∼ } , and  1,2 = { }. The corresponding  -extended rules for 1 are:
1∼ :  ← , ∼, ∼.</p>
          <p>1¬:  ← , ∼,
 .</p>
          <p>Similarly, for the CI-conflict ℛ2, we choose to extend 4. We define 2 = (5) ∖ (4) = {, ∼} ,
resulting in 2 = {∼} . Selecting ∼ , we construct possible  -extensions for 4, namely,  2,1 = {},
and  2,2 = {∼ }. The corresponding -extended rules for  4 are:
4∼ :  ← , .</p>
          <p>4¬:  ← , ∼
.</p>
          <p>Suppose the expert selects 1∼ : and 4¬: as the  -extended rules. We then obtain the following modified
problem encoding Π ′11:
1∼ :  ← , ∼, ∼.</p>
          <p />
          <p>Since Π ′11 contains no CI-conflicts, the modified program is CI-consistent w.r.t. Ψ</p>
          <p>In summary, our approach provides a constructive method for ensuring robust CI-consistency. By
systematically detecting CI-conflicts and resolving them through suitable constraint-guarding and
informative  -extensions, we isolate the sources of potential constraint violations and weaken only
the necessary rules. This targeted repair strategy preserves the original encoding structure to the
greatest extent possible while guaranteeing that all constraints remain satisfied under any admissible
instance. As a result, the final encoding satisfies robust CI-consistency without requiring rule deletion
or instance-specific modifications.</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>5. Conclusion and Outlook</title>
      <p>In this paper, we have introduced a novel framework for managing CI-conflicts in ELPs. By allowing
users to specify coarse-grained conditions and constraints directly at the encoding level, our method
automatically determines which constraints could be violated under some (unspecified) instance. We
isolate the culprit rules whose derivations risk violating a constraint, leveraging the established concept
of constraint-guarding  -extensions, originally defined for achieving SC-consistency. Applying these
 -extensions yields robust CI-consistency, meaning that all constraints remain satisfied without deleting
rules or depending on particular data instances.</p>
      <p>Our main contributions are
(1) a formal definition of CI-conflicts as a semantic interaction between constraints and potentially
derivable literals;
(2) an algorithm for detecting and characterising such conflicts at the encoding level; and
(3) a constructive repair procedure based on  -extensions that minimally modifies only those rules
necessary to restore consistency w.r.t. constraints.</p>
      <p>For future work, we plan to generalise our inconsistency analysis framework to accommodate all
forms of constraints, including those involving default negation, thereby extending  -extensions to all
CI-conflicts. Furthermore, we are currently working on relaxing the current restrictions on admissible
problem instances–specifically, by allowing instances to contain literals that appear in constraints.</p>
      <p>In parallel, we are developing a complementary theory of consistency w.r.t. odd cycles for ground
programs. Once this theory is established, we will investigate whether and how robust consistency
w.r.t. odd cycles can be achieved. Through these developments, we aim to provide a unified,
instanceindependent methodology for diagnosing and repairing all types of inconsistencies in ASP encodings.</p>
    </sec>
    <sec id="sec-5">
      <title>Declaration on Generative AI</title>
      <p>The authors have not employed any Generative AI tools.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A.</given-names>
            <surname>Thevapalan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Kern-Isberner</surname>
          </string-name>
          ,
          <article-title>On establishing robust consistency in answer set programs</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>23</volume>
          (
          <year>2023</year>
          )
          <fpage>1094</fpage>
          -
          <lpage>1127</lpage>
          . doi:
          <volume>10</volume>
          .1017/S1471068422000357.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Thevapalan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Kern-Isberner</surname>
          </string-name>
          ,
          <article-title>Sorting strategies for interactive conflict resolution in ASP</article-title>
          , in: E. Pontelli,
          <string-name>
            <given-names>S.</given-names>
            <surname>Costantini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Dodaro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. A.</given-names>
            <surname>Gaggl</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Calegari</surname>
          </string-name>
          , A. S.
          <string-name>
            <surname>d'Avila Garcez</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Fabiano</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Mileo</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          <string-name>
            <surname>Russo</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          <string-name>
            <surname>Toni</surname>
          </string-name>
          (Eds.),
          <source>Proceedings 39th International Conference on Logic Programming</source>
          ,
          <source>ICLP</source>
          <year>2023</year>
          , Imperial College London, UK,
          <source>9th July 2023 - 15th July</source>
          <year>2023</year>
          , volume
          <volume>385</volume>
          <source>of EPTCS</source>
          ,
          <year>2023</year>
          , pp.
          <fpage>116</fpage>
          -
          <lpage>128</lpage>
          . doi:
          <volume>10</volume>
          .4204/EPTCS.385.13.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Lifschitz</surname>
          </string-name>
          ,
          <article-title>Classical negation in logic programs</article-title>
          and disjunctive databases,
          <source>New Gener. Comput</source>
          .
          <volume>9</volume>
          (
          <year>1991</year>
          )
          <fpage>365</fpage>
          -
          <lpage>386</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>C.</given-names>
            <surname>Sakama</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Inoue</surname>
          </string-name>
          ,
          <article-title>Paraconsistent stable semantics for extended disjunctive programs</article-title>
          ,
          <source>J. Log. Comput</source>
          .
          <volume>5</volume>
          (
          <year>1995</year>
          )
          <fpage>265</fpage>
          -
          <lpage>285</lpage>
          . doi:
          <volume>10</volume>
          .1093/LOGCOM/5.3.265.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>J.</given-names>
            <surname>Oetsch</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pührer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Tompits</surname>
          </string-name>
          ,
          <article-title>Stepwise debugging of answer-set programs</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>18</volume>
          (
          <year>2018</year>
          )
          <fpage>30</fpage>
          -
          <lpage>80</lpage>
          . doi:
          <volume>10</volume>
          .1017/S1471068417000217.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>T.</given-names>
            <surname>Syrjänen</surname>
          </string-name>
          ,
          <article-title>Debugging inconsistent answer set programs</article-title>
          ,
          <source>in: The 11th International Workshop on Nonmonotonic Reasoning</source>
          , Low Wood hotel, Lake District, England, UK, 30 May - 1
          <string-name>
            <surname>June</surname>
          </string-name>
          ,
          <year>2006</year>
          , number IfI-
          <volume>06</volume>
          -04 in Clausthal University of Technology, Department of Informatics,
          <source>Technical Report</source>
          , Clausthal University of Technology, Germany,
          <year>2006</year>
          , pp.
          <fpage>77</fpage>
          -
          <lpage>83</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>C.</given-names>
            <surname>Dodaro</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Gasteiger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Reale</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Ricca</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Schekotihin</surname>
          </string-name>
          ,
          <article-title>Debugging non-ground ASP programs: Technique and graphical tools</article-title>
          ,
          <source>Theory Pract. Log. Program</source>
          .
          <volume>19</volume>
          (
          <year>2019</year>
          )
          <fpage>290</fpage>
          -
          <lpage>316</lpage>
          . doi:
          <volume>10</volume>
          .1017/ S1471068418000492.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gebser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Pührer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Schaub</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Tompits</surname>
          </string-name>
          ,
          <article-title>A meta-programming technique for debugging answer-set programs</article-title>
          , in: D.
          <string-name>
            <surname>Fox</surname>
            ,
            <given-names>C. P.</given-names>
          </string-name>
          Gomes (Eds.),
          <source>Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence</source>
          ,
          <source>AAAI</source>
          <year>2008</year>
          , Chicago, Illinois, USA, July
          <volume>13</volume>
          -
          <issue>17</issue>
          ,
          <year>2008</year>
          , AAAI Press,
          <year>2008</year>
          , pp.
          <fpage>448</fpage>
          -
          <lpage>453</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>T.</given-names>
            <surname>Eiter</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Fink</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Moura</surname>
          </string-name>
          ,
          <article-title>Paracoherent answer set programming</article-title>
          ,
          <source>in: Proceedings of the Twelfth International Conference on Principles of Knowledge Representation and Reasoning</source>
          , KR'10, AAAI Press, Toronto, Ontario, Canada,
          <year>2010</year>
          , p.
          <fpage>486</fpage>
          -
          <lpage>496</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>A.</given-names>
            <surname>Thevapalan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Kern-Isberner</surname>
          </string-name>
          ,
          <article-title>Towards interactive conflict resolution in ASP programs</article-title>
          , in: M.
          <string-name>
            <surname>Martinez</surname>
          </string-name>
          , I. Varcinczak (Eds.),
          <source>Proceedings of the 18th International Workshop on NonMonotonic Reasoning</source>
          ,
          <source>NMR</source>
          <year>2020</year>
          ,
          <year>2020</year>
          , pp.
          <fpage>29</fpage>
          -
          <lpage>36</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Caminada</surname>
          </string-name>
          ,
          <article-title>Well-founded semantics for semi-normal extended logic programs</article-title>
          ,
          <source>in: Proc. 11th Int'l Workshop on Nonmonotonic Reasoning</source>
          ,
          <year>2006</year>
          , pp.
          <fpage>103</fpage>
          -
          <lpage>108</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>M.</given-names>
            <surname>Gelfond</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Kahl</surname>
          </string-name>
          ,
          <article-title>Knowledge Representation, Reasoning, and the Design of Intelligent Agents: The Answer-Set Programming Approach</article-title>
          , Cambridge University Press,
          <year>2014</year>
          . doi:
          <volume>10</volume>
          .1017/ CBO9781139342124.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>M.</given-names>
            <surname>Alviano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W.</given-names>
            <surname>Faber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Woltran</surname>
          </string-name>
          ,
          <article-title>Complexity of super-coherence problems in ASP</article-title>
          ,
          <source>Theory and Practice of Logic Programming</source>
          <volume>14</volume>
          (
          <year>2013</year>
          )
          <fpage>339</fpage>
          -
          <lpage>361</lpage>
          . doi:
          <volume>10</volume>
          .1017/s147106841300001x.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>