Foreword
This document is the first document of the Plurimath specifications series. The series documents the Plurimath formula system as implemented by the plurimath interpreter: the math model shared by every input and output representation (this document), the uncertainty model, the format interfaces, and the evaluation semantics.
The math model described here is the one implemented in the plurimath gem, version 0.11.12 and later of the 0.11 series. Where this document and the implementation disagree, the disagreement is a defect in one of the two, and is resolved in favour of whichever is corrected first; the series does not describe an unimplemented design.
Documents in the series
| Number | Title | Subject |
|---|---|---|
| 1001 | Math model | The formula tree, the node classes, the symbol and function registry, the rendering surfaces |
| 1002 | Uncertainty model | Uncertainty nodes, their fields and their per-format representations |
| 1003 | Format interfaces | The per-format readers and writers: MathML, OMML, UnicodeMath, LaTeX, HTML, AsciiMath |
| 1004 | Evaluation | Numeric evaluation of formula trees, uncertainty propagation, coverage |
Maintainers
This document is maintained by the Plurimath project at https://github.com/plurimath/plurimath. Corrections and implementations are tracked as issues in that repository.
Stability of this document
This document is a draft standard. The model it describes is implemented and released; the document pins behaviour to model versions so that readers can tell which statements describe released software and which anticipate the next edition. Corrections that change observable behaviour arrive with a model-version change and are recorded here; corrections that only clarify arrive at any time.
Introduction
Plurimath reads mathematics written in one text or markup form and writes it in another: AsciiMath, UnicodeMath and LaTeX on the input side; MathML, OMML (Office Math Markup Language), LaTeX, UnicodeMath, HTML and AsciiMath on the output side. It also evaluates simple formula trees numerically and carries measurement uncertainty through them.
Doing all of that through a single implementation would be impossible without a single representation in the middle. Every reader converts its input into one tree shape; every writer consumes that same shape. This document defines that shape: the formula tree, the node classes that compose it, the registry of symbols and functions the nodes refer to, and the rendering surfaces that produce each output format.
The model is deliberately independent of any syntax. Nothing in the tree records which input notation produced it, and nothing in the tree is specific to one output notation. A tree built from an OMML document and a tree built from the equivalent AsciiMath source are the same object with the same content, and they render identically in every format. That property — one model, many representations — is the load-bearing wall of the whole system: correctness is stated once, here, instead of once per format pair.
Three further documents build on this one. The uncertainty model (1002) defines the fields an uncertainty node carries; the format interfaces (1003) define how each reader and writer behaves at its boundary; evaluation (1004) defines what it means to compute with these trees. This document defines the thing they all operate on.
EXAMPLE
The AsciiMath source and the OMML document produced from rendering that source are two representations of one formula. Plurimath parses either into the same formula tree: a Sum (nary) node carrying sub/superscript limits and a power expression; an equality; a fenced fraction; a square. Rendering that tree to MathML, OMML, LaTeX, UnicodeMath, HTML or AsciiMath yields the six outputs with identical mathematical content.
1 Scope
1.1 General
This document specifies the math model of the Plurimath system:
the formula tree and its ownership rules;
the node classes — formula containers, symbols, numbers, functions, tables, font styles, unit embeddings and uncertainty nodes — with their attributes and relationships;
the registry of symbols and functions, its entry shape, its generation and its versioning;
the rendering surfaces: the contract each output format satisfies and the stability rules that govern them;
the rules by which the model is extended;
conformance of an implementation of this model.
This document does not specify:
the syntax of any input representation, or the behaviour of any reader (format interfaces, document 1003);
the representation of uncertainty inside specific notations, nor uncertainty arithmetic (uncertainty model, document 1002);
numeric evaluation, propagation or coverage (evaluation, document 1004);
the UnitsML unit-expression language, which is specified in the UnitsML series (asciiunits content language, CalConnect 36817), and is consumed by the model through the Unitsml node defined here.
1.2 Relationship to the series
| Document | Relationship to this one |
|---|---|
| 1002 Uncertainty model | defines the fields this document’s Uncertainty node carries and their per-format representations |
| 1003 Format interfaces | defines the readers that produce this document’s tree and the writer-side detail per surface |
| 1004 Evaluation | consumes this document’s tree numerically; the model performs no arithmetic |
| CalConnect 36813, 1005, 1006 | define the numeric contract, the XML usage and the content language behind the Unitsml node |
1.3 Audience
Implementers of Plurimath itself, implementers of independent readers or writers that must interoperate with it, and authors of the neighbouring documents in this series.
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.
MathML 4, W3C Recommendation. The Math::Function::Intent and Math::Function::Semantics nodes carry the MathML 4 intent and semantics elements; the MathML rendering surface targets MathML 4.
ECMA-376, Office Open XML File Formats, Part 1. The OMML rendering surface produces DrawingML mathematics (m: namespace) as defined there.
Unicode Technical Report #28, Unicode Support for Mathematics (the UnicodeMath linear format). The UnicodeMath surface reads and writes it.
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.
CalConnect 36813 (numeric contract), of the UnitsML series
CalConnect 36816 (XML usage), of the UnitsML series, together with 36813, for the contract of the Unitsml node.
3 Terms and definitions
For the purposes of this document, the following terms and definitions apply.
For the purposes of this document, the following terms and definitions apply.
3.1 formula tree
the tree structure produced by every reader and consumed by every writer: a Formula root whose descendants are nodes
3.2 node
one element of the formula tree; an instance of a node class
3.3 node class
one of the classes enumerated in this document: Formula, Symbol, Number, Text, one of the function classes of Clause 12, one of the font styles, one of the table classes, Unitsml, or Uncertainty
3.4 container node
a node whose role is structural: Formula itself, Fenced, Left, Right, Table and its variants, Td, Tr, Mlabeledtr, Multiscript, Linebreak
3.5 symbol
a node of the symbol space: one glyph or operator name drawn from the symbol registry
3.6 symbol registry
the versioned set of symbol entries; at edition 1 of this document it contains 1 438 symbol entries, one per symbol class of the implementation
3.7 function node
a node of one of the 103 function classes, carrying zero or more operand subtrees
3.8 operand
a subtree held by a function node; the number and order of operands is fixed by the function class
3.9 font style node
a node that applies one of the 14 font variants to its operand (bold, italic, fraktur, and so on)
3.10 table node
a node of one of the 10 layout classes (matrix, bmatrix, pmatrix, vmatrix, cases, array, align, eqarray, split, multline), holding rows of cells
3.11 Unitsml node
a node embedding a UnitsML unit expression together with the rendered forms the UnitsML system produces for it
3.12 Uncertainty node
a node attaching an uncertainty to a value expression: the estimate, the uncertainty magnitude, the category and the coverage, as defined in document 1002
3.13 rendering surface
one output format and the set of rules that produce it: MathML, OMML, LaTeX, UnicodeMath, HTML, AsciiMath
3.14 reader
a component that converts one input representation into the formula tree (specified in document 1003)
3.15 writer
a component that converts a formula tree into one rendering surface (specified here as to the contract each surface satisfies; format detail in document 1003)
3.16 math zone
the textual rendering of a tree used for diagnostics, one line per node, showing nesting by indentation
3.17 byte-identical
producing the same bytes for the same input tree and the same model version, on any conforming implementation
3.18 model version
the version of the implementation’s model library (the plurimath gem version); render output is defined per model version
3.19 rendering options
the presentation flags carried by the root: display style, linebreak handling, and the per-surface options the root admits; never carried by descendant nodes
3.20 nary value
the operator glyph a nary function node carries (∑, ∏, ∫, ∮), emitted on nary constructs by the MathML and OMML surfaces
3.21 coverage
the probability or factor attached to an uncertainty of the coverage category; content specified in document 1002
3.22 fallback
the one declared substitute rendering a surface emits when a construct has no faithful form in that format
3.23 registry edition
the published version of the registry data; entry renderings are immutable within an edition
3.24 composition
the ownership relation between a container node and the nodes it holds; a composed node has exactly one owner, and the tree is acyclic
3.25 presentation option
a root-level flag that changes surface presentation without changing tree content; display style is the primary example
3.26 registry regeneration
the deterministic generation of symbol classes and parser vocabulary from the registry data; byte-identical within an edition
4 Conventions
4.1 Tree notation
Trees are written as indented lines, one node per line:
Formula
└─ Power
├─ Symbol("x")
└─ Number("2")
The class name appears first; a quoted string after the name is the node’s value (Symbol, Number, Text). This is the shape the math zone printer emits.
4.2 Examples
Examples appear in blocks titled Example and end with an Expected outcome paragraph. The expected outcome states what a conforming implementation does; an implementation that does something else does not conform to the clause the example illustrates.
4.3 Identifiers
Class names are written as they appear in the implementation: Plurimath::Math::Function::Frac is written Frac when the module is clear from context. The registry entries for symbols are written with the displayed glyph followed by the class name in parentheses when the glyph alone is ambiguous.
4.4 Version references
Behaviour is pinned to model versions. “0.11.x” names any version whose version string begins 0.11.; a clause that names a specific version, such as 0.11.12, applies to that version and is revisited at the next edition of this document.
4.5 Reading the LML blocks
The LML blocks of this document are the model. Attribute lines read as attribute name, Type with the cardinality following in braces where it is not one: attribute parameters, Node { cardinality 1..n } reads “every Formula carries one or more parameters, each a Node”. A cardinality left implicit is exactly one ([1]). Enumerations list their values; a node’s attribute of enumeration type carries one of them.
The LML blocks are checked: the model compiles with the LutaML toolchain, and a block that fails to compile fails the build of this document. The prose and the LML state the same model; where they appear to differ, the LML is corrected or the prose is — the two are never allowed to settle into disagreement.
4.6 Names
Conceptual class names are written without their implementation namespace: Formula stands for the implementation’s Plurimath::Math::Formula. Implementation namespaces appear once, here, and in the conformance vectors where byte output is frozen. A reader of this document needs no Ruby knowledge; an implementer maps each conceptual class to the implementation class of the same name.
4.7 The example format
Examples carry an Expected outcome paragraph. The outcome is stated as the observable behaviour of a conforming implementation: rendered bytes where the example is about rendering, tree shape where it is about the model, and refusal behaviour where it is about a prohibition. An example whose outcome cannot be observed is a defect in this document.
5 The formula tree
5.1 General
The formula tree is specified as an LutaML model. The model is normative: classes, attributes, types and cardinalities are defined in the LML blocks of this clause, and the prose states the rules the diagrams cannot.
5.2 The model
lml "1.0"
models Plurimath {
package Structure {
class Node {
attribute kind, String[1]
}
class Formula {
attribute parameters, Node { cardinality 1..n }
attribute display_style, Boolean
attribute options, RenderingOptions
}
class Symbol {
attribute entry, SymbolEntry[1]
}
class Number {
attribute text, String[1]
}
class Text {
attribute content, String[1]
}
}
package Functions {
class Function {
attribute operands, Node { cardinality 0..n }
}
class UnaryFunction {
attribute operand, Node[1]
}
class BinaryFunction {
attribute first, Node[1]
attribute second, Node[1]
}
class TernaryFunction {
attribute first, Node[1]
attribute second, Node[1]
attribute third, Node[1]
}
class NaryFunction {
attribute operand, Node[1]
attribute lower_limit, Node
attribute upper_limit, Node
attribute nary_value, String[1]
}
}
package Layout {
class Table {
attribute rows, Tr { cardinality 1..n }
}
class Tr {
attribute cells, Td { cardinality 1..n }
}
class Td {
attribute content, Node { cardinality 0..n }
}
class FontStyle {
attribute variant, FontVariant[1]
attribute operand, Node[1]
}
class Fenced {
attribute content, Node { cardinality 1..n }
attribute open, Symbol[1]
attribute close, Symbol[1]
}
class Linebreak
class None
class Phantom {
attribute operand, Node[1]
}
}
package Measurement {
class Unitsml {
attribute expression, String[1]
attribute unicode_form, String[1]
attribute latex_form, String[1]
attribute mathml_form, String[1]
attribute xml_form, String[1]
}
class Uncertainty {
attribute value, Node[1]
attribute category, UncertaintyCategory[1]
attribute magnitude, Node
attribute coverage_factor, Node
attribute coverage_probability, Node
attribute lower, Node
attribute upper, Node
attribute interval_kind, IntervalKind
attribute notation, Notation
attribute unit, Unitsml
}
enum UncertaintyCategory {
value standard
value expanded
value coverage-interval
}
enum Notation {
value absolute
value concise
}
enum IntervalKind {
value shortest
value probabilistically-symmetric
}
}
enum FontVariant {
value "bold"
value "italic"
value "bold-italic"
value "sans-serif"
value "sans-serif-italic"
value "sans-serif-bold-italic"
value "bold-sans-serif"
value "monospace"
value "fraktur"
value "bold-fraktur"
value "script"
value "bold-script"
value "double-struck"
value "normal"
}
}
5.3 The composition
diagram PlurimathComposition {
association HasParameters {
owner Formula
owner_type composition
member_type Structure::Node
member_multiplicity "1..n"
}
association HasOperands {
owner Functions::Function
owner_type composition
member_type Structure::Node
member_multiplicity "0..n"
}
association HasRows {
owner Layout::Table
owner_type composition
member_type Layout::Tr
member_multiplicity "1..n"
}
association HasCells {
owner Layout::Tr
owner_type composition
member_type Layout::Td
member_multiplicity "1..n"
}
}Every concrete function class of Annex A is a Function with a fixed operand count and order; the abstract shapes above (unary, binary, ternary, nary) are the families the concrete classes specialise.
5.4 Root and ownership
A formula tree has exactly one root, a Formula. The root holds the ordered top-level nodes and the presentation options; descendant nodes carry none. Display style, font defaults and line width are decided once, at the root, and applied during rendering.
EXAMPLE
A tree with one top-level node, a power of x to 2. Expected outcome. Rendering to MathML yields a <math> element containing <msup><mi>x</mi><mn>2</mn></msup>; rendering to LaTeX yields x^{2}.
5.5 Content nodes
A Symbol holds one registry reference: a glyph, an operator name or a named constant from the symbol space of the registry (1 438 entries at this edition). The class carries the per-format renderings; the tree carries only the reference.
A Number holds the numeral as written. The tree does not parse numbers into machine values — evaluation is a separate step (document 1004). Negative signs are not part of a Number; a minus is a Symbol sibling.
EXAMPLE
The tree for 10^3 + 0.5 is a Power over two Numbers and an addition symbol over a further Number. Expected outcome. Rendering to LaTeX gives 10^{3}+0.5; no rounding or normalization occurs at the model level.
A Text holds literal text to be typeset upright, copied verbatim by every surface, escaping only what the target format requires.
5.6 Function nodes
A function node is an instance of one of the concrete classes of Annex A. Operand order is normative and stable across editions: Frac renders its first operand as the numerator and its second as the denominator in every surface; Root renders its first operand as the radicand and its second as the degree. A reader may not reverse operand order to accommodate a quirk of its input; the surface writers absorb those quirks.
EXAMPLE
Root with radicand x and degree 3. Expected outcome. MathML: <mroot><mi>x</mi><mn>3</mn></mroot>. LaTeX: \sqrt[3]{x}. UnicodeMath: ∛(x&3).
The nary family carries a nary_value (∑, ∏, ∫, ∮) that the MathML and OMML surfaces emit on nary constructs.
5.7 Tables, fonts and fences
A Table holds Tr rows of Td cells; the concrete table class determines the delimiters and alignment semantics of the output, the row and cell structure is shared. Mlabeledtr is a row carrying a label. Cases renders a left brace with a null right delimiter on every surface.
A FontStyle holds one operand and one FontVariant; MathML emits it as mathvariant, OMML as run properties, LaTeX as the corresponding command, UnicodeMath as the corresponding mathematical alphanumeric character where one exists.
A Fenced holds its content and its open and close symbols; Left and Right declare the halves separately in the linear surfaces.
5.8 Units and uncertainty
A Unitsml embeds a unit expression written in the asciiunits content language (CalConnect 36817) together with the four renderings the UnitsML system supplies (CalConnect 36816). The tree performs no unit arithmetic: every surface emits the UnitsML-provided form for its format, and the XML form stays available machine-readably.
An Uncertainty attaches an uncertainty to a value expression. Its fields are specified in document 1002 and stated here in summary: the value, the category (standard, expanded, coverage interval), the magnitude or endpoints, the coverage factor and probability where present, the interval kind, the notation and the unit; the model-level contract stated here is that an uncertainty is carried as a node, rendering never recomputes it, and a surface without a faithful form for its category renders the category’s declared fallback from document 1002 and nothing else.
5.9 Presentation constructs
Intent and Semantics carry the MathML 4 intent and semantics constructs. Phantom renders its operand as space of the operand’s measure. Menclose, Merror, Mglyph, Mpadded, Ms, Msgroup, Msline, Multiscript, Mlabeledtr, Linebreak, None, Longdiv, Cancel, Scarry, Scarries, Obrace, Ubrace, Rule and Color model their host-format constructs under the names of those constructs.
5.10 Invariants
These properties hold for every tree a conforming implementation produces and consumes.
Syntax independence. No node records the input notation the tree was read from. Two readers given equivalent inputs produce equal trees.
Operand totality. Every function node’s operands are present and in the class-defined order before rendering; a class’s operand count is fixed.
Render totality. Every surface renders every well-formed tree; where a construct has no faithful form in a format, the surface emits the construct’s declared fallback for that format.
No formatting in the tree. Layout hints live at the root or in surface options, never in descendant nodes.
Structural equality. Two trees are equal when their classes, values and operand structure are equal. Equality does not consult rendering.
Byte stability. A writer given the same tree and the same model version emits the same bytes on every conforming implementation.
5.11 Quantity assertions
A tree may carry a quantity assertion: a statement that a subtree denotes a named quantity kind. The assertion is data — an intent annotation — and the tree performs no arithmetic gating with it. The semantics of assertions and their use in evaluation are specified in document 1004.
5.12 Normalisation
The tree form is canonical within a model version. Constructions that differ only in incidental ways — a lone parameter held directly versus wrapped in a single-child container, equivalent fence pairings, a unary function written with or without explicit grouping — produce the same canonical tree after normalisation, and normalisation is applied at construction time, not at render time. Writers therefore never normalise: they render what the tree holds.
Structural equality ([formula-tree]) compares normalised trees. Two trees that are equal up to normalisation are equal.
EXAMPLE
The quadratic formula read from AsciiMath and read from MathML — Expected outcome. the two trees are equal after normalisation; neither required the other to adjust, and neither writer inserted normalisation steps.
6 The registry
6.1 General
The registry is the versioned catalogue of everything the model can name: the symbol entries (6.3, Paragraph 1) and the function entries (Clause 12). It exists so that the vocabulary of the system is data, not code spread across readers and writers.
6.2 Entry shape
A registry entry names one thing the model can represent and carries its renderings. The entry is an LML model:
models Registry {
class SymbolEntry {
attribute name, String[1]
attribute glyph, String
attribute mathml, String[1]
attribute latex, String[1]
attribute omml, String[1]
attribute unicodemath, String[1]
attribute categories, Category { cardinality 1..n }
attribute status, EntryStatus[1]
}
class FunctionEntry {
attribute name, String[1]
attribute operands, String[1]
attribute fallbacks, String { cardinality 0..n }
attribute status, EntryStatus[1]
}
enum Category {
value greek
value operator
value arrow
value relation
value logic
value trigonometric
value nary
value accent
}
enum EntryStatus {
value active
value deprecated
}
}Prose restatement of the fields:
| Field | Content |
|---|---|
| name | the class name of the entry (Alpha, Frac, Matrix, Plusminus) |
| glyph | the displayed Unicode character or character sequence where one exists |
| mathml | the MathML rendering (entity name, character, or construct) |
| latex | the LaTeX rendering (command or literal) |
| omml | the OMML rendering (run text or construct reference) |
| unicodemath | the UnicodeMath token or character |
| categories | grouping tags: greek, operator, arrow, relation, logic, trigonometric, nary, and so on |
Entries are immutable once published. A correction to an entry is a new registry edition, never a mutation.
6.3 The symbol space
The symbol registry at this edition contains 1 438 entries, one implementation class each, generated from the registry data. The space covers the Greek alphabet (upper and lower), Latin letters in their mathematical roles, binary and relation operators, arrows, set and logic symbols, integrals and nary operators, accents and decoration forms, and the named constants of the input notations.
The complete listing is generated from the registry; this document does not print it. Annex B shows representative entries per category and the lifecycle of an entry.
6.4 Generation
The symbol classes and the parser vocabulary of each input notation are generated from the registry data. Generation is deterministic: the same registry edition produces byte-identical generated sources. A build that regenerates and finds a diff fails.
The generated artifacts are committed, and the build compares them against the registry as a drift check; a hand-edit to a generated file that survives regeneration is a defect.
6.5 Collision discipline
A new entry whose name or glyph collides with an existing entry, or with a name reserved by the model (Formula, Symbol, Number, Text, Function, the class names of Clause 12), fails the build. The registry does not permit two entries to share a class name, and the model does not permit an entry to shadow a model class.
6.6 Versioning
The registry is editioned with this document series. An entry’s renderings are stable within an edition: a writer using edition 1 entries produces the same bytes for the same tree across all model versions that declare edition 1. New entries join at the next edition; renderings of existing entries do not change within an edition.
6.7 Unit terminals
The unit expressions that may appear inside a Unitsml node are not registry entries of this document. They come from the UnitsDB dataset through the asciiunits artifact of the UnitsML series (CalConnect 36814, 1006), and the model consumes them as opaque validated content. Nothing in this registry duplicates a unit name, a prefix, or a quantity — the registry’s single source of truth for units is the UnitsDB dataset.
EXAMPLE
Adding a symbol for a newly standardised operator to the registry: the entry is defined (name, glyph, four renderings, category), the registry data changes, regeneration produces the new symbol class, the collision build passes, and the next registry edition ships it. Expected outcome. Trees built after the edition render the new glyph in all four surfaces; trees built before are unaffected; no previously published byte sequence changes.
7 Rendering
7.1 The surfaces
The model renders to six surfaces:
| Surface | Entry point | Outer element |
|---|---|---|
| MathML 4 | to_mathml | <math> (with intent options per MathML 4) |
| OMML | to_omml | m:oMath (office math namespace of ECMA-376) |
| LaTeX | to_latex | none (a LaTeX fragment) |
| UnicodeMath | to_unicodemath | none (a linear string) |
| HTML | to_html | none (an HTML fragment) |
| AsciiMath | to_asciimath | none (a linear string) |
Each surface has one entry point on the root and one rendering rule per node class. The math zone printer (to_asciimath_math_zone and its per-format siblings) is the diagnostic surface: it prints the tree as the indented notation of [conventions]-style examples.
7.2 Stability
Writers are deterministic. The same tree rendered by the same model version produces the same bytes, and a conforming implementation reproduces those bytes. Renderer output is covered by replay corpora: for each surface there is a frozen set of trees with frozen expected byte sequences, and a writer change that changes any of those bytes is a model-version change, not a patch.
7.3 Fallbacks
Some constructs have no faithful form in some surfaces. Each such pair has one declared fallback, recorded with the class in Clause 12, and the writer emits the fallback and nothing else: no marker, no warning channel in the output. Typical fallbacks: colour is dropped in LaTeX output when no colour package context is present, intent annotations are dropped in surfaces without annotation mechanisms, Mglyph degrades to its alt text in OMML.
7.4 Lossless and lossy directions
A surface is lossless when reading its output back yields a tree equal to the rendered tree. AsciiMath, MathML, OMML, LaTeX and UnicodeMath are the lossless directions of the readers defined in document 1003, each with the exceptions that document enumerates. HTML is a display surface: reading it back is not part of the contract, and its renderings optimise presentation.
EXAMPLE
Rendering the tree of to all six surfaces and reading the MathML, OMML, LaTeX and UnicodeMath outputs back: Expected outcome. All four read back to a tree structurally equal to the original. The HTML output is not required to read back.
7.5 Construct mapping
The same tree renders through every surface. The mapping below is the normative correspondence between node families and the constructs each surface emits; the per-class notes of Clause 12 refine it.
| Family | MathML | OMML | LaTeX | UnicodeMath |
|---|---|---|---|---|
| Fractions | mfrac | m:f with m:num, m:den | \frac{}{} | linear ()/() |
| Roots | msqrt, mroot | m:rad with degree visibility | \sqrt{}, \sqrt[]{} | √(), ∛(x&n) |
| Scripts | msub, msup, msubsup, mmultiscripts | m:sSub, m:sSup, m:sSubSup, m:sPre | _{}, ^{}, _{}^{} | _, ^ |
| Nary operators | mo with munder/mover limit pairs | m:nary with m:sub, m:sup, m:e | \sum_{}^{}, \int_{}^{} | ∑_^^, ∫_^^ |
| Tables | mtable, mtr, mtd, mlabeledtr | m:m, m:mr, m:e with delimiters per class | matrix, pmatrix, cases, aligned | ■(...) with @ row separators |
| Fences | mrow with mo delimiters | m:d with m:dPr | \left..\right | parenthesised grouping |
| Font styles | mathvariant on mi | m:rPr run properties | \mathbf{}, \mathfrak{}, \mathcal{} | mathematical alphanumeric code points |
| Accents | mover with accent mo | m:acc with m:chr | \bar, \vec, \hat, \tilde | combining characters |
| Text | mtext | m:r with upright run | \text{}, \mbox{} | quoted string |
| Units | UnitsML MathML form with <UnitsML> reference | UnitsML OMML form | UnitsML LaTeX form | UnitsML Unicode form |
| Uncertainty | per document 1002 | per document 1002 | per document 1002 | per document 1002 |
Where a family has no faithful construct in a surface, the declared fallback applies ([fallbacks]); the mapping above lists only the faithful forms.
7.6 OMML specifics
The OMML surface emits run properties (fonts, styles) from font style nodes, nary constructs from the nary classes, matrices from the table classes, and preserves linebreak semantics from Linebreak nodes and from the root’s linebreak option. Display style: the root’s display flag selects m:oMathPara wrapping; inline rendering omits it.
7.7 MathML specifics
The MathML surface emits MathML 4. Intent annotations carried by Intent nodes become intent attributes; Semantics nodes become semantics elements with their annotations as annotation children. Font style nodes become mathvariant. Tables become mtable/mtr/mtd, with labelled rows as mlabeledtr. Numbers become mn, symbols become mi or mo per their registry entry, and text becomes mtext.
7.8 Display and inline
The root’s display style selects between the display and inline forms of each surface: MathML toggles display="block"; OMML toggles the m:oMathPara wrapper; LaTeX and UnicodeMath choose display-only constructs (display fractions, centred nary limits) over their inline forms; HTML applies the display style class. The tree content is identical in both forms; only the surface presentation changes.
EXAMPLE
The formula sum_(i=1)^n i rendered with display style set and unset. Expected outcome. Display form: MathML display="block", LaTeX \sum_{i=1}^{n}i in display context with limits under and over; inline form: limits rendered beside the operator in LaTeX and UnicodeMath, and no block wrapper in MathML or OMML. The trees are identical.
9 Extensibility
The model grows by adding to it, not by modifying it. This clause states the extension points and the discipline each one carries.
The model grows by adding to it, not by modifying it.
9.1 Adding a node class
A new construct enters the model as a new class with: its operands, its registry entry (if it names a symbol), its per-surface rendering rules, and — where a surface has no faithful form — its declared fallbacks. No existing class changes. The collision build of Clause 6 applies.
9.2 Adding a registry entry
A new symbol or constant joins the registry per the entry lifecycle of Annex B. Generated sources regenerate; existing byte sequences are unchanged.
9.3 Adding a surface
A new output format is a new set of per-class rendering rules behind one root entry point. The node classes are untouched: the per-format field printers on the base are extended with the new surface’s printer, and each class supplies its rule. A surface that ships without a rule for a class fails the build — render totality (Clause 7) is enforced at build time, not discovered at run time.
9.4 Adding an input format
Readers are outside this document (document 1003). This document constrains them in one way: a reader ends at the tree. A reader that requires a change to a node class to accommodate its input is a model change and follows [adding-a-node-class].
9.5 Deprecation
A node class or registry entry is deprecated by marking it in the registry and this document, keeping its behaviour byte-stable, and removing it at a stated edition. Nothing is removed silently and no published output changes between the deprecation and the removal.
9.6 Worked extension
EXAMPLE 1
A new arrow symbol (a rightwards arrow with a bar) is added to the registry. Expected outcome. The entry carries its glyph and its four format renderings; generation produces the symbol class; the collision build confirms neither the name nor the glyph exists in the registry, the model class names, or the UnitsDB symbol space; a corpus entry freezing the six-surface rendering joins the render corpus; the next registry edition ships all of it. Trees that do not use the new symbol are untouched, and every previously published byte sequence is unchanged.
EXAMPLE 2
A new construct is needed for an upcoming OMML feature: a run-level alignment mark. Expected outcome. A new node class is added with its operands, its OMML rendering, and declared fallbacks for the surfaces without a faithful form; the render-totality build fails until every surface has a rule or a fallback; the class joins Annex A at the next edition. No existing class is modified.
11 Conformance
Conformance to this document is claimed per class, and every claim is discharged by replaying frozen vectors. Nothing in this clause is satisfied by assertion alone.
11.1 What conformance covers
An implementation of this document is an implementation of the math model: the tree, the node classes of Clause 12, the registry behaviour, and the writers of the six surfaces. Readers and the uncertainty and evaluation semantics are covered by documents 1003, 1002 and 1004; conformance to those documents is claimed separately.
11.2 Conformance classes
| Class | Licenses the implementation to claim | Replay requirements |
|---|---|---|
| model | constructs, inspects and transforms trees per [formula-tree] | structural-equality and math-zone vectors of Annex C |
| render-mathml | emits MathML 4 per Clause 7 | the MathML column of the render corpus, byte-identically |
| render-omml | emits OMML per Clause 7 | the OMML column of the render corpus, byte-identically |
| render-latex | emits LaTeX per Clause 7 | the LaTeX column of the render corpus, byte-identically |
| render-unicodemath | emits UnicodeMath per Clause 7 | the UnicodeMath column of the render corpus, byte-identically |
| render-html | emits the HTML surface per Clause 7 | the HTML column of the render corpus, byte-identically |
| render-asciimath | emits AsciiMath per Clause 7 | the AsciiMath column of the render corpus, byte-identically |
| full-model | all of the above | all columns |
A conformance claim names the classes it makes. A claim of render-<format> carries model with it: no surface can be claimed without the tree it renders.
11.3 The render corpus
The render corpus is a frozen set of trees and, per surface, their expected bytes. A corpus entry states its provenance (the tree’s construction, the model version that froze the bytes) and is replayed without modification. Corpus bytes change only at an edition: a new corpus entry joins frozen; a frozen entry never changes.
11.4 Drift
An implementation whose output for any frozen entry differs from the corpus bytes does not conform at the model version the corpus was frozen against, whatever its own version string says. Divergence is resolved by a model-version change and a new corpus entry, or by fixing the implementation.
12 Annex A: node class reference
12.1 General
This annex enumerates every function class of the model at this edition: 103 function classes, 14 font styles and 10 table classes. The list is normative. A class’s operands column uses 1, 2, 3, or “rows” for the table containers.
12.2 The inventory as a model
lml "1.0"
models FunctionInventory {
package Elementary {
class Abs
class Arg
class Ceil
class Deg
class Det
class Dim
class Exp
class Floor
class Gcd
class Glb
class Hom
class Inf
class Ker
class Lcm
class Lub
class Max
class Min
class Mod
class Norm
}
package Trigonometric {
class Sin
class Cos
class Tan
class Cot
class Sec
class Csc
class Sinh
class Cosh
class Tanh
class Coth
class Sech
class Csch
class Arcsin
class Arccos
class Arctan
}
package Logarithmic {
class Ln
class Lg
class Log
}
package ScriptPlacement {
class Power
class PowerBase
class Base
class Sup
class Ul
class Underover
class Over
class Overleftrightarrow
class Overset
class Underset
class Stackrel
class Substack
class Limits
class Lim
class Liminf
class Limsup
class Multiscript
}
package Fractions {
class Frac
class Root
class Sqrt
class Longdiv
class Cancel
class Scarry
class Scarries
}
package Fences {
class Fenced
class Left
class Right
class Obrace
class Ubrace
}
package Accents {
class Bar
class Vec
class Hat
class Tilde
class Dot
class Ddot
}
package Calculus {
class Sum
class Prod
class Int
class Oint
class Nary
}
package Tables {
class Table
class Td
class Tr
class Mlabeledtr
class Matrix
class Bmatrix
class Pmatrix
class Vmatrix
class Cases
class Array
class Align
class Eqarray
class Split
class Multline
}
package TextAndAnnotation {
class Text
class Mbox
class Intent
class Semantics
}
package Presentation {
class Phantom
class Menclose
class Merror
class Mglyph
class Mpadded
class Ms
class Msgroup
class Msline
class None
class Linebreak
class Rule
class Color
}
package Measurement {
class Unitsml
class Uncertainty
}
package Bases {
class UnaryFunction
class BinaryFunction
class TernaryFunction
}
}
The operand shape of each class is the family it belongs to in [formula-tree]: the Elementary and Trigonometric classes are unary with an optional limit where their input notation carries one; Log and Lg are unary with an optional base operand; the ScriptPlacement classes are binary (Power, Over, Underset, and the rest) or ternary (PowerBase, Underover); the Calculus classes are nary; the Tables containers hold rows. The tables below give the semantics and surface notes per class.
12.3 Elementary functions and operators
Elementary function classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Abs | absolute value |x| | 1 | fence pair on every surface |
| Arg | arg arg x | 1 | upright operator name |
| Ceil | ceiling ⌈x⌉ | 1 | fence pair |
| Det | determinant det | 1 | upright operator name |
| Dim | dimension dim | 1 | upright operator name |
| Exp | exponential exp | 1 | upright operator name |
| Floor | floor ⌊x⌋ | 1 | fence pair |
| Gcd | greatest common divisor | 1–2 | upright operator name |
| Glb | greatest lower bound glb | 1 | upright operator name |
| Hom | homomorphism hom | 1 | upright operator name |
| Inf | infimum inf | 1 | upright with optional limit |
| Ker | kernel ker | 1 | upright operator name |
| Lcm | least common multiple | 1–2 | upright operator name |
| Lub | least upper bound lub | 1 | upright operator name |
| Max | maximum | 1–2 | upright operator name |
| Min | minimum | 1–2 | upright operator name |
| Mod | modulo | 2 | upright with spaced operands |
| Norm | norm ‖x‖ | 1 | double fence pair |
| Deg | degrees deg | 1 | upright operator name |
12.4 Trigonometric and hyperbolic
Trigonometric and hyperbolic classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Sin, Cos, Tan, Cot, Sec, Csc | circular functions | 1 | upright operator names |
| Sinh, Cosh, Tanh, Coth, Sech, Csch | hyperbolic functions | 1 | upright operator names |
| Arcsin, Arccos, Arctan | inverse circular functions | 1 | upright operator names |
12.5 Logarithmic and exponential
Logarithmic and exponential classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Ln | natural logarithm | 1 | upright operator name |
| Lg | decadic logarithm | 1–2 | upright operator name; second operand is the base where written |
| Log | logarithm | 1–2 | upright operator name; second operand is the base where written |
| Exp | exponential | 1 | upright operator name |
12.6 Script placement and limits
Script placement and limit classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Power | superscript (x^2) | 2 | msup / run properties / ^{} / ^ |
| PowerBase | base with sub and superscript (x_2^3) | 3 | msubsup / combined / _{}^{} |
| Base | subscript (x_1) | 2 | msub / _{} / _ |
| Underover | sub and superscript under/over a large operator | 3 | munderover / \sum_{}^{} |
| Over | overscript | 2 | mover / \overset |
| Overset | pairing over | 2 | mover (accentless) |
| Underset | pairing under | 2 | munder |
| Stackrel | binomial-style stack | 2 | stacked pair |
| Substack | stacked limits under an operator | 1 (rows) | stacked rows |
| Limits | limits placement declaration | 1 | limits rendered under/over rather than beside |
| Lim | limit lim | 1 | upright with optional limit |
| Liminf, Limsup | limit inferior/superior | 1 | upright compound names |
| Multiscript | post-sub/superscript pairs (mmultiscripts) | rows | MathML construct; OMML pre-sub/superscript |
12.7 Fractions, roots and cancellation
Fraction, root and cancellation classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Frac | fraction | 2 | mfrac / \frac{}{} / linear ()/() |
| Root | nth root | 2 | mroot; first operand is the radicand, second the degree |
| Sqrt | square root | 1 | msqrt / \sqrt{} |
| Longdiv | long division layout | 1–2 | layout construct; fallback per surface |
| Cancel | strike-through of the whole operand | 1 | mcancel / \cancel |
| Scarry, Scarries | carry strike-through pairs (digit arithmetic) | 1–2 | mscarry / layout fallback |
12.8 Fences and delimiters
Fence and delimiter classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Fenced | content with an open and a close symbol | 3 | mrow with delimiters / \left..\right |
| Left | left delimiter declaration | 1 | pairs with Right in linear surfaces |
| Right | right delimiter declaration | 1 | pairs with Left |
| Obrace | over brace {} | 1 | mover with brace |
| Ubrace | under brace | 1 | munder with brace |
12.9 Accents and decorations
Accent and decoration classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Bar | bar over | 1 | \bar |
| Vec | vector arrow over | 1 | \vec |
| Hat | hat over | 1 | \hat |
| Tilde | tilde over | 1 | \tilde |
| Dot | dot over | 1 | \dot |
| Ddot | double dot over | 1 | \ddot |
| Overleftrightarrow | left-right arrow over | 1 | \overleftrightarrow |
12.10 Calculus and nary operators
Calculus and nary operator classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Sum | summation ∑ | 1 + limits | nary on MathML/OMML |
| Prod | product ∏ | 1 + limits | nary on MathML/OMML |
| Int | integral ∫ | 1 + limits | nary on MathML/OMML |
| Oint | contour integral ∮ | 1 + limits | nary on MathML/OMML |
| Nary | generic nary operator | 1 + limits | carries its own nary element value |
12.11 Tables
Table classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Table | generic table container | rows | mtable |
| Td | table cell | 1 | mtd |
| Tr | table row | cells | mtr |
| Mlabeledtr | labelled row | cells | mlabeledtr |
| Matrix | plain matrix | rows | parenthesised grid |
| Bmatrix | curly-brace matrix | rows | \{..\} grid |
| Pmatrix | parenthesis matrix | rows | (..) grid |
| Vmatrix | vertical-bar matrix | rows | |..| grid |
| Cases | case selection | rows | left brace, null right delimiter |
| Array | array with alignment | rows | array environment |
| Align | aligned equations | rows | alignment points preserved |
| Eqarray | equation array | rows | alignment at relations |
| Split | split equation | rows | line structure preserved |
| Multline | multiline equation | rows | line structure preserved |
12.12 Text and annotation
Text and annotation classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Text | upright text run | 1 | mtext / \text{} / upright run |
| Mbox | text box | 1 | mtext / \mbox{} |
| Intent | MathML 4 intent annotation | 1 + value | intent attribute; dropped elsewhere |
| Semantics | annotated expression | 1 + annotations | semantics element; fallback is the expression alone |
12.13 Presentation constructs
Presentation construct classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Phantom | space of the operand’s measure | 1 | mphantom / \phantom{} |
| Menclose | notations around content | 1 + notations | menclose; boxed fallback |
| Merror | error marker | 1 | merror; verbatim elsewhere |
| Mglyph | glyph reference | 0 + attributes | image reference; alt text fallback |
| Mpadded | padded box | 1 + attributes | mpadded; dropped elsewhere |
| Ms | string literal | 1 | ms / quoted run |
| Msgroup | stack group | children | msgroup; layout fallback |
| Msline | fraction bar in a stack | 0 | msline; rule fallback |
| None | empty slot | 0 | none element; empty cell |
| Linebreak | line break | 0 | mbreaking space / \\ |
| Rule | rule element | 0 + attributes | mstyle-rule fallback |
| Color | colour application | 1 + value | mathcolor / \textcolor; dropped where unsupported |
12.14 Units and uncertainty
Unit and uncertainty classes:
| Class | Meaning | Operands | Surface notes |
|---|---|---|---|
| Unitsml | UnitsML unit embedding | 0 + expression | per-format forms supplied by UnitsML (CalConnect 36816) |
| Uncertainty | uncertainty attachment | 1 + fields | fields per document 1002 |
12.15 Generic bases
These are the abstract bases the concrete classes specialise. They appear in trees only when a reader needs a function with no concrete class, which is a defect to be fixed at the model level.
| Class | Role |
|---|---|
| UnaryFunction | one-operand base |
| BinaryFunction | two-operand base |
| TernaryFunction | three-operand base |
| Nary | nary-operator base |
| Base | subscript-form base |
| Ul, Sup | linear-surface subscript/superscript bases |
12.16 Font styles
The 14 font style classes apply a mathematical font variant to their operand. Each carries one operand; the surfaces carry the variant per the mapping.
| Class | MathML | LaTeX | UnicodeMath |
|---|---|---|---|
| bold | mathvariant=”bold” | mathbf{} | bold alphanumeric range |
| italic | mathvariant=”italic” | mathit{} | italic alphanumeric range |
| bold-italic | mathvariant=”bold-italic” | oldsymbol{} | bold-italic range |
| sans-serif | mathvariant=”sans-serif” | mathsf{} | sans-serif range |
| sans-serif-italic | mathvariant=”sans-serif-italic” | mathsfit{} | sans-serif-italic range |
| sans-serif-bold-italic | mathvariant=”sans-serif-bold-italic” | mathsfbfit{} | sans-serif-bold-italic range |
| bold-sans-serif | mathvariant=”bold-sans-serif” | mathsfbf{} | bold sans-serif range |
| monospace | mathvariant=”monospace” | mathtt{} | typewriter range |
| fraktur | mathvariant=”fraktur” | mathfrak{} | fraktur range |
| bold-fraktur | mathvariant=”bold-fraktur” | mathbffrak{} | bold fraktur range |
| script | mathvariant=”script” | mathcal{} | script range |
| bold-script | mathvariant=”bold-script” | mathbfscr{} | bold script range |
| double-struck | mathvariant=”double-struck” | mathbb{} | double-struck range |
| normal | mathvariant=”normal” | mathrm{} | upright range |
Where an alphanumeric range does not exist for a character, the UnicodeMath surface renders the plain character with the variant dropped, per the fallback rule.
14 Annex B: registry entry lifecycle
This annex walks a registry entry from definition to publication. The normative rules live in the registry clause; this annex shows them applied.
This annex walks a registry entry from definition to publication, with representative entries per category. It illustrates Clause 6; the normative rules are stated there.
14.1 Defining an entry
An entry is a row of the registry data: name, glyph, the four format renderings, categories. Two examples:
| name | glyph | mathml | latex | omml | unicodemath | categories |
|---|---|---|---|---|---|---|
| Alpha | α | α | \alpha | run “α” | α | greek |
| Plusminus | ± | ± | \pm | run “±” | ± | operator, relation |
The generated symbol class is derived from the name: Plurimath::Math::Symbols::Alpha, Plurimath::Math::Symbols::Plusminus. The class holds the entry; the tree and the readers refer to the class.
14.2 Adding an entry
The steps of a new entry, in order:
The entry is added to the registry data with all fields filled; a field for which no rendering exists carries the declared empty rendering, not prose.
Generation runs; the new symbol class appears in the generated sources.
The collision build checks the name and the glyph against the existing registry, the model class names, and the UnitsDB symbol space. A collision fails the build.
The render corpus gains an entry exercising the new glyph in all six surfaces, frozen against the model version that ships it.
The registry edition is published; this document’s symbol-space count (1 438 at edition 1) is updated.
No step reorders: a glyph that fails collision never ships; a corpus entry is never retrofitted after publication.
14.3 Function entries
Function classes are not registry rows in the same sense — their semantics live in this document (Clause 12) and their renderings in their class definitions — but they obey the same discipline: a new function class ships with its operand definition, its per-surface rules, its fallbacks, and a frozen corpus entry per surface.
14.4 Deprecation path
A deprecated entry keeps its class, its glyph and its renderings byte-stable. The registry marks it deprecated with the edition of removal. Readers that encounter the entry keep parsing it; writers keep writing it. At the removal edition, the class is deleted, the corpus entries that used it are superseded, and the registry count decreases.
14.5 Counting
The symbol-space count is asserted by the build against the registry data, so this document’s count and the registry cannot disagree silently. Edition 1: 1 438 symbol entries, 103 function classes, 14 font styles, 10 table classes.
14.6 Representative symbol entries
The entries below are drawn from the registry at this edition; each row is one symbol entry with its input tokens and its LaTeX rendering as published.
| Entry | Glyph | AsciiMath | UnicodeMath | LaTeX |
|---|---|---|---|---|
| Alpha | α | alpha | alpha | \alpha |
| Beta | β | beta | beta | \beta |
| Gamma | Γ | Gamma | Gamma | \Gamma |
| Delta | Δ | Delta | Delta | \Delta |
| Omega | Ω | Omega | Omega | \Omega |
| Entry | Glyph | AsciiMath | UnicodeMath | LaTeX |
|---|---|---|---|---|
| Sum | ∑ | sum | sum | \sum |
| Prod | ∏ | prod | prod | \prod |
| Int | ∫ | int | int | \int |
| Oint | ∮ | oint | oint | \oint |
| Entry | Glyph | AsciiMath | UnicodeMath | LaTeX |
|---|---|---|---|---|
| Pm | ± | pm | pm | \pm |
| Times | × | times | times | \times |
| Leq | ≤ | leq | le | \leq |
| Geq | ≥ | geq | ge | \geq |
| Neq | ≠ | neq | ne | \neq |
| Approx | ≈ | approx | approx | \approx |
| Equiv | ≡ | equiv | equiv | \equiv |
| Entry | Glyph | AsciiMath | UnicodeMath | LaTeX |
|---|---|---|---|---|
| Forall | ∀ | forall | forall | \forall |
| Exists | ∃ | exists | exists | \exists |
| Neg | ¬ | neg | neg | \neg |
| Land | ∧ | and | and | \land |
| Lor | ∨ | or | or | \lor |
| Entry | Glyph | AsciiMath | UnicodeMath | LaTeX |
|---|---|---|---|---|
| Partial | ∂ | partial | partial | \partial |
| Infty | ∞ | oo | infty | \infty |
| Rightarrow | ⇒ | => | Rightarrow | \Rightarrow |
| Cup | ∪ | cup | cup | \cup |
| Cap | ∩ | cap | cap | \cap |
An entry carries more than the table shows: each row’s registry record also holds the MathML and OMML renderings and the additional input tokens (an entry may have several accepted tokens per notation; Alpha accepts alpha and the numeric character reference, for instance). The tables show the primary tokens.
15 Annex C: test-suite examples
15.1 General
Vectors illustrative of the conformance classes of [conformance-classes]. Each vector states the construction, the property under test, and the expected outcome. The replay corpora carry the frozen versions of these vectors.
15.2 Structural equality (class model)
EXAMPLE 1
Two trees built independently — one by nesting Power over Frac, one by rendering the equivalent LaTeX and reading it back with the LaTeX reader — Expected outcome. structural equality holds: same classes, same values, same operand structure at every node.
EXAMPLE 2
A tree containing a Text node whose content contains characters escaped differently in two constructions (raw < versus the escaped entity) — Expected outcome. the trees are equal; Text content is compared after unescaping, because content is data and escaping is a surface concern.
15.3 Math zone (class model)
EXAMPLE
Formula.new([Symbol.new("+")]) printed to the math zone — Expected outcome. the zone line is Formula followed by the indented line └─ Symbol("+").
15.4 Render replay (class render-<format>)
EXAMPLE 1
The tree for x^2 + y_1 rendered to each surface — Expected outcome. MathML x^{2}+y_{1}-equivalent markup with msup/msub; LaTeX x^{2}+y_{1}; UnicodeMath x^2+y_1; AsciiMath x^2+y_1; OMML with run-based sub/superscript structures; HTML with sub/sup elements. All six byte-frozen in the corpus.
EXAMPLE 2
Frac with numerator a+b and denominator c, inside Fenced with round delimiters — Expected outcome. MathML mrow(mo("("), mfrac(...), mo(")")); LaTeX \left(\frac{a + b}{c}\right); UnicodeMath (a+b)/c; OMML fraction structure inside delimiter structure.
15.5 Fallback verification (classes render-*)
EXAMPLE
A Color node rendering to LaTeX without colour context, and to MathML — Expected outcome. LaTeX output omits the colour and renders the operand; MathML output carries mathcolor. Both are the declared behaviours; neither emits a marker.
15.6 Byte stability (all render classes)
EXAMPLE
The full render corpus replayed on two implementations, different operating systems, same model version — Expected outcome. byte-identical output for every entry of every surface; any difference is nonconformance.
15.7 Model identity (class model)
EXAMPLE 1
The same formula constructed through two different paths — direct tree construction and reading its AsciiMath form — Expected outcome. the trees are structurally equal, and the math zones are identical line for line.
EXAMPLE 2
A tree containing an Uncertainty node with category standard, magnitude 0.2, attached to an estimate 10.3 — Expected outcome. the node is carried as specified in document 1002; every surface renders the uncertainty in its declared form; no surface recomputes the magnitude; the math zone prints the node with its fields.
15.8 Units embedding (classes render-*)
EXAMPLE
A tree whose top level is a Unitsml node with expression kg*m/s^2 — Expected outcome. each surface emits the UnitsML-provided form for its format (MathML, OMML, LaTeX, Unicode, XML per CalConnect 36816); the asciiunits expression is preserved verbatim in the model; no surface expands or rewrites the expression.
15.9 Fallback discipline (classes render-*)
EXAMPLE
An Mglyph node rendered to OMML, and a Color node rendered to LaTeX without colour context — Expected outcome. Mglyph degrades to its alt text in OMML; the colour is dropped and its operand rendered. Neither output carries a marker or placeholder; both are the declared fallbacks of [fallbacks].
15.10 Registry stability (class model)
EXAMPLE
A tree containing the symbol entries Alpha and Plusminus, rendered before and after a registry regeneration within the same edition — Expected outcome. byte-identical output in all six surfaces; regeneration changes nothing observable. A change in observable output within an edition is a registry defect.
15.11 Normalisation (class model)
EXAMPLE
The same expression constructed with and without an explicit single-child container around its operand — Expected outcome. the normalised trees are equal; the writers receive the same canonical form from both constructions and emit the same bytes in every surface.
Bibliography
[1] Plurimath repository, — https://github.com/plurimath/plurimath
[2] Plurimath specification set overview, — the design corpus underlying this series
[3] Pendrill, L. R. (2024), Quantities and units: order amongst complexity, De Gruyter
[4] isq-smart methodology, concept systems — https://metanorma.github.io/isq-smart/methodology/concept-system/
[5] MathML 4, — https://www.w3.org/TR/MathML4/
[6] ECMA-376, Office Open XML File Formats
[7] Unicode Technical Report #28, Unicode Support for Mathematics