← All reference docs

Arbitrary-precision integers (substrate change)

Status: committed direction (2026-07). Closes the "valid modulo overflow" caveat that sat on every proof. No back-compat: the corpus re-forks (every int literal re-encodes).

Decision

Int becomes ℤ — arbitrary precision, not int64. The runtime and the O1 encoding are brought into line with the proof model, which was already unbounded.

Why this is the correct solution

Proofs discharge over Z3's unbounded integer theory (LIA) — the language already committed to "Int = ℤ". The int64 runtime was the pragmatic shortcut that created the mismatch, giving every proof the caveat "valid modulo overflow": a proven-correct function could return a silently-wrong wrapped value (fib 93 overflows int64 today).

Overflow is not like division by zero. Division by zero has no answer, so erroring is correct. Overflow has a well-defined answer; int64 just can't hold it. Trapping (checked arithmetic) discards a real result because the representation is too small; representing it (bignum) computes the answer that exists. Given the proof model is already ℤ, the correct completion is to make the runtime ℤ too. total goes back to meaning total.

Governing principle (same as strings/maps): prove over the clean model, run over an optimized representation. The clean model here is ℤ; the small-int representation optimization (tagged int64 fast path) is a compiler concern (#13), not an inherent cost — it does not affect the semantics or the proofs.

What changes / what doesn't

Unchanged:

Changed:

Staging

  1. This note.
  2. Kernel: Term.Int/Value.Int*big.Int; parse, eval, canon encode/decode, gen, compile, prove-format updated. Green build; a big computation that overflowed int64 (fib 93, 2^100) now evaluates exactly.
  3. Corpus re-fork: re-put everything (new int encoding → new hashes), restore verdicts (proofs unchanged; only hashes move), regenerate fixtures.
  4. SPEC rewrite (the encoding + the deleted overflow caveat).
  5. Second kernel: blind oathrs re-derives from the SPEC; byte-oracle green.
  6. Fixtures, website, CI regenerated; merge.

Rendered verbatim from docs/bignum-integers.md in the repository. The markdown is the single source; this page is a copy checked for drift in CI, so what you read here is what an implementer reads.