<!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>Defeasible Justification for KLM-Style Logic</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Victoria Chama</string-name>
          <email>vchama@cs.uct.ac.za</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Steve Wang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Thomas Meyer</string-name>
          <email>tmeyer@cs.uct.ac.za</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giovanni Casini</string-name>
          <email>giovanni.casini@isti.cnr.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CAIR</institution>
          ,
          <country country="ZA">South Africa</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>CNR-ISTI</institution>
          ,
          <country country="IT">Italy</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Cape Town</institution>
          ,
          <country country="ZA">South Africa</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Research in description logics (DLs) and formal ontologies has dedicated quite an efort to the investigation of the notion of explanation for DL reasoning, for example relying on the notion of justification [1]. There has also been some efort dedicated to the definition of defeasible reasoning for DLs that, contrary to the classical monotonic reasoning, is appropriate for dealing with incomplete/uncertain information. In the present paper, we extend the notion of justification to the framework of defeasible reasoning for DLs; specifically, we consider rational closure [2], an entailment relation that is of particular importance in the area of defeasible reasoning. Here we present the main theoretical results for the DL ℒ, and an implementation of our solution, at the moment developed for propositional logic.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Defeasible entailment</kwd>
        <kwd>rational closure</kwd>
        <kwd>justification-based explanations</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <sec id="sec-1-1">
        <title>Knowledge Representation and Reasoning (KRR) is an essential aspect of Artificial Intelligence (AI).</title>
      </sec>
      <sec id="sec-1-2">
        <title>Logics such as Propositional Logic (PL) and Description Logic (DL) provide a way to formulate and</title>
        <p>represent knowledge in a structured manner. Reasoning with such formalised knowledge representations
allows us to deduce new information from explicit knowledge. In monotonic (classical) reasoning
adding new knowledge cannot cause the retraction of previously drawn deductions. This characteristic
of monotonic reasoning is not appropriate for reasoning with rules and generalisations that admit
exceptions.</p>
      </sec>
      <sec id="sec-1-3">
        <title>Consider the classic ‘penguin example’: “penguins are birds”, “penguins cannot fly” and “birds can</title>
        <p>
          lfy”. Monotonic reasoning concludes that there are no instances of penguins because birds can both fly
and not fly. However, penguins legitimately are birds that cannot fly. Non-monotonic reasoning can
overcome such restriction, in particular the approach to non-monotonicity that is known as defeasible
reasoning. We use a non-monotonic extension of the DL ℒ to perform defeasible reasoning, for
which software tools already exist [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
        </p>
        <p>
          Conclusions produced by reasoning tools are often dificult to understand due to the volume and
complexity of the statements, and there is a need for algorithms and tools that provide explanations
for conclusions. In recent years, research has been done to provide explanations for conclusions in
monotonic reasoning [
          <xref ref-type="bibr" rid="ref1">1, 4</xref>
          ]. Consequently, various algorithms to compute explanations and
implementations of these algorithms for DL are available as plugins in Protégé [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. However, little research has
gone into providing explanations for defeasible reasoning systems. Defeasible reasoning introduces
well-defined and systematic approaches to reasoning with incomplete information and rules that admit
exceptions [5]. Some popular defeasible reasoning systems are based on the semantics developed by
        </p>
      </sec>
      <sec id="sec-1-4">
        <title>Kraus, Lehmann, and Magidor (KLM) [6]. We focus here on rational closure, originally defined for PL</title>
        <p>
          [7], but has also been lifted to the case for DLs [
          <xref ref-type="bibr" rid="ref2">2, 8, 9</xref>
          ]. In this paper we introduce an algorithm that
computes explanations for conclusions drawn using rational closure. The logic we use for this algorithm
is a KLM extension to DL ℒ. We also present an implementation of the algorithm in PL.
        </p>
      </sec>
      <sec id="sec-1-5">
        <title>The rest of the paper is structured as follows. The next section introduces the necessary preliminaries.</title>
      </sec>
      <sec id="sec-1-6">
        <title>In Section 3, we use the concepts provided in Section 2 to construct a defeasible justification algorithm.</title>
      </sec>
      <sec id="sec-1-7">
        <title>Then, we present an implementation of the defeasible justification algorithm for the propositional case in Section 4. Lastly, we conclude the paper in Section 5.</title>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2. Preliminaries</title>
      <sec id="sec-2-1">
        <title>In this section, we introduce the foundational notions and concepts required to build an algorithm that</title>
        <p>computes explanations for conclusions produced by reasoning services. After a brief introduction to the</p>
        <sec id="sec-2-1-1">
          <title>DL ℒ, we present the notion of justification defined by Horridge which serves as an explanation for</title>
          <p>classical reasoning services. Then we introduce the defeasible logic that we are going to use throughout
the paper. Lastly, we provide details on the form of defeasible reasoning known as rational closure.
2.1. Description Logic ℒ</p>
        </sec>
      </sec>
      <sec id="sec-2-2">
        <title>Description logics (DLs) are a family of logical formalisms that can represent conceptual knowledge in a</title>
        <p>structured and formally well-understood way. ℒ is a basic formalism of DL and stands for Attributive
(Concept) Language with Complements [10]. It includes concept names, concept intersection, concept
union, complement, existential and universal qualifiers. This section provides the syntax and semantics
of ℒ that will be used in the rest of this paper.</p>
        <p>Definition 1 (Syntax). The language of ℒ is built from a finite set of atomic concept names, , and a
ifnite set of atomic role names, . Complex concepts are denoted with  and are built inductively according
to the following rule:</p>
        <p>::= ⊤|⊥||¬| ⊓ | ⊔ |∃.|∀.
where ⊤ is the universal concept, ⊥ is the bottom concept, ¬ is the unary negation operation, ⊓ is the
binary intersection operation, ⊔ is the binary union operation, ∃ is the existential qualifier, ∀ is the universal
qualifier,  ∈  and  ∈  [11].</p>
        <sec id="sec-2-2-1">
          <title>We use ℒ to denote the language of all ℒ concepts. The semantics of ℒ is given by the notion of</title>
          <p>interpretation.</p>
          <p>Definition 2 (Semantics). An interpretation is a structure ℐ = ⟨∆ ℐ , · ℐ ⟩, where ∆ ℐ is a non-empty set
called the domain, and · ℐ is an interpretation function. For every  ∈ , ℐ ⊆ ∆ ℐ , ⊤ℐ = ∆ ℐ , ⊥ℐ = ∅
and for every  ∈ , ℐ ⊆ ∆ ℐ × ∆ ℐ . For some complex concepts  and  ∈ ℒ, the interpretation function
· ℐ extends to interpret all complex concepts of ℒ in the following way:</p>
          <p>
            (¬)ℐ = ∆ ℐ /ℐ , ( ⊓ )ℐ = ℐ ∩ ℐ , ( ⊔ )ℐ = ℐ ∪ ℐ ,
(∀.)ℐ = {| ∈ ℐ for every  s.t (, ) ∈ ℐ }, (∃.)ℐ = {|(, ) ∈ ℐ for some  ∈ ℐ }
Given ,  ∈ ℒ,  ⊑  is called a subsumption statement (or a statement). Concept equivalence,
denoted  ≡ , is the abbreviation for  ⊑  and  ⊑ . An ℒ TBox  is a finite set of
statements. We refer to such statements in  as axioms. We use , , ... to denote statements in  . An
interpretation ℐ satisfies a statement,  ⊑ , denoted ℐ ⊩  ⊑ , if ℐ ⊆ ℐ . An interpretation ℐ is
a model of TBox  if ℐ satisfies every statement in  . Given a TBox  and a statement  ,  entails  ,
denoted  |=  , if and only if for every interpretation ℐ such that ℐ ⊩  , it also holds that ℐ ⊩  . In
this paper, we are not interested in the ABox  which is a finite set of concept assertions (instantiation
of concepts) and role assertions (instantiation of roles).
2.2. Justifications
Given an entailment,  |=  , an explanation for  |=  is a subset of  such that it entails  . Intuitively,
we want to identify the axioms in the  that contributed towards the entailment. There are several
approaches to computing explanations for entailments [
            <xref ref-type="bibr" rid="ref1">1, 12</xref>
            ]. In this paper, we base the explanation
for entailment on the notion of justification defined by Horridge [
            <xref ref-type="bibr" rid="ref1">1</xref>
            ]. Horridge defines justification for
an entailment as the minimal subsets of the knowledge base that entails the query.
Definition 3 (Justification). Let  be a TBox and  be a statement.  is a justification for  |=  if
 ⊆  ,  |=  and, for all  ′⊂ , it holds that  ′ ̸|=  .
          </p>
          <p>Example 1. Let us consider the penguin example that we mentioned in the introduction. We can formalise
it in a classical TBox,  , about birds, penguins and a special penguin that has flying capabilities.
 =
⎧ Bird ⊑ Fly, ⎫
⎨⎪⎪⎪⎪⎪⎪⎪⎪ SpePcBeinairlgdPue⊑inngW⊑uiin¬ngF⊑sly,F,ly, ⎪⎪⎪⎬⎪⎪⎪⎪⎪
⎪⎪⎪ Penguin ⊑ Bird, ⎪⎪⎪⎪
⎪⎪⎪SpecialPenguin ⊑ Penguin,⎪⎪
⎪⎩⎪ Robin ⊑ Bird ⎪⎪⎭</p>
          <p>Such a TBox entails that special penguins fly (  ⊨ SpecialPenguin ⊑ Fly). We can identify two
justifications for such a conclusion, that is, two minimal subsets of  that allow the derivation of
SpecialPenguin ⊑ Fly:</p>
          <p>1 = {SpecialPenguin ⊑ Fly}
2 = {SpecialPenguin ⊑ Penguin, Penguin ⊑ Bird, Bird ⊑ Fly}
1 is a valid justification because the query, SpecialPenguin ⊑ Fly, is an axiom in  , and 2 is also
valid according to Definition 3.</p>
        </sec>
      </sec>
      <sec id="sec-2-3">
        <title>Horridge presents an implementation for computing justifications in Prot égé [1, Algorithm 4.1]. In</title>
        <p>what follows we will refer to it as Algorithm ComputeAllJustifications(Algorithm 4.1), that, given a</p>
        <sec id="sec-2-3-1">
          <title>TBox  and a statement  ⊑  entailed by  , returns all associated justifications.</title>
          <p>2.3. Defeasible Reasoning</p>
        </sec>
      </sec>
      <sec id="sec-2-4">
        <title>In this section, we discuss how defeasible reasoning has been implemented in DLs. Defeasible logic</title>
        <p>enables us to reason with rules and generalisations that model typical scenarios that admit exceptions.</p>
      </sec>
      <sec id="sec-2-5">
        <title>For example, birds typically fly but penguins are atypical birds that do not fly.</title>
        <p>
          There is existing work for extending description logics with defeasible reasoning [
          <xref ref-type="bibr" rid="ref2 ref3">2, 3, 8, 9, 13, 14,
15, 16, 17, 18</xref>
          ]. As mentioned in the introduction our work is based on the so-called KLM approach to
defeasible reasoning [6], and in particular on a specific entailment relation, rational closure [7]. We focus
on rational closure since it is a particularly significant entailment relation in defeasible reasoning: other
relevant entailment relations are based on it [19, 20, 21], it has already been redefined for description
logics [
          <xref ref-type="bibr" rid="ref2">2, 8, 9, 22</xref>
          ], moreover it can be implemented just using a relatively simple procedure on top
of some classical DL reasoner [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ]. We introduce our explanations for defeasible reasoning using a
well-known extension of the DL ℒ to model defeasible reasoning [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. Such an extension allows for
an additional type of subsumption statement: ‘ ⊏∼ ’ is a defeasible statement which is read “Typically,
’s are ’s, as opposed to “all ’s are ’s” for the classical subsumptions ‘ ⊑ ’.
Definition 4. (Defeasible Inclusion) For ,  ∈ ℒ, a defeasible inclusion is a statement of the form  ⊏∼.
        </p>
        <p>
          A defeasible statement  ⊏∼  can be read as “usually, an instance of the class  is also an instance
of the class ”. A statement like “birds typically fly”, formally represented by Bird ⊏∼ Fly in defeasible
ℒ, indicates that if something is a bird then it is reasonable to infer that it flies, if we are not informed
of the contrary. ‘ ⊏∼ ’ is meant to be the defeasible counterpart of the classical subsumption ⊑ [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ]. We
define a DBox  as a finite set of defeasible statements, and a defeasible knowledge base  =  ∪  as
consisting of a TBox and DBox. We refer to statements stated in  as axioms. The statements that have
a defeasible form are those that can have exceptions to the statements: since most birds fly, but there
are exceptions such as penguins and ostriches, we use Bird ⊏∼ Fly instead of Bird ⊑ Fly.
Example 2. Consider the following defeasible version of TBox  shown in Example 1.
 =
 =
⎧
⎨
        </p>
        <p>Penguin ⊑ Bird,</p>
        <p>
          Robin ⊑ Bird
⎩SpecialPenguin ⊑ Penguin⎭
⎧⎪⎨⎪ BBirdir d⊏∼⊏∼WFinlyg,s, ⎫⎪⎪⎬
⎪ Penguin ⊏∼ ¬Fly ⎪
⎪⎩SpecialPenguin ⊏∼ Fly⎭⎪
⎫
⎬
2.3.1. Rational Closure
As mentioned, we focus our attention on rational closure, a specific form of defeasible entailment. For
the full description, the semantics, and the motivation for the use of rational closure in ℒ, the
reader is directed to the work of Britz et al. [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], while here we focus only on the description of the
algorithmic procedure to decide rational closure. In essence, given a knowledge base  =  ∪ ,
the algorithm produces a ranking of the defeasible axioms in , all of which are then converted to
classical axioms, from which defeasible entailment (rational closure) can then be computed by a series
of classical entailment checks. The ranking of axioms is based on their exceptionality. Intuitively, in case
of potential conflicts exceptionality arranges axioms in the knowledge base according to specificity: if
we have conflictual information, (e.g., birds fly, penguins are birds, and penguins do not fly), the axioms
that are considered less specific than others will be discarded first (e.g., ‘birds fly’ is discarded in favour
of ‘penguins do not fly’ since information about penguins is more specific than information about birds
in general).
        </p>
        <p>In [2, Sect. 5.2] the procedure Exceptional is aimed at deciding which defeasible axioms are more
exceptional w.r.t. a knowledge base. Exceptionality is based on the specificity among classes in case
we have a conflict: for example ‘penguins usually do not fly’ ( Penguin ⊏∼ ¬Fly) is more exceptional
than ‘birds usually fly’ ( Bird ⊏∼ Fly), since there is a potential conflict and the antecedent of the former
(Penguin) is a subclass (more specific) than the antecedent of the latter ( Bird). We do not provide the
procedure Exceptional here, referring the reader to [2, Sect. 5.2]. On top of procedure Exceptional we
build Algorithm 1, that takes as input a knowledge base  =  ∪  and returns a ranking of the axioms
in  according to exceptionality: from rank 0, with ℰ0 containing all the defeasible axioms in , to
some rank , with ℰ, containing the most exceptional axioms in . Algorithm 1 is taken from [23,</p>
      </sec>
      <sec id="sec-2-6">
        <title>Sect. 5.2]. We again refer the reader to this paper for proper explanations and analysis. Here we present the algorithm and go through an example to give a sense of how the algorithm works.</title>
        <p>Example 3. For the defeasible knowledge base  from Example 2, ComputeRanking will be executed as
follows.1
1. The algorithm takes as input  and creates a hierarchy of defeasible axioms w.r.t their exceptionality.</p>
        <p>
          First it considers the entire set , associating it with ℰ0 (line 6):
1Note that the algorithm also introduces a knowledge base * =  * ∪ * . * is a reformulation of the input  that is
needed for knowledge bases with a particular form, which is not the case for our example. Here the reader can just assume
that * =  and, again, we refer to [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ] for an explanation.
        </p>
        <sec id="sec-2-6-1">
          <title>Algorithm 1: ComputeRanking()</title>
          <p>Input:  =  ∪ 
Output: * =  * ∪ * , an exceptionality sequence ℰ0, . . . , ℰ and a partitioning
 = {0, . . . , } for *
1  * ← 
2 * ← 
3  ← ∅
4 repeat
5  ←
6
7
8
9
10
− 1 ← ℰ − 1 ∖ ℰ
 ←  ∪ {− 1}
18 ℰ ← (ℰ0, ..., ℰ− 1)
19 return * =  * ∪ * , ℰ ,</p>
          <p>ℰ0 = {Bird ⊏∼ Fly, Bird ⊏∼ Wings, Penguin ⊏∼ ¬Fly, SpecialPenguin ⊏∼ Fly}
2. Then it applies the algorithm Exceptional to it (line 7). Exceptional identifies all the potential conflicts
in  , that in our case are two: (1) birds fly, but penguins, that are birds, do not; (2) penguins do not
lfy, but special penguins, that are penguins, do. From such two conflicts, the algorithm Exceptional
identifies the most specific pieces of defeasible information that play a role in it: penguins do not fly
for (1) and special penguins fly for (2). Such axioms are associated with the first level of exceptionality:
ℰ1 = {Penguin ⊏∼ ¬Fly, SpecialPenguin ⊏∼ Fly}.
3. Now, since ℰ1 ̸= ℰ0, we apply the Exceptional algorithm iteratively until we reach a fixed point
(lines 9-12). More in detail, we apply it to  , ℰ1, and Exceptional identifies a potential conflict
corresponding to case (2) above: (2) penguins do not fly, but special penguins, that are penguins, do.
Again, the algorithm identifies the most specific defeasible axioms playing a role in the potential
conflicts (in this case, special penguins fly), and associates them with a new exceptionality level
(line 11):
ℰ2
ℰ2 = {SpecialPenguin ⊏∼ Fly}.
4. Since ℰ2 ̸= ℰ1 (line 9) we again apply the Exceptional algorithm to  , ℰ2, and Exceptional checks
that there are no more potential conflicts, and ℰ3 = ∅. (line 11). The empty set is trivially a fixed
point of our procedure. Now we have the exceptionality sequence {ℰ0, ℰ1, ℰ2}. The algorithm uses
this sequence to assign a ranking value to each axiom in  (line 18): all the axioms that are not
exceptional go into rank 0:</p>
          <p>0 = ℰ0 ∖ ℰ1 = Bird ⊏∼ Fly, Bird ⊏∼ Wings.</p>
          <p>The axioms that are exceptional only w.r.t. ℰ0 go into rank 1 (1), and so on:</p>
          <p>1 = ℰ1 ∖ ℰ2 = Penguin ⊏∼ ¬Fly.</p>
          <p>2 = ℰ2 ∖ ℰ3 = ℰ2 = SpecialPenguin ⊏∼ Fly.</p>
          <p>
            Now we move to Algorithm 2, that, given a knowledge base  and a query  ⊏∼ , decides whether
 entails  ⊏∼  under rational closure. The original algorithm is in [2, Sect. 5.2], and once again we
refer the reader to this publication for proper explanations and analysis. Here we simply go through
our guiding example, while pointing out the following about Algorithm 2:
• The symbol ℰ indicates the materialisation of a set of defeasible axioms: given a set  =
{1 ⊏∼ 1, . . . ,  ⊏∼ }, the set  = {¬1 ⊔ 1, . . . , ¬ ⊔ } is the set of concepts
expressing the implications that correspond to the defeasible subsumptions.
• Algorithm 2 is slightly diferent w.r.t. the Function RationalClosure in [
            <xref ref-type="bibr" rid="ref2">2</xref>
            ], since it returns not
only the answer to the query, but also a value  that provides the exceptionality ranking of the
query. This information is needed for the creation of the justifications (see Section 2.3).
Example 4. Consider the rankings obtained in Example 3 with the query SpecialPenguin ⊏∼ Fly. The
rational closure algorithm starts with ℰ0 (line 2), and checks whether the antecedent in the query is in a
conflict w.r.t. ℰ0. That is the case since (line 3):
 |= l{¬Bird ⊔ Fly, ¬Bird ⊔ Wings, ¬Penguin ⊔ ¬Fly, ¬SpecialPenguin ⊔ Fly} ⊓ SpecialPenguin ⊑ ⊥
          </p>
          <p>The algorithms goes on checking for increasing values of ℰ (lines 3-4), until it finds an exceptionality
level s.t. SpecialPenguin is not part of any conflict. That is the case fo ℰ2, since</p>
          <p≯|= (¬SpecialPenguin ⊔ Fly) ⊓ SpecialPenguin ⊑ ⊥</p>
          <p>Now the algorithm associates the information in ℰ2 with the query, and checks whether the query is
implied using materialisation and classical DL reasoning (line 6). That is the case since
 |= (¬SpecialPenguin ⊔ Fly) ⊓ SpecialPenguin ⊑ Fly.</p>
          <p>The algorithm returns true and the value 2 (the exceptionality level associated with the query).
1 (* =  * ∪ * , ℰ = (ℰ0, . . . , ℰ)) ←
2  ← 0
3 while  * |= d ℰ ⊓  ⊑ ⊥ and  ≤  do
4  ←  + 1
5 if  ≤  then
6 return  * |= d ℰ ⊓  ⊑  , i</p>
          <p>return  * |=  ⊑ , i</p>
        </sec>
        <sec id="sec-2-6-2">
          <title>Algorithm 2: RationalClosureForJustifications( ,  )</title>
          <p>Input:  =  ∪  and a query  =  ⊏∼ .</p>
          <p>Output: true if  ⊏∼  is in the rat. clos. of , false otherwise; and a rank value i
ComputeRanking()</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>3. Defeasible Justification</title>
      <sec id="sec-3-1">
        <title>We now define a procedure that calculates justifications for defeasible entailment:</title>
        <p>ComputeDefeasibleJustifications. It is obtained by using RationalClosureForJustifications and
ComputeAllJustification s* as sub-procedures. ComputeAllJustification s* is a simple modification of</p>
      </sec>
      <sec id="sec-3-2">
        <title>ComputeAllJustifications[1, Algorithm 4.1]. We will not present it here. It is suficient to know that,</title>
        <p>given  =  ∪  and a defeasible inclusion  ⊏∼ , ComputeAllJustification s* (,  ⊏∼ ) returns
every minimal set  =  ′ ∪ ′ s.t.  ⊆  and  ′ |= d ′ ⊓  ⊑ .</p>
      </sec>
      <sec id="sec-3-3">
        <title>The algorithm first determines whether a particular query is in the rational closure of the knowledge</title>
        <p>base (line 1), and only if it is the case, does it proceed to calculate the justifications (lines 3-15). From</p>
      </sec>
      <sec id="sec-3-4">
        <title>RationalClosureForJustificationswe know the rank  that is associated to the query (line 6), and we</title>
        <p>consider only the information in ℰ to calculate the justifications using RationalClosureForJustifications
(lines 8 or 15, depending on the value of the rank ).</p>
        <p>Example 5. Consider the defeasible knowledge base  =  ∪  from Example 2. In Example 4 we have
seen that SpecialPenguin ⊏∼ Fly is defeasibly entailed by . We see now how Algorithm 3 explains why
SpecialPenguin ⊏∼ Fly is defeasibly entailed by :
1. Line 1 checks whether SpecialPenguin ⊏∼ Fly is in the rational closure of . From Example 4 we
know that it is the case, and the algorithm moves to line 3.
2. We initialise a variable i to 0 (line 4) and a set  to an empty set (line 5). In line 6 we obtain
the value  = 2, since, as we have seen in Example 4, SpecialPenguin is associated to ℰ2. Due
to that, the If-statement block on lines 7-9 is skipped since  &gt; 0.
3. Once we obtain the ranking  from ComputeRanking (line 11), the while-loop in lines 12-14 removes
axioms contained in 0 and 1. Therefore, we can only use only axioms in 2 and in the TBox  to
compute the justifications.
4. On line 15 we compute all the justifications for the query SpecialPenguin ⊏∼ Fly w.r.t  ∪ 2. The
only justification in  is 1 = {SpecialPenguin ⊏∼ Fly}.</p>
        <sec id="sec-3-4-1">
          <title>Algorithm 3: ComputeDefeasibleJustifications( ,  )</title>
          <p>Input:  =  ∪  and a query  =  ⊏∼ .</p>
          <p>Output: RationalClosureForJustifications(,  ); the set of justifications 
1 if RationalClosureForJustifications(,  ) = false then
2 return RationalClosureForJustifications(,  )
 ←</p>
          <p>0
3 else
4
5
6
7
8
9
 = {0, . . .} ←  from ComputeRanking()
while  &lt;  do
 ←
 ←   ∖</p>
          <p>+ 1
 ← ComputeAllJustification s* (,  )
return RationalClosureForJustifications(,  ),</p>
          <p>We return to Example 1 given in Section 2.2. Recall that using the knowledge base in Example 1 there
are two justifications that support the query SpecialPenguin ⊑ Fly: 1 = { SpecialPenguin ⊑ Fly } and
2 = { SpecialPenguin ⊑ Penguin, Penguin ⊑ Bird, Bird ⊑ Fly }. Once converted the knowledge base to
the defeasible formalism (Example 2), the corresponding justification sets are 1 = { SpecialPenguin ⊏∼Fly
} and 2 = { SpecialPenguin ⊑ Penguin, Penguin ⊑ Bird, Bird ⊏∼Fly }. However, our algorithm eliminates
from the potential justifications all the axioms that have rank lower than 2, hence eliminating Bird ⊏∼ Fly,
that is required for 2. Eventually, only justification 1 is eligible.</p>
        </sec>
      </sec>
      <sec id="sec-3-5">
        <title>Everett et al. [24] extended the principle of justifications for both Relevant and Lexicographic Closure.</title>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Implementation</title>
      <sec id="sec-4-1">
        <title>In this section we present an implementation of Algorithm 3, but at the moment just for Propositional</title>
        <p>Logic (PL)[25]. The original formulation of rational closure was for PL [7], and was developed in
the formal framework introduced by Kraus, Lehmann and Magidor (KLM) [6]. They use defeasible
conditionals  |∼  , where  and  are propositional formulas, and that are read as “if  , usually
 ”. A knowledge base in this framework is a finite set of defeasible implications and propositional
formulas. Since any propositional formula can be rewritten as a classical implication of the form  → 
(trivially,  can be rewritten as ⊤ →  or ¬ → ⊥), a knowledge base in the KLM Framework can
be seen as a finite set of classical implications and defeasible implications. The correspondence with
our defeasible knowledge base in ℒ, which is a finite set of classical subsumption statements and
defeasible subsumption statements, is quite immediate.</p>
        <p>Example 6. The knowledge base below is the PL version of the knowledge base presented in Example 2.
 = {Penguin → Bird, Robin → Bird, SpecialPenguin → Bird, Bird |∼ Fly,</p>
        <p>Bird |∼ Wings, Penguin |∼ ¬ Fly, SpecialPenguin |∼ Fly}</p>
      </sec>
      <sec id="sec-4-2">
        <title>The notion of defeasible entailment used in the previous sections in this paper fully corresponds</title>
        <p>to rational closure in the propositional case, as shown by Britz et al. [23]. In other words, rational
closure in the propositional case is a simplified version of rational closure in the DL ℒ case. Similarly,
the defeasible justification algorithm in the propositional case (Algorithm 4) is a simplified version of</p>
        <sec id="sec-4-2-1">
          <title>Algorithm 3. → and ( |∼  )→ are obtained substituting every instance of a defeasible conditional</title>
          <p>|∼  with  →  .</p>
        </sec>
        <sec id="sec-4-2-2">
          <title>Algorithm 4: ComputePropositionalDefeasibleJustifications( ,  |∼  )</title>
        </sec>
        <sec id="sec-4-2-3">
          <title>Input: Defeasible knowledge base  and query  |∼  Output: the set of justifications</title>
          <p>1  ← 0
2  ← ∅
3  ← value  from RationalClosureForJustifications(,  |∼  )
4 if  = 0 then
5  = ComputeAllJustifications(→, ( |∼  )→)
6 return 
7  = {0, . . .} ←  from ComputeRanking()
8 while  &lt;  do
9  ←   ∖ 
10  =  + 1
11  = ComputeAllJustifications(, ( |∼  )→)</p>
          <p>→
12 return 
Example 7. If we run the algorithm with the knowledge base  from Example 6 and the query
SpecialPenguin |∼ Fly, we obtain the result that corresponds to the one of Example 5, that is, the only
justification is {SpecialPenguin |∼ Fly}, while the potential justification {Penguin → Bird, SpecialPenguin →
Bird, Bird |∼ Fly} is not considered since the rank of Bird |∼ Fly is too low w.r.t. the query.</p>
        </sec>
      </sec>
      <sec id="sec-4-3">
        <title>Wang et al. [25] provide more detailed examples of defeasible justification in the propositional case.</title>
      </sec>
      <sec id="sec-4-4">
        <title>The software that implements the defeasible justification algorithm for the KLM frame</title>
        <p>work is coded in Java. We refer to the software tool as KLMDefeasibleJustificationTool . The
KLMDefeasibleJustificationTool follows the Model View Controller (MVC) software architecture pattern
and is composed of objects, a graphical user interface (GUI) and algorithm implementations. The GUI is
constructed using Java Swing packages. The KLMDefeasibleJustificationTool takes two input parameters:
a text file that consists of a KLM-style propositional knowledge base and a query string. The resulting
justification(s) and statement rankings are displayed in a text area of the GUI. Two external packages
are used to compute the defeasible justification: the Tweety Project [ 26, 27] and SAT4J SAT solver
[28, 29]. The Tweety Project is a software framework that provides models and operations for a number
of logics, including PL. Our implementation extends the PL models to construct models and operations
required by the KLM Framework. Due to the constraints defined by the Tweety Project, we cannot
denote the KLM Framework operations with conventional symbols. Instead, the negation symbol. ¬
is replaced with ! and the binary operations ∧, ∨, →, ↔ and |∼ are replaced with &amp;&amp;, ||, =&gt;, &lt;=&gt;
and ∼ &gt;, respectively. Furthermore, we constructed a parser that reads strings such as “ ∼ &gt;  ” and
produces an instance of DefeasibleImplication, which allows the software to perform operations such
as materialisation. Classical entailment computation is needed as a sub-procedure to the defeasible
justification calculations. The SAT4J SAT solver is used to compute this.</p>
      </sec>
      <sec id="sec-4-5">
        <title>The source code of the defeasible justification tool for the KLM Framework can be found on Github [30].</title>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>The two main contributions of this paper are: (i) a defeasible justification algorithm for the DL ℒ and
(ii) an implementation of the defeasible justification algorithm in the propositional case. The obvious
next step is to provide an implementation of the defeasible justification algorithm for ℒ as a Protégé
plugin. Further future work includes the definition and implementation of defeasible justification
algorithms for other logics equipped with KLM-style defeasibility. One such logic is the restricted
version of first-order logic with KLM-style defeasibility presented by Casini et al. [ 31]. Finally, here
we have focused on a procedural definition of defeasible justification in the form of Algorithm 3. An
investigation into a declarative definition of defeasible justification is left as future work.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgments</title>
      <sec id="sec-6-1">
        <title>This work has been partially supported by the H2020 STARWARS Project (GA No. 101086252), a type of action HORIZON TMA MSCA Staf Exchanges.</title>
        <p>[4] S. P. Bail, The justificatory structure of OWL ontologies, PhD Thesis, University of Manchester,
2013.
[5] J. L. Pollock, A theory of defeasible reasoning, International Journal of Intelligent Systems 6 (1991)
33–54.
[6] S. Kraus, D. Lehmann, M. Magidor, Nonmonotonic reasoning, preferential models and cumulative
logics, Artificial intelligence 44 (1990) 167–207.
[7] D. Lehmann, M. Magidor, What does a conditional knowledge base entail?, Artificial Intelligence
55 (1992) 1–60.
[8] L. Giordano, V. Gliozzi, N. Olivetti, G. L. Pozzato, Semantic characterization of rational closure:</p>
      </sec>
      <sec id="sec-6-2">
        <title>From propositional logic to description logics, Artificial Intelligence 226 (2015) 1–33. URL: https:</title>
        <p>//doi.org/10.1016/j.artint.2015.05.001. doi:10.1016/J.ARTINT.2015.05.001.
[9] P. A. Bonatti, Rational closure for all description logics, Artificial Intelligence 274 (2019) 197–223.</p>
        <p>URL: https://doi.org/10.1016/j.artint.2019.04.001. doi:10.1016/J.ARTINT.2019.04.001.
[10] M. Schmidt-Schauß, G. Smolka, Attributive concept descriptions with complements, Artificial
intelligence 48 (1991) 1–26.
[11] F. Baader, D. Calvanese, D. McGuinness, P. Patel-Schneider, D. Nardi, The Description Logic</p>
      </sec>
      <sec id="sec-6-3">
        <title>Handbook: Theory, Implementation and Applications, 2 ed., Cambridge university press, 2007.</title>
        <p>[12] F. Baader, R. Penaloza, Axiom pinpointing in general tableaux, Journal of Logic and Computation
20 (2010) 5–34.
[13] K. Moodley, T. Meyer, I. J. Varzinczak, A defeasible reasoning approach for description logic
ontologies, in: Proceedings of the South African Institute for Computer Scientists and Information</p>
      </sec>
      <sec id="sec-6-4">
        <title>Technologists Conference, ACM, 2012, pp. 69–78.</title>
        <p>[14] L. Botha, T. Meyer, R. Pe˜naloza, The Probabilistic Description Logic ℬℒ, Theory and Practice
of Logic Programming (2020). doi:10.1017/s1471068420000460.
[15] P. Ke, U. Sattler, Next Steps for Description Logics of Minimal Knowledge and Negation as Failure,</p>
        <p>Description Logics 353 (2008).
[16] L. Giordano, V. Gliozzi, A reconstruction of multipreference closure, Artificial Intelligence 290
(2021) 103398. URL: https://doi.org/10.1016/j.artint.2020.103398. doi:10.1016/J.ARTINT.2020.
103398.
[17] P. A. Bonatti, C. Lutz, F. Wolter, Description Logics with Circumscription., in: KR, 2006, pp.</p>
        <p>400–410.
[18] P. A. Bonatti, M. Faella, I. M. Petrova, L. Sauro, A new semantics for overriding in description
logics, Artificial Intelligence 222 (2015) 1–48. URL: https://doi.org/10.1016/j.artint.2014.12.010.
doi:10.1016/J.ARTINT.2014.12.010.
[19] D. Lehmann, Another Perspective on Default Reasoning, Annals of Mathetics and Artificial
Intelligence 15 (1995) 61–82. URL: https://doi.org/10.1007/BF01535841. doi:10.1007/BF01535841.
[20] G. Casini, U. Straccia, Defeasible Inheritance-Based Description Logics, J. Artificial Intelligence</p>
        <p>Res. 48 (2013) 415–473. URL: https://doi.org/10.1613/jair.4062. doi:10.1613/JAIR.4062.
[21] G. Casini, T. Meyer, I. Varzinczak, Taking Defeasible Entailment Beyond Rational Closure, in:</p>
      </sec>
      <sec id="sec-6-5">
        <title>F. Calimeri, N. Leone, M. Manna (Eds.), Logics in Artificial Intelligence - 16th European Conference,</title>
      </sec>
      <sec id="sec-6-6">
        <title>JELIA 2019, Rende, Italy, May 7-11, 2019, Proceedings, volume 11468 of Lecture Notes in Computer</title>
        <p>Science, Springer, 2019, pp. 182–197. URL: https://doi.org/10.1007/978-3-030-19570-0_12. doi:10.
1007/978-3-030-19570-0\_12.
[22] G. Casini, U. Straccia, Rational closure for defeasible description logics, in: European Workshop
on Logics in Artificial Intelligence, Springer, 2010, pp. 77–90.
[23] K. Britz, G. Casini, T. Meyer, I. Varzinczak, A KLM Perspective on Defeasible Reasoning for</p>
      </sec>
      <sec id="sec-6-7">
        <title>Description Logics, in: Description Logic, Theory Combination, and All That, Springer, 2019, pp.</title>
        <p>147–173.
[24] L. Everett, E. Morris, T. Meyer, Explanation for klm-style defeasible reasoning, in: Southern</p>
      </sec>
      <sec id="sec-6-8">
        <title>African Conference for Artificial Intelligence Research, Springer, 2021, pp. 192–207.</title>
        <p>[25] S. Wang, T. Meyer, D. Moodley, Defeasible Justification Using the KLM Framework, in: Southern</p>
      </sec>
      <sec id="sec-6-9">
        <title>African Conference for Artificial Intelligence Research, Springer, 2022, pp. 187–201.</title>
        <p>[26] M. Thimm, Tweety - A Comprehensive Collection of Java Libraries for Logical Aspects of Artificial
Intelligence and Knowledge Representation, in: Proceedings of the 14th International Conference
on Principles of Knowledge Representation and Reasoning (KR’14), 2014, pp. 528–537.
[27] M. Thimm, The Tweety Project, Available online, 2014. URL: https://tweetyproject.org/.
[28] N. Eén, N. Sörensson, An extensible SAT-solver, in: International conference on theory and
applications of satisfiability testing, Springer, 2003, pp. 502–518.
[29] N. Eén, N. Sörensson, SAT4J SAT Solver, 2003. URL: https://www.sat4j.org/index.php.
[30] S. Wang, GitHub - KLM Defeasible Justification Tool, Available online, 2023. URL: https://github.</p>
        <p>com/SteveWang7596/DefeasibleJustificationForPropositionalLogic.
[31] G. Casini, T. Meyer, G. Paterson-Jones, I. Varzinczak, KLM-Style Defeasibility for Restricted</p>
      </sec>
      <sec id="sec-6-10">
        <title>First-Order Logic, in: International Joint Conference on Rules and Reasoning, Springer, 2022, pp.</title>
        <p>81–94.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>M.</given-names>
            <surname>Horridge</surname>
          </string-name>
          ,
          <article-title>Justification based explanation in ontologies</article-title>
          ,
          <source>PhD Thesis</source>
          , University of Manchester,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>K.</given-names>
            <surname>Britz</surname>
          </string-name>
          , G. Casini, T. Meyer, K. Moodley,
          <string-name>
            <given-names>U.</given-names>
            <surname>Sattler</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Varzinczak</surname>
          </string-name>
          ,
          <article-title>Principles of KLM-style Defeasible Description Logics, ACM Transactions on Computational Logic (TOCL) 22 (</article-title>
          <year>2020</year>
          )
          <fpage>1</fpage>
          -
          <lpage>46</lpage>
          . doi:
          <volume>10</volume>
          .1145/3420258.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>G.</given-names>
            <surname>Casini</surname>
          </string-name>
          , T. Meyer, K. Moodley,
          <string-name>
            <given-names>U.</given-names>
            <surname>Sattler</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Varzinczak</surname>
          </string-name>
          ,
          <article-title>Introducing defeasibility into OWL ontologies</article-title>
          , in: International Semantic Web Conference, Springer,
          <year>2015</year>
          , pp.
          <fpage>409</fpage>
          -
          <lpage>426</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>