SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.01719 · AAAI · 2021

Differentiable Inductive Logic Programming for Structured Examples

Hikaru Shindo, Masaaki Nishino, Akihiro Yamamoto

arXiv · PDF · Open in the Atlas

Code that ran

9 of 23 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 5 have no contract verdict; 2 failures of our instrument; 14 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2103.01719.json · badge: /api/ran/2103.01719.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
hkrsnd/dilp-st marked official in Papers with Code
Papers with Code archive
9 ran · 14 no recorded run
FunctionStatusWhere it lives
Atom Ran
ran on a synthesized input · constructed an object; no result was computed
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("acd256902db3d7da")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Atom: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

# Create minimal Term class for testing
class Term:
    def __init__(self, name, is_var=False):
        self.name = name
        self.is_var = is_var
    
    def __str__(self):
        return self.name
    
    def __repr__(self):
        return self.name
    
    def __eq__(self, other):
        return self.name == other.name and self.is_var == other.is_var
    
    def subs(self, target_var, const):
        if self.is_var and self.name == target_var.name:
            return Term(const.name, is_var=False)
        return self
    
    def all_vars(self):
        return [self] if self.is_var else []
    
    def all_consts(self):
        return [] if self.is_var else [self]
    
    def all_funcs(self):
        return []
    
    def max_depth(self):
        return 1
    
    def min_depth(self):
        return 1
    
    def size(self):
        return 1


# Create minimal Predicate class for testing
class Predicate:
    def __init__(self, name, arity):
        self.name = name
        self.arity = arity
    
    def __eq__(self, other):
        return self.name == other.name and self.arity == other.arity
    
    def __hash__(self):
        return hash((self.name, self.arity))


# Create test instances
pred = Predicate("loves", 2)
term1 = Term("alice", is_var=False)
term2 = Term("bob", is_var=False)
terms = [term1, term2]

ARGS = {
    "pred": pred,
    "terms": terms
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Atom — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Atom output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Const Ran
ran on a synthesized input · constructed an object; no result was computed
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("79758a0df2fbb970")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Const: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Const.__init__ takes a single parameter: name (str)
ARGS = {
    "name": "constant_example"
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Const — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Const output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Predicate Ran
ran on a synthesized input · constructed an object; no result was computed
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("8e94a3fefda05ceb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Predicate: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

class Predicate:
    """
    predicate symbol

    Parameters
    ----------
    name : str
        name of the predicate
    arity : int
        arity of the predicate (number of args)
    """

    def __init__(self, name, arity):
        self.name = name
        self.arity = arity

    def __str__(self):
        return self.name

    def __expr__(self):
        return self.name

    def __eq__(self, other):
        if type(other) == Predicate:
            return self.name == other.name
        else:
            return False


ARGS = {
    "name": "parent",
    "arity": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Predicate — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Predicate output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Term Ran
ran on a synthesized input · constructed an object; no result was computed
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("00a5b4ee11ed489c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Term: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

class Term:
    """
    terms: variables, constants, or terms with function symbols
    """

    def __init__(self):
        self.name = 'void'

    def __eq__(self, other):
        return self == other

ARGS = {}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Term — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Term output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Var Ran
ran on a synthesized input
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("db81a46d2b6706f8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# INIT_ARGS for Var.__init__
INIT_ARGS = {
    'name': 'x'
}

# The main computation methods to test are the various methods of Var
# We'll test __repr__ as the primary method since it's a simple computation method
METHOD = '__repr__'

ARGS = {
    'level': 0
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
flatten Ran
ran; our contract draft was wrong, not the code
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("1a922e4a8a94dba9")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function `flatten` takes a single parameter `x` which should be an iterable
# (but not a string) containing potentially nested iterables that need to be flattened
# into a single list of non-iterable elements.

# Test with a nested list structure containing various types
x = [
    1,
    [2, 3],
    [[4, 5], 6],
    "hello",  # strings are not iterated over
    [7, [8, 9]],
    (10, 11),  # tuples are iterable
    np.array([12, 13]),  # numpy arrays are iterable
]

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_disagree_index Ran
ran, honoured the contract we drafted
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("88d01be925b6598e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

# Create minimal Term-like classes that support the required interface
class Term:
    def __init__(self, symbols):
        self.symbols = symbols
    
    def to_list(self):
        return self.symbols

# Create test terms with different symbol lists
term1 = Term(['a', 'b', 'c'])
term2 = Term(['a', 'b', 'c'])
term3 = Term(['a', 'x', 'c'])

# Create disagreement case - these terms differ at index 1
disagreeing_terms = [term1, term3]

# Create non-disagreement case - all terms are identical
identical_terms = [term1, term2]

ARGS = {
    'terms': disagreeing_terms
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family int — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_disagreements Ran
ran; our contract draft was wrong, not the code
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("1307503a0ca46e08")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

class Term:
    """Stand-in Term class with required methods"""
    def __init__(self, symbol_list, ith_terms=None):
        self.symbol_list = symbol_list
        self.ith_terms = ith_terms or []
    
    def to_list(self):
        """Return list representation of term"""
        return self.symbol_list
    
    def get_ith_term(self, i):
        """Get the i-th term from this term's arguments"""
        if i < len(self.ith_terms):
            return self.ith_terms[i]
        return Term([f"arg_{i}"])


# Create test terms for unification
# Term 1: f(a, b, c)
term1_args = [Term(["a"]), Term(["b"]), Term(["c"])]
term1 = Term(["f", "a", "b", "c"], term1_args)

# Term 2: f(a, b, c) - same as term1
term2_args = [Term(["a"]), Term(["b"]), Term(["c"])]
term2 = Term(["f", "a", "b", "c"], term2_args)

# Term 3: f(a, x, c) - disagrees at index 1
term3_args = [Term(["a"]), Term(["x"]), Term(["c"])]
term3 = Term(["f", "a", "x", "c"], term3_args)

# Create list of terms that will have disagreement
terms = [term1, term2, term3]

ARGS = {
    "terms": terms
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
is_singleton Ran
ran, violated the contract we drafted
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("74560ac0380fb5b5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

class Atom:
    def __init__(self, value):
        self.value = value
    
    def __eq__(self, other):
        if not isinstance(other, Atom):
            return False
        return self.value == other.value


# Test case 1: all atoms are the same
atom1 = Atom("p")
atom2 = Atom("p")
atom3 = Atom("p")

ARGS = {
    "atoms": [atom1, atom2, atom3]
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
Clause Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("3613026564e05b5e")
How it ran

no invocation recorded.

ClauseGenerator Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("190a226af393125b")
How it ran

no invocation recorded.

FuncTerm Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("d817dcd7835646fc")
How it ran

no invocation recorded.

InferModule Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("ab2f061a519c64f0")
How it ran

no invocation recorded.

RefinementGenerator Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("fda81194aa3906d6")
How it ran

no invocation recorded.

convert Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("ece9dfa2bd12d452")
How it ran

no invocation recorded.

find_subs_term Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("e28c5695ccf75788")
How it ran

no invocation recorded.

is_entailed Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("dc2069a3e3e2350f")
How it ran

no invocation recorded.

occur_check Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("8434df103dd0829e")
How it ran

no invocation recorded.

subs Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("13939b1b9513f421")
How it ran

no invocation recorded.

subs_list Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("8d19b6fe8156a952")
How it ran

no invocation recorded.

t_p Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("a48cee9bec30434c")
How it ran

no invocation recorded.

t_p_n Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("552c5aa6d7f3973d")
How it ran

no invocation recorded.

unify Not yet run
unverified (harvested, no recorded run)
hkrsnd/dilp-st/src/clause_generator.py
code served (permissive licence) · get_code("221082e2e2fad2e6")
How it ran

no invocation recorded.

Also present in other papers' code

Of 23 samples lifted from this paper's linked repositories, 23 carry a function identity and 0 do not. Of the 23 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 23 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

The differentiable implementation of logic yields a seamless combination of symbolic reasoning and deep neural networks. Recent research, which has developed a differentiable framework to learn logic programs from examples, can even acquire reasonable solutions from noisy datasets. However, this framework severely limits expressions for solutions, e.g., no function symbols are allowed, and the shapes of clauses are fixed. As a result, the framework cannot deal with structured examples. Therefore we propose a new framework to learn logic programs from noisy and structured examples, including the following contributions. First, we propose an adaptive clause search method by looking through structured space, which is defined by the generality of the clauses, to yield an efficient search space for differentiable solvers. Second, we propose for ground atoms an enumeration algorithm, which determines a necessary and sufficient set of ground atoms to perform differentiable inference functions. Finally, we propose a new method to compose logic programs softly, enabling the system to deal with complex programs consisting of several clauses. Our experiments show that our new framework can learn logic programs from noisy and structured examples, such as sequences or trees. Our framework can be scaled to deal with complex programs that consist of several clauses with function symbols.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2103.01719")
get_code_for_paper("2103.01719")
have("2103.01719")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2103.01719.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2103.01719.svg)](https://syntology.ai/paper/2103.01719)

Connect an agent — have() is free.