Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions sources/pm-1009/document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/01-scope.adoc[]

include::sections/02-normrefs.adoc[]

include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/05-quantity-value.adoc[]

include::sections/06-unit-expr.adoc[]
Expand Down
34 changes: 34 additions & 0 deletions sources/pm-1009/sections/10-conformance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,37 @@ An implementation conforms to this document when it constructs, reduces, compare
* `3 m` and `2 s` refuse with `DimensionMismatch` carrying both vectors;
* the affine traps (difference vs absolute) return the stated answers, and the corpus pins them;
* an unregistered symbol refuses with `UnknownUnit` naming the code.

=== The corpus

The vectors of this document are the quantity rows of the UnitsML testsuite. A claim names the repository, the commit and the generation below; an implementation replayed against a different commit makes a different claim.

.Pinned corpus generations
[cols="2,3,1,3", options="headers"]
|===
|Generation |Repository and commit |Rows |Comparison

|`corpora/features/evaluator-reference/v1`, families `quantity-register`, `quantity-f40`, `R30-wasm-quantity`
|https://github.com/unitsml/unitsml-testsuite, commit `087e4ee60eb402d6436ae919f50a187faec2abb7`
|35
|the request is sent verbatim; the expected wire is compared byte for byte as canonical JSON

|`corpora/features/unitsml-quantities.json`
|same commit
|39
|value, unit, dimension vector and scale, or the typed error class

|`corpora/conversions/expected-conversions.json`
|same commit
|25
|the converted value as an exact rational
|===

`scripts/check_feature_corpus.py` and `scripts/evaluator_reference_vectors.py check` of the testsuite verify the seals and re-derive the vectors; both exit 0 at the pinned commit.

=== Known gaps at the pinned commit

* The `quantity-register` family is partial: its rows are produced by the native evaluator, and an independent exact check covers 16 of its 32 identifiers.
* No source names the quantity class of `kV·A` (apparent against active power). The corpus states the reduction to the power dimension and the conversion to `kW` by dimension only; it asserts no class. Asserting or refusing a class is an open decision of this document.
* The UnitsML Ruby `Quantity#==` compares the raw value and the dimension vector without converting the scale (`10 kV * 5 A == 50 W` is true; corpus row `kva-equals-50-W-upstream-spec` and the file's `source_semantics_findings`). Clause 5 ("Equality and comparison") requires conversion to a common scale before comparison, so that row records a non-conformance of the implementation, not an acceptance vector.
* No row yet pins the comparison `3 km` against `2500 m`, the reductions of `mm·kN` and `V/Hz`, or a quantity carrying a PM 1002 uncertainty node.
27 changes: 27 additions & 0 deletions sources/pm-1009/sections/92-annex-c.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,30 @@ Each row is one corpus vector with its expected outcome frozen; the corpus is th
* *Comparison.* same-dimension comparison converts the smaller scale first; cross-dimension comparison refuses with `DimensionMismatch`.
* *Conversion.* factor conversions of exact operands are exact; affine conversions apply the offset to the value and never to the difference; both traps carry corpus vectors.
* *The uncertainty field.* a quantity with a PM 1002 uncertainty node carries the node unchanged — no normalisation, no recomputation; the unit-dimension equality of the uncertainty is checked and refused otherwise.

=== Vector index

Each acceptance vector of clause 10 with the rows that pin it (generations and commit as in clause 10). "Not yet pinned" marks a vector the corpus does not yet carry.

[cols="3,4", options="headers"]
|===
|Vector |Rows

|`kV·A` reduces to the power dimension at the kilo scale
|`unitsml-quantities.json`: `dim-kVxA`, `kva-product`, `conv-kva-to-w`, `conv-kva-to-kw`, `conv-w-to-kva`

|`3 km` compares to `2500 m` after conversion
|not yet pinned (conversion only: `unitsml-quantities.json` `conv-km-to-m`, `expected-conversions.json` `km-to-m-prefix`)

|`3 m` and `2 s` refuse with `DimensionMismatch`
|`unitsml-quantities.json`: `refuse-m-to-s`, `refuse-v-plus-s`; `evaluator-reference/v1`: `registered-dimension-mismatch-refusal`

|the affine traps
|`unitsml-quantities.json`: `conv-degc-to-k`, `conv-k-to-degc`, `difference-degc`, `refuse-degc-to-k2`, `refuse-degc2-to-k2`; `evaluator-reference/v1`: `registered-affine-point`, `registered-affine-difference`, `registered-affine-subtraction`, `registered-affine-compound-refusal`, `registered-difference-minus-point-refusal`; `expected-conversions.json`: the `degc-*` and `k-to-degc-inverse` rows

|an unregistered symbol refuses with `UnknownUnit`
|`evaluator-reference/v1`: `register-refusal-unknown-unit`

|the uncertainty field is carried unchanged
|not yet pinned
|===
8 changes: 0 additions & 8 deletions sources/pm-1010/document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/01-scope.adoc[]

include::sections/02-normrefs.adoc[]

include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/05-language.adoc[]

include::sections/06-grammar-parg.adoc[]
Expand Down
2 changes: 2 additions & 0 deletions sources/pm-1010/sections/02-normrefs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@
* [[[pm1009,nofetch(PM 1009 (quantity type system))]]] of this series — the operand types the operators consume.
* [[[parsanol,nofetch(Parsanol)]]] — the PARG grammar language and toolchain compiling this document's grammar.
* [[[cc36813,nofetch(CalConnect 36813 (numeric contract))]]] of the UnitsML series — the exact-decimal discipline the literals preserve.

* [[[pm-expression-corpus,nofetch(Plurimath testsuite supporting generation)]]] — https://github.com/plurimath/plurimath-testsuite/tree/7c13256efd0ddcd88680b242b45cdedeaf3c75d5[commit 7c13256efd0ddcd88680b242b45cdedeaf3c75d5], `generations/roundtrip.yaml` and `stages/roundtrip/generations/000001` (clause 10).
34 changes: 17 additions & 17 deletions sources/pm-1010/sections/07-precedence.adoc
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
== The precedence chain
== The precedence chain

=== The full chain
=== The full chain

The grammar states one precedence chain, extending PM 1004's arithmetic chain upward with the logical levels:
The grammar states one precedence chain, extending PM 1004's arithmetic chain upward with the logical levels:

.The precedence chain of the expression language
[cols="1,4", options="headers"]
|===
|Level |Constructs

|implies
|or
|xor
|and
|comparison (`<=`, `>=`, `<`, `>`, `=`, `≠`)
|additive (`+`, `−`)
|multiplicative (implicit products, `/`, `mod`)
|unary (negation, positive sign)
|power (`^`, right-associative)
|operand (literals, names, calls, groups)
|implies |`implies`
|or |`or`
|xor |`xor`
|and |`and`
|comparison |`<=`, `>=`, `<`, `>`, `=`, `≠`
|additive |`+`, `−`
|multiplicative |implicit products, `/`, `mod`
|unary |negation, positive sign
|power |`^`, right-associative
|operand |literals, names, calls, groups
|===

Each level parses the next as its operand; every level except the power folds left-associatively. The chain is the superset of PM 1004's: an expression PM 1004 accepts parses to the same arithmetic tree here, and the logical levels above it extend, never reorder.
Each level parses the next as its operand; every level except the power folds left-associatively. The chain is the superset of PM 1004's: an expression PM 1004 accepts parses to the same arithmetic tree here, and the logical levels above it extend, never reorder.

[example]
`a <= b and c < d implies ok`.
*Expected outcome.* parsed as `(a <= b) and (c < d)` implies `ok` — the comparison binds tighter than `and`, and `implies` binds loosest, right-associatively.
[example]
`a <= b and c < d implies ok`.
*Expected outcome.* parsed as `(a <= b) and (c < d)` implies `ok` — the comparison binds tighter than `and`, and `implies` binds loosest.
8 changes: 8 additions & 0 deletions sources/pm-1010/sections/09-round-trip.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,11 @@ Where a notation cannot carry a construct, the render states the loss (the forma
[example]
`2.10 + x` rendered to the formats and re-parsed.
*Expected outcome.* the trailing zero survives the render and the re-parse in every round-tripping format; the corpus asserts the AST equality per format.

=== Reading the pinned evidence

The supporting generation and row identifiers are listed in clause 10.
Its per-target `lossless`, loss and refusal fields delimit the demonstrated
round trips. They neither establish all new expression constructs in every
format nor establish preservation after editing in an external document
application.
58 changes: 58 additions & 0 deletions sources/pm-1010/sections/10-conformance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,61 @@ An implementation conforms to this document when it parses exactly the construct
* the precedence chain parses the Annex A examples to the stated trees;
* every static diagnostic of the corpus carries the node and the expected types;
* the artifact checksums match the published artifacts, per runtime.

=== Pinned supporting generations

The supporting corpus is `plurimath/plurimath-testsuite` at commit
`7c13256efd0ddcd88680b242b45cdedeaf3c75d5` (BSD-2-Clause, `LICENSE`).
The immutable round-trip generation is
`stages/roundtrip/generations/000001`, listed in `generations/roundtrip.yaml`:
9 payloads, 46 rows, snapshot digest
`sha256:7ee63e894f86a139899623f2b04f32228893ea3b0f77da55333c2927b630c337`.
Its `provenance.yaml` names the producer, dependency versions and generator:
`plurimath/plurimath` commit `2967dcc47a9f37d5b9a2dd13d94a2ad35d4cc256`,
`scripts/roundtrip_cases.rb`. A generation is not regenerated in place.

The generation records AsciiMath, UnicodeMath and MathML source cases and
per-target AsciiMath, UnicodeMath, MathML and OMML outcomes. Each outcome
states exact output and losslessness, a stated loss, or a refusal. Replay
uses that outcome rather than assuming every target is lossless.

.Supporting round-trip rows
[cols="2,3", options="headers"]
|===
|Payload under `payloads/` |Row identifiers and purpose

|`asciimath-standard.yaml`
|`asciimath-standard.absolute`: standard uncertainty and verbatim decimals

|`asciimath-expanded.yaml`
|`asciimath-expanded.k`: expanded uncertainty and coverage factor

|`asciimath-coverage-interval.yaml`
|`asciimath-coverage-interval.unspecified`: interval representation, with each target's recorded outcome

|`asciimath-invalid.yaml`
|`asciimath-invalid.zero-k`: refusal, not a successful round trip

|`unicode-markers.yaml`
|`unicode-markers.standard`: UnicodeMath marker reading

|`mathml-markers.yaml`
|`mathml-markers.standard`: MathML marker reading
|===

=== Coverage boundary

This generation supplies existing uncertainty-markup round trips. It does
not establish conformance of the complete expression language: it is not a
frozen `expressions.parg` source-to-AST generation for boolean logic,
conditionals, iterators, undefined values or the complete static type pass.
Those constructs still require the grammar artifact and the `.pgtest`
generation of clause 6. No checksum or row identifier for such a generation
is asserted here. Supporting arithmetic and serialized diagnostics are
pinned by PM 1013; they do not replace static-language diagnostics.

The repository checks are `ruby scripts/validate.rb`,
`ruby scripts/validate-stages.rb` and
`python3 scripts/validate-evaluation-profiles.py`. These validate corpus
structure and seals. An implementation's parse/write/read replay is separate
and must report the generation and the target outcomes it actually checks.
10 changes: 10 additions & 0 deletions sources/pm-1010/sections/91-annex-b.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
A `.pgtest` case is the triple: the source, the artifact's AST, and the result where the case evaluates. The suites ride the grammar artifact; a runtime replays the triple or refuses.

The form is data: the source as written, the AST as the artifact's parse states it, the result as PM 1011's evaluation states it — three fields, each checksummed with the artifact version. A case that refuses carries the diagnostic in the third field; refusals replay exactly like results.

=== Existing data and the expression-generation gap

The round-trip rows pinned in clause 10 are YAML, not a substitute PARG
suite. For example, `asciimath-standard.absolute` supplies source
`ustd(1.230, 0.004)` and per-format results; it checks the existing
uncertainty representation. A future expression `.pgtest` generation must
add its actual source, bound Formula tree and evaluation or diagnostic
result, with grammar and binding checksums. It must not relabel a numeric
JSON AST fixture as evidence that expression source parsed correctly.
8 changes: 0 additions & 8 deletions sources/pm-1011/document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/01-scope.adoc[]

include::sections/02-normrefs.adoc[]

include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/05-evaluation-extension.adoc[]

include::sections/06-propagation.adoc[]
Expand Down
2 changes: 1 addition & 1 deletion sources/pm-1011/sections/06-propagation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ For an expression f over the input quantities xᵢ, each carrying a standard unc

`u_c = √( Σᵢ (∂f/∂xᵢ · uᵢ)² + 2 Σᵢ<ⱼ (∂f/∂xᵢ)(∂f/∂xⱼ) u(xᵢ,xⱼ) )`

— the partials evaluated symbolically over the expression tree or numerically at the bound point, per the stated mode. The independence term is the first sum; the correlation term is stated and carried per clause 6.4.
— the partials evaluated symbolically over the expression tree or numerically at the bound point, per the stated mode. The independence term is the first sum; the correlation term is the second sum.

=== The inputs

Expand Down
60 changes: 60 additions & 0 deletions sources/pm-1011/sections/11-conformance.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,63 @@ An implementation conforms to this document at the class its corpus generation p
=== The acceptance

A conformance claim names the classes and the corpus generations. The classes are independent: arithmetic-only conformance is PM 1004's, unchanged; each new class stands on PM 1009 and this document's clauses for that class.

=== The corpus

A claim names the repository, the commit and the generations below, per class. The evaluator-reference generation sends each request verbatim and compares the expected wire byte for byte as canonical JSON; a stochastic row replays only with the identical method, generator and seeds, and `precision=approximate` marks a declared approximation, not a looser comparison.

.Pinned corpus generations (https://github.com/unitsml/unitsml-testsuite, commit `087e4ee60eb402d6436ae919f50a187faec2abb7`)
[cols="1,3,1", options="headers"]
|===
|Class |Generation and families |Rows

|arithmetic
|`corpora/features/evaluator-reference/v1`: `numeric-v1`, `numeric-supplemental-v1`, `numeric-validation-v1`, `numeric-bignum-v1`, `numeric-nonfinite-v1`, `numeric-annex-h`
|204

|quantity
|35 UnitsML rows from `corpora/features/evaluator-reference/v1`: `quantity-register`, `quantity-f40`, `R30-wasm-quantity`; plus the PM 1009 rows

|propagation
|`corpora/features/evaluator-reference/v1`: `gum-annex`, `gum-annex-methods`, `gum-f40`, `coverage-validation`; `corpora/features/host-evaluator/v1`: the Annex H producer rows
|111 and 74

|second-order
|`corpora/features/evaluator-reference/v1`: `gum-mcm`, `gum-mcm-joint-rational` (the MCM comparison rows, referenced per clause 7)
|13

|series
|`corpora/features/host-evaluator/v1`: `series_statistics`, `grouped_statistics`, `annex_h_type_a_covariance`
|9
|===

`scripts/evaluator_reference_vectors.py check` and `scripts/host_evaluator_vectors.py check` of the testsuite verify the seals and re-derive the vectors; both exit 0 at the pinned commit. The acceptance record of each family is `corpora/features/evaluator-reference/v1/acceptance.json`.

=== The GUM worked examples in the corpus

[cols="1,4", options="headers"]
|===
|Example |Rows

|H.1
|`gum-annex`: `h1-lpu-analytic`
|H.2
|`gum-annex-methods`: `h2-derived-vector`, `h2-correlations`, `h2-derived-observations`; `host-evaluator/v1`: `producer-00` to `producer-03`
|H.3
|`gum-annex-methods`: the `h3-fit-*`, `h3-predict-*`, `h3-correlation-*` and `h3-refusal-*` rows
|H.4
|`gum-annex-methods`: `h4-derived-covariance`, `h4-ratio-approach`; `host-evaluator/v1`: `producer-04`, `producer-05`
|H.5
|`host-evaluator/v1`: `producer-06` to `producer-08`
|H.6
|`gum-annex-methods`: `h6-resolution-and-unknown-dof`
|===

=== Known gaps at the pinned commit

* *H.2.* The independent exact-input arithmetic is checked, but agreement with the last digit the GUM publishes is not established; it needs the original unrounded inputs or the source's rounding convention (`acceptance.json`, `unresolved`).
* *H.1.* The `h1-lpu-analytic` row carries the second-order terms: its standard uncertainty is 33.78 nm, against 32 nm at the first order. The row reproduces the second-order figure; a first-order H.1 row is not yet pinned.
* *H.5* is pinned only by the host-evaluator producer rows; the evaluator-reference generation has no H.5 row.
* The `numeric-annex-h` rows do not record which worked example each reproduces.
* *The serialized class.* The evaluator-reference wires are produced by the Rust evaluator and re-run byte-equal by the Ruby reference for the arithmetic families; cross-runtime parity for TypeScript is not yet pinned.
* The MCM rows were not re-run in the generation; they carry the generator, the seeds and the final state of their source run, per clause 7's boundary.
2 changes: 1 addition & 1 deletion sources/pm-1011/sections/90-annex-a.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The mapping of the GUM's worked examples to this document's clauses:

* H.1 (the gauge block, the type A and B components, the combined and expanded) — clauses 6 and 6.3, at the first order;
* H.2 (the thermometer, the correlation) — clause 6.4, the correlation term stated;
* H.2 (the thermometer, the correlation) — clause 6.1, the correlation term of the law;
* H.4–H.6 — clause 6 with the mixtures of type A and B inputs;
* the Amd.1 note to H.1.7 — clause 7, the second-order terms derived and documented per the corpus;
* the H.1 comparison against MCM — clause 7, the LPU-adequacy verdict.
Expand Down
8 changes: 0 additions & 8 deletions sources/pm-1012/document.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/01-scope.adoc[]

include::sections/02-normrefs.adoc[]

include::sections/03-terms.adoc[]

include::sections/04-conventions.adoc[]

include::sections/05-constraints.adoc[]

include::sections/06-decision-rules.adoc[]
Expand Down
2 changes: 1 addition & 1 deletion sources/pm-1012/sections/02-normrefs.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
* [[[pm1004,nofetch(PM 1004 (evaluation))]]] of this series — the accuracy classes and the strict error contract.
* [[[pm1009,nofetch(PM 1009 (quantity type system))]]] of this series — the quantities and the coherence.
* [[[pm1011,nofetch(PM 1011 (evaluation processing))]]] of this series — the propagated results and the expanded uncertainty.
* [[[ilacg8,nofetch(ILAC-G8)]], ILAC — the guidelines on decision rules and statements of conformity — the guarded acceptance family.
* [[[ilacg8,nofetch(ILAC-G8)]]], ILAC — the guidelines on decision rules and statements of conformity — the guarded acceptance family.
* [[[jcgm106,nofetch(JCGM 106)]]] — the decision-rule framing.
Loading
Loading