<!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 Predicate Invention: Learning Relational Concepts from Visual Scenes</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Jingyuan Sha</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Hikaru Shindo</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Kristian Kersting</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Devendra Singh Dhami</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Technische Universität Darmstadt</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>German Research Centre for Artificial Intelligence</institution>
          ,
          <addr-line>DFKI</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Hessian Center for Artificial Intelligence</institution>
          ,
          <addr-line>hessian.AI</addr-line>
        </aff>
      </contrib-group>
      <abstract>
        <p>The predicates used for Inductive Logic Programming (ILP) systems are usually elusive and need to be hand-crafted in advance, which limits the generalization of the system when learning new rules without suficient background knowledge. Predicate Invention (PI) for ILP is the problem of discovering new concepts that describe hidden relationships in the domain. PI can mitigate the generalization problem for ILP by inferring new concepts, giving the system a better vocabulary to compose logic ruless. Although there are several PI approaches for symbolic ILP systems, PI for NeSy ILP systems that can handle visual input to learn logical rules using diferentiable reasoning is relatively unaddressed. To this end, we propose a neural-symbolic approach, NeSy- , to invent predicates from visual scenes for NeSy ILP systems based on clustering and extension of relational concepts. ( denotes the abbrivation of Predicate Invention). NeSy- processes visual scenes as input using deep neural networks for the visual perception and invents new concepts that support the task of classifying complex visual scenes. The invented concepts can be used by any NeSy ILP systems instead of hand-crafted background knowledge. Our experiments show that the PI model is capable of inventing high-level concepts and solving complex visual logic patterns more eficiently and accurately in the absence of explicit background knowledge. Moreover, the invented concepts are explainable and interpretable, while also providing competitive results with state-of-the-art NeSy ILP systems based on given knowledge.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;Predicate Invention</kwd>
        <kwd>Inductive Logic Programming</kwd>
        <kwd>Neural Symbolic Artificial Intelligence</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        Inductive Logic Programming (ILP) learns generalized logic programs from given data [
        <xref ref-type="bibr" rid="ref1 ref2 ref3">1, 2, 3</xref>
        ].
Unlike Deep Neural Networks (DNNs), ILP gains vital advantages, such as learning
explanatory rules from small data. However, predicates for ILP systems are typically elusive and
need to be hand-crafted, requiring much prior knowledge to compose solutions.
Predicate invention (PI) systems invent new predicates that map new concepts from well
designed primitive predicates given by experts, which extend the expression of the ILP
language and consequently reduce the dependence on human experts [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. A simple example
      </p>
      <p>Const.</p>
      <p>Basic
Pred.</p>
      <p>B.K.</p>
      <p>Pred.</p>
      <p>NeSy-ILP
Object:O1/O2,Shape:Sphere/Cube;</p>
      <p>Color:Blue/Pink/Green;</p>
      <p>Direction:Left/Right/Front/Behind
color/2/obj,color;shape/2/obj,shape;</p>
      <p>dir/2/obj,obj
b_sp(O1):-color(O1,B),shape(O1,Sp).
g_sp(O1):-color(O1,G),shape(O1,Sp).
g_cu(O1):-color(O1,G),shape(O1,Cu).</p>
      <p>left_side/2/obj,obj
right_side/2/obj,obj</p>
      <p>NeSy-π
is the concept of the blue sphere. In classical NeSy-ILP systems, this can be explained by
a clause blue_sphere(X):-color(X, blue), shape(X, sphere) given as background
knowledge. With PI systems, such concepts are learned from the basic predicates color(X, blue) and
shape(X, sphere) by concatenation.</p>
      <p>
        Recently, several neural-symbolic ILP frameworks have been proposed [
        <xref ref-type="bibr" rid="ref5 ref6">5, 6</xref>
        ] that incorporate
DNNs for visual perception and learn explanation rules from raw inputs. NeSy-ILP systems
outperform pure neural-based baselines on visual reasoning, where the answers are inferred by
reasoning about objects’ attributes and their relations [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. The major flaw of existing NeSy-ILP
systems is that they require all predicates beforehand, e.g. pretrained neural predicates or
explained by hand-crafted background knowledge. Moreover, the collection of background
knowledge is very costly as it needs to be provided by human experts or requires pre-training
of the neural modules with additional supervision. This severely limits the applicability of these
NeSy-ILP systems to diferent domains. In contrast, DNNs require a minimal prior and achieve
high performance by learning from data [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. So the question arises: How can we implement a
NeSy-ILP system that can learn from less or no background knowledge?
      </p>
      <p>To this end, we propose Neural-Symbolic Predicate Invention (NeSy- ), a predicate invention
pipeline that can invent relational concepts given visual scenes by using primitive predicates,
reducing dependence on prior knowledge (see Fig. 1 for an example). NeSy- discovers predicates
describing attributes of objects and their spatial relations in visual scenes, which is equivalent
to summarizing the required knowledge from scenes. The NeSy- system (shown in Fig. 2)
consists of two iterative steps: 1) evaluating clauses consisting of existing predicates and 2)
inventing new predicates. To evaluate the existing predicates we propose two novel indicators
of necessity and suficiency which are computed by mapping the examples to a 2D Euclidean
space. Only the predicates satisfying the above properties are considered in the invention of
Visual ILP problem
positive
negative
: clause weights
: loss function
Invent new predicates</p>
      <p>Eval</p>
      <p>Invent</p>
      <p>Minimize the classification loss</p>
      <p>Invented
inv_pred3(Orii1hnn,o((O(OO2O51,1,,O,XX3O)),2,,O,i5rn)h(:oO-02),,Xr)h,oi(nO(1O,3O,5X,)r,ho0). Pirnevd_picreadt3es 0.9: targetiiii(nnnnXvv(()__OO:pp41-rr,,eeXXdd))34,,ii((nnOO((12OO,,52OO,,24XX,,))OO,,35i,)nO.(5O)3,,X),
inv_︙pred4(Ori1hn,o(O(O2O1,1,O,X5O))2,:,i-rnh(oO02),,Xr)h,oi(nO(1O,5O,5X,)rho0). inv︙_pred4 0.1: ︙targetici(nonX(l()OoO:1r4-,(,XOX)1),,,ipinin(n(OkO2)5,,,XsX)h),a,ipne((OO32,,Xc)u,be).
new predicates. NeSy- can be integrated with existing NeSy-ILP systems providing them with
a rich vocabulary to generate eficient solutions.</p>
      <p>
        Overall, we make the following important contributions: (1) We propose NeSy- , a NeSy
predicate invention framework compatible with NeSy ILP systems. NeSy- extends NeSy ILP
systems by providing the capability to enrich their vocabularies by learning from data. (2) We
propose two criteria for evaluating clauses, which can then be used for predicate invention
tasks. (3) We develop 3D Kandinsky Patterns, which extends Kandisnky Patterns to the 3D
world, and it achieves faster generation than other environments, e.g. CLEVR [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
2. First-order Logic and Inductive Logic Programming
First-Order Logic (FOL). A Language ℒ is a tuple ( , , ℱ ,  ), where  is a set of predicates,
 is a set of constants, ℱ is a set of function symbols (functors), and  is a set of variables. A
term is a constant, a variable, or a term consisting of a functor. A ground term is a term with no
variables. We denote an -ary predicate p by p/. An atom is a formula p(t1, . . . , tn), where
p is an -ary predicate symbol and t1, . . . , tn are terms. A ground atom or simply a fact is
an atom with no variables. A literal is an atom or its negation. A positive literal is simply an
atom. A negative literal is the negation of an atom. A clause is a finite disjunction ( ∨) of literals.
A ground clause is a clause with no variables. A definite clause is a clause with exactly one
positive literal. If , 1, . . . ,  are atoms, then  ∨ ¬1 ∨ . . . ∨ ¬ is a definite clause. We
write definite clauses in the form of  :- 1, . . . , . The atom  is called the head, and the
set of negative atoms {1, . . . , } is called the body. For simplicity, we refer to the definite
clauses as clauses in this paper. ℐℱ is the assignments of a function from  to  for each
-ary function
      </p>
      <p>Inductive Logic Programming. ILP problem  is tuple (ℰ +, ℰ − , ℬ, ℒ), where ℰ + is a set
of positive examples, ℰ − is a set of negative examples, ℬ is background knowledge, and ℒ
is a language. We assume that the examples and background knowledge are ground atoms.
The solution of an ILP problem is a set of definite clauses ℋ ⊆ ℒ that satisfies the following
conditions: (1) ∀ ∈ ℰ +, ℋ ∪ ℬ |=  and (2) ∀ ∈ ℰ − ℋ ∪ ℬ ̸|= . Typically the search
algorithm starts with general clauses. If the current clauses are too general (strong), i.e., they
entail too many negative examples, then the solver specifies (weakens) them incrementally.
This weakening operation is called a refinement , which is one of the essential tools for ILP.</p>
      <p>
        Ne-Sy Inductive Logic Programming. We address the ILP problem in visual scenes, which
is called visual ILP problem, where each example is given as an image with multiple objects [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
The classification pattern is defined on high-level concepts such as attributes and relations
of objects. To solve visual ILP problems, diferentiable ILP frameworks have been proposed,
e.g. ILP [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and  ILP [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. They use a diferentiable implementation of forward reasoning
in FOL and so that the classification rules can be learned by gradient descent, they solve
min loss(, , ), where  is an ILP problem,  is a set of clause candidates,  is a set of
clause weights, and loss is a loss function that returns a penalty when training constraints are
violated. We note that we solve visual ILP problems where each positive and negative example
is an image containing multiple objects.
3. Neuro-Symbolic Predicate Invention: NeSy-
We propose NeSy- , which invents new predicates for
the NeSy-ILP solver from the dataset. Given initial
language ℒ, initial clauses 0, and dataset , NeSy- aims Algorithm 1 NeSy-
to extend the language ℒ by inventing new predicates Input: ℒ, 0, 
that make NeSy-ILP systems solve ILP problems efi- 1:  ←  0
ciently. Algorithm 1 shows the PI algorithm of NeSy- , 2: while  &lt;  do
and we describe each step in detail. 3:  ← extend (, ℒ)
      </p>
      <p>
        Clause Evaluation. We evaluate each clause to in- 4: # Evaluate each set of clauses
vent new predicates. (Line 1–3) A set of clauses  is 5: for pp ∈ ℘() do
initialized, and extended by generating new clauses 6: ness ← ness (p, )
by adding a body atom to each clause in  using the 7: spuff ← suff (p, )
available predicates in ℒ. (Line 5–7) Promising predi- 8: end for
cates are those that can form a clause containing many 9: # Invent new predicates
positive examples but no negative examples. We de- 10: n*ess ← top_k (℘(), ness )
velop two evaluation metrics for clauses in NeSy-ILP 11: s*uff ← top_k (℘(), suff )
systems, which we call necessity and suficiency . Intu- 12: ℒ ← update(ℒ, n*ess , s*uff )
itively, necessary clauses are those that are those that 13: end while
are true in all positive examples, but they can also be 14: return ℒ, 
true in negative examples. Suficient clauses are those
that are true in only some of positive examples, some
of positive examples maybe false, but they are always false in negative examples. To handle
complex visual scenes, NeSy- uses a diferentiable reasoning function  for scenes from
complex visual patterns in  ILP [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. It computes logical entailment softly on visual scenes to
target(X):-in(O1,X),in(O2,X),in(O5,X),
      </p>
      <p>inv_pred4(O1,O2,O5).
inv_pred4(O1,O2,O5):in(O1,X),in(O2,X),in(O5,X),
rho(O1,O2,rho0),rho(O1,O5,rho3).
perform classification as follows: (i) conversion of a positive or negative visual scene  into
a set of probabilistic atoms, (ii) diferentiable forward reasoning using weighted clauses and
probabilistic atoms, and (iii) the reasoning result is used to predict the label of the visual scene.</p>
      <p>
        Given set of clauses , we assume that each subset of  defines a new predicate, i.e. we
consider p ∈ ℘() defining predicate p where ℘() is a powerset of . To eficiently evaluate
clauses, NeSy- maps each training pair (+, − ) ∈ , to a point in a 2D Euclidean scoring
space ( (+),  (− )) ∈ [
        <xref ref-type="bibr" rid="ref1">0, 1</xref>
        ]2, where  is a reasoning function for clauses , as shown in
Fig. 3.  (+
      </p>
      <p>) represents the score of positive example + , i.e., the probability that a positive
example is classified as positive.  (− ) represents the score of negative example − , i.e., the
probability that a negative example is classified as positive. |+| and |− | represent the number
of positive and negative images in the dataset, respectively. On the scoring space, the necessity
of clauses p is measured as follows:
The suficiency
of clauses p is measured as:</p>
      <p>p
ness = ness (p, +) =
1</p>
      <p>∑︁
|+| +∈+</p>
      <p>p (+),
p
suff = suff (p, − ) =
1</p>
      <p>∑︁ (1 − p (− )),
|− | − ∈−
(1)
(2)</p>
      <p>Predicate Invention. NeSy- invents new predicates by composing clauses to define new
predicates using high scoring clauses in the two metrics. Given ℘() and their evaluation
(a) Three Same
(b) Two Pairs
(c) Shape in Shape
(d) Check Mark
scores, ness and suff , top- sets of clauses for each score are selected from ℘(), i.e. n*ess =
top_k (℘(), ness ) and s*uff = top_k (℘(), suff ). Let * = n*ess ∪ s*uff , i.e. * is a set
of clause sets that have high scores in the metrics. New predicates are composed by taking
disjunction of high-scored clauses to define them. Let {1, ..., } ∈ * , we compose the
following clauses to define a new predicate: new ← body (1), . . . , new ← body (),
where new is an atom using a new predicate and body () is body atoms of clause .</p>
      <p>For example, assume the following clauses defining inv_pred1 and inv_pred2 are selected:
inv_pred1(X):-in(O1, X), in(O2, X), color(O1, blue), color(O2, blue).</p>
      <p>inv_pred2(X):-in(O1, X), in(O2, X), color(O1, red), color(O2, red).
then NeSy- invents a new predicate by taking the disjunction of their bodies:
inv_pred3(X):-in(O1, X), in(O2, X), color(O1, blue), color(O2, blue).</p>
      <p>inv_pred3(X):-in(O1, X), in(O2, X), color(O1, red), color(O2, red).
where inv_pred3 is an invented 1-ary predicate that can be interpreted as: “There is a pair of
objects with the same color (blue or red) in the image.”. By iterating the steps evaluate and invent,
NeSy- discovers new high-level relational concepts useful for classifying given visual scenes.
The invented predicates are then fed into a NeSy ILP system to solve visual ILP problems.</p>
    </sec>
    <sec id="sec-2">
      <title>4. Experimental Evaluation</title>
      <p>
        We aim to answer the following questions: Q1: Does NeSy- invent predicates from complex
visual scenes for NeSy ILP systems, reducing required background knowledge? Q2: Is NeSy-
computationally eficient?
(A1. Predicate Invention) : We designed four visual scenes with diferent patterns for 2D
and 3D Kandinsky patterns, respectively. (see Fig. 4). Each pattern has at least two varieties.
For example, the pattern three same can be three same blue sphere, or three same pink cube, or
something similar. All the patterns that we designed cannot be simply described by one or few
given basic predicate, but need several long clauses. The results are compared with no predicate
invention equipped model  ILP [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
      <p>To solve such patterns, classical NeSy-ILP systems requires background knowledge and
predicates to help the system reason about the final rules. For example, to solve pattern
three same, NeSy-ILP can give the concept two_same(A, B) as background knowledge, then
chains two_same(A, B) twice, i.e. three_same(A, B, C) : − two_same(A, B), two_same(B, C).,
and two_same(A, B) is given as background knowledge described by other five BK predicates
and five BK clauses as follows:
two_same(A,B):-same_color_pair(A,B),same_shape_pair(A,B),in(A,X),in(B,X).
same_shape_pair(A,B):-shape(A,sq),shape(B,sq),in(A,X),in(B,X).
same_shape_pair(A,B):-shape(A,cir),shape(B,cir),in(A,X),in(B,X).
same_color_pair(A,B):-color(A,red),color(B,red),in(A,X),in(B,X).
same_color_pair(A,B):-color(A,blue),color(B,blue),in(A,X),in(B,X).</p>
      <p>In NeSy- , such kind of background knowledge is not provided, but learned by the system.
The concepts are invented as new predicates. We only give six kinds of basic predicates as
background knowledge. They are: in/2/O, X: evaluate if the object O exists in the image X.
shape/2/O, S: evaluate if the object O has shape S. color/2/O, C: evaluate if the object O has
color C. phi/2/O1, O2, : evaluate if the object O2 is located in the direction  of O1 as calculated
in polar coordinate system. rho/2/O1, O2,  : evaluate if the distance between object O2 and O1
is around  (For more details, please check Appendix A). A possible solution of pattern three
same from NeSy- can be learned as follows
target(A,B):-in(O1,X),in(O2,X),inv_pred2(O1,O2).
inv_pred1(O1,O2):-color(O1,blue),color(O2,blue),in(O1,X),in(O2,X).
inv_pred1(O1,O2):-color(O1,red),color(O2,red),in(O1,X),in(O2,X).
inv_pred2(O1,O2):-in(O1,X),in(O2,X),inv_pred1(O1,O2),shape(O1,cir),shape(O2,cir).
inv_pred2(O1,O2):-in(O1,X),in(O2,X),inv_pred1(O1,O2),shape(O1,sq),shape(O2,sq).
In this case, the predicate target(A, B) corresponds the concept two_same(A, B) and it
takes five clauses to explain it, which are learned instead of given. The predicates
inv_pred1(A, B) and inv_pred2(A, B) are invented predicates. The other three predicates
(shape(A, Y), color(A, Z), in(A, X)) are given beforehand. For more examples, please check
Appendix. A.</p>
      <p>The result of the evaluation of each pattern is shown in Tab. 1. For each pattern, we give the
system only basic predicates and see that our system can successfully invent new predicates
for complex visual patterns, resulting in improved accuracy. For most of the patterns, NeSy-
successfully finds the target rules by inventing new predicates and using them to describe the
target patterns, while  ILP can only use existing predicates to describe them and fails at finding
the correct target clauses. However, since the variety of each pattern is controlled in a small
scale (limited choice of colors, shapes and positions), it is possible to find the target clauses that
describe the pattern comprehensively, which also explains the reason for the accuracy of 1.0.
The pattern full house has many more varieties (3024 varieties for positive patterns). Therefore
Dataset
2D KP
3D KP</p>
      <p>Patterns
Red Triangle</p>
      <p>Two Pairs
Full House
Check Mark</p>
      <p>Same</p>
      <p>Two Pairs
Shape of Shape</p>
      <p>Check Mark
# obj
2
4
4
5
3
4
4
5</p>
      <sec id="sec-2-1">
        <title>Iter.</title>
      </sec>
      <sec id="sec-2-2">
        <title>Time (minutes) Accuracy # Preds</title>
        <p>5
8
8
5
5
5
4
4

3
4
8
3
3
3
2
2

has 64 PN pairs.  and  denote  ILP system (without background knowledge) and NeSy- respectively.
The brackets in last column represent the number of invented predicates used in the target clauses.
it is impossible to consider every single case, which is very time consuming. Therefore, no
predicate was generated to describe it comprehensively. Nevertheless, the PI module improves
the accuracy up to 0.9, which proves that the invented predicates improve the accuracy in
incomplete description.
(A2. Computational Eficiency)</p>
        <p>: The runtime of NeSy- depends mainly on the number
of iterations needed to find the target clause. In each iteration, a predicate is added to each
clause to obtain more complex rules. The higher the number of iterations, the more complex
the rule becomes. Tab. 1 shows the time comparison of NeSy- with  ILP (without background
knowledge). Since the invented predicates entail the previously learned clauses, they are far
more informative than the clauses learned by classical NeSy systems like  ILP. Therefore,
NeSy- is able to converge to the target clause faster, making it more eficient.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>5. Related Work</title>
      <p>
        Inductive Logic Programming [
        <xref ref-type="bibr" rid="ref1 ref10 ref2 ref3">1, 10, 2, 3</xref>
        ] has emerged at the intersection of machine learning
and logic programming. Many ILP frameworks have been developed, e.g., FOIL [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ],
Progol [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ], ILASP [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], Metagol [13, 14], and Popper [15]. Recently, NeSy ILP (Diferentiable
ILP) frameworks have been developed [
        <xref ref-type="bibr" rid="ref5 ref6">5, 16, 6</xref>
        ] to deal with visual inputs in ILP. Predicate
invention (PI) has been a long-standing problem for ILP and many methods have been
developed [17, 18, 14, 19, 20, 21, 22, 23]. Although these methods can invent predicates for symbolic
inputs, predicate invention for Ne-Sy ILP systems has not been addressed. NeSy- invents
predicates given visual scenes using DNNs as a perception model, and to this end NeSy-ILP
systems achieve better performance with less background knowledge or pre-training of neural
modules. Meta rules, which define a template for rules to be generated, have been used for
dealing with new predicates in (NeSy) ILP systems [
        <xref ref-type="bibr" rid="ref5">5, 24</xref>
        ]. NeSy- achieves memory-eficient
predicate invention system by performing scoring and pruning of candidates from given data,
and this is crucial to handle complex visual scenes in NeSy ILP systems since they are are
      </p>
    </sec>
    <sec id="sec-4">
      <title>6. Conclusion</title>
      <p>We proposed an approach for Neural-Symbolic Predicate Invention (NeSy- ). NeSy- is able to
ifnd the new knowledge and summarize it as new predicates, thus it requires less background
knowledge for reasoning. We show that our NeSy- model uses only basic neural predicates
for finding target clauses, i.e., no further background knowledge is required. Compared to
the NeSy-ILP system without PI module, our system provides significantly more accurate
classifications. Extending NeSy-  to more complex problems, e.g., with more objects in the
scene, is an interesting avenue for future work. Developing an eficient prune strategy for
ifnding longer clauses is another interesting direction.
[13] A. Cropper, S. H. Muggleton, Metagol system, https://github.com/metagol/metagol, 2016.</p>
      <p>URL: https://github.com/metagol/metagol.
[14] A. Cropper, R. Morel, S. Muggleton, Learning higher-order logic programs, Mach. Learn.</p>
      <p>109 (2019) 1289 – 1322.
[15] A. Cropper, R. Morel, Learning programs by learning from failures, Mach. Learn. 110
(2021) 801–856.
[16] H. Shindo, M. Nishino, A. Yamamoto, Diferentiable inductive logic programming for
structured examples, in: Proceedings of the 35th AAAI Conference on Artificial Intelligence
(AAAI), 2021, pp. 5034–5041.
[17] I. Stahl, Predicate invention in ilp — an overview, in: P. B. Brazdil (Ed.), Machine Learning:</p>
      <p>ECML-93, Springer Berlin Heidelberg, Berlin, Heidelberg, 1993, pp. 311–322.
[18] D. Athakravi, K. Broda, A. Russo, Predicate Invention in Inductive Logic Programming,
in: 2012 Imperial College Computing Student Workshop, volume 28 of OpenAccess Series
in Informatics (OASIcs), Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl,
Germany, 2012, pp. 15–21.
[19] C. Hocquette, S. H. Muggleton, Complete bottom-up predicate invention in
metainterpretive learning, in: Proceedings of the Twenty-Ninth International Joint Conference
on Artificial Intelligence, (IJCAI), International Joint Conferences on Artificial Intelligence
Organization, 2020, pp. 2312–2318.
[20] S. Kok, P. M. Domingos, Statistical predicate invention, in: International Conference on</p>
      <p>Machine Learning (ICML), 2007.
[21] S. Kramer, Predicate invention : A comprehensive view 1, 2007.
[22] A. Cropper, R. Morel, S. H. Muggleton, Learning higher-order programs through predicate
invention, Proceedings of the AAAI Conference on Artificial Intelligence (AAAI) (2020)
13655–13658.
[23] A. Cropper, R. Morel, Predicate invention by learning from failures, arXiv</p>
      <p>Preprint:2104.14426 (2021).
[24] T. KAMINSKI, T. EITER, K. INOUE, Exploiting answer set programming with external
sources for meta-interpretive learning, Theory and Practice of Logic Programming 18
(2018) 571–588. doi:10.1017/S1471068418000261.</p>
      <p>?.
?1
?/
??*
!"#$%
?0
?+
?,
!"#$%&amp;!#$'(#)</p>
    </sec>
    <sec id="sec-5">
      <title>A. Experiment Setting.</title>
      <sec id="sec-5-1">
        <title>A.1. Spatial Neural Predicates</title>
        <p>To represent the spatial relationships between two objects, we have developed two types
of spatial neural predicates, i.e., rho(O1, O2,  ) and phi(O1, O2, ), which are given as basic
knowledge. They are used for new predicates invention in some patterns associated with spatial
concepts.
ℎ(1, 2,  ) The neural predicate rho(O1, O2,  ) describes the distance between object 1
and 2, where  is the measure. Let  denotes the length of image diagonal. Obviously,  is
the maximum possible distance between 1 and 2. To symbolize the distance between 1
and 2, we divide  into  parts and denote each part by  , 1 ≤  ≤  (as shown in Fig. 5
right). For example, if  = 4, then  1 = 0.25,  2 = 0.5,  3 = 0.75,  4 = 1.0 . The
actual distance between two objects can be symbolized by  1,  2,  3 or  4.
ℎ(1, 2, ) The predicate ℎ(1, 2, ) describes the direction of 2 with respect to
1. Based on the polar coordinate system, we consider the first argument 1 as the original
point, then the direction of 2 is in the range [0, 360). We symbolize all directions with
1, ...,  , where  is a hyper-parameter. The actual direction can be classified to one of these
symbols (as shown in Fig. 5).</p>
      </sec>
      <sec id="sec-5-2">
        <title>A.2. Visual Patterns</title>
      </sec>
      <sec id="sec-5-3">
        <title>A.3. Invented Predicates</title>
        <p>(e) True
(f) True
(g) False
(e) True
(f) True
(g) False
(h) False
(i) True
(j) True
(k) False
(l) False
(m) True
(n) True
(o) False
(p) False
(three same)
kp(X):-in(O1,X),in(O2,X),in(O3,X),inv_pred100(O1,O2,O3),inv_pred451(O1,O2,O3).
inv_pred451(O1,O2,O3):-in(O1,X),in(O2,X),in(O3,X),inv_pred2(O1,O2),
inv_pred2(O1,O3),inv_pred2(O2,O3).
inv_pred100(O1,O2,O3):-in(O1,X),in(O2,X),in(O3,X),shape(O1,cube),
shape(O2,cube),shape(O3,cube).
inv_pred100(O1,O2,O3):-in(O1,X),in(O2,X),in(O3,X),shape(O1,sphere),
shape(O2,sphere),shape(O3,sphere).
inv_pred2(O1,O2):-color(O1,blue),color(O2,blue),in(O1,X),in(O2,X).
inv_pred2(O1,O2):-color(O1,green),color(O2,green),in(O1,X),in(O2,X).
inv_pred2(O1,O2):-color(O1,pink),color(O2,pink),in(O1,X),in(O2,X).
(shape in shape)
kp(X):-in(O1,X),in(O2,X),in(O3,X),in(O4,X),inv_pred7(O1,O2,O3,O4),
phi(O2,O4,phi2),rho(O1,O4,rho1).
inv_pred7(O1,O2,O3,O4):-in(O1,X),in(O2,X),in(O3,X),in(O4,X),inv_pred1(O1,O2,O3),
phi(O1,O4,phi3).
inv_pred7(O1,O2,O3,O4):-in(O1,X),in(O2,X),in(O3,X),in(O4,X),inv_pred1(O1,O2,O3),
shape(O1,sphere).
inv_pred1(O1,O2,O3):-in(O1,X),in(O2,X),in(O3,X),rho(O2,O3,rho0).
inv_pred1(O1,O2,O3):-in(O1,X),in(O2,X),in(O3,X),shape(O1,cube).
(check mark)
kp(X):-in(O1,X),in(O2,X),in(O3,X),in(O4,X),in(O5,X),inv_pred3(O2,O3,O4,O5),
rho(O2,O5,rho0),rho(O3,O4,rho1).
inv_pred3(O1,O2,O3,O5):-in(O1,X),in(O2,X),in(O3,X),in(O5,X),phi(O1,O2,phi2),
phi(O2,O5,phi1).
inv_pred3(O1,O2,O3,O5):-in(O1,X),in(O2,X),in(O3,X),in(O5,X),phi(O2,O5,phi1),
phi(O3,O5,phi4).</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>S. H.</given-names>
            <surname>Muggleton</surname>
          </string-name>
          ,
          <article-title>Inductive logic programming</article-title>
          ,
          <source>New Gener. Comput</source>
          .
          <volume>8</volume>
          (
          <year>1991</year>
          )
          <fpage>295</fpage>
          -
          <lpage>318</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>S</given-names>
            <surname>.-H.</surname>
          </string-name>
          Nienhuys-Cheng, R. d. Wolf,
          <string-name>
            <given-names>J.</given-names>
            <surname>Siekmann</surname>
          </string-name>
          , J. G. Carbonell,
          <source>Foundations of Inductive Logic Programming</source>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cropper</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Dumancic</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Evans</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. H.</given-names>
            <surname>Muggleton</surname>
          </string-name>
          ,
          <article-title>Inductive logic programming at 30, Mach</article-title>
          . Learn.
          <volume>111</volume>
          (
          <year>2022</year>
          )
          <fpage>147</fpage>
          -
          <lpage>172</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>S.</given-names>
            <surname>Muggleton</surname>
          </string-name>
          ,
          <string-name>
            <given-names>W. L.</given-names>
            <surname>Buntine</surname>
          </string-name>
          ,
          <article-title>Machine invention of first order predicates by inverting resolution</article-title>
          ,
          <source>in: Proceedings of the Fifth International Conference on Machine Learning</source>
          , ML'
          <fpage>88</fpage>
          , Morgan Kaufmann Publishers Inc., San Francisco, CA, USA,
          <year>1988</year>
          , p.
          <fpage>339</fpage>
          -
          <lpage>352</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Evans</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Grefenstette</surname>
          </string-name>
          ,
          <article-title>Learning explanatory rules from noisy data</article-title>
          ,
          <source>J. Artif. Intell. Res</source>
          .
          <volume>61</volume>
          (
          <year>2018</year>
          )
          <fpage>1</fpage>
          -
          <lpage>64</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>H.</given-names>
            <surname>Shindo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Pfanschilling</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D. S.</given-names>
            <surname>Dhami</surname>
          </string-name>
          , K. Kersting,
          <article-title>ilp: thinking visual scenes as diferentiable logic programs</article-title>
          ,
          <source>Mach. Learn</source>
          . (
          <year>2023</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>J.</given-names>
            <surname>Mao</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Gan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Kohli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. B.</given-names>
            <surname>Tenenbaum</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. Wu,</surname>
          </string-name>
          <article-title>The neuro-symbolic concept learner: Interpreting scenes, words, and sentences from natural supervision</article-title>
          ,
          <source>in: International Conference on Learning Representations (ICLR)</source>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>A.</given-names>
            <surname>Vaswani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Shazeer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Parmar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Uszkoreit</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Jones</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. N.</given-names>
            <surname>Gomez</surname>
          </string-name>
          , Ł. Kaiser,
          <string-name>
            <surname>I. Polosukhin</surname>
          </string-name>
          ,
          <article-title>Attention is all you need</article-title>
          ,
          <source>Advances in neural information processing systems (NeurIPS) 30</source>
          (
          <year>2017</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>J.</given-names>
            <surname>Johnson</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Hariharan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. Van Der</given-names>
            <surname>Maaten</surname>
          </string-name>
          , L.
          <string-name>
            <surname>Fei-Fei</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <string-name>
            <surname>Lawrence Zitnick</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Girshick</surname>
          </string-name>
          ,
          <article-title>Clevr: A diagnostic dataset for compositional language and elementary visual reasoning</article-title>
          ,
          <source>in: Proceedings of the IEEE conference on computer vision and pattern recognition (CVPR)</source>
          ,
          <year>2017</year>
          , pp.
          <fpage>2901</fpage>
          -
          <lpage>2910</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>S.</given-names>
            <surname>Muggleton</surname>
          </string-name>
          , Inverse Entailment and Progol, New Generation Computing,
          <source>Special issue on Inductive Logic Programming</source>
          <volume>13</volume>
          (
          <year>1995</year>
          )
          <fpage>245</fpage>
          -
          <lpage>286</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Quinlan</surname>
          </string-name>
          ,
          <article-title>Learning logical definitions from relations</article-title>
          ,
          <source>Mach. Learn</source>
          .
          <volume>5</volume>
          (
          <year>1990</year>
          )
          <fpage>239</fpage>
          -
          <lpage>266</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>M.</given-names>
            <surname>Law</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Russo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Broda</surname>
          </string-name>
          ,
          <article-title>Inductive learning of answer set programs</article-title>
          , in: E. Fermé, J. Leite (Eds.),
          <source>Logics in Artificial Intelligence - 14th European Conference (JELIA)</source>
          , volume
          <volume>8761</volume>
          of Lecture Notes in Computer Science,
          <year>2014</year>
          , pp.
          <fpage>311</fpage>
          -
          <lpage>325</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>