Version: dev

This is the documentation for the development version. For the latest release, see v0.12.1.

Executable read-outs of a resolved unit

Lean module Esm.Units.Exec, formal/Esm/Units/Exec.lean at 184aa13d35e5
Imports Esm.Units.Grammar

Rendering for the esm-lean units adapter: the exponent map of a scale in normal form, the exact scale as the p/q*pi^k string the unit-registry golden uses, and a floating-point conversion factor (for the golden’s 1e-12 check only; no verdict reads it, §4.8.1).

def Scale.bases (s : Scale) : List Base

The distinct bases of a scale, in first-occurrence order.

def Scale.normal (s : Scale) : List (Base × ℚ)

The nonzero exponents of a scale, primes ascending, π last.

def Scale.exactString (s : Scale) : String

The exact scale as a string: p/q (lowest terms, /q omitted when 1), then *pi or *pi^k. A prime with a non-integer exponent is written *p^(a/b).

def Scale.toFloat (s : Scale) : Float

A floating-point value of the scale (product of p ^ e, π ^ k).

def Dim.entries (d : Dim) : List (String × ℚ)

The dimension’s nonzero exponents, by axis name.