Draft Standard

Ribose Standard

•
36815(d) (draft 2026-11-01)
UnitsML specifications — Units Model
CalConnect
Ribose Standard

Draft Standard

Warning for Drafts

This document is not a Ribose Standard. It is distributed for review and comment, and is subject to change without notice and may not be referred to as a Standard. Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.





Foreword

This part defines the semantics computed over the register (CalConnect 36814: how units resolve to dimensions and quantity kinds, which arithmetic operations are legal on which measurement scales, and how absolute quantities are distinguished from differences. It is the layer the evaluation parts consume and the vector sets of CalConnect 36819 freeze.


Introduction

Two distinctions carry this part. First, Pendrill’s levels: a dimension is what makes quantities comparable; a quantity kind is what makes them meaningful; confusing them is how J + N·m passes a dimension check and fails physics. Second, the absolute/difference duality: 20 °C and 15 °C are positions; their difference is a length of scale, and the offset that positions carry has no business in it. Every rule below serves one of these two distinctions.

1  Scope

This document specifies: the L0/L1 frame for dimensions and quantities; quantity resolution (membership, primary reference, asserted kinds); arithmetic gating including declared equivalence classes; measurement-scale classes and their permitted operations; and the absolute/difference typing law with its invariants.

Conversion arithmetic is specified in CalConnect 36816; expression syntax in the Plurimath input-language parts; evaluation in Plurimath 4.

2  Normative references

The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.

JCGM 200:2012, INTERNATIONAL ORGANIZATION FOR STANDARDIZATION, ORGANISATION INTERNATIONALE DE NORMALISATION (ISO), INTERNATIONAL ELECTROTECHNICAL COMMISSION, COMMISSION ÉLECTROTECHNIQUE INTERNATIONALE (IEC), INTERNATIONAL ORGANIZATION OF LEGAL METROLOGY, ORGANISATION INTERNATIONALE DE MÉTROLOGIE LÉGALE (OIML), INTERNATIONAL UNION OF PURE AND APPLIED CHEMISTRY, UNION INTERNATIONALE DE CHIMIE PURE ET APPLIQUÉE (IUPAC), INTERNATIONAL UNION OF PURE AND APPLIED PHYSICS, UNION INTERNATIONALE DE PHYSIQUE PURE ET APPLIQUÉE (IUPAP), INTERNATIONAL FEDERATION OF CLINICAL CHEMISTRY AND LABORATORY MEDICINE, FÉDÉRATION INTERNATIONALE DE CHIMIE CLINIQUE ET DE BIOLOGIE MOLÉCULAIRE (IFCC), INTERNATIONAL LABORATORY ACCREDITATION COOPERATION, COOPÉRATION INTERNATIONALE D’ACCRÉDITATION DES LABORATOIRES (ILAC), and BUREAU INTERNATIONAL DES POIDS ET MESURES (BIPM). International vocabulary of metrology – Basic and general concepts and associated terms (VIM). Report no. JCGM 200:2012. Third edition. Paris: International Bureau of Weights and Measures, Bureau international des poids et mesures; International Organization for Standardization, Organisation internationale de normalisation; International Organization for Standardization, Organisation internationale de normalisation; International Electrotechnical Commission, Commission électrotechnique internationale, 2012. Available from: https://www.bipm.org/documents/20126/2071204/JCGM_200_2012.pdf/f0e1ad45-d337-bbeb-53a6-15fe649d0ff1.

ISO 80000-1, INTERNATIONAL ORGANIZATION FOR STANDARDIZATION (ISO). Quantities and units — Part 1: General. Report no. 80000. Second edition. Geneva: International Organization for Standardization, Available from: https://www.iso.org/standard/76921.html.

Pendrill 2024, (L0–L3 concept levels; isq-smart concept system)

3  Terms and definitions

No terms and definitions are listed in this document.

dimension (L0)

the exponent vector over the base quantities; the comparable-family level. Derived from the register’s dimensions.yaml; never stored per quantity.

quantity (L1)

a named concept of the register (quantities.yaml) — “energy”, “plane angle” — carrying a dimension_reference and identifiers.

dedicated quantity (L2)

an L1 quantity bound to a kind of entity (“length of rod”). Outside the language surface; binding metadata of evaluation inputs.

measured value (L3)

the value + unit pairing (with uncertainty per the Plurimath series). The language surface.

absolute quantity

a value positioned on a scale (T = 20 °C).

difference quantity

a value that is an interval between two absolutes (ΔT = 5 °C); subject to the law of Clause 9.

4  Conventions

Statements are declarative. Kind identifiers resolve exactly as tokens; prose names are never syntax. Errors name the violated rule and the data involved (both kinds, or the scale class).

5  Quantity levels

Dimensions are the L0 arithmetic-gating level: derived from the register’s dimension references, never stored per quantity. L1 quantities are the register’s named concepts (200 of them), each with a dimension reference. The levels answer different questions — L0 “can these be added at all?”, L1 “do these mean the same thing?” — and this part keeps the answers in that order.

EXAMPLE

Interpretation. Hertz and becquerel share dimension s⁻¹ (L0: comparable) and are different L1 kinds (L0 does not make them interchangeable). Length, breadth and height are distinct L1 quantities within the L0 kind of length — comparable and addable.

6  Quantity resolution

A value asserts at most one L1 quantity by identifier. The assertion resolves against the register in the fixed order: short name → unitsml identifier (q:…) → nist identifier (NISTq…); resolution is exact-token; free-text names are never syntax. A stated kind is a member of the resolved unit’s quantity_references (CalConnect 36814). For register units with multiple references and no stated kind, the primary reference is the default; an unregistered composite falls back to the dimension check of Clause 8 only.

EXAMPLE

Expected outcome. u:joule without an assertion resolves to energy (NISTq17, the primary reference) — never “Lagrange function”, which is merely a list member. unit(J::torque) is invalid: torque is not among the joule’s references, though the dimensions match. unit(N·m::torque) is valid: the newton-metre record lists it.

7  Arithmetic gating

Addition and subtraction require equal dimension vectors and kind compatibility: identical L1 kinds, or kinds within one declared equivalence_class (CalConnect 36814). Multiplication, division and scaling compose dimensions and derive the result kind through the normalized register record (primary reference), falling back to dimension-only when no record matches. Strict conversion gating: dimension-compatible units with disjoint kinds are rejected as conversions (Bq↔Hz, Sv↔Gy) unless the asserted kinds are compatible.

EXAMPLE

Expected outcome. unit(J::work) + unit(J::energy) evaluates (one equivalence class). unit(J::energy) + unit(N·m::torque) raises a typed error naming both kinds — the classic blunder the gate exists to catch. Bq → Hz without stated kinds is rejected as a conversion.

8  Scales and operation legality

Each scale class in scales.yaml lists its permitted operations; consumers enforce exactly that list and name the scale class in the error. The landed classes: continuous_ratio (, −, scaling, ×, ÷, comparison), continuous_interval (, −, comparison only), logarithmic_ratio, logarithmic_field, discrete.

EXAMPLE

Expected outcome. 10 °C × 2 is a specified scale error naming continuous_interval; 10 K × 2 is legal (continuous_ratio); 20 °C − 15 °C is legal on both — differences are permitted wherever the scale permits subtraction.

9  The difference law

With a scale map s(x) = f·x + o (o ≠ 0 on interval scales), an absolute value converts as s(x), while a difference x₁ − x₂ converts as f·(x₁ − x₂): the offset cancels. The invariants:

I1 — Diff(Q) is closed under +, − (same dimension) and under factor-only conversion; it is never reachable by affine conversion; Diff(Q) × scalar is legal.
I2 — Abs − Abs on a non-ratio scale yields Diff(Q); Abs + Abs, Abs × Abs, Abs ÷ Abs on such a scale are scale errors (Clause 8).
I3 — Typing follows the value’s provenance (operation history), not its unit: the unit’s scale_reference bounds legal operations; the history determines the conversion law.
I4 — Uncertainties are always Diff(Q): u, U and interval-endpoint distances convert factor-only, never affinely.

Differences are typed in the algebra; no delta pseudo-units exist in the register. A difference raised through a power ≥ 2, or an affine unit inside a composite, is a specified error (CalConnect 36816).

EXAMPLE 1

Expected outcome. (20 °C − 15 °C) → K is 5 K (offset cancels); (20 °C).convert_to(K) is 293.15 K (offset applies). An uncertainty magnitude 0.2 °C → K is 0.2 K. Implementations producing 278.15 K for the difference violate this clause.

EXAMPLE 2

Provenance, not unit. The same text 5 °C is an absolute when measured and a difference when subtracted; the unit record is identical, the type differs. The type is carried by the value, set at construction (Abs literal or Abs − Abs).

10  Conformance

Conformance class quantity-conversion (CalConnect 36819 includes this part. Annex A defines the red/green vector table; CalConnect 36819 Annex B freezes and replays it byte-identically across the reference implementation and parity runtimes.


Annex A
(normative)

Annex A (normative): gating and difference vectors

The red/green vector table is given in Table A.1; CalConnect 36819, Annex B freezes and replays it.

Table A.1 — Gating and difference vectors
InputExpected result
u:joule quantity resolution (no assertion)primary kind = energy (red against .first: “Lagrange function”)
unit(J::energy) / unit(N·m::torque)valid / valid (membership per register)
unit(J::torque)invalid: not a member of the joule record
Bq → Hz conversion (no kinds stated)rejected (strict gating)
unit(J::work) + unit(J::energy)valid (equivalence class energy)
unit(J::energy) + unit(N·m::torque)typed error naming both kinds
10 °C × 2scale error naming continuous_interval
(20 °C − 15 °C) → K5 K (offset cancels)
uncertainty magnitude 0.2 °C → K0.2 K (factor-only)

Bibliography

[1]  content-rule provenance, — unitsml/unitsdb#135, #136, #42; unitsml/unitsml-ruby#82 (R-A4), #92 Task 6