Skip to content

Dataset card — agda-algebras corpus v0.1

An agda-strux JSONL corpus of the whole of ualib/agda-algebras: one row per definition, carrying the definition's normalized name, its pretty-printed type, a structural encoding of that type, its dependency tokens, and its proof term where it has one.

v0.1 is a re-cut of v0 at a newer library commit; the schema, the pipeline, and the reading of every statistic are unchanged. The re-pin exists for one reason: the benchmark tier of issue #127 is mined from this corpus, and its provenance commitment is that the benchmark's library commit and the corpus's library commit are the same; the tier PR (#132) records that commit in data/benchmarks/README.md and pins it as the agda-algebras-src flake input. v0.1 was first cut at a5f9acb5 (2026-08-31); before it was published, the library's FLRP program landed its Kurzweil-surjectivity theorem (ualib/agda-algebras#569) and a follow-up tidy on master, and the corpus moved with it so that work is retrievable. This card describes the final cut, at 4662373d.

  • Corpus: corpus.jsonl is 13,123 rows, 224,646,301 bytes; corpus.jsonl.gz is 5,709,185 bytes.
  • Row schema: agda-strux Full JSONL, docs/representation.md §3; typeAstVersion 0.3-v0 on every row.
  • Companion artifacts: coverage.json (per-module outcomes), provenance.json (commits, pins, digests), stats.json and stats.md (the statistics quoted below).

Provenance

Everything in this section is recorded machine-readably in provenance.json; the values below are that record in prose.

What Value
Source library ualib/agda-algebras, git@github.com:ualib/agda-algebras.git
Library commit 4662373d281daf0f20a6319f1a46755a45d33293 (2026-09-07), working tree clean
Source tree read src/ (the library's include: directory)
Producer formalverification/agda-native-air at ba9272a7fdda4002bdc2e0f9d3eec88865965f9c (the PR #131 branch), working tree clean; struxdriver.extract.AgdaJsonlDriver → agda-strux's agda-json
Agda 2.8.0
Agda standard library 2.3, /nix/store/pkks1pz1n2bci0pva1sxbydnc4xyliid-standard-library-2.3
GHC 9.10.3
Toolchain pin flake.lock: nixpkgs-agda at 9dcb002ca1690658be4a04645215baea8b95f31d, nixpkgs at b6018f87da91d19d0ab4cf979885689b469cdd41
Extraction run 409 modules, --runner spark (no fallback), parallelism 20, no resume; 6 m 26 s wall, 7,998 s of module time
Corpus SHA-256 af8644328352d95cb2887dd553e4f23c0d1b807c1dcd1f6274aa4f8150e7ed35
Gzip SHA-256 a56785dc67df0e2a165a0cc3654c27e2357b98b26651c2d59bc3b7634d4fa1e2

The digests were confirmed byte-identical across two independent extraction runs and three assembly runs over them. The v0 card's notes on when values are recorded apply verbatim: the library commit, its dirty state, and the runner come from the extraction manifest; commitMatchesCheckout was true at packaging; the toolchain block is sampled at packaging time.

Coverage

The library has 407 committed source modules; its two Everything* barrels are generated by the library's own Makefile and git-ignored upstream, and were present in the extraction checkout, so the module scan enumerated 409. All 409 were extracted and all 409 succeeded (the generated barrels contribute 0 rows). Nothing is excluded.

Quantity Value
Modules under src/ (407 committed + 2 generated Everything* barrels) 409
Modules requested / attempted / succeeded 409 / 409 / 409
Failed / never attempted 0 / 0
Modules contributing 0 rows 63

The 63 zero-row modules are barrels (Classical, Overture, Everything, EverythingLegacy and kin): import lines only, so nothing of their own to extract. coverage.json records all 409 outcomes individually.

Statistics

Full tables, including the twenty most-depended-upon definitions and the module-level import graph, are in stats.md; the same numbers are in stats.json.

Quantity Value
Definitions (rows) 13,123
Distinct prettyQname 11,865
Distinct prettyModule 779
Top-level namespaces 8
Definitions carrying a proof term 12,027

By kind. 12,161 functions, 649 constructors, 184 records, 126 data types, 3 other.

By namespace. FLRP 4,283; Classical 3,095; Setoid 2,530; Legacy 1,856; Examples 1,043; Overture 237; Order 54; Exercises 25. Relative to the first v0.1 cut at a5f9acb5 the growth is concentrated in Classical (+479) and FLRP (+256) (the Kurzweil-surjectivity theorem and its group-theoretic prerequisites).

Sizes. Types have a median length of 422 characters and a p99 of 3,218 (max 109,095). Proof terms have a median of 126 characters and a p99 of 31,724, with a maximum of 11,557,651, the same machine-generated certificate row as before (see Known gaps). A definition takes a median of 7 top-level Π binders before its codomain, and at most 36.

Dependency shape. At definition level the graph is keyed by prettyQname: 11,865 nodes, into which the 13,123 rows collapse (1,258 rows share a name with another and are merged). 53,687 of the dependency tokens name a definition in this corpus; the other 78,068 occurrences resolve to nothing here and are reported as unresolved tokens, of which 41,702 at least have the shape of a qualified name, which is a lower bound on the real outward edges, dominated by Agda.Primitive.Level (6,985) and the standard library's Data.Fin.Base.Fin (2,928). The most depended-upon definition is Overture.Signatures.Signature with 3,735 references.

At module level, Agda's dependency graph over 672 modules (local plus external) is acyclic, with 1,315 edges and a longest chain of 80. The v0 caveat stands: that DOT is a load-order graph, not the import relation; use the definition-level graph for anything that has to be complete.

Intended uses

The same four as v0,

  • retrieval for proof assistance,
  • training and evaluation data,
  • measuring a library,
  • schema regression

plus the one this cut exists for,

  • Benchmark curation (issue #127). The agda-algebras tier of data/benchmarks/ (added by the tier PR #132) is mined from this corpus's rows (scripts/python/corpus/mine_benchmark_candidates.py, committed there) and its fixtures are cut from the same library commit, so "the benchmark's library" and "the corpus's library" cannot drift apart silently.

It is not a benchmark: no held-out split, no difficulty labels; see data/benchmarks/.

Known gaps

All eight v0 gaps carry over unchanged in kind; the numbers that moved are as follows:

  • 1,258 rows are shadowed under prettyQname (733 qualified names occur more than once; worst Classical.Structures.Ring.absurdlambda, 28 times). A consumer keyed by prettyQname indexes 11,865 of the 13,123 rows. Use qname when identity matters. Tracked by issue #144.
  • Twelve rows are over a megabyte each, and the largest ten are 25.9 % of the corpus by bytes; these are machine-generated certificate and table rows in FLRP and Examples; the biggest is still 11.5 MB. Filter on body length (or serialized row length) before budgeting per row; astSize is the pretty-printed type's length and bounds nothing about the body.
  • Dependency tokens remain heuristic; the module DOT remains load-order; ports, refsFromBody, and wires remain unemitted, so body-level dependency edges are still absent and the graph statistics are type-level only (issue #15); types remain internal-printer strings; --safe/--cubical-compatible regimes remain unrecorded; one library, one commit.

License and attribution

Identical to v0: the corpus and its stats inherit the library's Apache-2.0 (Copyright 2025-2026 William DeMeo and Contributors); this card is CC-BY-4.0. Cite:

The Agda Universal Algebra Library (ualib/agda-algebras), commit 4662373d281daf0f20a6319f1a46755a45d33293, Apache-2.0.

Reproducing it

From an agda-native-air checkout at the producer commit, outside any Nix shell, with ~/git/ualib/agda-algebras/master checked out at the library commit above:

make extract-lib-nix AGDA_ALGEBRAS_ROOT=~/git/ualib/agda-algebras/master RESUME=0
make corpus-nix CORPUS_VERSION=v0.1

Artifacts land under data/corpora/agda-algebras/v0.1/. Byte-identical output is expected for the same library commit and toolchain (sorted concatenation, gzip with no filename and mtime=0); compare against the digests above. The generated Everything* barrels may or may not be present in the checkout; they contribute no rows, so corpus.jsonl and its digests are unaffected; only coverage.json's module count varies with them. Expect six to seven minutes of wall time with warm .agdai interfaces.

The toolchain has moved since. The producer commit pins Agda 2.8.0; since #234 the repository pins Agda 2.9.0, and agda-json links 2.9.0's library, so reproducing these bytes needs the producer commit's flake. An extraction at a later commit differs, as follows, measured on 29 modules of this library commit (every fourteenth of the module list):

  • 2.8.0 wrote 962 rows and 2.9.0 wrote 954, of which 944 share a qname;
  • the printed type agrees for 938 rows and bodyRefs for 943;
  • typeAst agrees for 426 only, because it carries strings of Agda's internal terms that 2.9.0 prints differently (a function type's sort, FunSort under 2.8.0, is PiSort; a variable, Var, is Var'); without those strings it agrees for 900.

Using it with agda-mcp

As for v0: gunzip -k corpus.jsonl.gz && agda-mcp --corpus corpus.jsonl [flags] registers search_by_name, search_by_type, and get_dependencies; make corpus-mcp-smoke CORPUS_VERSION=v0.1 drives them over the real JSON-RPC transport.