<!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>Neural-Symbolic Reasoning Under Open-World and Closed-World Assumptions</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Benedikt Wagner</string-name>
          <email>Benedikt.Wagner@city.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Artur d'Avila Garcez</string-name>
          <email>A.Garcez@city.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>City, University of London</institution>
          ,
          <addr-line>Northampton Square, London, EC1V0HB</addr-line>
          ,
          <country country="UK">United Kingdom</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>In A. Martin, K. Hinkelmann</institution>
          ,
          <addr-line>H.-G. Fill, A. Gerber, D. Lenat, R. Stolle, F. van Harmelen (Eds.)</addr-line>
          ,
          <institution>Proceedings of the AAAI 2022 Spring Symposium on Machine Learning and Knowledge Engineering for Hybrid Intelligence (AAAI-MAKE 2022), Stanford University</institution>
          ,
          <addr-line>Palo Alto, California</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Neural-Symbolic approaches are becoming increasingly prominent due to their ability to integrate knowledge and data. In this paper, we propose the iterative use of a neurosymbolic approach and evaluate its reasoning capability. We deploy the Logic Tensor Networks neurosymbolic approach iteratively and compare its reasoning capability with purely symbolic reasoning under closed-world and open-world assumptions. Reasoning capability is evaluated on two data sets, a family relationship task and a typical ontology reasoning data set. The use of an iterative neurosymbolic approach improves reasoning from an F1 score of 0.64 to 0.97 in one case, and from 0.60 to 0.88 in the other, which is higher than what was reported previously in the literature. Our results also show that an open-world neurosymbolic approach based on diferentiable fuzzy logic can excel at recall, while a logical reasoner under a closed-world assumption can achieve high precision when the domain is under-specified.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Neurosymbolic AI</kwd>
        <kwd>Practical Reasoning</kwd>
        <kwd>Open-World Assumption</kwd>
        <kwd>Closed-World Assumption</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The integration of neural and symbolic AI approaches has become increasingly prominent [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ].
This has been motivated by the fact that neural and symbolic approaches are complementary:
while deep learning has been widely successful across a large variety of data-driven applications,
symbolic AI has been shown capable of overcoming limitations such as a need for large amounts
of labelled data or lack of explainability.
      </p>
      <p>
        Neural-Symbolic (NeSy) learning approaches can be weakly-supervised whereby only a
limited number of data is required. Furthermore, NeSy systems can be in principle interpretable,
allowing for mitigation of undesired system properties [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ]. Learning from data and knowledge
using logical formulas that express background knowledge in the form of diferentiable loss
functions has been formalised as Diferentiable Fuzzy Logic in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. Krieken et al. [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] provide
a valuable contribution by analysing the efect of diferent specific fuzzy logic implications
on reasoning and learning that indicate imbalances associated with diferent fuzzy operators.
Bianchi and Hitzler [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] have approached the study of the reasoning capability of neural networks
(NNs) in practical terms by measuring the F1 score of the deductive closure of a knowledge-base
trained by the network. In this paper, we seek to expand both analyses by investigating how
varying forms of background knowledge may impact the reasoning capability of a NeSy system.
We investigate how the selection of background knowledge can afect reasoning in NNs. We
further show that reasoning results may vary considerably depending on the assumption of a
closed or open-world reasoning. In order to measure and compare results precisely, we also
provide a definition for reasoning in NNs. By investigating such relevant examples of reasoning,
we conclude that background knowledge as used traditionally by NeSy systems and symbolic
machine learning may need to be formulated including the explicit use of negation for the
purpose of improving reasoning capabilities.
      </p>
      <p>In Section 2, we specify the relevant methods before defining practical reasoning and the
querying method in Section 3. Section 4 provides practical examples and is followed by a
conclusion in Section 5.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Diferentiable Fuzzy Logic</title>
      <p>
        Neural-Symbolic approaches that employ fuzzy logic with diferentiable logical operators build
diferentiable loss functions from symbolic background knowledge specified in the language of
ifrst-order logic involving multiple logical formulas. Given data, these approaches use fuzzy
logic to determine the truth-value of statements in first-order logic. The method works in a
semi-supervised setting whereby the data can be unlabeled or sparsely labelled. Such method is
exemplified by [
        <xref ref-type="bibr" rid="ref10 ref11 ref7 ref8 ref9">7, 8, 9, 10, 11</xref>
        ].
      </p>
      <p>
        In the following, we provide a high-level overview of the Diferentiable Fuzzy Logic (DFL)
method before discussing in more detail the Logic Tensor Network (LTN) framework [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] as
an instance of DFL. The semantics of DFL methods is derived from vector embeddings and
functions whereby logic terms are interpreted in a real-valued vector space. Objects are
dimensional vectors of real values in a domain. Predicates are mappings from these vectors
to fuzzy truth-values in the interval [
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ], which can be represented by trainable NNs with
learneable parameters  . Varying the values of  will derive diferent interpretations according
to the embedding. To emphasize that symbols are interpreted based on their grounding onto
real numbers, LTN refers to an interpretation as a grounding, denoted by . The truth-values
of logical formulas containing quantifiers are determined by using an aggregation function
 : [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ] → [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ], for example the harmonic mean. Fuzzy truth-values for atomic formulas
are derived in the usual way, relying on fuzzy logical operators that preserve the properties
of Boolean logic in the {0,1} extreme cases. These are aggregated into the satisfiability Sat()
of the knowledge-base, i.e. the set of logical formulas. In LTN and other DFL methods, the
parameters  associated with the predicates’ groundings are learned using a training signal
such as the maximum satisfiability of the knowledge-base ⟨,  ⟩. This subsequently reduces
to an optimisation problem that can be solved using gradient-descent methods, such that:
 * = arg max Sat( ()),
      </p>
      <p>∈Θ
subject to an aggregation  of all logical formulas in ;  * is obtained by minimising a loss
function that encompasses grounded knowledge ⟨,  ⟩ and maximising satisfiability of .
Due to the fact that all fuzzy operators are diferentiable, this optimisation can be achieved by
gradient descent given knowledge and data.</p>
      <p>
        Logic Tensor Networks [
        <xref ref-type="bibr" rid="ref12 ref7 ref8">8, 12, 7</xref>
        ] implement a many-valued first-order logic (FOL) language ℒ.
The semantics for the connectives is defined according to fuzzy logic semantics: conjunctions are
approximated by t-norms (e.g. (, )), disjunctions by t-conorms (e.g. (, )), negation
by fuzzy negation (e.g. 1 − ) and implication by fuzzy implications (e.g. (1 − , )).
Predicates are grounded as mappings onto the interval [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ] representing the predicate’s degree
of truth given the data. Formulas in ℒ facilitate the specification of relational knowledge using
variables. For example, the atomic formula partOf (, ) with variable  and object  may
indicate the objects that form the parts of object . Additionally, since we are interested in
learning and reasoning in real-world scenarios, exceptions to the rule may occur. Due to the
fuzzy semantics adopted by the language, formulas may be partially true in case there are
exceptions in the data.
      </p>
      <p>
        In order to obtain a satisfiability level that serves as the optimisation criterion for training, it
is necessary to aggregate all the formulas in the knowledge-base . Universal and existential
quantifiers need to be expressed using the diferentiable fuzzy logic ℒ. LTN therefore replaces
 with all objects  ( ∈ ) in the data whenever a quantified free variable ( ∀) is part of
a formula in ℒ. The truth-value of such formula is then obtained by aggregating the
truthvalues of each grounded object . The universal quantifier and clause aggregation function
adopted in the experiments reported in this paper is the generalised mean, also referred to as
p-mean1. Existential quantification is not used in this paper. We adopt the product t-norm for
conjunctions, its corresponding t-conorm for disjunctions, and the Reichenbach implication.
As reported in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], this setup is seen to be superior due to enhanced gradient propagation for
learning.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. Practical Reasoning</title>
      <p>
        The term reasoning has been used frequently in the Machine Learning (ML) literature recently
to denote various inference tasks. It seems desirable to specify the way that reasoning can be
performed within ML. The most intuitive definition is that of a system capable of generating
conclusions from a given knowledge-base. In a seminal paper about reasoning in ML [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ],
Leon Bottou argues that "instead of trying to bridge the gap between machine learning and
sophisticated all-purpose inference mechanisms, we can algebraically enrich the set of
manipulations applicable to training systems, and build reasoning capabilities from the ground up."
More importantly, Bottou shows that there is continuity between algebraically rich inference
systems such as logical or probabilistic systems and simple manipulations such as the mere
concatenation of learning models.
      </p>
      <p>By mapping symbolic knowledge into regular loss functions, DFL can make reasoning a part
of learning as argued by Bottou. In this setting, one can analyse how knowledge and data follow
specific rules of inference by observing how the loss term influences model learning while
hoping to measure the reasoning capabilities that these optimisations enable, or one can extract
1p-mean(1, . . . , ) = ︂( 1 ∑︀ ︂) 1
 =1</p>
      <p>.
knowledge explicitly from the trained model and evaluate by proxy the reasoning of the model
by evaluating the reasoning and fidelity to the model of the extracted knowledge.</p>
      <p>
        In the first option above, one evaluates both the network’s forward (inference) and backward
pass (learning). In the second option, the focus is exclusive on the forward pass. Furthermore,
while the former is interested in specific examples (local reasoning), the latter takes the view of
reasoning capabilities obtained through a set of examples (global reasoning). In this respect,
while [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] analyses each fuzzy operator at a time w.r.t. their ability to translate rules of inference
into the neural network (based on specific examples by analysing the partial derivatives of
logical subformulas), in this paper, we take a broad perspective and evaluate reasoning w.r.t. a
set of axioms being trained in a network through a set of examples. This motivates the following
definition of practical reasoning.
      </p>
      <p>Traditionally, reasoning in LTN is the process of searching for a set of parameters and
grounding that satisfy a given logical proposition. Since, as discussed, in this paper we are
concerned with evaluating the capabilities of a trained network, in what follows we define
practical reasoning in LTN as akin to the task known as inference in Machine Learning. We
therefore focus on reasoning given a single grounded theory ⟨,  ⟩ under the usual assumption
that some sound statistical evaluation, e.g. cross-validation or bootstrapping, has been applied
to select the best available grounding (set of parameters).</p>
      <p>Given a logical axiom Λ to be checked on a LTN, we generate symbolically a set of formulas
{}Λ such that Λ |= , where |= denotes logical consequence. We say that a LTN proves formula
, written ⟨,  ⟩ ⊢ , if the satisfiability of  given the best available grounding is greater
than a predefined real number  (0.5 ≤  &lt; 1), that is:</p>
      <p>⟨,  ⟩ ⊢  if  () &gt; .</p>
      <p>We then check whether ⟨,  ⟩ ⊢  for all  ∈ {}Λ, which gives us a measure of the neural
network’s reasoning capability. For example, to check whether a NN satisfies the axiom of
Modus Ponens, we define Λ = {,  →  |= }. Given atomic formulas  () and (),
suppose that ⟨,  ⟩ ⊢  () and ⟨,  ⟩ ⊢ ∀( () → ()). Thus, () is added to the
set of formulas to be checked for satisfiability in the NN, i.e. () ∈ {}Λ; {}Λ may contain
therefore all the instances that can be obtained given a set of axioms Λ. Examples of such
axioms may include transitivity, monotonicity and symmetry of relations.</p>
      <p>Given a set of examples  ⊆ { }Λ, the relation ⊢ allows one to measure the reasoning
capability of network ⟨,  ⟩ w.r.t. Λ by measuring the level of satisfiability of all the cases in
 in comparison with the satisfiability of all  in {}Λ. Suppose for example that one wishes
to evaluate in practice the reasoning capability of a given neural network that has been trained
to recognise images with various bounding boxes in them. Suppose further that it is useful
to check whether the network has learned that, whenever a bounding box is inside another
bounding box, which in turn is inside another bounding box then the first bounding box must
be inside that last bounding box. In other words, this property  of bounding boxes satisfies
the transitivity relation, namely,  = ∀, ,  : ( (,  ) ∧  (, )) →  (, ). A set of
examples  may contain a number of bounding boxes 1, 2, ... satisfying instances of the
above transitivity relation, such that given for example  (1, 2) and  (2, 3), one concludes
that  (1, 3) holds. Checking the network’s reasoning capability w.r.t. property  includes
checking whether  (1, 3) is satisfied by the network (soundness) but also quantifying the
size of  as a proportion of {}Λ (as a measure of completeness). {}Λ should include all the
cases of transitivity that can be derived symbolically by following a given proof procedure, not
just the cases in the training set.</p>
      <p>Notice how practical reasoning takes into account the ability of the system to interpolate (by
measuring soundness) and extrapolate (by measuring completeness) since knowledge derived
symbolically may be out of distribution. In what follows, the LTN network will be queried
systematically to obtain a measure of its reasoning capability2. Querying using first-order logic
(FOL) clauses in LTN is not only a post-hoc explanation in the traditional sense. We argue
that querying should form an integral part of an iterative process allowing for incremental
explanation and system improvement through the distillation of knowledge guided by reasoning
from knowledge and data (c.f. Figure 1).</p>
      <p>
        Given a trained network (a set of parameters  ), we compute the value of a grounding  ()
for a user-defined query  [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Specifically, we save and reinstate the learned parameters stored
in the LTN implementation resulting from  * = arg max ∈Θ Sat (). This also means
that changes to the knowledge-base will instead start from saved state  * , which allows us
to continually query and guide the learning process according to knowledge-base , an
approach akin to that of continual learning.
      </p>
      <p>A query is any logical formula expressed in FOL. Queries are evaluated by calculating the
grounding  of any formula whose predicates are already grounded in the NN or by defining a
new predicate in terms of existing predicates.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Quantitative Comparisons on Reasoning Tasks</title>
      <p>
        We now evaluate comparatively the reasoning capabilities of NNs in the LTN framework on
the experiments used by Bianchi and Hitzler [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] and Ebrahimi et al. [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. In their experiments,
redundant rules (formulas) are added to the knowledge-base. These are called redundant
because they can be inferred symbolically from the existing knowledge-base. They conclude
that redundancy produces an increase in the reasoning capability of NNs because the networks
will see more data due to the additional rules. We demonstrate that only specific additional
information is helpful in what concerns such improvement in reasoning.
      </p>
      <p>
        We use the iterative continual framework of Figure 1 whereby a closed world or open world
assumption can be implemented by adding specific propositions or quantified formulas to the
knowledge-base. In a closed-world, it is assumed that a statement that is true is also known to
be true. The absence of information is therefore treated as negative information, or a license to
jump to conclusions until further information to the contrary become available. By contrast, in
an open-world, completeness of information is not required. By making an open or closed-world
assumption with varying amounts of incomplete knowledge, reasoning capability results will
vary. This may not seem surprising in the presence of the above definition of practical reasoning,
although to the best of our knowledge, this paper is the first to address the issue systematically,
2Our definition applies directly to the reasoning tasks evaluated in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] where the reasoning capability of LTN
is studied in the context of a set of experiments. Here, we allow such experiments to be generated systematically
based not only on Prolog semantics but on any proof theory, in particular also using an open-world semantics.
which is important with all the recent interest in NN reasoning.
      </p>
      <p>In LTN, a quantified formula either expands the set of examples in an existing domain (a form
of semi-supervised learning) or it helps with transfer learning from a data-rich domain (defined
by a set of predicates) to a domain with insuficient data (e.g. a new predicate). In the first
experiment below, we illustrate the first case and in the second experiment information is
transferred from a domain with high availability of data (parent) to one without (ancestor).</p>
      <sec id="sec-4-1">
        <title>4.1. Ontology Reasoning</title>
        <p>
          The first example illustrates the manner in which the reasoning capabilities of a system that
presumes an open-world (NN) may be afected and assessed when it is applied in a closed-world
setting. An ontology’s direct subclass relations are given and quantified formulas are utilised
to derive and complement data in order to infer multiple hop inferences on the ontology’s
knowledge graph. Thus, the task is to learn subclass relations of any depth using quantifiable
axioms in addition to 22 single-step subclass relations. The ontology is provided in Bianchi and
Hitzler [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ]. In this paper, we follow the task formalisation introduced by Badreddine et al. [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
        </p>
        <sec id="sec-4-1-1">
          <title>Domain: classes, to denote the taxonomy entries.</title>
          <p>Constants: 1, .., 24 denoting the 24 classes for which an embedding is to be learned.
Predicates: (, ) for the subclass relation.  ∈ classes.</p>
        </sec>
        <sec id="sec-4-1-2">
          <title>Variables: , ,  are variable ranging over the domain (classes).</title>
          <p>Axioms: Let  = {(, )} denote the 22 direct subclass relations, e.g. (Dog, Mammal), dog is
a subclass of mammal.  is the training data for learning the groundings.</p>
          <p>∀ ∈  :
∀,  ∈  :
∀, ,  ∈  :
¬(, )
(, ) → ¬(, )
(, ) ∧ (, ) → (, )
(1)
(2)
(3)
Let ℰ = {(, )} denote the negative complement of the subclass relation. As Knowledge
is assumed to be complete, it can be deduced by creating a set of all possible relations
without the known subclass relation.</p>
          <p>Grounding: (class) = R2. We learn embeddings in R2.</p>
          <p>(1 |  ) = v (1), (2 |  ) = v (2), . . . , (24 |  ) = v (24); every class is
associated with a vector of two real numbers. The embedding is initialized uniformly at
random.
( |  ) = ( |  ) = ( |  ) = ⟨v (1), . . . , v (24)⟩.</p>
          <p>( |  ) : ,  ↦→ sigmoid(MLP_sub (, )), where MLP_sub has 1 output neuron.</p>
          <p>
            Figure 2 illustrates the dificulty of integrating logical statements that originate from primary
logic-based approaches directly into DFL systems without considering the open or closed
world assumptions. Since there are only positive propositions in , the network grounds
every variable positively to the predicate (, ) when applying formula (3). Due to the fact
that  only contains positive propositions, each variable in formula (3) is grounded positively
to the predicate (, ) using the network. The formula does not provide any additional
information for the gradient updates and, therefore, does not enhance the reasoning capabilities
of the NN. Only formulas containing a negation in the consequent enable the network to acquire
further relevant information in order to improve its reasoning capabilities. In the absence of
such information, the network is unable to learn a meaningful interpretation of the vector
embeddings. This is reflected in a low F1-score (F1=0.64) when considering all possible subclass
relations (comparable to the results reported in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ]). Notably, the precision here is 0.436 but the
recall is 1, indicating that the network is prone to false positives. Nevertheless, by assuming
that knowledge is complete, it is possible to deduce negative propositions ℰ on the basis of
transitive closure. By generating negative propositions for learning, we impose data based on a
closed-world assumption upon an open-world model, leading to a significant improvement of
the F1 measure (F1=0.968).
          </p>
        </sec>
      </sec>
      <sec id="sec-4-2">
        <title>4.2. Reasoning across Domains</title>
        <p>
          The goal of this task is to be able to use quantified formulas to complete an existing domain but
also to transfer information efectively into a new predicate domain. Again, we compare results
with [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], this time on the well-known ancestor example from Inductive Logic Programming. We
further compare results with logic programming using Prolog (henceforth; Prolog) and the
openworld theorem prover Coq, for the sake of a comparison with symbolic reasoning approaches.
Using subsets of the knowledge-base  in Prolog and Coq, we can derive comparisons on
reasoning capability with incomplete information and open domains. We shall also investigate
continual learning within the LTN iterative approach and its ability to reason with partial
knowledge. The iterative application of LTN allows one to increase the size of the
knowledgebase incrementally by querying the network. The following example illustrates how false
positives may be exacerbated over multiple deductive reasoning steps as part of this iterative
approach.
        </p>
        <p>The ancestor example is a well-known family tree problem centred around the learning of
recursive relations, in particular the definition of ancestor as the recursive application of a parent
predicate. Given only positive propositions about the parent relation, the ancestor relation is
expected to be learned and to be generalised to the recursive application of any instance of the
parent relation3.</p>
        <sec id="sec-4-2-1">
          <title>Domain: people, to denote the individuals.</title>
          <p>Constants: 1, .., 17 denoting the 17 individuals for which an embedding is to be learned (in
the domain of people).</p>
        </sec>
        <sec id="sec-4-2-2">
          <title>3In Prolog notation:</title>
          <p>ancestor(X,Y) :- parent(X,Y).
ancestor(X,Y) :- parent(X,Z), ancestor(Z,Y).</p>
          <p>Predicates: (, ), (, ) for the parent and ancestor binary relation (both predicates
in the domain of people).</p>
        </sec>
        <sec id="sec-4-2-3">
          <title>Variables: , ,  are variable ranging over the domain people.</title>
          <p>Axioms: Let  = {(, )} denote the 22 parental relations, e.g. (joe, juliet), joe is a parent of
juliet, (janice, juliet), janice is a parent of juliet, etc.  denotes the training data. The
knowledge-base is incrementally expanded using the 10 quantifiable clauses listed in
Figure 3 (left).</p>
          <p>Grounding: (people) = R2. We learn embeddings in R2.</p>
          <p>(1 |  ) = v (1), (2 |  ) = v (2), . . . , (17 |  ) = v (17); every individual is
associated with a vector of two real numbers. The embedding is initialized uniformly at
random.
( |  ) = ( |  ) = ( |  ) = ⟨v (1), . . . , v (17)⟩.
( |  ) : ,  ↦→ sigmoid(MLP_parent (, )), where MLP_parent has 1
output neuron.
( |  ) : ,  ↦→ sigmoid(MLP_ancestor (, )), where MLP_ancestor has
1 output neuron.</p>
          <p>
            As shown in Figure 3, the full knowledge-base is split into partial knowledge-bases and
queried incrementally on knowledge that does not form part of the training process. The
formulas used here correspond to those in the small and extended knowledge-bases used in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ].
For eficiency, we use an embedding of size 2 as opposed to 10 in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ]. Furthermore, we employ
the product Real Logic operators introduced in [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ]. With the theorem prover Coq, we can derive
proofs of the ancestor relation given a knowledge-base and propositions (i.e., examples). Coq
derives these proofs under an open-world assumption. The information is incomplete, although
each revision step contributes to the knowledge-base (Table 2).
          </p>
          <p>LTN Rev. 1
LTN Rev. 2
LTN Rev. 3</p>
          <p>LTN Rev. 4
Prolog Rev. 1,2,3</p>
          <p>Prolog Rev. 4</p>
          <p>
            In a first revision step, we initialise the task with minimal background knowledge consisting
of the 4 formulas highlighted in the first column of Figure 3 and the 22 propositions ( ) of
the parent relation. We train the network to learn an embedding for each clause indicated
by a green arrow in the figure at each revision step. We observe fast convergence at training
to the level of 99% of satisfiability after 2,000 epochs, whilst in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] networks were optimised
up to 10,000 and 20,000 epochs. In a first revision step, we initialise the task with minimal
background knowledge consisting of the 4 formulas highlighted in the first column of Figure 3
and the 22 propositions () of the parent relation. The network is trained at each revision step
to learn a grounding for the clauses indicated by a green arrow in the figure. Upon training, we
observe a fast convergence to 99% satisfiability of  after 2,000 epochs, whilst in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] networks
were optimised up to 10,000 and 20,000 epochs to converge. By querying each clause after
learning from clauses 1 to 4, it is evident that the network has acquired knowledge of clauses 5
to 8, as indicated by their satisfiability levels at revision 1 in Fig.3. Thus, using the extended
knowledge-base as presented in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] would not enhance the deductive reasoning capability in this
case (with the use of the product real logic operators [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ]). The network is generating many false
positives (see Table 2) as numerous propositions and quantified formulas in  specify positive
relations. The majority of unknown relations which cannot be deduced, as determined by the
theorem prover Coq, are inferred to be true by the network. Although, under the assumption
of a closed world, Prolog assigns all unknowns to false and achieves high precision (see Table
2). By querying clauses 9 and 10, whose consequents are negative literals, a low satisfiability
value of around 37 % indicates also that the majority of parent relations that are not part of the
training data are assumed to be true by the network. Therefore, either more data containing
negative examples should be considered or specific quantified formulas should be added to LTN,
both will yield the same efect of improving the groundings. Here we opted for the latter option
due to the simplicity of adding a clause as a constraint to LTN. The incremental addition of
clauses and the monitoring of performance improvements should make revision easier when
clauses (rather than large chunks of data) may need to be removed later.
          </p>
          <p>As a part of revision step two, we add clause 9 having ¬(, ) in the consequent to the
LTN and continue to train the LTN for 2,000 additional epochs. As shown in Figure 3 bottom,
the added knowledge enables the network to eliminate false positives from the  relation.
Notably, this translates into an improved inference of the  relation by the network, as can
be seen from the Table 2, despite Coq finding no additional proofs for these  relation.</p>
          <p>During revision step three, following an additional 2,000 epochs of training with the clauses
shown in Figure 3, the ¬ relation is further specified. An examination of the F1 score in
Table 2 indicates that the provision of negative examples significantly enhances the reasoning
capabilities of DFL-models. Further specification of ¬ cannot improve Prolog’s results where
unknowns are assumed to be false under the closed-world assumption.</p>
          <p>
            Lastly, revision four adds the clauses that fully specify all ancestor relations within the set
of examples and all 46 positive  relations can be derived using Coq. However, the ¬
relations remain under-specified with 186 examples not being provable under an open-world
assumption. The continuous revision of the model has demonstrated that one can eliminate an
undesirable model property by adding constraints that will increase the deductive capabilities
reported in [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ]. Using less than 1% trainable parameters, we obtain a Mean Absolute Error of
0.04 and F1 of 0.884, while [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] achieved 0.14 and 0.85. The results indicate that open-world
DFL methods are prone to recall while logical reasoners under a closed-world assumption are
better at attaining high precision when the domain is underspecified. Considering this point
is essential when making assumptions about the information required to ground a domain
through learning. Our findings also indicate that DFL methods outperform logic-based methods
when the information is incomplete.
          </p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-5">
      <title>5. Conclusion</title>
      <p>Adding logically-redundant knowledge to a neurosymbolic system can be beneficial to improve
overall performance. When such performance is intended to measure the so-called reasoning
capability of the system, it is important to make explicit the underlying assumption of a
closedworld or open-world reasoning. We began by providing a definition of reasoning in NNs, which
can be used to formalise, measure, and compare results. The first reasoning example used in this
paper (ontology reasoning) showed how an open-world neurosymbolic model trained without
suficient negative information fails to learn simple relational knowledge. As expected, the
iterative provision of negative information can improve reasoning capabilities dramatically.
The second example used in this paper (the ILP ancestor example) showed the same trend, with
the iterative application of knowledge improving the reasoning capability of the neural
network. The neurosymbolic approach showed also a superior reasoning performance than purely
symbolic methods in the presence of incomplete information, indicating how the combination
of data and knowledge may benefit purely neural or purely symbolic (reasoning) approaches.
Comparisons with purely-symbolic learning approaches and other neurosymbolic approaches
are planned as future work. Our results showed that the network was capable of capturing
multi-hop steps and we intend to extend the evaluation to a large-scale knowledge graph with
increasingly sophisticated relations.</p>
    </sec>
    <sec id="sec-6">
      <title>A. Appendix</title>
      <sec id="sec-6-1">
        <title>A.1. On the Raven’s paradox</title>
        <p>
          Krieken et al. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] illustrate the reasoning capabilities of DFL systems using the well-known
raven paradox [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]. They approach the raven paradox by specifying and measuring diferential
updates that have particular properties. Their focus is specifically on the fuzzy implications and
adjustments to the relative importance of Modus Ponens (MP) with respect to Modus Tollens
(MT) updates, which is a trade-of at the heart of the the raven’s paradox 4.
        </p>
        <p>The paradox centres around the question: What constitutes evidence for the statement "all
ravens are black"? In first-order logic, ∀ : () → ().</p>
        <p>
          The authors observe that the average DFL gradient update due to MT is, in the case of this
problem, around 100 times larger than the average MP gradient update, i.e. "it uses far more
contrapositive reasoning" [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]. They propose to handle positive and contrapositive reasoning
separately. MP and MT diferential updates in the context of the paradox can be specified as:
• Modus Ponens: "It’s a raven so it has to be black"; increase the truth-value of black during
semi-supervised learning.
• Modus Tollens: "It is not black so it cannot be a raven"; decrease the truth-value of raven
by contraposition of the implication.
        </p>
        <p>
          Most fuzzy implications will focus on MP reasoning (first bullet point above). Krieken et al. [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ]
argue that this is undesirable as MT reasoning (second bullet point) can be more representative
of what goes on in the real world.
        </p>
        <p>Although the argument about the importance of MT is bound to continue (MT does not
feature in Prolog, for example), the diference between MP and MT is particularly noticeable in
semi-supervised settings because the choice of Modus influences directly how unlabelled data
is used for optimisation of the system. We argue that MT may need to be provided explicitly to
the system in the form of a formula ∀ : ¬() → ¬(), allowing one to generate
4Does the observation of non-black objects varied in colour and unrelated to ravens provide evidence that
should increase the likelihood that all ravens are black?
an adequate number of negative examples (non-ravens of various colours) to counteract the
problem with the gradients.</p>
        <p>In the context of learning given the raven’s paradox, examples of non-ravens become relevant
and should be provided as input to the system
If possible, providing such data directly (i.e. instances of non-ravens, non-black things
¬() ∧ ¬()) may be preferred to allow for an adequate interpolation or
clustering of representations, but the measure of this may be highly domain dependent. There
are limitations that remain as the non-black non-ravens may be dificult to specify in an open
world with the DFL system not being able to ground non-black things equally well as black
things using a data-driven approach. However, it should be noted that in the LTN iterative
approach, the observed phenomenon can be tackled at the fuzzy logic knowledge level as well
as at the data-driven level. Notice how, when a closed-world assumption can be adopted, in
particular when Clark’s completion can be assumed valid (not the case of the raven’s paradox),
the problem is simplified greatly. This can be illustrated with the well-known example of human
reasoning whereby participants are told that if there’s an exam tomorrow then Lisa studies late
in the library, ∀ : () → (). When informed in addition that there are no
exams tomorrow, most participants conclude that Lisa is not in the library, which is a fallacy. A
possible explanation is that most participants assume, when told if there’s an exam tomorrow
then Lisa studies late in the library, that the completion holds, i.e. Lisa studies late in the library if
and only if there’s an exam tomorrow, ∀ : () ↔ (). Given this closed-world
assumption, it is not dificult to derive ∀ : ¬() → ¬(), which provides an
adequate knowledge-base for the generation of negative examples required for DFL learning.</p>
      </sec>
      <sec id="sec-6-2">
        <title>A.2. Detailed description of the ontology and ancestor examples</title>
        <p>
          In this section, we detail the setup of the examples used in the paper. We define the domain and
all knowledge-base formulas and give a description that follows the same structure as that used
in [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. All experiments were run using the Tensorflow version 2.0 and reproduced in PyTorch
1.2. The processor used i9 (4.5Ghz) with a NVIDIA 2080 TI GPU and 32GB Ram using Windows
105.
        </p>
        <p>A.2.1. Ontology Reasoning
The task is learning an ontology’s subclass relations. Direct (one-hop) relations in the form of
propositions are given and quantified formulas are used to derive and complement data to infer
multi-hop inferences of any length in the ontology’s knowledge graph.</p>
        <p>5The code for the experiments can be found here: https://github.com/benediktwagner/ltn-reasoning.</p>
        <p>A.2.2. Cross-domain Reasoning
The task is a combination of transferring information from the parent predicate to the ancestor
predicate while at the same time inferring the complement of the existing formulas
(nonparents). This is achieved by the quantified formulas and it illustrates how false positives may
be exacerbated over multiple reasoning steps.</p>
        <p>Total</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>A. d.</given-names>
            <surname>Garcez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Lamb</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Serafini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Spranger</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. N.</given-names>
            <surname>Tran</surname>
          </string-name>
          ,
          <string-name>
            <surname>Neural-Symbolic Computing</surname>
          </string-name>
          :
          <article-title>An Efective Methodology for Principled Integration of Machine Learning and Reasoning</article-title>
          , arXiv:
          <year>1905</year>
          .
          <volume>06088</volume>
          (
          <year>2019</year>
          ). URL: http://arxiv.org/abs/
          <year>1905</year>
          .06088.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>T. R.</given-names>
            <surname>Besold</surname>
          </string-name>
          , A. d. Garcez,
          <string-name>
            <given-names>S.</given-names>
            <surname>Bader</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Bowman</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Domingos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Hitzler</surname>
          </string-name>
          , K.-U. Kuehnberger,
          <string-name>
            <given-names>L. C.</given-names>
            <surname>Lamb</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Lowd</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. M. V.</given-names>
            <surname>Lima</surname>
          </string-name>
          , L. de Penning, G. Pinkas,
          <string-name>
            <given-names>H.</given-names>
            <surname>Poon</surname>
          </string-name>
          , G. Zaverucha,
          <article-title>Neural-Symbolic Learning and Reasoning: A Survey and Interpretation (</article-title>
          <year>2017</year>
          )
          <fpage>1</fpage>
          -
          <lpage>58</lpage>
          . URL: http://arxiv.org/abs/1711.03902.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>B.</given-names>
            <surname>Wagner</surname>
          </string-name>
          , A. d. Garcez,
          <article-title>Neural-Symbolic Integration for Fairness in AI</article-title>
          , in: AAAI Spring
          <string-name>
            <surname>Symposium</surname>
            <given-names>AAAI</given-names>
          </string-name>
          -MAKE,
          <year>2021</year>
          . URL: http://ceur-ws.
          <source>org/</source>
          Vol-
          <volume>2846</volume>
          /paper5.pdf.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>B.</given-names>
            <surname>Wagner</surname>
          </string-name>
          , A.
          <string-name>
            <surname>d'Avila Garcez</surname>
          </string-name>
          ,
          <article-title>Neural-Symbolic Integration for Interactive Learning and Conceptual Grounding</article-title>
          , in: NeurIPS, Workshop on Human and
          <source>Machine Decisions</source>
          ,
          <year>2021</year>
          . URL: https://arxiv.org/abs/2112.11805.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E. v.</given-names>
            <surname>Krieken</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Acar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F. v.</given-names>
            <surname>Harmelen</surname>
          </string-name>
          ,
          <string-name>
            <surname>Analyzing Diferentiable Fuzzy Logic Operators</surname>
          </string-name>
          (
          <year>2020</year>
          ). URL: https://arxiv.org/abs/
          <year>2002</year>
          .06100v1.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>F.</given-names>
            <surname>Bianchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Hitzler</surname>
          </string-name>
          ,
          <article-title>On the Capabilities of Logic Tensor Networks for Deductive Reasoning</article-title>
          , AAAI Spring Symposium MAKE (
          <year>2019</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>S.</given-names>
            <surname>Badreddine</surname>
          </string-name>
          , A. d. Garcez,
          <string-name>
            <given-names>L.</given-names>
            <surname>Serafini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Spranger</surname>
          </string-name>
          , Logic Tensor Networks (
          <year>2020</year>
          ). URL: http://arxiv.org/abs/
          <year>2012</year>
          .13635.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>L.</given-names>
            <surname>Serafini</surname>
          </string-name>
          , A. d. Garcez,
          <article-title>Logic tensor networks: Deep learning and logical reasoning from data and knowledge</article-title>
          ,
          <source>arXiv preprint arXiv:1606.04422</source>
          (
          <year>2016</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>S.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Q.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Guo</surname>
          </string-name>
          ,
          <article-title>Jointly embedding knowledge graphs and logical rules</article-title>
          ,
          <source>in: EMNLP 2016 - Conference on Empirical Methods in Natural Language Processing</source>
          , Proceedings,
          <year>2016</year>
          . doi:
          <volume>10</volume>
          .18653/v1/d16-
          <fpage>1019</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>M.</given-names>
            <surname>Diligenti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Gori</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Saccà</surname>
          </string-name>
          ,
          <article-title>Semantic-based regularization for learning and inference</article-title>
          ,
          <source>Artificial Intelligence</source>
          (
          <year>2017</year>
          ). doi:
          <volume>10</volume>
          .1016/j.artint.
          <year>2015</year>
          .
          <volume>08</volume>
          .011.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>G.</given-names>
            <surname>Marra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Giannini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Diligenti</surname>
          </string-name>
          ,
          <string-name>
            <surname>M.</surname>
          </string-name>
          <article-title>Gori, LYRICS: a General Interface Layer to Integrate Logic Inference and Deep Learning (</article-title>
          <year>2019</year>
          ). URL: http://arxiv.org/abs/
          <year>1903</year>
          .07534.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>I.</given-names>
            <surname>Donadello</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Serafini</surname>
          </string-name>
          , A. d. Garcez,
          <article-title>Logic tensor networks for semantic image interpretation</article-title>
          ,
          <source>in: IJCAI International Joint Conference on Artificial Intelligence</source>
          ,
          <year>2017</year>
          . doi:
          <volume>10</volume>
          .24963/ijcai.
          <year>2017</year>
          /221.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>L. Bottou,</surname>
          </string-name>
          <article-title>From machine learning to machine reasoning: An essay</article-title>
          ,
          <source>Machine Learning</source>
          (
          <year>2014</year>
          ). doi:
          <volume>10</volume>
          .1007/s10994-013-5335-x.
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>M.</given-names>
            <surname>Ebrahimi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Eberhart</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Bianchi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Hitzler</surname>
          </string-name>
          ,
          <article-title>Towards bridging the neurosymbolic gap: deep deductive reasoners</article-title>
          ,
          <source>Applied Intelligence</source>
          (
          <year>2021</year>
          ).
          <source>doi:10.1007/ s10489-020-02165-6.</source>
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>C. G.</given-names>
            <surname>Hempel</surname>
          </string-name>
          , I.
          <article-title>-STUDIES IN THE LOGIC OF CONFIRMATION (I.)</article-title>
          ,
          <source>Mind</source>
          (
          <year>1945</year>
          ). doi:
          <volume>10</volume>
          .1093/mind/liv.213.1.
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>H.</given-names>
            <surname>Lipson</surname>
          </string-name>
          ,
          <source>Foundations of Artificial Intelligence</source>
          , Cornell University CS4700,
          <year>2011</year>
          , p.
          <source>Lecture 16 Slides.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>