<!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>Rule-Based Reasoning using State Space Search</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Dieter De Paepe</string-name>
          <email>dieter.depaepe@ugent.be</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ruben Verborgh</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Erik Mannens</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ghent University - iMinds Sint-Pietersnieuwstraat 41</institution>
          ,
          <addr-line>B-9000 Ghent</addr-line>
          ,
          <country country="BE">Belgium</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Semantic Web reasoners are powerful tools that allow the extraction of implicit information from RDF data. This information is reachable through the definition of ontologies and/or rules provided to the reasoner. To achieve this, various algorithms are used by different reasoners. In this paper, we explain how state space search can be applied to create a backward-chaining rule-based reasoner. By using the OWL-profiles (especially OWL 2 RL), DL-based reasoning becomes possible. State space search is an approach used in the Artificial Intelligence domain that solves problems by modeling them as a graph and searching (using diverse algorithms) for solutions within this graph. State space search offers inherent proof generation and the ability to plug in different search algorithms to determine the characteristics of the reasoner such as: speed, memory or ensuring shortest proof generation.</p>
      </abstract>
      <kwd-group>
        <kwd>rule-based reasoning</kwd>
        <kwd>state space search</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        Semantic reasoners are used to infer new knowledge from existing knowledge. Ideally, a
verifiable proof can be provided for each inference. Despite the importance of proofs for
the trust component in the Semantic Web Stack1 envisioned by Tim Berners-Lee, proof
generation is only supported by very few reasoners (such as EYE [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and cwm [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]).
      </p>
      <p>
        Algorithms used by current reasoners are: Euler path detection (EYE), tableaux
(Pellet [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]) and RETE (FuXi [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]). This paper describes how state space search [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ],
a concept from Artificial Intelligence in which problems are solved by exploring a
state graph, can be applied to reasoning. Using different approaches is important since
it allows reasoners to be truly independent, once again aiding to establish the trust
component in the Semantic Web Stack.
      </p>
      <p>
        By plugging different search algorithms into state space search, the characteristics of
the reasoner can be tweaked. This includes speed and memory usage, but also the ability
to generate the shortest proof, a property not directly supported by any other reasoner.
For applications such as RESTdesc [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], where proofs are used to compose web services,
the length of a proof plays an important role.
1 https://www.w3.org/2000/Talks/1206-xml2k-tbl/slide10-0.html
      </p>
    </sec>
    <sec id="sec-2">
      <title>Context and Related Work</title>
      <p>State space search transforms a problem context into a directed state graph, where
each vertex represents a certain state of the context being modeled and the edges are
determined by what is considered a valid transition between states. In this graph, both
the starting situation and solution are represented by one or more vertices. This graph
may or may not be materialized for a specific problem. Path finding is one of the more
well-known applications of state space search.</p>
      <p>The process of solving the problem consists of finding a path between the starting
vertex and one of the solution vertices. This is done by creating a search tree that explores
the state graph. The search tree and the state graph are separate concepts, as the search
tree tracks information about the solution being constructed. In the example of path
finding the state graph coincides with the graph being navigated where each vertex
represents a location. The search tree tracks how each node was reached (one path may
be better than the others).</p>
      <p>
        The performance of state space search depends on the algorithm used to construct the
search tree. Depending on the requirements, a suitable algorithm may be selected.
Wellknown algorithms include: A*, IDA* [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], SMA* [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and (stochastic) beam search [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>Although any form of backward-chaining reasoning could be considered as a form
of state space search, it has not been examined as such in current literature to the best of
our knowledge.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Rule-Based Reasoning using State Space Search</title>
      <p>Rule-based reasoners differ from ontological reasoners since they are configured to only
use a specified set of rules rather than the OWL 2 specification. Luckily, big parts of
OWL 2 can still be used for rule-based reasoning through OWL 2 RL, a subset of OWL
2 that can be expressed in rules.</p>
      <p>
        In rule-based reasoners, data and rules are both provided as input. Listing 1.1 and
1.2 list example rules and data in Notation3 (N3) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
      </p>
      <p>1 @prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;.
2 @prefix : &lt;http://www.example.com/&gt;.
3 {?x a :CoolPerson} =&gt; {?x :has :sunglasses}. # Rule 1
4 {?x a ?Sub. ?Sub rdfs:subClassOf ?Super} =&gt; {?x a ?Super}. # Rule 2</p>
      <p>Listing 1.1. Example rules in N3.
1 @prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;.
2 @prefix : &lt;http://www.example.com/&gt;.
3 :MovieStar rdfs:subClassOf :CoolPerson.
4 :Researcher rdfs:subClassOf :CoolPerson.
5 :alice a :Researcher.</p>
      <p>Listing 1.2. Example facts in N3.</p>
      <p>Using state space search, we can design a backward-chaining rule-based reasoner
that allows us to prove given statements. Each node in the search tree contains a number
of statements that are yet to be confirmed. Starting from the root node which contains the
statement to be proven, the children of each node represent the different ways to confirm
a remaining statement from its parent. This can be done by finding the statement in the
known facts, or by applying a rule that proves the statement given that its prerequisites
are satisfied, thereby introducing new statements to be proven. A solution is found when
a node is reached where no remaining statements are to be proven. The path from the
root node to the solution acts as the corresponding proof. Figure 1 demonstrates an
example search tree.</p>
      <p>In more realistic examples, the search tree might contain millions of nodes. The
chosen search algorithm determines how much of the search tree will be constructed
before a solution is found.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Advantages of State Space Search Reasoning</title>
      <p>By allowing to change the search algorithm, it is possible to tweak the characteristics of
the reasoner. For example, it would be possible to guarantee that the shortest possible
proof is found by using a variant of the A* algorithm. If memory is the most important
factor, a variant of depth first search could be used. This choice does not have to be made
in advance, it could be specified through configuration for each reasoner run.</p>
      <p>
        Because multiple search algorithms are supported, it is easy to tweak the performance
of the reasoner to specific use cases. It is also possible to create context agnostic
heuristics to further improve these search algorithms by analyzing the common patterns
of previously generated proofs. This could be similar to the approach used by Arndt
et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], where specialized rules are generated in an intermediate step to speed up
reasoning by 75%.
      </p>
      <p>Finally, the usage of different approaches to reasoning is not just interesting from
an academic point of view. It is a vital part of the trust component in the Semantic Web
Stack, where exchangeable proofs should be checked by independent reasoners using
different algorithms.
5</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusions</title>
      <p>In this paper, we explained our proposal to apply state space search to create a
backwardchaining rule-based semantic reasoner. Using different algorithms is important to enable
trust, but using state space search offers other specific advantages: 1) it is trivial to
construct proofs during reasoning due to the nature of state space search; 2) the ability
to switch between different search algorithms to determine the characteristics of the
reasoner, such as guaranteeing the generation of the shortest proof; 3) the potential gain
of automatically updating search heuristics based on previous queries.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>1. Fuxi 1.4: A python-based, bi-directional logical reasoning system for the semantic web</article-title>
          , https://code.google.com/archive/p/fuxi/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Arndt</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Meester</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bonte</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Schaballie</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bhatti</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dereuddre</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ongenae</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Turck</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          , Van de Walle, R.,
          <string-name>
            <surname>Mannens</surname>
          </string-name>
          , E.:
          <article-title>Improving OWL RL reasoning in N3 by using specialized rules</article-title>
          . In: Tamma,
          <string-name>
            <given-names>V.</given-names>
            ,
            <surname>Dragoni</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Gonçalves</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            ,
            <surname>Ławrynowicz</surname>
          </string-name>
          ,
          <string-name>
            <surname>A</surname>
          </string-name>
          . (eds.) Ontology Engineering: 12th
          <source>International Experiences and Directions Workshop on OWL. Lecture Notes in Computer Science</source>
          , vol.
          <volume>9557</volume>
          , pp.
          <fpage>93</fpage>
          -
          <lpage>104</lpage>
          . Springer (Apr
          <year>2016</year>
          ), http://dx.doi.org/10.1007/978-3-
          <fpage>319</fpage>
          -33245-1_
          <fpage>10</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Berners-Lee</surname>
          </string-name>
          , T.: cwm, https://www.w3.org/
          <year>2000</year>
          /10/swap/doc/cwm.html
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Berners-Lee</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Connolly</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kagal</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Scharf</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hendler</surname>
            ,
            <given-names>J.:</given-names>
          </string-name>
          <article-title>N3Logic: A Logical Framework For the World Wide Web</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          <volume>8</volume>
          (
          <issue>03</issue>
          ),
          <fpage>249</fpage>
          -
          <lpage>269</lpage>
          (
          <year>2007</year>
          ), http://arxiv.org/abs/0711.1533
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Korf</surname>
          </string-name>
          , R.E.:
          <article-title>Depth-first iterative-deepening</article-title>
          .
          <source>Artificial Intelligence</source>
          <volume>27</volume>
          (
          <issue>1</issue>
          ),
          <fpage>97</fpage>
          -
          <lpage>109</lpage>
          (
          <year>Sep 1985</year>
          ), http://linkinghub.elsevier.com/retrieve/pii/0004370285900840
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sirin</surname>
          </string-name>
          , E.:
          <article-title>Pellet : An OWL DL Reasoner</article-title>
          . Artificial Intelligence pp.
          <fpage>1</fpage>
          -
          <lpage>2</lpage>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Russell</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <article-title>Efficient memory-bounded search methods</article-title>
          .
          <source>In: Proceedings of the 10th European Conference on Artificial Intelligence</source>
          . pp.
          <fpage>1</fpage>
          -
          <lpage>5</lpage>
          . ECAI '
          <volume>92</volume>
          ,
          <string-name>
            <surname>John</surname>
            <given-names>Wiley</given-names>
          </string-name>
          &amp; Sons, Inc., New York, NY, USA (
          <year>1992</year>
          ), http://dl.acm.org/citation.cfm?id=
          <volume>145448</volume>
          .
          <fpage>145476</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Russell</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Norvig</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          : Artificial Intelligence:
          <string-name>
            <given-names>A Modern</given-names>
            <surname>Approach</surname>
          </string-name>
          . Pearson, third edn. (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Arndt</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Van Hoecke</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De Roo</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mels</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Steiner</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gabarró</surname>
            <given-names>Vallés</given-names>
          </string-name>
          ,
          <string-name>
            <surname>J.:</surname>
          </string-name>
          <article-title>The pragmatic proof: Hypermedia API composition and execution</article-title>
          .
          <source>Theory and Practice of Logic Programming</source>
          (
          <year>2016</year>
          ), http://arxiv.org/pdf/1512.07780v1.pdf
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Verborgh</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          , De Roo, J.:
          <article-title>Drawing conclusions from linked data on the web: The EYE reasoner</article-title>
          .
          <source>IEEE Software 32(3)</source>
          ,
          <fpage>23</fpage>
          -
          <lpage>27</lpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lim</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>A stochastic beam search for the berth allocation problem</article-title>
          .
          <source>Decision Support Systems</source>
          <volume>42</volume>
          (
          <issue>4</issue>
          ),
          <fpage>2186</fpage>
          -
          <lpage>2196</lpage>
          (
          <year>2007</year>
          ), http://www.sciencedirect.com/science/ article/pii/S016792360600090X,
          <article-title>decision Support Systems in Emerging Economies</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>