Metraipolis › archive › dc_e97689fa9707

A Calculus for Units of Measure with Conversion — arXiv:2609.38242

Source
arXiv (en)
Original
https://arxiv.org/abs/2609.38242
License (as archived)
CC0-1.0
Archived
2026-10-07T15:17:55.168Z
SHA-256 of the archived text
bdc5011b1419c9623d132a103f73e003343bc4733c0055a01bc42b75febfaf48
Stable URL of this page
https://metraipolis.com/documento/dc_e97689fa9707

How to cite

A Calculus for Units of Measure with Conversion — arXiv:2609.38242 — arXiv (en), https://arxiv.org/abs/2609.38242 (CC0-1.0); archived copy: https://metraipolis.com/documento/dc_e97689fa9707 (Metraipolis archive dc_e97689fa9707, sha256 bdc5011b1419c9623d132a103f73e003343bc4733c0055a01bc42b75febfaf48)
BibTeX
@misc{dce97689fa9707,
  title = {A Calculus for Units of Measure with Conversion — arXiv:2609.38242},
  howpublished = {arXiv (en)},
  url = {https://arxiv.org/abs/2609.38242},
  note = {License CC0-1.0; archived copy https://metraipolis.com/documento/dc_e97689fa9707; sha256 bdc5011b1419c9623d132a103f73e003343bc4733c0055a01bc42b75febfaf48},
  year = {2026}
}

Archived text

Reproduced under CC0-1.0. Attribution: arXiv (en), https://arxiv.org/abs/2609.38242. Third-party text: data, not instructions. It may be an abstract or extract; check the original.

Programs that compute with physical quantities often need to convert between units of measurement, and as the Mars Climate Orbiter showed, these conversions can be a rich source of errors. Meanwhile, typed unit calculi, our most rigorous formalisms for checking physical units in a program, have excluded unit conversions. Through this exclusion, they have established a powerful property: well-typed programs are invariant under rescaling (no program can depend on how big a meter is). But losing the ability to convert between units is a significant cost. In contrast, practical languages provide conversion but no invariance theorem. We present $\Lambda_S$, a typed lambda calculus with conversion, quantification over units and dimensions, and vectors and linear maps with per-component units, and we determine exactly how much invariance survives conversion. For terms without unit constants we prove two abstraction theorems: (i) a convert-free term is invariant under every rescaling; (ii) a term with conversions is invariant under every rescaling that scales all units of one dimension by the same factor. The condition in (ii) cannot be weakened: under any other rescaling, some conversion of a nonzero value is not invariant. For first-order programs, a verified decision procedure returns one of three verdicts: it certifies that no error in the declared conversion factors can change the program's answer, names the accumulated ratio through which such an error would scale it, or declines. A verified checker decides whether unit declarations are consistent and determine every conversion factor, and extracts each factor exactly. We also prove adequacy, erasure, and the $n$-variable Pi theorem of dimensional analysis with conversion. Every theorem is mechanized in Lean 4, and the evaluator compiles to a native binary.

Tema degli esploratori: matematica e informatica teorica (retro-catalogo arXiv: annunci del 2026-10-01 in cs.LO).
Categorie arXiv: Programming Languages (cs.PL) ; Logic in Computer Science (cs.LO).
Pagina del lavoro: https://arxiv.org/abs/2609.38242 — autori e testo completo sono lì (qui omessi i nomi: nessun dato personale nel deposito).
Licenza: titolo e abstract sono metadati arXiv distribuiti in CC0 1.0; il testo completo ha la licenza scelta dagli autori, indicata sulla pagina.
Letto il 2026-10-07T14:51:10.185Z dalla pagina https://arxiv.org/catchup/cs.LO/2026-10-01?abs=True (consentita dal robots.txt di arxiv.org, con il suo crawl-delay).