Draft Standard

Ribose Standard

•
1001(d) (draft 2026-10-31)
Plurimath specifications — Math model
Plurimath
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 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

Table 1 — .Documents in the series
NumberTitleSubject
1001Math modelThe formula tree, the node classes, the symbol and function registry, the rendering surfaces
1002Uncertainty modelUncertainty nodes, their fields and their per-format representations
1003Format interfacesThe per-format readers and writers: MathML, OMML, UnicodeMath, LaTeX, HTML, AsciiMath
1004EvaluationNumeric 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 ∑ i = 1 n i 3 = ( n ( n + 1 ) 2 ) 2 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

Table 2 — Relationship to the series
DocumentRelationship to this one
1002 Uncertainty modeldefines the fields this document’s Uncertainty node carries and their per-format representations
1003 Format interfacesdefines the readers that produce this document’s tree and the writer-side detail per surface
1004 Evaluationconsumes this document’s tree numerically; the model performs no arithmetic
CalConnect 36813, 1005, 1006define 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")
Figure 1

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"
  }
}
Figure 2

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"
  }
}
Figure 3

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
  }
}
Figure 4

Prose restatement of the fields:

Table 3 — .Registry entry fields
FieldContent
namethe class name of the entry (Alpha, Frac, Matrix, Plusminus)
glyphthe displayed Unicode character or character sequence where one exists
mathmlthe MathML rendering (entity name, character, or construct)
latexthe LaTeX rendering (command or literal)
ommlthe OMML rendering (run text or construct reference)
unicodemaththe UnicodeMath token or character
categoriesgrouping 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:

Table 4 — .Rendering surfaces
SurfaceEntry pointOuter element
MathML 4to_mathml<math> (with intent options per MathML 4)
OMMLto_ommlm:oMath (office math namespace of ECMA-376)
LaTeXto_latexnone (a LaTeX fragment)
UnicodeMathto_unicodemathnone (a linear string)
HTMLto_htmlnone (an HTML fragment)
AsciiMathto_asciimathnone (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 ( n ( n + 1 ) 2 ) 2 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.

Table 5 — Construct mapping by surface
FamilyMathMLOMMLLaTeXUnicodeMath
Fractionsmfracm:f with m:num, m:den\frac{}{}linear ()/()
Rootsmsqrt, mrootm:rad with degree visibility\sqrt{}, \sqrt[]{}√(), ∛(x&n)
Scriptsmsub, msup, msubsup, mmultiscriptsm:sSub, m:sSup, m:sSubSup, m:sPre_{}, ^{}, _{}^{}_, ^
Nary operatorsmo with munder/mover limit pairsm:nary with m:sub, m:sup, m:e\sum_{}^{}, \int_{}^{}∑_^^, ∫_^^
Tablesmtable, mtr, mtd, mlabeledtrm:m, m:mr, m:e with delimiters per classmatrix, pmatrix, cases, aligned■(...) with @ row separators
Fencesmrow with mo delimitersm:d with m:dPr\left..\rightparenthesised grouping
Font stylesmathvariant on mim:rPr run properties\mathbf{}, \mathfrak{}, \mathcal{}mathematical alphanumeric code points
Accentsmover with accent mom:acc with m:chr\bar, \vec, \hat, \tildecombining characters
Textmtextm:r with upright run\text{}, \mbox{}quoted string
UnitsUnitsML MathML form with <UnitsML> referenceUnitsML OMML formUnitsML LaTeX formUnitsML Unicode form
Uncertaintyper document 1002per document 1002per document 1002per 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.

8  Extensibility

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.

10  Conformance

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

Table 6 — .Conformance classes
ClassLicenses the implementation to claimReplay requirements
modelconstructs, inspects and transforms trees per [formula-tree]structural-equality and math-zone vectors of Annex C
render-mathmlemits MathML 4 per Clause 7the MathML column of the render corpus, byte-identically
render-ommlemits OMML per Clause 7the OMML column of the render corpus, byte-identically
render-latexemits LaTeX per Clause 7the LaTeX column of the render corpus, byte-identically
render-unicodemathemits UnicodeMath per Clause 7the UnicodeMath column of the render corpus, byte-identically
render-htmlemits the HTML surface per Clause 7the HTML column of the render corpus, byte-identically
render-asciimathemits AsciiMath per Clause 7the AsciiMath column of the render corpus, byte-identically
full-modelall of the aboveall 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
  }
}
Figure 5

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:

Table 7 — Elementary function classes
ClassMeaningOperandsSurface notes
Absabsolute value |x|1fence pair on every surface
Argarg arg x1upright operator name
Ceilceiling ⌈x⌉1fence pair
Detdeterminant det1upright operator name
Dimdimension dim1upright operator name
Expexponential exp1upright operator name
Floorfloor ⌊x⌋1fence pair
Gcdgreatest common divisor1–2upright operator name
Glbgreatest lower bound glb1upright operator name
Homhomomorphism hom1upright operator name
Infinfimum inf1upright with optional limit
Kerkernel ker1upright operator name
Lcmleast common multiple1–2upright operator name
Lubleast upper bound lub1upright operator name
Maxmaximum1–2upright operator name
Minminimum1–2upright operator name
Modmodulo2upright with spaced operands
Normnorm ‖x‖1double fence pair
Degdegrees deg1upright operator name

12.4  Trigonometric and hyperbolic

Trigonometric and hyperbolic classes:

Table 8 — Trigonometric and hyperbolic classes
ClassMeaningOperandsSurface notes
Sin, Cos, Tan, Cot, Sec, Csccircular functions1upright operator names
Sinh, Cosh, Tanh, Coth, Sech, Cschhyperbolic functions1upright operator names
Arcsin, Arccos, Arctaninverse circular functions1upright operator names

12.5  Logarithmic and exponential

Logarithmic and exponential classes:

Table 9 — Logarithmic and exponential classes
ClassMeaningOperandsSurface notes
Lnnatural logarithm1upright operator name
Lgdecadic logarithm1–2upright operator name; second operand is the base where written
Loglogarithm1–2upright operator name; second operand is the base where written
Expexponential1upright operator name

12.6  Script placement and limits

Script placement and limit classes:

Table 10 — Script placement and limit classes
ClassMeaningOperandsSurface notes
Powersuperscript (x^2)2msup / run properties / ^{} / ^
PowerBasebase with sub and superscript (x_2^3)3msubsup / combined / _{}^{}
Basesubscript (x_1)2msub / _{} / _
Underoversub and superscript under/over a large operator3munderover / \sum_{}^{}
Overoverscript2mover / \overset
Oversetpairing over2mover (accentless)
Undersetpairing under2munder
Stackrelbinomial-style stack2stacked pair
Substackstacked limits under an operator1 (rows)stacked rows
Limitslimits placement declaration1limits rendered under/over rather than beside
Limlimit lim1upright with optional limit
Liminf, Limsuplimit inferior/superior1upright compound names
Multiscriptpost-sub/superscript pairs (mmultiscripts)rowsMathML construct; OMML pre-sub/superscript

12.7  Fractions, roots and cancellation

Fraction, root and cancellation classes:

Table 11 — Fraction, root and cancellation classes
ClassMeaningOperandsSurface notes
Fracfraction2mfrac / \frac{}{} / linear ()/()
Rootnth root2mroot; first operand is the radicand, second the degree
Sqrtsquare root1msqrt / \sqrt{}
Longdivlong division layout1–2layout construct; fallback per surface
Cancelstrike-through of the whole operand1mcancel / \cancel
Scarry, Scarriescarry strike-through pairs (digit arithmetic)1–2mscarry / layout fallback

12.8  Fences and delimiters

Fence and delimiter classes:

Table 12 — Fence and delimiter classes
ClassMeaningOperandsSurface notes
Fencedcontent with an open and a close symbol3mrow with delimiters / \left..\right
Leftleft delimiter declaration1pairs with Right in linear surfaces
Rightright delimiter declaration1pairs with Left
Obraceover brace {}1mover with brace
Ubraceunder brace1munder with brace

12.9  Accents and decorations

Accent and decoration classes:

Table 13 — Accent and decoration classes
ClassMeaningOperandsSurface notes
Barbar over1\bar
Vecvector arrow over1\vec
Hathat over1\hat
Tildetilde over1\tilde
Dotdot over1\dot
Ddotdouble dot over1\ddot
Overleftrightarrowleft-right arrow over1\overleftrightarrow

12.10  Calculus and nary operators

Calculus and nary operator classes:

Table 14 — Calculus and nary operator classes
ClassMeaningOperandsSurface notes
Sumsummation ∑1 + limitsnary on MathML/OMML
Prodproduct ∏1 + limitsnary on MathML/OMML
Intintegral ∫1 + limitsnary on MathML/OMML
Ointcontour integral ∮1 + limitsnary on MathML/OMML
Narygeneric nary operator1 + limitscarries its own nary element value

12.11  Tables

Table classes:

Table 15 — Table classes
ClassMeaningOperandsSurface notes
Tablegeneric table containerrowsmtable
Tdtable cell1mtd
Trtable rowcellsmtr
Mlabeledtrlabelled rowcellsmlabeledtr
Matrixplain matrixrowsparenthesised grid
Bmatrixcurly-brace matrixrows\{..\} grid
Pmatrixparenthesis matrixrows(..) grid
Vmatrixvertical-bar matrixrows|..| grid
Casescase selectionrowsleft brace, null right delimiter
Arrayarray with alignmentrowsarray environment
Alignaligned equationsrowsalignment points preserved
Eqarrayequation arrayrowsalignment at relations
Splitsplit equationrowsline structure preserved
Multlinemultiline equationrowsline structure preserved

12.12  Text and annotation

Text and annotation classes:

Table 16 — Text and annotation classes
ClassMeaningOperandsSurface notes
Textupright text run1mtext / \text{} / upright run
Mboxtext box1mtext / \mbox{}
IntentMathML 4 intent annotation1 + valueintent attribute; dropped elsewhere
Semanticsannotated expression1 + annotationssemantics element; fallback is the expression alone

12.13  Presentation constructs

Presentation construct classes:

Table 17 — Presentation construct classes
ClassMeaningOperandsSurface notes
Phantomspace of the operand’s measure1mphantom / \phantom{}
Menclosenotations around content1 + notationsmenclose; boxed fallback
Merrorerror marker1merror; verbatim elsewhere
Mglyphglyph reference0 + attributesimage reference; alt text fallback
Mpaddedpadded box1 + attributesmpadded; dropped elsewhere
Msstring literal1ms / quoted run
Msgroupstack groupchildrenmsgroup; layout fallback
Mslinefraction bar in a stack0msline; rule fallback
Noneempty slot0none element; empty cell
Linebreakline break0mbreaking space / \\
Rulerule element0 + attributesmstyle-rule fallback
Colorcolour application1 + valuemathcolor / \textcolor; dropped where unsupported

12.14  Units and uncertainty

Unit and uncertainty classes:

Table 18 — Unit and uncertainty classes
ClassMeaningOperandsSurface notes
UnitsmlUnitsML unit embedding0 + expressionper-format forms supplied by UnitsML (CalConnect 36816)
Uncertaintyuncertainty attachment1 + fieldsfields 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.

Table 19 — Abstract base classes
ClassRole
UnaryFunctionone-operand base
BinaryFunctiontwo-operand base
TernaryFunctionthree-operand base
Narynary-operator base
Basesubscript-form base
Ul, Suplinear-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.

Table 20 — Font style classes
ClassMathMLLaTeXUnicodeMath
boldmathvariant=”bold”mathbf{}bold alphanumeric range
italicmathvariant=”italic”mathit{}italic alphanumeric range
bold-italicmathvariant=”bold-italic”oldsymbol{}bold-italic range
sans-serifmathvariant=”sans-serif”mathsf{}sans-serif range
sans-serif-italicmathvariant=”sans-serif-italic”mathsfit{}sans-serif-italic range
sans-serif-bold-italicmathvariant=”sans-serif-bold-italic”mathsfbfit{}sans-serif-bold-italic range
bold-sans-serifmathvariant=”bold-sans-serif”mathsfbf{}bold sans-serif range
monospacemathvariant=”monospace”mathtt{}typewriter range
frakturmathvariant=”fraktur”mathfrak{}fraktur range
bold-frakturmathvariant=”bold-fraktur”mathbffrak{}bold fraktur range
scriptmathvariant=”script”mathcal{}script range
bold-scriptmathvariant=”bold-script”mathbfscr{}bold script range
double-struckmathvariant=”double-struck”mathbb{}double-struck range
normalmathvariant=”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.

13  Annex B: registry entry lifecycle

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:

Table 21 — .Representative registry entries
nameglyphmathmllatexommlunicodemathcategories
Alphaα&#x3b1;\alpharun “α”αgreek
Plusminus±&#xb1;\pmrun “±”±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:

  1. 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.

  2. Generation runs; the new symbol class appears in the generated sources.

  3. 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.

  4. The render corpus gains an entry exercising the new glyph in all six surfaces, frozen against the model version that ships it.

  5. 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.

Table 22 — Greek letters
EntryGlyphAsciiMathUnicodeMathLaTeX
Alphaαalphaalpha\alpha
Betaβbetabeta\beta
GammaΓGammaGamma\Gamma
DeltaΔDeltaDelta\Delta
OmegaΩOmegaOmega\Omega
Table 23 — Nary operators
EntryGlyphAsciiMathUnicodeMathLaTeX
Sum∑sumsum\sum
Prod∏prodprod\prod
Int∫intint\int
Oint∮ointoint\oint
Table 24 — Relations and operators
EntryGlyphAsciiMathUnicodeMathLaTeX
Pm±pmpm\pm
Times×timestimes\times
Leq≤leqle\leq
Geq≥geqge\geq
Neq≠neqne\neq
Approx≈approxapprox\approx
Equiv≡equivequiv\equiv
Table 25 — Logic and quantifiers
EntryGlyphAsciiMathUnicodeMathLaTeX
Forall∀forallforall\forall
Exists∃existsexists\exists
Neg¬negneg\neg
Land∧andand\land
Lor∨oror\lor
Table 26 — Derivations and miscellany
EntryGlyphAsciiMathUnicodeMathLaTeX
Partial∂partialpartial\partial
Infty∞ooinfty\infty
Rightarrow⇒=>Rightarrow\Rightarrow
Cup∪cupcup\cup
Cap∩capcap\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