SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.12149 · 2019

SATNet: Bridging deep learning and logical reasoning using a differentiable satisfiability solver

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 2 failures of our instrument; 1 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/1905.12149.json · badge: /api/ran/1905.12149.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
locuslab/SATNet canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
FunctionStatusWhere it lives
computeErr Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
locuslab/SATNet/exps/sudoku.py
code served (permissive licence) · get_code("979489d150ea11b0")
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 int, ndim 0, dtype family int, 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.

import torch
import numpy as np

torch.manual_seed(0)

# The function expects:
# - pred_flat: a tensor of shape (batch_size, ?, n^2*n^2) that will be viewed as (batch_size, n^2, n^2, n^2)
# - n: an integer representing the sudoku grid size
# - unperm: either None or a permutation indices tensor

# For a valid sudoku of size n=2, we have nsq=4
# pred_flat needs to be reshapeable to (-1, 4, 4, 4)
# So pred_flat should have shape (batch_size, 16) or we need to think about the middle dimension

# Looking at the code: pred_flat[:, :] = pred_flat[:, unperm] suggests pred_flat has shape (batch, something)
# Then pred_flat.view(-1, nsq, nsq, nsq) reshapes it to (batch, 4, 4, 4)
# So pred_flat should have shape (batch, 16) where 16 = 4*4*4 / some factor
# Actually, looking more carefully: if we view (batch, X) as (batch, 4, 4, 4), then X = 64

# Let's use n=2, so nsq=4, and pred_flat has shape (batch_size, 64)
n = 2
nsq = n ** 2  # 4
batch_size = 2

# Create pred_flat with shape (batch_size, nsq*nsq*nsq) = (2, 64)
# Fill with valid sudoku-like values (0 to nsq-1)
pred_flat = torch.randint(0, nsq, (batch_size, nsq * nsq * nsq), dtype=torch.float32)

# unperm can be None or a permutation of indices
# If not None, it should be indices to permute the columns
unperm = None
# Alternatively, we could test with a permutation:
# unperm = torch.tensor([1, 0, 2, 3, 5, 4, 6, 7, 9, 8, 10, 11, 12, 13, 14, 15, ...])
# But None is simpler and valid

ARGS = {
    "pred_flat": pred_flat,
    "n": n,
    "unperm": unperm
}
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 int, ndim 0, dtype family int, 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
computeErr Ran
ran, honoured the contract we drafted
locuslab/SATNet/exps/parity.py
code served (permissive licence) · get_code("83f53a6a79c8de4c")
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 float, 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.

import torch

torch.manual_seed(0)

# The function expects:
# - pred: tensor with shape (batch_size, ..., last_dim) where it accesses [:, -1]
# - target: tensor with shape (batch_size, ..., last_dim) where it accesses [:, -1]
# Both tensors need to support indexing and arithmetic operations

# Create small tensors with batch_size=2 and last dimension=4
# pred and target should have compatible shapes for the operations
pred = torch.randn(2, 4)
target = torch.randn(2, 4)

ARGS = {
    "pred": pred,
    "target": target
}
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 float, 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
find_unperm Ran
ran, violated the contract we drafted
locuslab/SATNet/exps/sudoku.py
code served (permissive licence) · get_code("ea38eb60359ba548")
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 Tensor, ndim 1, dtype family int, shape (4,) 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.

import torch

torch.manual_seed(0)

# Construct a permutation tensor
# The function expects a 1D tensor of indices that represents a permutation
# For example, perm = [2, 0, 1] means position 0 -> 2, position 1 -> 0, position 2 -> 1
perm = torch.tensor([2, 0, 3, 1], dtype=torch.long)

ARGS = {
    "perm": perm
}
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 Tensor, ndim 1, dtype family int, shape (4,) — shape (4,) 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
process_inputs Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
locuslab/SATNet/exps/sudoku.py
code served (permissive licence) · get_code("95f02588dfc909d3")
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
import torch.nn as nn

torch.manual_seed(0)

# Analyze function usage:
# - X: tensor with .sum(dim=3, keepdim=True), .expand_as(), .int(), .sign(), .view()
#   Operations suggest X is 4D: (batch, height, width, channels)
# - Ximg: tensor with .flatten(start_dim=1, end_dim=2), .unsqueeze(2), .float()
#   Operations suggest Ximg is 3D: (batch, height, width)
# - Y: tensor with .view()
#   Operations suggest Y is 2D: (batch, features)
# - boardSz: integer parameter used for sizing

# Create minimal tensors with distinct dimensions:
batch_size = 2
board_h = 4
board_w = 3
channels = 5
y_dim = 6

# X: (batch, height, width, channels) = (2, 4, 3, 5)
X = torch.randn(batch_size, board_h, board_w, channels)

# Ximg: (batch, height, width) = (2, 4, 3)
Ximg = torch.randn(batch_size, board_h, board_w)

# Y: (batch, y_dim) = (2, 6)
Y = torch.randn(batch_size, y_dim)

# boardSz: integer parameter
boardSz = 8

ARGS = {
    "X": X,
    "Ximg": Ximg,
    "Y": Y,
    "boardSz": boardSz
}
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
apply_seq Not yet run
unverified (harvested, no recorded run)
locuslab/SATNet/exps/parity.py
code served (permissive licence) · get_code("b65c4afca5a45ef2")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 3 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.

FunctionAlso present inEarliest-datedOthers named
apply_seq 1 other paper
1 later
2106.11072 (2021-06)
Techniques for Symbol Grounding with SATNet
computeErr 1 other paper
1 later
2106.11072 (2021-06)
Techniques for Symbol Grounding with SATNet

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

Integrating logical reasoning within deep learning architectures has been a major goal of modern AI systems. In this paper, we propose a new direction toward this goal by introducing a differentiable (smoothed) maximum satisfiability (MAXSAT) solver that can be integrated into the loop of larger deep learning systems. Our (approximate) solver is based upon a fast coordinate descent approach to solving the semidefinite program (SDP) associated with the MAXSAT problem. We show how to analytically differentiate through the solution to this SDP and efficiently solve the associated backward pass. We demonstrate that by integrating this solver into end-to-end learning systems, we can learn the logical structure of challenging problems in a minimally supervised fashion. In particular, we show that we can learn the parity function using single-bit supervision (a traditionally hard task for deep networks) and learn how to play 9x9 Sudoku solely from examples. We also solve a "visual Sudok" problem that maps images of Sudoku puzzles to their associated logical solutions by combining our MAXSAT solver with a traditional convolutional architecture. Our approach thus shows promise in integrating logical structures within deep learning.

For agents

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

get_harvested_code_for_paper("1905.12149")
get_code_for_paper("1905.12149")
have("1905.12149")

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

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

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

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

Connect an agent — have() is free.