SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2301.02195 · 2023

Towards Autoformalization of Mathematics and Code Correctness: Experiments with Elementary Proofs

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 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; 0 honoured the contract we drafted, 1 violated it and 4 have no contract verdict; 0 failures of our instrument; 2 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/2301.02195.json · badge: /api/ran/2301.02195.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
gc974517/autoformalization canonical (classifier label)
classifier basis not recorded on the link
5 ran · 2 no recorded run
FunctionStatusWhere it lives
clones Ran
ran on a synthesized input
gc974517/autoformalization/src/util.py
code served (permissive licence) · get_code("7f420205df3056db")
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 ModuleList. 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
import copy

torch.manual_seed(0)

# Create a simple module to clone
class SimpleModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

module = SimpleModule()

ARGS = {
    "module": module,
    "N": 2,
    "T": 1
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList output the recorded ndim 1 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
get_input_seq Ran
ran on a synthesized input
gc974517/autoformalization/src/load.py
code served (permissive licence) · get_code("83056f957e8c7913")
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

# Define ARGS for get_input_seq
# The function expects a list of sentences, where each sentence is an iterable of tokens
sentences = [
    ['hello', 'world', 'foo'],
    ['bar', 'baz', 'hello']
]

ARGS = {
    'sentences': sentences
}
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
get_vocabulary Ran
ran on a synthesized input
gc974517/autoformalization/src/load.py
code served (permissive licence) · get_code("a4fbab6684b34cac")
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 re

# Analyze the function: get_vocabulary takes two parameters
# lsent: list of examples (each example is an iterable of tokens)
# csent: list of examples (each example is an iterable of tokens)
# The function iterates through tokens in each example and counts them
# It applies regex matching and lowercasing to normalize tokens

# Create sample data with tokens that match the regex patterns
lsent = [
    ['<nat:1>', '<var:x>', '<def:foo>', 'hello', 'world'],
    ['<nat:2>', 'test', '<var:y>', 'UPPER'],
]

csent = [
    ['<nat:3>', '<var:a>', '<def:bar>', '<genH:something>', 'coq_token'],
    ['<nat:4>', '<var:b>', 'another'],
]

ARGS = {
    'lsent': lsent,
    'csent': csent,
}
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 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
load_directory Ran
ran on a synthesized input
gc974517/autoformalization/src/load.py
code served (permissive licence) · get_code("8c39a7140a3518d5")
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 tempfile
import os

# Create temporary directory with test files
tmpdir = tempfile.mkdtemp()

# Create test files for subset 0
test_file_0 = os.path.join(tmpdir, "test0.txt")
with open(test_file_0, 'w') as f:
    f.write("token1 token2 token3 ~ token4 token5 token6")

# Create test files for subset 1
test_file_1 = os.path.join(tmpdir, "test1.txt")
with open(test_file_1, 'w') as f:
    f.write("token1 token2 \\begin{proof} token3 ~ token4 Proof token5 token6")

# Create test files for subset 2
test_file_2 = os.path.join(tmpdir, "test2.txt")
with open(test_file_2, 'w') as f:
    f.write("token1 \\begin{proof} token2 token3 ~ token4 Proof token5 token6")

ARGS = {
    "directory": os.path.join(tmpdir, "*.txt"),
    "subset": 0
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — 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
subsequent_mask Ran
ran, violated the contract we drafted
gc974517/autoformalization/src/util.py
code served (permissive licence) · get_code("79e53d4ea458987d")
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 3, dtype family float, shape (1, 4, 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 numpy as np
import torch

torch.manual_seed(0)

# The function takes a single parameter 'size' which is used to create
# a numpy array of shape (1, size, size) and then converted to a torch tensor.
# We need to provide a small integer value for size.

size = 4

ARGS = {
    "size": size
}
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 Tensor, ndim 3, dtype family float, shape (1, 4, 4) — shape (1, 4, 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
make_model Not yet run
unverified (harvested, no recorded run)
gc974517/autoformalization/src/model.py
code served (permissive licence) · get_code("18c6a1df97636c4d")
How it ran

no invocation recorded.

process_minibatch Not yet run
unverified (harvested, no recorded run)
gc974517/autoformalization/src/util.py
code served (permissive licence) · get_code("fdadf595d617e2c3")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
subsequent_mask 21 other papers
14 dated earlier, 7 later
1411.4555 (2014-11)
Show and Tell: A Neural Image Caption Generator
1612.00563 (2016-12)
Self-critical Sequence Training for Image Captioning
1707.07998 (2017-07)
Bottom-Up and Top-Down Attention for Image Captioning and Visual Question Answering
and 18 more not named here

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 ever-growing complexity of mathematical proofs makes their manual verification by mathematicians very cognitively demanding. Autoformalization seeks to address this by translating proofs written in natural language into a formal representation that is computer-verifiable via interactive theorem provers. In this paper, we introduce a semantic parsing approach, based on the Universal Transformer architecture, that translates elementary mathematical proofs into an equivalent formalization in the language of the Coq interactive theorem prover. The same architecture is also trained to translate simple imperative code decorated with Hoare triples into formally verifiable proofs of correctness in Coq. Experiments on a limited domain of artificial and human-written proofs show that the models generalize well to intermediate lengths not seen during training and variations in natural language.

For agents

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

get_harvested_code_for_paper("2301.02195")
get_code_for_paper("2301.02195")
have("2301.02195")

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

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

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

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

Connect an agent — have() is free.