<!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>Rational preferential reasoning for datalog ?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Michael Harrison</string-name>
          <xref ref-type="aff" rid="aff0">0</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>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Centre for Artificial Intelligence Research, Department of Computer Science, University of Cape Town</institution>
        </aff>
      </contrib-group>
      <abstract>
        <p>Datalog is a powerful language that can be used to represent explicit knowledge and compute inferences in knowledge bases. Datalog cannot represent or reason about contradictory rules, though. This is a limitation as contradictions are often present in domains that contain exceptions. In this paper, we extend datalog to represent contradictory and defeasible information. We define an approach to efficiently reason about contradictory information in datalog and show that it satisfies the KLM requirements for a rational consequence relation. Finally, we introduce an implementation of this approach in the form of a defeasible datalog reasoning tool and evaluate the performance of this tool.</p>
      </abstract>
      <kwd-group>
        <kwd>Datalog Non-monotonic Reasoning Preferential Reasoning Defeasible Implication Knowledge Representation Rational Closure</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Datalog [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] is a rule-based language that was originally designed as an effort
to integrate efforts from the Artificial Intelligence and Database communities
[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The aim of datalog was to provide a deductive database querying language
that extended conjunctive queries with recursion [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], thereby allowing a relation
(predicate) to be present in both the head and body of a rule. Datalog was
derived from logic programming [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], with a key distinction being that datalog
does not contain functions.
      </p>
      <p>
        Datalog has been around since the eighties, but interest in it waned as there
did not seem to be many compelling uses for it. Datalog has experienced some
renewed interest in the past decade as the world moves towards greater levels
of automation in most industries. Some of the areas where datalog is currently
being used include data integration, declarative networking, program analysis,
information extraction, network monitoring, security, and cloud computing [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ].
Datalog has been used as the core of some very expressive and efficient
Knowledge Representation and Reasoning systems, such as DLV [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] and RDFox [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ].
DLV is a Disjunctive Logic Programming (DLP) system that uses an extended
Disjunctive Datalog [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] as its kernel language. DLV is one of the most successful
and widely used DLP engines.
? Partially funded by the CSIR-DST Inter-Bursary support programme
      </p>
      <p>
        Most of these reasoning systems have limited applicability to real-world
problems, though, as they can usually not reason about inconsistent or contradictory
information. Contradictions often occur in domains that contain exceptions.
Many systems cannot handle these contradictions due to the systems being
monotonic [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Monotonicity is a usually desirable property of logical languages
that states that previously concluded information cannot be revoked in light of
new, contradictory information. The information concluded in a monotonic
system can only ever be added to and never taken away. Systems capable of dealing
with contradictions need to, therefore, be nonmonotonic. DLV is nonmonotonic,
but only in the way that it can represent and reason about incomplete
information. We desire a system that can model rules that will generally hold true but
also permit exceptions without the user having to perform additional knowledge
engineering.
      </p>
      <p>We present a simple example of a case where we would want to be able to
represent and reason about exceptional information:</p>
      <sec id="sec-1-1">
        <title>Example 1. Strict mammal knowledge base</title>
        <p>– All mammals don’t lay eggs.
– All platypusses are mammals.
– All platypusses lay eggs.</p>
        <p>If we wanted to query the knowledge base in Example 1 to find out if
platypusses lay eggs, traditional datalog reasoning systems (including DLV) would
conclude that platypusses lay eggs and platypusses don’t lay eggs, thereby
returning an empty model (essentially saying that there can be no platypusses).
This is obviously not a desirable result. We would like to extend datalog to
represent defeasible knowledge. A defeasible rule is a non-strict rule that typically
holds. A defeasible version of Example 1 would be:</p>
      </sec>
      <sec id="sec-1-2">
        <title>Example 2. Defeasible mammal knowledge base</title>
        <p>– All mammals typically don’t lay eggs.
– All platypusses are mammals.
– All platypusses typically lay eggs.</p>
        <p>Defeasible rules, unlike strict rules, would not have to hold if they are
contradicted by strict information.</p>
        <p>
          A seminal approach to reasoning about defeasible knowledge is the
preferential approach, as defined by Kraus, Lehmann, and Magidor [
          <xref ref-type="bibr" rid="ref11 ref13">11, 13</xref>
          ] (often
referred to as the KLM approach). The KLM approach looks at nonmonotonic
reasoning from a general and abstract point of view. The framework defines the
requirements that the authors of the KLM approach believe a nonmonotonic
inference procedure should meet in order to be considered a rational consequence
relation. The KLM approach is defined in the propositional logic setting. The
KLM approach has been successfully lifted to Description Logics [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] as a way to
extend the Description Logic language ALC with nonmonotonic reasoning
capabilities. A practical defeasible reasoning system [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] using the KLM approach
has even been implemented in the form of a plugin for Protégé, an ontology
engineering program.
        </p>
        <p>The KLM approach’s abstract framework and impressive computational
tractability make it an appealing candidate for application to the datalog setting. In this
paper, we define a defeasible extension to datalog. We define an algorithm that
performs a defeasible entailment check for our extended defeasible datalog
language, as well as defining the supporting algorithms required to perform this
kind of reasoning. We show that our approach meets the KLM requirements for
a rational consequence relation. We then introduce an implemented system that
can create, edit, and, critically, query a defeasible datalog program.
2</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Language</title>
      <p>We will first define vanilla datalog before we propose our extensions to it. A
datalog program consists of a set of datalog rules. Datalog rules are expressions
of the form</p>
      <p>b1; :::; bn ! h1
where b1; :::; bn and h1 are literals. The left-hand side of the rule is the body and
the right-hand side of the rule is the head 1. Traditionally, the head of a datalog
rule contains only one literal but the body is made up of a conjunction of any
finite number of literals. If all the literals in the body are true in a model of a
datalog program, then the literal in the head is implied and added to the model.</p>
      <p>In vanilla datalog, a literal is just an atom p. An atom is an expression
p(t1; :::; tm), where p is a predicate with arity m and t1; :::; tm are terms. A term
can either be a constant or a variable.</p>
      <p>
        Datalog follows a model-theoretic semantics where the datalog program is
viewed as a set of first-order sentences that describes the desired answer [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. A
datalog interpretation is an assignment of concrete meaning to all constant and
predicate symbols in the datalog program [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. A datalog fact is entailed (j=) by
a datalog program if that fact is true under every model of the datalog program.
      </p>
      <p>We define two language extensions to datalog:
1. A practical defeasible datalog language that is used in our implemented
defeasible datalog reasoning.
2. A theoretical defeasible datalog language enriched with additional operators
that is used purely to prove how our approach meets the KLM requirements
for a rational consequence relation (defined in Section 4).
2.1</p>
      <sec id="sec-2-1">
        <title>Practical defeasible datalog language</title>
        <p>We need to define an extension to datalog that is capable of expressing defeasible
knowledge.
1 Datalog is often written with the head on the left and the body on the right, with
a fullstop at the end of each rule. :– is also often used to represent the implication
operator instead of !. This more traditional representation is used for the syntax
of our implementation.</p>
        <p>The first essential extension to the language is negation, :2. Any literal in
the head or body can now be an atom p or a negated atom :p. Negation is
necessary in order to be able to express any contradictory information.</p>
        <p>Our next extension is disjunction _. We include disjunction as a nice-to-have,
purely because our system is built on top of DLV, which uses disjunctive datalog
as its underlying language. We, therefore, also only allow disjunction in the head
between literals.</p>
        <p>Our final extension is an essential one — we add a defeasible implication
operator ;3. This operator can be used in place of the traditional strict implication
operator ! when we want to express a defeasible rule.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Theoretical defeasible datalog language</title>
        <p>We define further extensions to our defeasible datalog language, purely to express
the postulates that characterise the language and in proving that the postulates
hold for our approach.</p>
        <p>We introduce disjunction in the body between literals and conjunction in the
head between literals.</p>
        <p>The defeasible datalog rule
corresponds to the logical sentence</p>
        <p>b1 _ ::: _ bn ! h1
8x1; :::; xm(b1 _ ::: _ bn ! h1)
where x1; :::; xm are all the terms occurring in the all the literals of the rule.</p>
        <p>Similarly, the defeasible datalog rule</p>
        <p>b1 ! h1 ^ ::: ^ hn
corresponds to the logical sentence</p>
        <p>8x1; :::; xm(b1 ! h1 ^ ::: ^ hn)
where x1; :::; xm are all the terms occurring in all the literals of the rule.</p>
        <p>Furthermore, we introduce bottom ?, which can be seen as shorthand for
p ^ :p.</p>
        <p>Bodies of rules are seen as equivalent if they are modelled by the same
interpretations.</p>
        <p>A defeasible datalog fact ; is defeasibly entailed (j ) by a defeasible
datalog program if, knowing is true and based on the information contained
in the defeasible datalog program, it would be sensible to (defeasibly) conclude
that is true.</p>
        <p>If we have a set of defeasible rules DR, then DR is a set of strict versions
! of all defeasible rules ; in DR.
2 is used to represent negation in our implementation.
3 : is used to represent defeasible implication in our implementation.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>A rational consequence relation for defeasible datalog</title>
      <p>
        Kraus, Lehmann, and Magidor studied preferential consequence relations as an
approach to nonmonotonic reasoning [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ]. Lehmann and Magidor looked at a
more restricted class of consequence relations, rational relations [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. They
argued that any reasonable nonmonotonic inference procedure should define a
rational consequence relation. Rational relations are those that may be
represented by a ranked preferential model. A ranked model is a preferential model
for which there is a modular strict partial order [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>A nonmonotonic inference procedure needs to meet properties known as the
KLM postulates to be considered a rational consequence relation. The original
KLM postulates were defined in propositional logic. We define defeasible datalog
versions of the KLM postulates that characterise a rational consequence relation
for ranked defeasible datalog models:</p>
      <sec id="sec-3-1">
        <title>Reflexivity</title>
      </sec>
      <sec id="sec-3-2">
        <title>Left Logical Equivalence</title>
      </sec>
      <sec id="sec-3-3">
        <title>Right Weakening And Or</title>
      </sec>
      <sec id="sec-3-4">
        <title>Cautious Monotonicity</title>
      </sec>
      <sec id="sec-3-5">
        <title>Rational Monotonicity</title>
        <p>;
;
K j
; Kj</p>
        <p>Kj ;
Kj
; ; j= !
Kj ;
Kj
Kj
Kj
Kj
; ; Kj
Kj ; ^
;
; ; Kj ;
Kj _ ;
; ; Kj
Kj ^ ;
; ; K6j
Kj ^ ;
;
;:
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Rational preferential reasoning for defeasible datalog</title>
      <p>
        In this section, we attempt to emulate rational closure (a specific construction
given by KLM [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] that satisfies all the KLM postulates for a rational
consequence relation) for our defeasible datalog. Our approach satisfies the KLM
postulates — the full proofs are available online4.
      </p>
      <p>Our rational closure will rely on a ranking of the defeasible datalog rules in
a defeasible datalog program. We need to construct a ranking of our defeasible
datalog rules based on the exceptionality of each rule. If a rule is assigned a
lower ranking, then that rule is more normal or general. If a rule is assigned a
higher ranking, then that rule is more exceptional or specific. Only once we have
this ranking can we perform rational closure to determine if a rule is defeasibly
entailed by our knowledge base.
4 https://github.com/MindfulMichaelJames/proofs/blob/master/Proofs.pdf</p>
      <p>Firstly, we define an algorithm to determine which defeasible rules in a set of
defeasible rules are exceptional with regards to that set of defeasible rules and
an optional set of strict rules. A defeasible rule is exceptional with regards to a
set of defeasible and strict rules if the body of the rule is not satifisfiable with
regards to the set of defeasible and strict rules.</p>
      <p>Platypusses would not be satisfiable in Example 2, meaning that the
defeasible rule with platypusses as the body (“All platypusses typically lay eggs”) will
be exceptional with regards to the strict rule and the other defeasible rule in
Example 2.</p>
      <p>1 DRE0 := ;;</p>
      <sec id="sec-4-1">
        <title>2 foreach</title>
        <sec id="sec-4-1-1">
          <title>Algorithm 1: exceptional(SR; DRE )</title>
          <p>Input : A set of strict datalog rules SR and a set of defeasible datalog
rules DRE
Output: DRE0 DRE such that DRE0 is exceptional w.r.t. SR and DRE
Next, we define an algorithm that computes the ranking of a set of
defeasible rules. This algorithm starts by putting all the defeasible rules in rank 0. It
then utilises Algorithm 1 to determine which rules are exceptional to rank 0
and a set of strict rules. The exceptional rules are moved from rank 0 to rank
1. The same process is then performed to determine which rules in rank 1 are
exceptional relative to rank 1 and the strict rules. Those exceptional rules will
be moved to rank 2. This process is continued until either there are no more
exceptional rules in a rank or all the rules in a rank are exceptional. If all the
defeasible rules in a rank are exceptional, then the defeasible rules are strict rules
represented as defeasible rules. These rules will be moved to the set of strict rules
and represented as strict rules.</p>
          <p>Going back to Example 2, the two defeasible rules (“All platypusses typically
lay eggs” and “All mammals typically don’t lay eggs”) would start on rank 0. “All
platypusses typically lay eggs” would be found to be exceptional with regards
to the other defeasible rules in its current rank (“All mammals typically don’t
lay eggs”) and the strict rules (“All platypusses are mammals”). “All platypusses
typically lay eggs” would, therefore, be moved to rank 1.</p>
        </sec>
        <sec id="sec-4-1-2">
          <title>Algorithm 2: computeRanking(SR; DR)</title>
          <p>Input : A knowledge base consisting of the set of strict datalog rules</p>
          <p>SR and the set of defeasible datalog rules DR</p>
          <p>Output: The ranking of defeasible rules R and set of strict rules SR
1 DR0 := DR; DR1 := exceptional(SR; DR0); n := 1; R := ;;
2 while DRn 1 6= DRn and DRn 6= ; do
3 n := n + 1; DRn := exceptional(SR; DRn 1);
4 if DRn 6= ; then
5 SR := SR [ DRn;
6 for i = 1 to n 1 do
7</p>
          <p>Ri 1 = DRi 1 n DRi;
8 Ri := DRi;
9 return R = Sjj=0i Rj and SR;</p>
          <p>Once we have computed the ranking for a defeasible datalog knowledge base,
we can go about checking if a defeasible rule is defeasibly entailed by the
knowledge base. We do this by checking if the rule is in the rational closure of the
knowledge base. Essentially, the rational closure algorithm looks at the portion
of the knowledge base for which the queried rule is not exceptional (using
Algorithm 1). The algorithm then checks if the rule classically follows from this
portion of the knowledge base.</p>
          <p>Going back to Example 2 again, if we wanted to query that knowledge base
to see if it defeasibly entailed the query “All platypusses typically lay eggs”, we
would first look at the portion of the knowledge base where the body of the
query is satisfiable. Platypusses are not satisfiable when considering rank 0 (“All
mammals typically don’t lay eggs”), rank 1 (“All platypusses typically lay eggs”)
and the strict rules (“All platypusses are mammals”). When considering just rank
1 and the strict rules, though, platypusses are satisfiable. We will then look at
the strict version of the remaining defeasible rules and the strict rules and see if
a strict version of our query is classically entailed, which it is in this case.</p>
          <p>Our approach can also check for defeasible entailment of strict rules. To do
this, we check if the strict query is classically entailed by the strict portion of
the knowledge base. This is worth mentioning, but it is not our focus so it shall
not be discussed further here.</p>
        </sec>
        <sec id="sec-4-1-3">
          <title>Algorithm 3: RationalClosure(K;</title>
          <p>; )
Input : A knowledge base K that consists of the ranking R of the set of
defeasible rules DR and the set of strict rules SR, and a
defeasible query ;
Output: True iff ; is in the rational closure of the knowledge base
consisting of defeasible rules DR and strict rules SR, False
otherwise
1 i := 0; n := number of ranks in R + 1;
2 while Sj n !</p>
          <p>j=i Rj [ SR j=
3 i := i + 1;
4 return Sj n !
j=i Rj [ SR j=
! ? and i</p>
          <p>n do
! ;
5</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>A defeasible datalog querying system</title>
      <p>We now introduce DDLV. DDLV is a system that performs prefential reasoning
for defeasible datalog programs. The defeasible datalog language for defeasible
datalog programs is defined in Section 3.1 of this paper.</p>
      <p>Defeasible datalog programs can be edited in DDLV for convenience, but its
main feature is the capability to query if a defeasible datalog rule is entailed by a
defeasible datalog program. DDLV achieves this by implementing the algortithms
defined in Section 4.1 of this paper.</p>
      <p>DDLV creates a ranking of a defeasible datalog program using
implementations of Algorithm 1 and Algorithm 2. This ranking is computed when a
defeasible datalog program is loaded into DDLV or edited in DDLV.</p>
      <p>To check if a defeasible datalog rule is defeasibly entailed by a defeasible
datalog program, DDLV utilises an implementation of Algorithm 3.</p>
      <p>
        Algorithm 1 performs a classical datalog entailment check on line 3.
Algorithm 3 performs two classical datalog entailment checks — one on line 2
and one on line 4. DDLV uses DLV [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] to perform these classical datalog
entailment checks in co-NP. One of the greatest appeals to the KLM approach is its
computational tractability and that is largely because the preferential reasoning
process can be reduced to classical reasoning. This feature allows us to leverage
the years of development that has been put into DLV to make it a highly efficient
datalog reasoning system.
      </p>
      <p>
        DDLV is built in Java and uses the DLV Wrapper [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ] to interact with DLV
programatically. The source code for DDLV is freely available online5, along with
instructions on how to install, run, and use DDLV.
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Evaluation</title>
      <p>
        This section evaluates the performance of DDLV. Seeing as though there are no
other preferential reasoning systems for defeasible datalog, we compare DDLV
5 https://github.com/MindfulMichaelJames/DDLV
with DIP, the Defeasible-Infererence Platform for Description Logics [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
Although datalog and Description Logics have their differences, everything else
about DIP is quite similar to DDLV. DIP performs KLM-style rational closure
for ALC. The exceptionality check for DIP terminates in EXPTIME. Moodley
evaluated DIP as part of his PhD thesis[
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. He synthesised ontologies to
evaluate. Seeing as we have defined defeasible datalog, no defeasible datalog programs
exist, so we must synthesise defeasible datalog programs to evaluate. We follow
Moodley’s parameters and techniques for the synthesised programs in order to
have defeasible datalog programs that are as comparable as possible to his
defeasible ontolgies. Hardware with identical specifications is also used (Intel i7, 4
cores, 3GB RAM).
      </p>
      <p>We evaluate 10 groups of defeasible datalog programs. Each group has a
different percentage of defeasible rules in the program, starting from 10% and
going up to 100% in intervals of 10%. Each group contains 35 programs, with
the smallest program containing 150 rules and the largest program containing
3500 rules. The program sizes are uniformly distributed between the smallest
and largest programs.</p>
      <p>Computing the ranking is the greatest bottleneck with this approach. Once
the ranking has been computed, defeasible entailment checks can be performed
very quickly. We will first compare DDLV’s ranking compilation time with DIP’s.</p>
      <p>
        Moodley used percentile plots because they give a good general picture of
the performance and reveal outliers quickly [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. Note that the vertical scale for
Figure 1 is staggered whereas the vertical scale for Figure 2 is constant.
      </p>
      <p>As with DIP, the time that DDLV takes to compute rankings increases
with the level of defeasibility present in the program. DDLV seems to perform
favourably against DIP, though. DIP already takes about 100 seconds on average
to compute a ranking for an ontology with 60% defeasibility. DIP, in the worst
case of datalog programs with 100% defeasibility, only takes just over 40 seconds
on average to compute a ranking. The longest DIP takes to compute a ranking
is nearly 1000 seconds. The longest DDLV takes to compute a ranking is less
than 130 seconds.</p>
      <p>Next, we will compare the time DDLV takes to perform a defeasible
entailment check with the time DIP takes to perform a defeasible entailment check.</p>
      <p>DDLV does not outperform DIP on average when it comes to defeasible
entailment checks. DIP’s average query time is less than 50 milliseconds, even
for ontologies with 100% defeasibility. DDLV’s average query time is about 120
milliseconds in the worst categories. In the worst cases, however, DDLV
outperforms DIP. The longest DIP takes to perform a defeasible entailment check is
just over 300 millisconds whereas the longest DDLV takes to perform a defeasible
entailment check is about 220 milliseconds.</p>
      <p>Even though DDLV’s average query time is slower than DIP, the difference
is very small in terms of real units of time and almost negligible when single
queries are performed in isolation.</p>
      <p>DDLV’s impressive ranking time is to be celebrated, because getting the
bottleneck of the ranking time to be as short as possible will greatly increase the
usability of the system.</p>
      <p>To test how well DDLV will scale up, we also present stress tests.</p>
      <p>For the size stress test, we recorded the ranking compilation time for 20
defeasible datalog programs varying uniformly in size from 5000 rules to 10000
rules, with all 20 programs having a 20% level of defeasibility. For the ranking
depth stress test, we recorded the ranking compilation time for 20 defeasible
datalog programs of 5000 rules and a 20% level of defeasibility, while the number
of ranks in each program varied from 2 to 21. These two tests were performed
because the number of rules in a program and the number or defeasible ranks
have shown to have the greatest impact on ranking time. The two stress tests
were performed on an Intel Xeon processor with 96 cores. DDLV performs the
exceptionality checks for each rule in a rank asynchronously. This allows DDLV
to perform as many exceptionality checks in parallel as the number of cores
available. We believe this approach is the reason for the impressive results shown
in Figure 5 and Figure 6. The longest DDLV took to compute a ranking in the
size stress test is just under 7 seconds for 8750 rules. The longest DDLV took to
compute a ranking in the ranking depth stress test is just under 6.5 seconds for
19 ranks.
7</p>
    </sec>
    <sec id="sec-7">
      <title>Related work</title>
      <p>
        The KLM preferential reasoning approach has been lifted to the Description
Logic setting a couple of times in a couple of different flavours [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ][
        <xref ref-type="bibr" rid="ref4">4</xref>
        ][
        <xref ref-type="bibr" rid="ref5">5</xref>
        ][
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. DIP is
the most similar work and the only other known implementation of KLM-style
preferential reasoning.
      </p>
      <p>
        There does not seem to be much work on handling inconsistent datalog
programs. There is research into handling incomplete knowledge in datalog programs
[
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], but that is not the same type of nonmonotonicity that we are dealing with.
      </p>
      <p>Morris et al., in a submission to this conference, consider the extension of a
version of defeasible datalog to relevant closure and lexicographic closure. Their
considerations are purely theoretical.
8</p>
    </sec>
    <sec id="sec-8">
      <title>Conclusions and future work</title>
      <p>We have identified the need for an extension to datalog that can handle
inconsistent information in order to deal with exceptions. We introduced the defeasible
datalog language that is able to express defeasible datalog rules and
contradictory datalog rules.</p>
      <p>We lifted the KLM preferential reasoning framework to our defeasible datalog
setting. We defined versions of the rational closure algorithm and its
supporting ranking and exceptionality algorithms for defeasible datalog. We defined
defeasible datalog versions of the KLM postulates and proved that our rational
closure algorithm meets these KLM requirements to be considered a rational
consequence relation.</p>
      <p>Finally, we introduced an implementation of our defeasible datalog reasoning
approach that can perform efficient defeasible entailment checks for defeasible
datalog programs.</p>
      <p>In this paper, our preferential reasoning approach was very syntactic. Future
work would involve clearly defining a semantics for this work and demonstrating
the correspondence between the syntactic and semantic approaches.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Abiteboul</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hull</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Vianu</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          : Foundations of Databases. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1st edn. (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Ben-Ari</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Mathematical logic for computer science</article-title>
          . Springer Science &amp; Business
          <string-name>
            <surname>Media</surname>
          </string-name>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Britz</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heidema</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Labuschagne</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          :
          <article-title>Semantics for dual preferential entailment</article-title>
          .
          <source>Journal of Philosophical Logic</source>
          <volume>38</volume>
          (
          <issue>4</issue>
          ),
          <fpage>433</fpage>
          -
          <lpage>446</lpage>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Britz</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Heidema</surname>
          </string-name>
          , J., Meyer, T.:
          <article-title>Semantic preferential subsumption</article-title>
          .
          <source>In: Eleventh International Conference on Principles of Knowledge Representation and Reasoning</source>
          . pp.
          <fpage>476</fpage>
          -
          <lpage>484</lpage>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Britz</surname>
          </string-name>
          , K., Meyer, T.,
          <string-name>
            <surname>Varzinczak</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          :
          <article-title>Semantic foundation for preferential description logics</article-title>
          .
          <source>In: Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)</source>
          . vol.
          <volume>7106</volume>
          LNAI, pp.
          <fpage>491</fpage>
          -
          <lpage>500</lpage>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Casini</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Straccia</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Rational Closure for Defeasible Description Logics</article-title>
          .
          <source>In: European Workshop on Logics in Artificial Intelligence</source>
          . pp.
          <fpage>77</fpage>
          -
          <lpage>90</lpage>
          . Springer (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Ceri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tanca</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          :
          <article-title>What You Always Wanted to Know About Datalog (And Never Dared to Ask)</article-title>
          .
          <source>IEEE Transactions on Knowledge and Data Engineering</source>
          <volume>1</volume>
          (
          <issue>1</issue>
          ),
          <fpage>146</fpage>
          -
          <lpage>166</lpage>
          (
          <year>1989</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
          </string-name>
          , G.:
          <article-title>Disjunctive Datalog</article-title>
          .
          <source>ACM Transactions on Database Systems</source>
          <volume>22</volume>
          (
          <issue>3</issue>
          ),
          <fpage>364</fpage>
          -
          <lpage>418</lpage>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Leone</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mateis</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfeifer</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scarcello</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>A deductive system for non-monotonic reasoning</article-title>
          .
          <source>In: International Conference on Logic Programming and Nonmonotonic Reasoning</source>
          . pp.
          <fpage>363</fpage>
          -
          <lpage>374</lpage>
          . Springer (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>S.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Green</surname>
            ,
            <given-names>T.J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Loo</surname>
            ,
            <given-names>B.T.</given-names>
          </string-name>
          :
          <article-title>Datalog and emerging applications</article-title>
          .
          <source>Proceedings of the 2011 international conference on Management of data - SIGMOD '11</source>
          p.
          <volume>1213</volume>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Kraus</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Magidor</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Nonmonotonic reasoning, preferential models and cumulative logics</article-title>
          .
          <source>Artificial Intelligence</source>
          <volume>44</volume>
          (
          <issue>1-2</issue>
          ),
          <fpage>167</fpage>
          -
          <lpage>207</lpage>
          (
          <year>1990</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          :
          <article-title>Another perspective on default reasoning</article-title>
          .
          <source>Annals of Mathematics and Artificial Intelligence</source>
          <volume>15</volume>
          (
          <issue>1</issue>
          ),
          <fpage>61</fpage>
          -
          <lpage>82</lpage>
          (
          <year>1995</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Lehmann</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Magidor</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>What does a conditional knowledge base entail?</article-title>
          <source>Artificial Intelligence</source>
          <volume>55</volume>
          (
          <issue>1</issue>
          ),
          <fpage>1</fpage>
          -
          <lpage>60</lpage>
          (
          <year>1992</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Leone</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pfeifer</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Faber</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eiter</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gottlob</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Perri</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scarcello</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>The DLV System for Knowledge Representation and Reasoning</article-title>
          .
          <source>ACM Transactions on Computational Logic (TOCL) 7</source>
          (
          <issue>3</issue>
          ),
          <fpage>499</fpage>
          -
          <lpage>562</lpage>
          (
          <year>2002</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Lloyd</surname>
            ,
            <given-names>J.W.</given-names>
          </string-name>
          :
          <article-title>Foundations of logic programming</article-title>
          . Springer Science &amp; Business
          <string-name>
            <surname>Media</surname>
          </string-name>
          (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16. Meyer, T.,
          <string-name>
            <surname>Moodley</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>DIP: A defeasible-inference platform for OWL ontologies</article-title>
          .
          <source>In: CEUR Workshop Proceedings</source>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Moodley</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          :
          <article-title>Practical Reasoning for Defeasible Description Logics</article-title>
          .
          <source>Ph.D. thesis</source>
          , University of KwaZulu-Natal (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Nenov</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Piro</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Motik</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wu</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Banerjee</surname>
          </string-name>
          , J.:
          <article-title>Rdfox: A highlyscalable rdf store</article-title>
          .
          <source>In: International Semantic Web Conference</source>
          . pp.
          <fpage>3</fpage>
          -
          <lpage>20</lpage>
          . Springer (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Ricca</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>A Java wrapper for DLV</article-title>
          .
          <source>CEUR Workshop Proceedings</source>
          <volume>78</volume>
          ,
          <fpage>305</fpage>
          -
          <lpage>316</lpage>
          (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>