<?xml version="1.0" encoding="UTF-8"?>
<metanorma xmlns="https://www.metanorma.org/ns/standoc" type="semantic" version="2.9.1" schema-version="v2.3.0" flavor="ribose">
<bibdata type="standard">
<title language="en" type="main">Plurimath specifications — Evaluation</title>
<docidentifier primary="true" type="Ribose">1004(d)</docidentifier><docnumber>1004</docnumber><date type="updated"><on>2026-10-31</on></date><contributor><role type="author"/><organization>
<name>Ribose Asia Limited</name>
<abbreviation>Ribose</abbreviation></organization></contributor><contributor><role type="author"><description>committee</description></role><organization>
<name>Ribose Asia Limited</name>
<subdivision type="Committee" subtype="technical">
<name>Plurimath</name>
</subdivision></organization></contributor><contributor><role type="publisher"/><organization>
<name>Ribose Asia Limited</name>
<abbreviation>Ribose</abbreviation></organization></contributor><edition>1</edition><version>2026-10-31</version><language>en</language><script>Latn</script><status><stage>draft-standard</stage></status><copyright><from>2026</from><owner><organization>
<name>Ribose Asia Limited</name>
<abbreviation>Ribose</abbreviation></organization></owner></copyright><ext><doctype>standard</doctype><flavor>ribose</flavor></ext></bibdata><metanorma-extension><semantic-metadata><stage-published>false</stage-published></semantic-metadata>
<presentation-metadata><toc-heading-levels>2</toc-heading-levels><html-toc-heading-levels>2</html-toc-heading-levels><doc-toc-heading-levels>2</doc-toc-heading-levels><pdf-toc-heading-levels>2</pdf-toc-heading-levels></presentation-metadata></metanorma-extension>
<boilerplate><copyright-statement>

<clause id="_0bf1199e-8f6c-bc16-f9b0-78b3f1efec79" obligation="normative"><p id="_945067f2-795a-1e64-6f2b-25dd57c0f4d3">© Ribose Asia Limited 2026</p>
</clause>
</copyright-statement>

<license-statement>

<clause id="_3179d22c-816d-e694-6037-341f744bc6dc" obligation="normative">
<title id="_5ad8fb30-fcae-1072-87a2-407e6b4939ec">Warning for Drafts</title>
<p id="_a24807ee-0381-7ef8-1167-c3aacbb0fd73">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.</p>
</clause>
</license-statement>

<legal-statement>

<clause id="_7e0f3c63-3fc9-65cf-37f7-b94afa0dbc5d" obligation="normative"><p id="_50bbfa02-61c3-8332-bad8-61e7389d1808">All rights reserved. Unless otherwise specified, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, or posting on the internet or an intranet, without prior written permission. Permission can be requested from the address below.</p>
</clause>
</legal-statement>

<feedback-statement>

<clause id="_d43a5e83-e752-e9bc-955e-4282a8ebb43a" obligation="normative"><p id="_0145a561-c9cc-a509-4784-ac2a1e6ea922" anchor="boilerplate-name" align="left">Ribose Asia Limited</p>

<p id="_80954cc8-1f49-9d20-5987-829595995a92" anchor="boilerplate-address" align="left">Suite 1, 8/F, New Henry House<br/> 10 Ice House Street<br/> Central<br/> Hong Kong<br/> <br/> <link target="mailto:copyright@ribose.com"/><br/> <link target="https://www.ribose.com">www.ribose.com</link></p>
</clause>
</feedback-statement>
</boilerplate><preface><foreword id="_592ffc47-e79c-5353-ee44-8c2230ea7ce9" obligation="informative">
<title id="_41c9fad3-d4c1-eecc-4fad-f91704acc026">Foreword</title>
<clause id="_87c5e18d-878b-e161-cde1-57235c4b5191" obligation="informative">
<title id="_e29a5469-67c9-90aa-f17a-63304bcec2bb">General</title>
<p id="_5441fa7a-aa43-e188-40b3-0a72a8fa121e">This document is the fourth document of the Plurimath specifications series. It specifies evaluation: the computation of a numeric value for a formula tree against variable bindings, under a strict error contract.</p>

<p id="_4f68654f-101f-4db1-bb13-f92aefc1b645">The evaluator described here is implemented in the <tt>plurimath</tt> gem of the 0.11 series (<tt>Plurimath::Math::Evaluation</tt>). It evaluates arithmetic over the tree exactly as written: it never rewrites the tree, never rounds behind the caller’s back, and never returns a value that is not a real, finite number — the alternative is one of the typed errors. Uncertainty propagation is not part of this edition: the model of PM 1002 carries uncertainty nodes, this document’s evaluator does not compute with them, and the propagation rules will arrive in this document when they arrive in the implementation.</p>
</clause>

<clause id="_e86e52ac-b9c1-0c8f-6c3d-f91cb11966fc" obligation="informative">
<title id="_dff8ad12-da29-1635-d34a-86a12ce26e23">Documents in the series</title>
<table id="_0c165f61-3f2e-91a2-7419-a94596884da2"><colgroup><col width="16.6666%"/><col width="50%"/><col width="33.3334%"/></colgroup>
<name id="_8ba81754-e2a3-6855-e68d-adf51719d6bc">Documents in the series</name>
<thead><tr id="_2432e572-7864-80cb-c492-7f47cb7b7cf6"><th id="_1b704ae7-780b-ecf8-bef7-fa18d5d88a1f" valign="top" align="left">Number</th>
<th id="_bf960ce6-4737-ae2a-a5e5-4ddb5b06d416" valign="top" align="left">Title</th>
<th id="_32566de1-8f31-8daf-1907-1beb1e2c407e" valign="top" align="left">Subject</th>
</tr></thead>
<tbody><tr id="_f1dc34d5-f74b-fbc7-4204-b2474d2ea051"><td id="_30b37317-5e34-fd61-49b1-fc10134813b8" valign="top" align="left">1001</td>
<td id="_ba3e6170-bcb4-c94c-9c13-10cae18788f4" valign="top" align="left">Math model</td>
<td id="_20467d8e-02ab-9abf-7ad0-add62db36470" valign="top" align="left">The formula tree, the node classes, the registry, the rendering surfaces</td>
</tr><tr id="_fc2ac57c-66de-b565-ee10-91ce10b6dafa"><td id="_1eb9bc75-45e1-8265-fabb-fab472ad0cd0" valign="top" align="left">1002</td>
<td id="_b345ea72-98b4-2ef8-427a-dd9f6b57782a" valign="top" align="left">Uncertainty model</td>
<td id="_aa0fcc5f-ca05-660d-5dbf-b8c25ffb34a9" valign="top" align="left">The uncertainty node, its categories, its encodings</td>
</tr><tr id="_e2fe7db4-69ba-c5d3-a7ef-e28a9b4eb97a"><td id="_caf92e88-9ba6-defb-b7af-51a45b3d40f2" valign="top" align="left">1003</td>
<td id="_21509851-4f65-9a0b-add1-128aced03496" valign="top" align="left">Format interfaces</td>
<td id="_25e31c50-df0c-ac76-1d75-437b0ef45d13" valign="top" align="left">The readers and writers per format</td>
</tr><tr id="_e1837579-1014-71f9-3e12-c67b81bb2f4f"><td id="_6b1fa606-369a-8e21-2f24-fc99fc4b5631" valign="top" align="left">1004</td>
<td id="_396b142d-2308-23b0-b1d8-658992ca1e3b" valign="top" align="left">Evaluation</td>
<td id="_3b5a27cb-8108-88c1-cf66-d3519e1e20f2" valign="top" align="left">This document: numeric evaluation of trees</td>
</tr></tbody>
</table>
</clause>

<clause id="_91287e17-b901-367a-9fc7-7d8b34bf86db" obligation="informative">
<title id="_acf72849-a777-2ec7-cbe5-efcb46f6d917">Maintainers</title>
<p id="_3b4f5e47-7c59-1dd8-c312-9895aeb48063">This document is maintained by the Plurimath project at <link target="https://github.com/plurimath/plurimath"/>.</p>
</clause>
</foreword><introduction id="_9494928f-ce7d-2068-00f5-2771428f7db2" obligation="informative">
<title id="_2b2e98d1-114a-3da4-8556-01ae0a724280">Introduction</title>
<p id="_16d4a760-8f12-8b31-9bb2-0f040a1a4c7e">A formula tree is content until something computes with it. Evaluation is that step: given a tree and a set of bindings — names and their numeric values — the evaluator walks the tree, applies the operations its nodes denote, and yields one number, or refuses with a typed error naming exactly what stood in the way.</p>

<p id="_837d9cf6-6a6c-df7e-bd5a-209a9afe9691">The design centre is the strict error contract. Arithmetic in general notation runs into division by zero, negative square roots, logarithms of non-positive numbers, overflowing magnitudes and unbound names. Many evaluators answer such cases with <tt>NaN</tt>, <tt>Infinity</tt> or a silent fallback; this one answers with a refusal. A result is always a real, finite number, and everything else is one of eight typed errors. The effect on callers is that a successful evaluation needs no hedging: the number returned is usable, and the errors can be handled each by name.</p>

<p id="_427d1212-1198-b326-d5bf-a12055acd4d1">The evaluator is deliberately small. It evaluates arithmetic: addition, subtraction, multiplication, division, modulo, powers, negation, the function classes the model defines, and bounded iteration for the nary sum and product. It does not simplify, does not convert units, does not propagate uncertainty, and does not solve. Every one of those is a different contract with its own semantics; this document specifies the one the implementation carries.</p>

<example id="_0e8b73e6-e06b-dcdc-c40e-f4add2f43dfa"><p id="_2d8bf360-70d2-9479-9b2a-a5bc982fae16">The tree of <tt>x^2 + 1</tt> with the binding <tt>x → 3</tt>. <strong>Expected outcome.</strong> the evaluation yields <tt>10</tt>: the power evaluates to <tt>9</tt>, the addition to <tt>10</tt>, and the result is a real, finite number.</p>
</example>

<clause id="_44995aca-399b-940c-b7ef-fdd4ae74a907" obligation="informative">
<title id="_2b381bb6-7f58-de87-61db-7f7a402d9d2b">The design forces</title>
<ul id="_1b1cb31d-bf98-b594-f4b6-ce94b16b33bd"><li><p id="_0764e569-2184-3663-a63f-03df1985570f"><strong>One answer.</strong> Real finite number, or typed error — the evaluator never leaves the caller between the two.</p>
</li>
<li><p id="_98900f1c-a070-efa9-1db3-91a0cf69934b"><strong>As written.</strong> The tree is evaluated as the author wrote it: precedence, grouping and order respected, nothing rewritten.</p>
</li>
<li><p id="_4914304a-ecf4-7fb3-88b6-7fb0f5a8846b"><strong>Small surface.</strong> Arithmetic, functions, iteration, bindings — and nothing else. Every non-goal is stated, not implied.</p>
</li>
<li><p id="_fb94454b-f561-cf45-2918-9bd2e4e110a7"><strong>Replayable.</strong> Determinism is the testability: the corpus freezes trees, bindings and outcomes, and drift is visible.</p>
</li>
</ul>
</clause>
</introduction></preface><sections>

<clause id="_4aa7a8a6-b30b-82c1-49c7-e28343eda3c0" type="scope" obligation="normative">
<title id="_f70b6ff6-6131-0e24-81e1-850dbe94b63d">Scope</title>
<clause id="_dc0e77ed-2260-0ea7-1e4e-98e31e485713" obligation="normative">
<title id="_917955c1-7e75-5fad-982e-70ebd4b7acee">General</title>
<p id="_03012a9d-27bf-dbc8-6553-b6185bfb5497">This document specifies evaluation of Plurimath formula trees:</p>

<ul id="_3c88a3dc-86a6-5986-2b33-090ae80fe84b"><li><p id="_45ed2257-59ff-67ee-e2c3-fa527b6bd493">the evaluator: its inputs, its contract, and the shape of its results;</p>
</li>
<li><p id="_9c422fe9-ca46-0cf2-e329-10755bd3cefc">the expression parser: the precedence that turns a tree’s linear reading into operations;</p>
</li>
<li><p id="_61b247cb-3616-8177-6a61-be7da1da367d">the arithmetic: every operation, its domain, and its exactness;</p>
</li>
<li><p id="_f2f84617-5572-fe7d-a015-59f4b4fd864f">functions and their arguments;</p>
</li>
<li><p id="_3db9a65e-9ea6-bc78-875b-82463a5abd3b">bindings: keys, values, and the errors they raise;</p>
</li>
<li><p id="_7787ee07-4f99-b479-fb62-a96db9bb66b5">bounded iteration for the nary sum and product;</p>
</li>
<li><p id="_4316d829-268d-c4ab-a4d2-d913e770c1d3">the error contract: the eight typed errors and what each one means;</p>
</li>
<li><p id="_d38a9a64-e574-cdbc-c01e-3ff72b246ddb">conformance of an implementation.</p>
</li>
</ul>

<p id="_c907d05d-7bf8-baca-f31c-6c5e5386a461">This document does not specify:</p>

<ul id="_2b66172d-7960-48a8-f6ba-31a450870470"><li><p id="_1625717d-c08e-7351-deb9-e333ab5592fd">uncertainty propagation, combination or coverage computation — not implemented in this edition (see clause 12);</p>
</li>
<li><p id="_182597a1-dd06-ed39-078d-5b4b06e37930">unit conversion or quantity arithmetic — the UnitsML series governs units, and evaluation works on numbers;</p>
</li>
<li><p id="_56074f04-a56c-d8f3-aef5-b51962ae8182">simplification, factorisation or any rewriting — the tree is evaluated as written;</p>
</li>
<li><p id="_4797b303-7bbe-7edf-8deb-44d3cc7b57a2">the numeric contract of exact decimals in the data — CalConnect 36813 governs that, and this evaluator binds ordinary real numbers.</p>
</li>
</ul>
</clause>

<clause id="_53f80e7e-4143-22bd-ff08-b1b5b5a1a6f0" obligation="normative">
<title id="_c2e8613d-9c75-ab29-bedc-57271c2b7976">Relationship to the series</title>
<table id="_61596f12-3126-f694-c136-c935452ae53b"><colgroup><col width="25%"/><col width="75%"/></colgroup>
<name id="_2d809204-d3ff-342c-900d-3b9ed28aa618">Relationship to the series</name>
<thead><tr id="_9527b38b-f19d-5d6f-e437-122274b292a3"><th id="_16eeed8d-a9d8-685e-0009-7b18bb6b2177" valign="top" align="left">Document</th>
<th id="_288d5435-13f8-37bc-31bb-3b3941bd0b37" valign="top" align="left">Relationship to this one</th>
</tr></thead>
<tbody><tr id="_c2b51130-b7d4-4a8d-9cd6-95576612a0cd"><td id="_dc4b6190-7e62-95ed-b1e0-9bee286387c5" valign="top" align="left">1001 Math model</td>
<td id="_f7cfa12d-3ae0-a616-f246-9d6e41177335" valign="top" align="left">supplies the tree and the node classes this evaluator walks</td>
</tr><tr id="_6a01b90f-cf42-8859-1cb8-0e477df1652d"><td id="_06e5e470-9c31-8467-a9e9-609b5a171127" valign="top" align="left">1002 Uncertainty model</td>
<td id="_342da500-2dbe-bad4-d091-ef05904de2ff" valign="top" align="left">carries uncertainty nodes; this evaluator does not compute with them in this edition</td>
</tr><tr id="_7782e420-e367-c1d8-46dc-686f5f188f8d"><td id="_46f01dcf-409c-cfcc-a239-9cefe7f55a34" valign="top" align="left">1003 Format interfaces</td>
<td id="_6baa6880-762d-1167-cb67-d22cec2e9d8a" valign="top" align="left">delivers the trees; evaluation is a consumer, not a boundary of that document</td>
</tr></tbody>
</table>
</clause>

<clause id="_028609e8-d3dc-ce83-9219-9dc78a7cd9d9" obligation="normative">
<title id="_1d0e1a4c-ffd7-07ab-27d9-1b93b15f0191">Audience</title>
<p id="_f4d7a096-21ab-f5bc-8ad2-7b575e322c7b">Implementers of Plurimath, applications embedding evaluation, and authors of the propagation rules to come.</p>
</clause>
</clause>



<terms id="_8b59a1b3-fa49-aa37-ddbb-72e9deadc7f7" obligation="normative">
<title id="_dfb2eab2-f980-6365-3c47-81d0eb272962">Terms and definitions</title><p id="_dcc01114-4d03-3550-1347-4ba901bda94c">For the purposes of this document, the following terms and definitions apply.</p>
<p id="_44019f7c-608e-0020-3363-715be497391e">For the purposes of this document, the following terms and definitions apply.</p>

<term id="_9ff43459-9e54-9631-da06-e3be1912336a" anchor="term-evaluator"><preferred><expression>
<name>evaluator</name>
</expression>
</preferred>
<definition id="_393f3fb0-64c7-efd7-5052-5c9a1a1f62bf"><verbal-definition id="_9429bed8-ab5f-f31c-8a34-ebf42d23fd93"><p id="_d9cc1fe4-07f9-2f43-ba91-ed0c3cfdb436">the component that computes a numeric value for a tree against bindings</p></verbal-definition></definition>
 </term>

<term id="_d5f8b3b5-475f-7cf8-83fa-73ca11bd5d3c" anchor="term-binding"><preferred><expression>
<name>binding</name>
</expression>
</preferred>
<definition id="_1fab2d1b-bbcd-e948-e0b7-723822e64dee"><verbal-definition id="_0f68859f-6f7c-d1dd-09af-1168d94bf3a7"><p id="_7515d760-5d61-0130-fe15-05d58fab39f5">a name and the real numeric value bound to it for one evaluation</p></verbal-definition></definition>
 </term>

<term id="_b1587d45-7cce-f4f9-baa1-1ca572aaf1bd" anchor="term-bindings"><preferred><expression>
<name>bindings</name>
</expression>
</preferred>
<definition id="_cd8701a9-0d2c-90de-41e4-37ee55cafc62"><verbal-definition id="_1c7fc8a0-ef0a-435f-9cce-bebc26c450c4"><p id="_927e855a-72b6-b678-5845-778cf5edb162">the set of bindings an evaluation uses; keys are names, values are real numbers</p></verbal-definition></definition>
 </term>

<term id="_7f5871d3-0005-9259-8e28-7e8be06a9831" anchor="term-name"><preferred><expression>
<name>name</name>
</expression>
</preferred>
<definition id="_9b951e49-5a5f-5f42-f8fd-9b4ff19c2c0e"><verbal-definition id="_bfa68331-0791-4976-42c1-9ae7e0c3bc52"><p id="_2c512934-e427-9398-4978-f2c54fe01f25">the identifier a tree’s symbols denote for evaluation purposes</p></verbal-definition></definition>
 </term>

<term id="_e3522303-f3db-ad00-a7af-a2ddd7dccb9d" anchor="term-evaluation"><preferred><expression>
<name>evaluation</name>
</expression>
</preferred>
<definition id="_2df48844-09e2-f2ca-6ab2-4d0a88b14bd7"><verbal-definition id="_f5bbc8b6-a6e0-bbbf-a2c5-78c90e093c09"><p id="_a88d64f5-c64b-d537-2308-b3ef7e3dafda">one walk of the tree under one binding set, yielding a number or raising a typed error</p></verbal-definition></definition>
 </term>

<term id="_5b346016-bc68-6c3d-960e-6ceff96e7e95" anchor="term-typed-error"><preferred><expression>
<name>typed error</name>
</expression>
</preferred>
<definition id="_74742546-427c-a631-638e-99902d3f6338"><verbal-definition id="_d42fa711-7cdc-c27e-a438-8cb4e8a67a2f"><p id="_c99bbefe-e6e2-d423-dc22-72164f68d486">one of the eight error classes of clause 11; the only failures evaluation produces</p></verbal-definition></definition>
 </term>

<term id="_383de5ed-3f4b-fe91-824d-3195db8e36ac" anchor="term-real_-finite"><preferred><expression>
<name>real, finite</name>
</expression>
</preferred>
<definition id="_d76dffc1-030b-aca3-6cae-cabf583f7616"><verbal-definition id="_a8d166ea-b1c6-85c6-8f2e-9e3f72aed4fe"><p id="_5c02b68b-c704-f83e-f766-497bf11fc231">the only successful results: a real number with finite value — never NaN, never an infinity</p></verbal-definition></definition>
 </term>

<term id="_16b4f3fb-6659-a22d-df50-ee67bad5596f" anchor="term-strict-error-contract"><preferred><expression>
<name>strict error contract</name>
</expression>
</preferred>
<definition id="_95049cb9-f93c-91e5-2ba4-0ae3c04edba9"><verbal-definition id="_434a0e44-8a01-fe48-ba6a-fba0b9325023"><p id="_1deb7ee7-b216-8e7d-4fb5-8a4d3235b9bb">the rule that evaluation either returns such a result or raises; there is no third answer</p></verbal-definition></definition>
 </term>

<term id="_722ed445-d722-1872-9430-422927c7be30" anchor="term-iteration"><preferred><expression>
<name>iteration</name>
</expression>
</preferred>
<definition id="_7275fa47-0559-4e2e-af49-53708b8139fa"><verbal-definition id="_8f6a5737-de46-37fa-7253-38d23f270dd6"><p id="_92761afb-b1cf-4998-03f1-ab93a0f214f2">the bounded evaluation of a nary sum or product over an integer index range</p></verbal-definition></definition>
 </term>

<term id="_c2ef8fbd-d07e-adc7-ebfa-174f9cb715ab" anchor="term-index"><preferred><expression>
<name>index</name>
</expression>
</preferred>
<definition id="_bb7e04d0-bebe-134d-ae74-583662ceceed"><verbal-definition id="_a85148c7-92c9-ac46-f866-1c0b56985f0d"><p id="_101a255d-b091-3dbc-ea4b-2d496e00272b">the iteration variable, temporarily bound while the body folds</p></verbal-definition></definition>
 </term>

<term id="_01942a5d-f87c-e5aa-6ea2-f041914c3a18" anchor="term-shadowing"><preferred><expression>
<name>shadowing</name>
</expression>
</preferred>
<definition id="_f6647b40-5c84-348d-daef-cbeb206ab0b0"><verbal-definition id="_b3cd26a0-1c06-6c6b-acc9-f7db88e5b8f4"><p id="_183ebfda-2c13-2bb0-8e1c-238c90f69042">an index temporarily replacing an outer binding of the same name for the body’s evaluation</p></verbal-definition></definition>
 </term>

<term id="_65d4c328-c314-4ab5-3afb-c74cfe0fd260" anchor="term-fold"><preferred><expression>
<name>fold</name>
</expression>
</preferred>
<definition id="_218dadcc-0f48-a5e7-84f4-78df42ba5d13"><verbal-definition id="_9c4e744d-15b1-b110-1067-e35d530c44b8"><p id="_e516b84b-c881-ef3b-c7b0-9fd726278ec8">the left-to-right accumulation of the body’s values under the iteration’s operation</p></verbal-definition></definition>
 </term>

<term id="_ec642365-b475-1ff2-5362-34aa64f3ea96" anchor="term-backend"><preferred><expression>
<name>backend</name>
</expression>
</preferred>
<definition id="_be612f54-410b-cf71-7a71-f92bbf5d32d9"><verbal-definition id="_e05de28e-a398-27b0-38de-a5b8c8d4b90a"><p id="_b733985d-025e-3da5-dab1-0a80caad2d05">the arithmetic engine the evaluator’s folds delegate to; its operations are clause 7’s</p></verbal-definition></definition>
 </term>

<term id="_62582bf1-ace3-16ce-e0fc-0c51b1a81252" anchor="term-step-limit"><preferred><expression>
<name>step limit</name>
</expression>
</preferred>
<definition id="_2e264f92-dfa5-0e7d-7d89-88a698c42072"><verbal-definition id="_d3f8e78f-42fb-0ebe-756f-7c819d808621"><p id="_850573f5-ef6f-34c6-9c87-fa391076af62">the maximum range width an iteration accepts; behaviour pinned by the corpus</p></verbal-definition></definition>
 </term>

<term id="_13926edd-b8d6-6b36-aaf3-304323419f55" anchor="term-normalisation"><preferred><expression>
<name>normalisation</name>
</expression>
</preferred>
<definition id="_e17f3b4e-a011-30be-b4f5-dd46c49fcc9e"><verbal-definition id="_23516310-1d45-68b7-8b44-854451e896a4"><p id="_c2a098f2-557d-0f59-f720-bee9de9ffdcb">the deterministic token preparation that makes implicit products explicit before parsing</p></verbal-definition></definition>
 </term>

<term id="_b450e7dc-2741-5237-5ef1-161d28a531da" anchor="term-fold-order"><preferred><expression>
<name>fold order</name>
</expression>
</preferred>
<definition id="_d442c80f-2f42-b1c7-b1bc-6c5a980f5b5b"><verbal-definition id="_987b6f58-c69a-5366-c9ee-1e17e18f6973"><p id="_bd4049cb-9333-e4ed-e429-a0093bd29c2c">the left-to-right (or right, for powers) application order within one precedence level</p></verbal-definition></definition>
 </term>
</terms>

<clause id="_a1db832a-f7d8-6a30-73b5-b4254d3fe03e" obligation="normative">
<title id="_577f0878-cbad-249b-c576-b43a5f664bb6">Conventions</title>
<clause id="_3de4ffde-01c4-99b4-4f9d-a50c2a77e7c7" obligation="normative">
<title id="_53d82e48-1024-e16a-9901-40ceda1ab9b0">General</title>
<p id="_6cf651a3-b718-0053-9690-4d49e5610c4c">Evaluations are written as: tree, bindings, result. Errors are written as their class names of clause 11 with the identifying data the message carries.</p>
</clause>

<clause id="_35466963-75b7-74f7-ac60-80d82b828247" obligation="normative">
<title id="_e9f19607-0eba-c5f0-206e-d25ce63aee52">Examples</title>
<p id="_0b776499-756d-7c44-f377-942fe6642086">Examples carry an <strong>Expected outcome</strong> paragraph stating the number yielded or the error raised. Numbers in examples are exact where they are exact: a rational binding such as one third behaves as its exact value in every example that uses it.</p>
</clause>

<clause id="_073e1c4f-557f-78b6-a9d3-9c8a7f9071f6" obligation="normative">
<title id="_9a9fb44c-3096-ac2d-eadf-283a625514df">Names</title>
<p id="_3fb8afd4-663c-ced3-03bb-90253715ca93">Names in examples (<tt>x</tt>, <tt>n</tt>, <tt>i</tt>) are the plain identifiers the trees carry. The mapping from a tree’s symbols to names is pinned by the corpus; this document treats names as the keys of the binding set.</p>
</clause>
</clause>

<clause id="_2505288e-d2ac-3277-6702-1f6b7cdf9ec7" obligation="normative">
<title id="_017ec7c0-cd0b-b669-1361-183fbc5a368a">The evaluator</title>
<clause id="_8ec0c27e-b432-ff3d-b01f-ea596d2f3067" obligation="normative">
<title id="_a0244a14-f003-da3f-ec29-c5150c39790c">The model</title>
<sourcecode id="_0942b264-7ec4-c33e-7386-c6cfb3607bd8" lang="lml"><body>lml "1.0"

models Evaluation {

  class Evaluator {
    attribute tree, Formula[1]
    attribute bindings, Binding { cardinality 0..n }
  }

  class Binding {
    attribute name, Name[1]
    attribute value, RealNumber[1]
  }

  class Result {
    attribute value, RealNumber[1]
  }

  enum EvaluationError {
    value "division-by-zero"
    value "invalid-binding"
    value "invalid-binding-key"
    value "math-domain"
    value "missing-variable"
    value "non-finite-result"
    value "unsupported-expression"
  }
}</body></sourcecode>


<p id="_41d88611-b459-74eb-17fc-bd89b5dde21f">An evaluation is one <tt>Evaluator</tt> over one tree with zero or more bindings. Its success is one <tt>Result</tt>; its failure is one <tt>EvaluationError</tt>, raised as the corresponding class of clause 11.</p>
</clause>

<clause id="_e1f25af5-f90a-4374-38c7-d426aefb56e7" obligation="normative">
<title id="_4d87ae21-1ed8-d068-e6ae-f1ef19792446">The contract</title>
<p id="_5c71bb89-e65c-fc80-a32a-c246978e5ba1">The strict error contract, stated once and honoured everywhere below: an evaluation returns a real, finite number, or raises one of the typed errors. There is no NaN result, no infinite result, no silently skipped subtree, no partial evaluation.</p>

<example id="_72966411-a88f-8076-7ce3-f901f39842f1"><p id="_7b68041e-5558-e492-e975-bd6af2cbab8c">An evaluation whose arithmetic would produce a division by zero inside a larger expression. <strong>Expected outcome.</strong> the whole evaluation raises <tt>DivisionByZeroError</tt>. No subtree value, no partial result and no default leaks; the caller sees the refusal and nothing else.</p>
</example>
</clause>

<clause id="_6d5c5449-4182-1cfc-b59d-25666eb5ab5b" obligation="normative">
<title id="_966d25cb-2ac9-d817-8332-ad1f7f1190f0">Determinism</title>
<p id="_82683064-70a0-a299-75db-5f74d6197058">The same tree and the same bindings produce the same result or the same error, in the same order of internal operations. Evaluation has no randomness, no parallelism and no environment sensitivity; the corpus replays it identically.</p>
</clause>

<clause id="_63a9d51a-35f1-0ee4-f660-d41b1fd39ddc" obligation="normative">
<title id="_8e183a2d-8698-c5d9-aaa2-6ce8b039f999">The tree is not modified</title>
<p id="_04cb0f29-c24c-a00a-fc33-8ba64aba0e2a">Evaluation reads the tree. Nothing in the tree changes — no annotation of computed values, no caching inside nodes, no rewrite. A tree evaluates twice identically, and an evaluated tree writes exactly as an unevaluated one.</p>
</clause>

<clause id="_f7ee064f-b1c4-2b01-cffd-fe4017b01f69" obligation="normative">
<title id="_ce58b312-ade2-7484-7a38-ff30de4d6554">Foreign exceptions become typed errors</title>
<p id="_52995591-5b17-9be4-600a-2b2831395917">The underlying arithmetic platform’s own signals — domain errors from the math library, float-domain failures, platform division failures — are caught at the evaluation boundary and re-raised as the corresponding typed errors: <tt>MathDomainError</tt>, <tt>NonFiniteResultError</tt>, <tt>DivisionByZeroError</tt>. A caller never sees a foreign exception from evaluation; the message text of the platform error, where one exists, travels inside the typed error.</p>
</clause>

<clause id="_f1c7b951-cd3f-e8b3-d4bd-1e39563f80f8" obligation="normative">
<title id="_ec0e85dd-30c9-1dda-8eb6-9efbd04d5dcd">The walk, in order</title>
<p id="_e48a74d3-2ddd-d7e1-c543-7c249d02ab6a">An evaluation proceeds:</p>

<ol id="_9e2dac06-8a63-e98d-cb49-dc232a58d7d2" type="arabic"><li><p id="_03840d48-4ab6-f24a-1fe5-fe3e1f02844e">bindings validate at entry (clause 9) — nothing has run yet;</p>
</li>
<li><p id="_aa0ded17-1ef6-2944-79f9-ff43f23f8808">the tree walks in writing order through the expression parser’s chain (clause 6);</p>
</li>
<li><p id="_e0085f64-75c7-fa02-5ace-e7cf695920db">each node maps to an operation, a function call, an iteration, a name, or a leaf number;</p>
</li>
<li><p id="_5e36e971-3bff-759d-59d4-7f42099eaaed">names resolve against the bindings at first use;</p>
</li>
<li><p id="_b6c4bfba-3994-96b6-d669-7dc5e0d2e416">folds apply clause 7’s arithmetic and clause 8’s functions, each result checked real-and-finite;</p>
</li>
<li><p id="_7de1e482-cb3e-b5c7-d5a1-5cba2d485d5c">the final value returns; any refusal along the way aborts with its typed error.</p>
</li>
</ol>

<p id="_5f524162-7322-2ea0-4a0a-f7a90720ab5b">The order is observable through the errors: an expression with both a missing name and a division by zero reports whichever the walk reaches first. The corpus includes order-sensitive vectors so the ordering is tested, not implied.</p>
</clause>

<clause id="_fd162113-a822-9610-b6c0-dd94ef69b0b0" obligation="normative">
<title id="_86a01d59-fcbd-25d5-389c-ac6504030390">Zero bindings</title>
<p id="_9984c204-d11c-3509-577c-3814671befb2">An evaluation with no bindings evaluates the closed part of the tree: a tree without names evaluates completely (<tt>2 + 3 * 4</tt> yields <tt>14</tt> with no bindings); a tree with any name refuses at that name. Both are ordinary evaluations under the one contract.</p>
</clause>

<clause id="_4f9233f6-9312-ba76-7335-9d8035f9e384" obligation="normative">
<title id="_24983310-29ed-bb07-4993-6efcce183c66">The evaluator is reentrant</title>
<p id="_9a217d6d-72a8-c747-1e33-841bd8892e37">An <tt>Evaluator</tt> instance holds its tree and bindings and nothing mutable; evaluating twice, or evaluating from two callers, shares no state. Iteration’s temporary bindings are scoped to their body and restored on every exit path, including the error paths — an aborted iteration leaves the binding set as it found it.</p>
</clause>
</clause>

<clause id="_6e019814-ae19-a745-ca5a-e452897c83dc" obligation="normative">
<title id="_a58d34ea-f9ee-9c42-5416-e106b88c4e8f">The expression parser</title>
<clause id="_8b4d33a7-f5ef-41e3-3627-da222485f816" obligation="normative">
<title id="_24abdf30-6d12-8734-45d3-cd1948186a03">General</title>
<p id="_98f4b8df-45ba-3bdb-1b30-3c34ce821b1f">A tree denotes operations in writing order, not in a flat list: <tt>2 + 3 * 4</tt> multiplies before it adds. The expression parser turns the evaluator’s node walk into that precedence-correct sequence of folds. It is a precedence-climbing parser over the tree’s linear reading, with one level per binding strength.</p>
</clause>

<clause id="_e6814d99-5557-d3d6-0683-0af49bdd6b03" obligation="normative">
<title id="_98446bf3-d052-f314-d552-ce987a405a09">The precedence chain</title>
<p id="_f2784ed7-d1a7-dbe4-fc74-fb34947c9e21">The parser descends one chain, strictest last:</p>

<table id="_b6d25678-ea58-a60c-1968-098ddb445744"><colgroup><col width="14.2857%"/><col width="42.8571%"/><col width="42.8572%"/></colgroup>
<name id="_0ddaca2a-bc93-3ae4-6c26-2799ceeaaf31">The precedence chain</name>
<thead><tr id="_64e5323d-4952-592e-c57a-a9a92c9fa7ff"><th id="_5b08730b-b36e-70c2-b2e3-d040a9781309" valign="top" align="left">Level</th>
<th id="_541f9307-a6f1-b24c-16cd-28df658f4d43" valign="top" align="left">Constructs</th>
<th id="_40e832f6-6bab-1963-61bf-1518e4ed5c45" valign="top" align="left">Folds to</th>
</tr></thead>
<tbody><tr id="_bfaef25a-a21e-9bef-67fb-dc5385a29954"><td id="_9b3beab6-d304-3c3d-a9cb-1ef903bc9d72" valign="top" align="left">relation</td>
<td id="_4db2eb24-7316-c5dd-6ae4-198a5048d3f7" valign="top" align="left"><tt>=</tt>, <tt>≠</tt>, comparisons</td>
<td id="_2eff69f1-a822-a707-49d3-ae3a0f4d84ff" valign="top" align="left">the relation evaluation of clause 7</td>
</tr><tr id="_2fc43d90-7f68-8bb9-bdc9-1511364a6fb9"><td id="_2d7a21fd-8fa1-3446-9805-f92a323db4dc" valign="top" align="left">additive</td>
<td id="_9161ee03-56e8-967f-bb03-ccf9917320d1" valign="top" align="left"><tt>+</tt>, <tt>−</tt></td>
<td id="_f9cc0583-e2e0-cd7d-c370-d8d7c3c23c60" valign="top" align="left">addition and subtraction</td>
</tr><tr id="_97c7e760-22ba-454d-4d90-d8ea9ea50e33"><td id="_697a0ec2-9041-3772-7b41-8a4048a3433f" valign="top" align="left">multiplicative</td>
<td id="_1a87ac68-e2cc-e08d-02c5-5784f186b470" valign="top" align="left">implicit products, <tt>/</tt>, <tt>mod</tt></td>
<td id="_17b45412-82c4-f9f7-01dd-a66f0223bbd4" valign="top" align="left">multiplication, division, modulo</td>
</tr><tr id="_7d2c7b08-806b-cdc8-acab-79efa926c400"><td id="_1163e1b3-f09e-c7f3-f4ca-40394851c4f9" valign="top" align="left">unary</td>
<td id="_044a6585-f475-b6ee-84c9-df74186b7e38" valign="top" align="left">negation, positive sign</td>
<td id="_95e4de29-414c-c597-e712-417309dbb89f" valign="top" align="left">negation</td>
</tr><tr id="_82388ada-5474-99c9-1b4e-44e121b762f0"><td id="_99f39cb8-753b-6b6b-9fc8-543586df0ac2" valign="top" align="left">power</td>
<td id="_deb75f74-9945-54a6-f531-eb378915e4f3" valign="top" align="left"><tt>x^y</tt>, right-associative</td>
<td id="_8b0ad6a9-ae9b-b30d-5479-fe11e148653d" valign="top" align="left">powers</td>
</tr><tr id="_43cc93c6-3ec0-1d0d-9f2b-8a547d75f14e"><td id="_92efda36-bd8a-d923-d52e-0642271ab2b7" valign="top" align="left">operand</td>
<td id="_92ecf68e-e548-07b4-b783-1a89b276ddb7" valign="top" align="left">numbers, names, groups, functions</td>
<td id="_15d41df7-0a2c-5723-14e5-609d3d3a77dc" valign="top" align="left">leaf evaluation or recursion</td>
</tr><tr id="_d414e102-c402-1698-31b2-35f79c43740d"><td id="_f8df9e6c-94b7-9d6e-9642-fac9a5d5b452" valign="top" align="left">group</td>
<td id="_c72563ef-d091-974b-3701-cafb40e99f13" valign="top" align="left">parenthesised content</td>
<td id="_242c9750-c607-e1f7-eded-fbfebefa5ef3" valign="top" align="left">recursion with saved state</td>
</tr></tbody>
</table>

<p id="_993c28b6-eaed-5f42-2c16-960fed4743b2">Each level parses the next as its operand and folds left-associatively within itself — powers excepted, which fold right-associatively: <tt>2<sup>3</sup>2</tt> is <tt>2<sup>(3</sup>2)</tt>, the mathematical convention.</p>
</clause>

<clause id="_da10f592-06b4-e199-8fd1-bbae9d53bc93" obligation="normative">
<title id="_2c159132-da25-a1b8-5f64-c6356c9da712">What the parser accepts</title>
<p id="_4239e03b-8f85-4a02-154e-cfb85115ba42">The parser accepts the arithmetic core the evaluator evaluates: numbers, bound names, the operations above, groups, and the function and iteration calls of clauses 8 and 10. A node outside this core — a <tt>Text</tt> node, a matrix, an uncertainty node — makes the whole evaluation raise <tt>UnsupportedExpressionError</tt>: the evaluator does not evaluate what it does not define, and never guesses.</p>

<example id="_af92bfaf-128b-681f-9fb0-bd453829f129"><p id="_0ffa2524-044b-f958-2411-ab345e3db440">The tree of <tt>2 + 3 * 4</tt>. <strong>Expected outcome.</strong> the parser folds the multiplicative level first (yielding <tt>12</tt>) and the additive level second (yielding <tt>14</tt>), regardless of the walk order the tree’s linear reading might suggest.</p>
</example>

<example id="_025c8806-8399-9c81-520a-b14c19f39bef"><p id="_478cb1cc-9867-62b5-900f-db673d224242">The tree of <tt>2<sup>3</sup>2</tt>. <strong>Expected outcome.</strong> <tt>512</tt> — the right-associative reading — not <tt>64</tt>.</p>
</example>
</clause>

<clause id="_aa65a6ff-c5d4-c403-f1d7-c6703f4803e1" obligation="normative">
<title id="_ddba941c-b00b-78c4-bc60-e8bbf13129cb">Groups</title>
<p id="_8d0ebc46-c30e-565d-3760-8cd4fca9ea2c">A group saves the parser’s pending state, evaluates its content to one value, and presents that value as an operand. Groups are the author’s precedence: <tt>2 * (3 + 4)</tt> yields <tt>14</tt>, not <tt>10</tt>.</p>
</clause>

<clause id="_22dba286-45d1-7c61-6687-ad76ca2c091f" obligation="normative">
<title id="_8628f889-9e28-aeb6-84bf-614a9159cc0a">Relations</title>
<p id="_0579adae-6d21-ac61-35ca-615a933e7203">The relation level evaluates comparisons to truth values in the platform’s terms. A tree whose top level is a relation yields that relation’s result; relations compose left-associatively where the tree carries chains. The corpus pins the truth-value results alongside the numeric ones — both are results of the one contract.</p>
</clause>

<clause id="_5bd361cc-f7a1-8da0-cffd-cd9e63d1ff54" obligation="normative">
<title id="_8cafb318-569e-92b7-ea11-3891d42658a1">Token normalisation</title>
<p id="_39080ae0-ea64-e403-1812-2e11861afffe">Before parsing, the tree’s linear tokens normalise: implicit products are marked (<tt>2x</tt> becomes <tt>2 * x</tt>, <tt>a(x + 1)</tt> becomes multiplication, <tt>x sin y</tt> stays two operands), explicit multiplication symbols map to the same fold, and spacing is irrelevant. Normalisation is deterministic and pinned by the corpus; it changes no node, only the fold sequence.</p>
</clause>

<clause id="_7fb134fa-6ce0-91c3-693f-3f335ed09652" obligation="normative">
<title id="_82017a6a-049d-3246-99ef-cff2ce807f60">Function calls in the chain</title>
<p id="_04257ced-8484-4dca-3a21-7b318f7a8761">A function call parses as a prefix at the operand level: the function name, then its argument or arguments as the grammar of the construct gives them — parenthesised, braced, or by adjacency for the notation’s single-argument forms. The argument expressions parse at the full chain, so <tt>log_2 x^3</tt> binds the power inside the argument where the notation’s grouping says so; the corpus carries the ambiguous-looking cases explicitly.</p>
</clause>
</clause>

<clause id="_ad0e5807-5808-6f92-1063-7a59761e2fac" obligation="normative">
<title id="_66cd0838-015d-9f1c-f559-5ae31c479191">Arithmetic</title>
<clause id="_7a5b7c46-f3fa-690d-70bf-39c99186734d" obligation="normative">
<title id="_fe0a5f05-f03a-dec6-03a6-113cd5f2eb59">The operations</title>
<p id="_b22a96f4-a7cb-3dd5-6034-20ee8bf69553">The evaluator’s operations, their names, and their domains:</p>

<table id="_bb34c15c-e509-2733-f826-624bf69f90c4"><colgroup><col width="25%"/><col width="37.5%"/><col width="37.5%"/></colgroup>
<name id="_c667d71b-414b-9ac1-5482-063bb7e96aca">The arithmetic</name>
<thead><tr id="_79ebaa1a-e421-fc81-fdd3-f440fca5e5cf"><th id="_2c96b372-18a7-5d1c-add0-43be35a54ae1" valign="top" align="left">Operation</th>
<th id="_a6ce1dee-724c-1426-2513-90d20a941075" valign="top" align="left">Notation in the tree</th>
<th id="_f1381da9-de0f-561d-5c04-8181314e6c10" valign="top" align="left">Domain</th>
</tr></thead>
<tbody><tr id="_7f8a1345-8828-a838-e266-ef97ff939872"><td id="_84a1f983-149f-f3fc-0381-62f739bed8c2" valign="top" align="left">addition</td>
<td id="_c8129388-dcae-4ae5-69c1-81e680c15237" valign="top" align="left"><tt>a + b</tt></td>
<td id="_793b9bb2-fc0a-b12a-3aec-394c4b3016bc" valign="top" align="left">reals</td>
</tr><tr id="_64e6d328-40d2-3fbd-7ed9-fb1ba184b572"><td id="_ab40ac53-77ea-4e79-cedd-b7a54f08f726" valign="top" align="left">subtraction</td>
<td id="_9b76a508-b5d0-bb6e-9e62-1136a71aaac4" valign="top" align="left"><tt>a − b</tt></td>
<td id="_438381c7-0218-f1ad-b443-30f927d143c4" valign="top" align="left">reals</td>
</tr><tr id="_615874d4-bd54-1b53-bc37-325abfe56124"><td id="_b8a3b5b8-b2fd-7aa6-1614-43f16fc16e27" valign="top" align="left">multiplication</td>
<td id="_4b06210d-c19e-de6c-92b8-38351bb6715e" valign="top" align="left"><tt>a * b</tt>, <tt>a b</tt> (implicit)</td>
<td id="_63a1433f-56ed-2adc-0e6e-35ed8bc421ca" valign="top" align="left">reals</td>
</tr><tr id="_69ee565e-b4fe-f545-5f72-aa950b9e4a90"><td id="_eb0c8d3a-d5e8-900f-fece-bc09cb56d843" valign="top" align="left">division</td>
<td id="_64e72089-6f9d-5a05-1be1-69414b4796e3" valign="top" align="left"><tt>a / b</tt></td>
<td id="_33162c8a-caa6-ca9a-7087-76bcea03eda4" valign="top" align="left">reals, <tt>b ≠ 0</tt></td>
</tr><tr id="_a2c26136-29c6-f2db-51fc-ac57c8c95605"><td id="_14197578-cbbb-56a2-a1b0-1b2d009b615b" valign="top" align="left">modulo</td>
<td id="_82c225a8-42ed-6734-8e77-e9750c070728" valign="top" align="left"><tt>a mod b</tt></td>
<td id="_2f4aad23-b003-2593-f421-602787a0bccd" valign="top" align="left">reals per the platform’s modulo</td>
</tr><tr id="_fe782d4f-48cc-c7c3-bc0d-0085bedeef90"><td id="_0e0a89eb-3509-817a-18db-f91a3478eb25" valign="top" align="left">power</td>
<td id="_25bbc56a-645e-9ff6-e573-0e0330ac9bae" valign="top" align="left"><tt>a^b</tt></td>
<td id="_8d967ef2-fe0d-af8d-5ac9-40470ca86b62" valign="top" align="left">per clause 7’s power rules</td>
</tr><tr id="_1a287234-7827-cb5a-c6c7-66862f1bf85a"><td id="_c2f10310-c65a-80dc-8a4b-534889c27628" valign="top" align="left">negation</td>
<td id="_8e920bd3-19b2-9edc-6b29-087dff8b7cd4" valign="top" align="left"><tt>−a</tt></td>
<td id="_4b8d1d9a-3bc3-e4c2-30a3-4ab1b1cad21b" valign="top" align="left">reals</td>
</tr><tr id="_5d0c7e23-97b5-7684-4a02-33b969428859"><td id="_2d2d0e0d-d408-7118-5114-7391717d670a" valign="top" align="left">positive sign</td>
<td id="_d625a68f-86c6-edf2-fec9-2ad458474cef" valign="top" align="left"><tt>+a</tt></td>
<td id="_7f0ed245-c464-342f-6a51-6a48045024bf" valign="top" align="left">reals</td>
</tr></tbody>
</table>

<p id="_e0d5a2f9-4a6e-608a-62de-12e70425c4ef">Every operation consumes real, finite values and produces one; the contract of clause 5 applies at each fold.</p>
</clause>

<clause id="_0c1438bb-7597-f3b8-bde4-1690058c3a8c" obligation="normative">
<title id="_4d95d7bb-13a1-3ae2-d8a4-a332fd5a05c6">Division</title>
<p id="_5b5880de-9ea8-ee83-e3f8-5f30fdfc5474">Division by zero raises <tt>DivisionByZeroError</tt> — including division by an expression that evaluated to zero, however far away the zero came from. There is no limiting behaviour, no infinity: the contract has no place to put one.</p>
</clause>

<clause id="_867aa9dd-54b5-2a4d-7494-072fc6221a2b" obligation="normative">
<title id="_7a56cdeb-f2ef-3ebd-e9e0-7bd576167f62">Modulo</title>
<p id="_b454d5a4-032c-909a-cefd-0144df8413db">Modulo follows the platform’s modulo semantics for real operands; a zero divisor raises <tt>DivisionByZeroError</tt>. The sign behaviour is the platform’s and the corpus pins it.</p>
</clause>

<clause id="_25036771-cdfd-691b-0872-c1da0424a43f" obligation="normative">
<title id="_2dd9a883-c1e4-38b2-33c4-e630b5b2b330">Powers</title>
<p id="_acf0a7cc-6f5f-faf8-df17-2bf2c1d8b132">The power operation evaluates <tt>a^b</tt> for the domains the real numbers define: a positive base with any real exponent, a zero base with a positive exponent, a negative base only where the exponent is an integer or a rational with an odd denominator in lowest terms. Outside those domains the platform’s domain error becomes <tt>MathDomainError</tt>. An exponent that would produce a non-finite magnitude raises <tt>NonFiniteResultError</tt> at the boundary.</p>

<example id="_91b7685f-13ae-ef14-c05e-25903a36d30b"><p id="_092e3791-e421-4292-ed7e-a823710ad0f7"><tt>2^10</tt>, <tt>9^(1/2)</tt>, <tt>(−8)^(1/3)</tt>. <strong>Expected outcome.</strong> <tt>1024</tt>; <tt>3</tt>; <tt>−2</tt> — the real cube root, in the odd-denominator domain.</p>
</example>

<example id="_9dcbb35b-c9ae-3074-c2ce-6d3eb6eb00d8"><p id="_2c189f79-7d30-7fad-6047-e1e2dd32adb4"><tt>(−2)^(1/2)</tt> and <tt>0^(−1)</tt>. <strong>Expected outcome.</strong> <tt>MathDomainError</tt> for the first; <tt>DivisionByZeroError</tt> for the second — the platform’s reading of a zero base with a negative exponent.</p>
</example>
</clause>

<clause id="_96be7bc6-c41e-eda0-1def-ce7a22942b58" obligation="normative">
<title id="_86e80f59-2f88-a712-388a-31e676276e47">Negation and sign</title>
<p id="_abf608b2-6b62-3bb4-6bdb-b5f0a25d0d90">Negation flips the sign of its operand; a unary plus is the identity. Neither has side effects, and chains (<tt>−−x</tt>) negate once per sign as written.</p>
</clause>

<clause id="_f1542897-52a4-2a1a-6948-18a824702dc2" obligation="normative">
<title id="_1a893992-d635-1051-e985-15c4c798cd7a">Results</title>
<p id="_3a0fe348-94ac-046c-207e-c4f8f0f39377">Every fold’s result passes the real-and-finite check before it feeds the next. A non-finite intermediate — an overflow inside the platform’s numbers — aborts the whole evaluation with <tt>NonFiniteResultError</tt> rather than propagating a poisoned value.</p>
</clause>

<clause id="_1580005d-2950-1f0d-ba51-a17d660361d5" obligation="normative">
<title id="_eec2a0c3-5428-5108-f589-00241f2bf9b4">Implicit products</title>
<p id="_271fbe0c-8762-e683-e4a6-f86d4e9ce208">Adjacency means multiplication where the notation puts values side by side: a number before a name, a name before a group, a group before a group. It does not mean multiplication between two numbers (<tt>2 3</tt> is not a valid product — the corpus refuses it as a token fault) nor between a name and the keyword introducing an iteration. The normalisation of clause 6 makes every implicit product explicit before folding.</p>
</clause>

<clause id="_c05e8e3f-dfa7-bf7e-3a72-c8873d292081" obligation="normative">
<title id="_b3d9138c-fc7e-1950-b3df-2348bd383e7a">Accuracy classes</title>
<p id="_f23175d0-b897-0ea2-00fe-959711c0e271">Every value an evaluation carries belongs to an accuracy class. Integers and rationals are <em>exact</em>: their add, subtract, multiply and rational division are exact operations, and an exact operand list yields an exact result. Floats are <em>limited</em> with undeclared accuracy (the platform’s bits); guard-digit decimals are <em>limited</em> to their declared precision. Limited operands contaminate exact ones: the accuracy of an operation’s result is the accuracy of its least precise operand. A five-digit value times a six-digit value is defined to five digits — the class algebra states this, the corpus vectors pin it.</p>
</clause>

<clause id="_27818986-4e5c-8226-513b-f1de604cbd79" obligation="normative">
<title id="_4b328d66-6929-b8d1-e8b2-4ab16f4952fa">Boundaries</title>
<p id="_27774483-c647-5901-27cc-2df5271f6549">A <em>boundary</em> is an operation that would replace exact values with platform approximations: a transcendental function, an irrational root, a non-exact power on exact operands. The evaluator processes until a boundary and never violates one silently — every crossing is reported.</p>
</clause>

<clause id="_45450cc1-3cb7-f6c0-d4e2-2bb83637035a" obligation="normative">
<title id="_c0c87e7e-9070-3bd2-850f-6fa074b17110">Modes</title>
<p id="_bb9ca1d7-e6ea-20ab-d2da-42e514139d91">The caller chooses the mode at the entry point; the default is approximate.</p>

<ul id="_1a94bf62-304b-5556-015f-d27a13283b65"><li><p id="_929acd33-cd0c-f683-6252-189ea9f0d7eb"><em>Approximate</em> mode crosses every boundary: the computation runs on platform floats, and the result reports each boundary it crossed — the operation, the operands and their accuracy classes, and the produced value. This is the mode of the original contract: whatever the platform computes is delivered as computed, refused when not real-and-finite, never silently rounded. The corpus records its expected values, platform and version pinned.</p>
</li>
<li><p id="_7db60c29-8380-92b9-0161-c27025017e4e"><em>Strict</em> mode never crosses an exactness boundary: the first boundary defers the evaluation. The result then carries no value, the boundary record, and the unevaluated expression in source form — a partially evaluated result whose accuracy is undiminished, which the caller can re-run in approximate mode or with declared guard digits. Limited operands degrade as defined: a transcendental over a limited value computes without deferring, since there is no exactness left to lose.</p>
</li>
<li><p id="_9a08fc4f-a832-bba6-7b2b-83cc45596578"><em>Guard digits</em> extend strict mode: with a declared digit count, a boundary is crossed by computing a decimal result to that declared precision (an exact rational square root stays exact without any declaration). Functions without a guard-digit implementation are refused with a typed error naming the function.</p>
</li>
</ul>

<p id="_19ac3dbf-35e6-7ede-d6a2-6355a892e5af">Exact vectors — whole expressions evaluated without a crossed boundary — are byte-identical across runtimes: their results are integers and rationals, not platform values. The exact-decimal discipline of the data layer (CalConnect 36813) is the same discipline strict mode evaluates under.</p>
</clause>

<clause id="_1e31a1e6-8615-cca8-b295-c70ff0cf8c57" obligation="normative">
<title id="_cdc36a2c-6d0d-f5ae-066b-cfb9aaccf2b6">Results</title>
<p id="_5a09a239-6d19-c62a-335d-8a2263a4772c">Evaluation returns a result object, not a bare number: the value, the ordered boundary records (operation, operands, operand accuracy, action — approximated, guarded or deferred — and the produced value), and the unevaluated expressions when strict mode deferred. A result whose boundaries contain no approximation is exact; a deferred result carries the residual expression.</p>
</clause>

<clause id="_0dd533ec-c4e8-f3ce-ba5b-9a4fd99f1553" obligation="normative">
<title id="_67f6dea4-c3c0-fe8f-723a-7b08bff63075">Order of folds</title>
<p id="_9dc44831-cede-68d5-1f9e-c596cf676a21">Left-associative levels fold left: <tt>a − b − c</tt> is <tt>(a − b) − c</tt>, and <tt>a / b / c</tt> is <tt>(a / b) / c</tt>. Right-associativity belongs to powers alone. The distinction is observable in floating point even when exact arithmetic would agree; the corpus pins the fold order with vectors whose inputs differ by association.</p>
</clause>

<clause id="_bff66c73-c878-163c-81f5-ffae14e6f849" obligation="normative">
<title id="_dcdf4b41-1202-2c5f-bf9f-4433543c025d">A precedence walk, concretely</title>
<p id="_0a21fda5-5b5d-bdb5-fd9d-52f0b98468bb">The tree of <tt>−3 + 4 * 2^2 / (1 + 1)</tt>:</p>

<ol id="_04ab08f0-9542-a86a-218b-e6f0fe47949a" type="arabic"><li><p id="_1bf0c495-1371-e52f-fd72-9ed7de03f977">the group folds first: <tt>1 + 1</tt> yields <tt>2</tt>;</p>
</li>
<li><p id="_ead10331-682f-03d7-9f68-8891cb1c958c">the power: <tt>2^2</tt> yields <tt>4</tt>;</p>
</li>
<li><p id="_16fb0f36-0e74-09bc-4f09-13282aa00683">the multiplicative level folds left: <tt>4 * 4</tt> yields <tt>16</tt>, then <tt>16 / 2</tt> yields <tt>8</tt>;</p>
</li>
<li><p id="_bc6a47a8-606b-84ad-2778-290a74adfdd5">the unary level negates <tt>3</tt> to <tt>−3</tt> for its operand;</p>
</li>
<li><p id="_2eedeb36-ec61-01f7-5ab6-04833333f4fb">the additive level folds: <tt>−3 + 8</tt> yields <tt>5</tt>.</p>
</li>
</ol>

<p id="_fe76cc4d-4058-17f4-a92b-5a7c33471eb4"><strong>Expected outcome.</strong> <tt>5</tt> — each level once, in the chain’s order, with the group overriding the written order.</p>
</clause>
</clause>

<clause id="_3e1cf6f9-8f47-07d9-c893-bab43c9107f7" obligation="normative">
<title id="_d0773640-5b98-f487-a029-c30de6fc72d7">Functions</title>
<clause id="_47ee21cc-31d4-da9d-13f8-af59ca255ef3" obligation="normative">
<title id="_d470a348-fece-7262-79cd-c49077d87e8a">The function classes</title>
<p id="_e7629c16-b740-d05e-809d-548eb3e4e6e4">The evaluator evaluates the function classes the model defines where a numeric semantics exists: the trigonometric and hyperbolic functions and their inverses, the logarithms (<tt>ln</tt>, <tt>lg</tt>, <tt>log</tt> with a base), the exponential, the absolute value, floor and ceiling, min and max, and the named constants of the registry where the platform defines their values.</p>

<table id="_723ff0c4-28a3-9db1-80e1-61a204dbeab3"><colgroup><col width="25%"/><col width="37.5%"/><col width="37.5%"/></colgroup>
<name id="_a97cf118-5444-1f66-ee4d-1855d5e3ccc6">Function evaluation</name>
<thead><tr id="_aefcd87a-ba3e-dc33-d5ea-2f63da9def6b"><th id="_89a74fb0-21ea-d967-e42c-1a8184d1b7de" valign="top" align="left">Family</th>
<th id="_10c8655e-7f7b-1401-226d-06fe08d2fbce" valign="top" align="left">Evaluation</th>
<th id="_9a974312-befc-eea1-702b-cbc7c7bc91b1" valign="top" align="left">Domain refusals</th>
</tr></thead>
<tbody><tr id="_9119650d-9a04-df75-18a7-7e8a1350a4a4"><td id="_ceed1409-f796-6c32-00a9-91ddc0929599" valign="top" align="left">trigonometric</td>
<td id="_cd8d3307-5a40-a5aa-8563-73ea1651db1d" valign="top" align="left">per the platform</td>
<td id="_be0ada2e-aaff-16ec-91be-fb4343510b60" valign="top" align="left">none; results checked real and finite</td>
</tr><tr id="_144ccefa-3307-f611-5989-4b0eb1cc836c"><td id="_79d4df30-f8bd-c48f-a346-34f31cd47c90" valign="top" align="left">inverse trigonometric</td>
<td id="_21c02134-42b4-7076-e20a-f18e21c8b00f" valign="top" align="left">per the platform</td>
<td id="_e3222709-783d-611b-7389-b724b10906ae" valign="top" align="left">argument outside <tt>[−1, 1]</tt> → <tt>MathDomainError</tt></td>
</tr><tr id="_c8ee1b14-94a2-e3ae-0d87-0ce803091d57"><td id="_127ce506-fe87-dfe1-5b82-0a7f2c302faa" valign="top" align="left">hyperbolic</td>
<td id="_c8a4fa39-e91f-ae31-777f-793b35849941" valign="top" align="left">per the platform</td>
<td id="_457e5f3c-6b70-fdcc-6915-f1fda9467133" valign="top" align="left">overflow → <tt>NonFiniteResultError</tt></td>
</tr><tr id="_f3533243-075c-60e9-d0c8-8359254d5404"><td id="_45c23bf7-d072-452c-4b9e-c1df664eb681" valign="top" align="left">logarithms</td>
<td id="_6518c575-691d-2c7b-2053-85ab227b50ae" valign="top" align="left"><tt>ln</tt>, <tt>lg</tt>, <tt>log_b</tt></td>
<td id="_f070e691-6055-9954-5bfa-48c2134d4407" valign="top" align="left">non-positive argument → <tt>MathDomainError</tt>; base <tt>≤ 0</tt> or base <tt>1</tt> → <tt>MathDomainError</tt></td>
</tr><tr id="_6fa8477f-dc18-47bd-dae3-565e9b9f3f18"><td id="_89377d7b-8778-6103-ea46-3103bd6113ad" valign="top" align="left">exponential</td>
<td id="_dd709bdb-d5bc-b60e-e6dc-626938f922f8" valign="top" align="left">per the platform</td>
<td id="_5817635c-9313-2180-eccb-0f5f79ffab8d" valign="top" align="left">overflow → <tt>NonFiniteResultError</tt></td>
</tr><tr id="_19c62aac-05f0-9928-6dc1-32b05c97d606"><td id="_5b8d9cd5-0e60-785d-04a6-7753840f6c34" valign="top" align="left"><tt>abs</tt></td>
<td id="_c7fa965b-521d-76c4-622e-dddfd88c1e43" valign="top" align="left">absolute value</td>
<td id="_cf8d50f5-eb7e-4523-397c-fa2828021673" valign="top" align="left">none</td>
</tr><tr id="_df904965-88c9-1626-869e-afead5476cf4"><td id="_0df6f7b4-997f-5e46-87cd-1087a0c5bd90" valign="top" align="left"><tt>floor</tt>, <tt>ceil</tt></td>
<td id="_d0a7021b-75c7-ba3c-12e7-a6b9c0e4eda4" valign="top" align="left">per the platform</td>
<td id="_946ef7b8-8c00-1a01-4ebb-8ea3245b668b" valign="top" align="left">none</td>
</tr><tr id="_2206cf7e-7a74-2a67-6f9e-707b844774a9"><td id="_940af405-7c51-744e-7224-e0f1aab5fe55" valign="top" align="left"><tt>min</tt>, <tt>max</tt></td>
<td id="_04ccf9bf-ea56-dadd-ef11-10dd4620374b" valign="top" align="left">over the arguments</td>
<td id="_0e1a6aee-8043-1888-0049-f74fcdbd6b37" valign="top" align="left">none</td>
</tr></tbody>
</table>
</clause>

<clause id="_ee8c5c21-679a-1376-2fa0-b4c669f470fd" obligation="normative">
<title id="_0ea49e5d-efc0-6b42-3835-c517edbdec01">Arguments</title>
<p id="_f32788ff-4dc4-bd33-2674-872ef460c262">A function’s arguments are its operands, evaluated left to right as ordinary sub-evaluations. The argument count is the class-defined arity of PM 1001; a tree that carries a different count is an <tt>UnsupportedExpressionError</tt> — the evaluator does not improvise signatures.</p>
</clause>

<clause id="_38cab439-74dc-e1f1-e091-da6746f500f9" obligation="normative">
<title id="_6f4fb1b6-2830-a0af-5d7f-3e72eb8262ca">The logarithm base</title>
<p id="_ce5d3fd6-5f17-6e36-528b-8c9b21e78d29"><tt>log</tt> with a base evaluates to the logarithm in that base: <tt>log_2 8</tt> yields <tt>3</tt> under exact arithmetic in the corpus. The one-argument form is the natural logarithm’s decadic sibling per the registry’s reading; the corpus pins which.</p>
</clause>

<clause id="_cf4cb80a-9f5d-f9b2-eb6e-8eb88323ee33" obligation="normative">
<title id="_8fb4e241-54a8-b935-f9bc-c1ea6a4c0bc5">Constants</title>
<p id="_8db5187a-3284-9fa4-58e6-58b9888b8ed6">Registry constants with platform values (<tt>π</tt>, the exponential constant) evaluate to the platform’s value of that constant. Constants without one are names: they bind from the bindings or refuse with <tt>MissingVariableError</tt>, like any name.</p>

<example id="_390ea680-874b-19e1-dd2a-965716749f43"><p id="_edf74156-7ebc-a755-3f4e-3a1d238ea3db">The tree of <tt>log(x)</tt> with the binding <tt>x → 100</tt> under the decadic reading. <strong>Expected outcome.</strong> <tt>2</tt> where the corpus fixes the decadic reading; the reading itself is pinned there, not negotiated per call.</p>
</example>

<example id="_5ebe325c-3af7-b882-42c5-7ecb6227700d"><p id="_17a14b5d-66bd-6ecb-2990-bb88b321a6de">The tree of <tt>sqrt(x)</tt> with <tt>x → −1</tt>. <strong>Expected outcome.</strong> <tt>MathDomainError</tt> — the square root of a negative number has no real value, and the contract has no complex numbers.</p>
</example>
</clause>

<clause id="_985d69c2-268c-eec4-9a80-fa250b3ea7a3" obligation="normative">
<title id="_52e38e6e-ea41-2d5e-dfb1-86e1ec5bc0c2">Nary calls and argument evaluation</title>
<p id="_ca35b580-f3bf-2d2a-0a2d-67849a8474c6">The nary functions the evaluator defines (<tt>sum</tt>, <tt>prod</tt> with bounds) route to iteration (clause 10); the nary classes without bounds refuse as unsupported in this edition — a bare <tt>∑</tt> over a list has no evaluation semantics here. Argument sub-evaluations run through the same chain and contract; an error inside an argument aborts the whole call, and there is no argument-level recovery.</p>
</clause>

<clause id="_01b025d9-2b0b-e966-e0cc-a1c49da1fbbf" obligation="normative">
<title id="_cb582d5e-cb0c-5257-31a5-2fa22b8760ab">The log argument rule</title>
<p id="_beb25f3d-11fd-e0fd-b097-5b7fbfde1bfa">The logarithm’s argument is the full expression the notation groups: <tt>log x + 1</tt> is <tt>log(x) + 1</tt> under the adjacency binding, and <tt>log(x + 1)</tt> is the logarithm of the sum. Where the writer’s shape and the reader’s grouping disagree, the tree is authority: the evaluator evaluates the tree it is given, and the corpus carries the disambiguated pairs.</p>
</clause>

<clause id="_f78595be-c41a-1852-9cb6-2f888d1de909" obligation="normative">
<title id="_582b232f-8ce7-6303-9649-981cce2f39d5">Constants and names, precisely</title>
<p id="_5a489e43-df76-3497-d73e-5ebf3882f2fa">A registry constant with a platform value evaluates without bindings; a name without one binds or refuses. The registry decides which is which, per PM 1001 — evaluation adds no constants of its own and treats an unknown constant exactly like any other name.</p>
</clause>
</clause>

<clause id="_310c1319-4b42-7ee3-3b4c-971112c69a04" obligation="normative">
<title id="_240f86a0-f5fd-7ed2-d55a-c3f23af3a921">Bindings</title>
<clause id="_d40b6c7f-c829-99fd-67f6-ad91a23fcd1b" obligation="normative">
<title id="_1fdaf088-c930-eeca-9cae-3966bc3f947a">The binding set</title>
<p id="_311613ba-de4d-4f1c-1e62-75de6465a0f5">Bindings are the evaluation’s variables: a set of names, each with a real numeric value. Keys arrive as strings or symbols and normalise to strings; values must be real numbers.</p>
</clause>

<clause id="_9daf50e4-af97-b286-2be1-f915c927e421" obligation="normative">
<title id="_aff01e1f-ab67-e355-3d5f-51ebf44d99c6">Validation at entry</title>
<p id="_d54ea899-6ce7-ece2-1c72-8e2a426a6f2e">The binding set is validated before the tree is touched:</p>

<ol id="_21ba53a6-591c-043b-9155-d27cda1e0e11" type="arabic"><li><p id="_59e3a36e-d737-7ef4-ecfe-c4024510ad87">a key that is neither a string nor a symbol raises <tt>InvalidBindingKeyError</tt>, carrying the key;</p>
</li>
<li><p id="_9b78b0f2-c6a9-ae8e-db21-ad55b4f109d6">a value that is not a real number raises <tt>InvalidBindingError</tt>, carrying the key and the value;</p>
</li>
<li><p id="_35a5e254-9407-caac-966e-ffcd127a0125">duplicate keys after normalisation — <tt>:x</tt> and <tt>"x"</tt> together — collapse to one binding, the last one given.</p>
</li>
</ol>

<p id="_2fa9de9c-7058-fdde-cf8e-2954b032c5cf">An evaluation with an invalid binding refuses before any evaluation happens: the tree is not walked with a bad environment.</p>

<example id="_785c0607-1c72-c0b9-7fe0-c444defb1d26"><p id="_4b92e6a0-6242-3a49-9571-e43643b55e58">Bindings <tt>{ x: 3, "y" =&gt; 4.5 }</tt>. <strong>Expected outcome.</strong> accepted; the names <tt>x</tt> and <tt>y</tt> bind <tt>3</tt> and <tt>4.5</tt>.</p>
</example>

<example id="_bc27ab7b-bb51-9773-6ee3-7e4f1fd9184f"><p id="_ad4d32f2-55a4-0ccc-38bb-6be4abbeeb47">The binding key <tt>2</tt> — a number offered as a name. <strong>Expected outcome.</strong> <tt>InvalidBindingKeyError</tt> carrying <tt>2</tt>, raised before evaluation.</p>
</example>

<example id="_72c536dc-94d8-88e1-d32c-c1f82ceae617"><p id="_329a8e6f-1bf5-6155-93d1-4693fe205571">The binding <tt>x → "three"</tt>. <strong>Expected outcome.</strong> <tt>InvalidBindingError</tt> carrying the key and the string: values must be real numbers, not their spellings.</p>
</example>
</clause>

<clause id="_9cf6e601-bbfc-943c-f584-b575cbece632" obligation="normative">
<title id="_fa8ef288-0c0e-5543-e4a7-2a1e35ae1cd0">Missing names</title>
<p id="_2eb44ce5-19e3-2c50-d309-6b1704430593">A name the tree mentions and the bindings lack raises <tt>MissingVariableError</tt>, carrying the name. The refusal happens at first use — evaluation does not pre-scan the tree for names, so an evaluation that dies early reports the first missing name it needed, not all of them.</p>
</clause>

<clause id="_14c0e8be-aba6-94fc-ba66-264ffbc022b4" obligation="normative">
<title id="_1c7ab20a-4faa-268a-84e1-e46a0217dc98">Shadowing</title>
<p id="_cd6cd7a3-0234-c79b-a3ad-a6d228eeafe7">The iteration index temporarily shadows an outer binding of the same name for the body’s evaluation and restores the outer binding afterwards (clause 10). Shadowing is scoped to the body: outside the iteration, the outer binding is untouched.</p>

<example id="_8651aafe-1983-7b9b-382b-263efb67770e"><p id="_33da983e-94df-c9ed-7a80-ff0f1ea3373c">The tree of <tt>i + sum_(i=1)^3 i</tt> with the binding <tt>i → 10</tt>. <strong>Expected outcome.</strong> the outer <tt>i</tt> contributes <tt>10</tt>; the iteration binds its own <tt>i</tt> over <tt>1..3</tt> and contributes <tt>6</tt>; the result is <tt>16</tt>. The outer binding survives the iteration unchanged.</p>
</example>
</clause>

<clause id="_9e4651af-0c10-ceab-2995-92349a391fa0" obligation="normative">
<title id="_7da0e48a-d67e-4560-55fc-75a228064bc0">The numeric types accepted</title>
<p id="_c5d22f94-c27a-a4f0-1b27-94b34f53080c">A binding value may be any real numeric type the platform offers — integers, rationals, floating-point numbers. The evaluator normalises nothing: an integer binding stays an integer in the arithmetic where the platform keeps it one, a rational stays exact while its operations do, and the corpus pins the type-observable outcomes (<tt>sum_(i=1)^3 i</tt> with an integer index folds in integers). Values that are complex, non-real or not numbers at all refuse per clause 9.</p>
</clause>

<clause id="_99ce462e-68e0-c37e-04ff-94d2297a836f" obligation="normative">
<title id="_c3fecb97-bc9f-4432-6222-490a0a74aac5">Name shape</title>
<p id="_71df8374-893a-e286-9740-c91032e725df">A name is the identifier text a tree’s symbols carry for evaluation. Names are case-sensitive and exact: <tt>X</tt> and <tt>x</tt> are different bindings, and a binding for one does not serve the other. There are no reserved names — the iteration indexes are ordinary names that shadow per clause 10.</p>
</clause>

<clause id="_03d524f7-ef85-cf30-4e80-0bdc30643f25" obligation="normative">
<title id="_34b00182-0d47-b6e7-6cdb-c79ff12ba86e">Binding once, evaluating many</title>
<p id="_4daf80c5-c521-a843-ee22-255a75f6a8eb">An evaluation binds its names once, at entry. There is no rebinding during evaluation, no environment mutation from inside the tree, and no callback through which the tree could observe or alter its own bindings.</p>
</clause>
</clause>

<clause id="_59c23e9b-85e1-591a-0caf-1f5f9fb9f5a2" obligation="normative">
<title id="_8a99bfd4-0508-dc19-eba5-3c7681add7bc">Iteration</title>
<clause id="_38693f0c-4be0-841e-3529-c530578e8688" obligation="normative">
<title id="_f2787e1a-d134-d8db-0213-fef552defbbf">The construct</title>
<p id="_e0fafb70-d4a8-4506-557f-b33290e0ddc2">The nary sum and product with explicit bounds — <tt>sum_(i=1)^n body</tt>, <tt>prod_(i=1)^n body</tt> — evaluate as bounded iteration: the index runs the integer range and the body’s values fold under the operation, starting from the operation’s identity.</p>
</clause>

<clause id="_6e59f055-18fd-ac38-2450-d409939c856f" obligation="normative">
<title id="_364c6d9f-4df7-9746-b234-6098965bacaf">The bounds</title>
<p id="_46f4340f-96b3-7eeb-9f75-88b0a1d0ea15">The lower bound parses as <tt>index = start</tt> and the upper as the end expression. Both evaluate to integers: a bound that evaluates to a non-integer or an infinite value raises the typed error of its cause (<tt>MathDomainError</tt> for a non-integer bound where the platform names it so, <tt>NonFiniteResultError</tt> for an infinite one). An empty range — a start above the end — yields the identity: the empty sum is <tt>0</tt>, the empty product is <tt>1</tt>.</p>
</clause>

<clause id="_50a134c9-86ea-7c64-8b76-7131f3ceb212" obligation="normative">
<title id="_90659aa7-eccc-802e-3c5c-67f9ac9e2621">The step limit</title>
<p id="_467884f3-5fdc-c78e-c4eb-430dc801e584">A range wider than the implementation’s step limit refuses with <tt>UnsupportedExpressionError</tt>: iteration is bounded by construction, and an unbounded or enormous range is a caller error, not a long computation.</p>
</clause>

<clause id="_9a686a0d-9c83-97cc-8604-e86273ca8eab" obligation="normative">
<title id="_250e9d4d-b400-f50b-aa3f-b222c10495b0">The fold</title>
<p id="_3ada9f83-0889-de53-2d03-aeed907e35cd">The body evaluates once per index value, left to right, with the index bound; the values fold under the operation — addition for the sum, multiplication for the product — from the identity. The index binding shadows per clause 9 and restores after.</p>

<example id="_d0b42373-2728-d56c-fca4-ea753ba7a9f2"><p id="_b0cd00e6-0c0c-28da-6dd4-1658c3e930a3"><tt>sum_(i=1)^4 i^2</tt>. <strong>Expected outcome.</strong> <tt>30</tt> — <tt>1 + 4 + 9 + 16</tt>, each square evaluated with the index bound, folded in order.</p>
</example>

<example id="_36279120-f056-3297-4d3d-41fbef79bda8"><p id="_5b3d24f4-b3aa-ebd5-d63c-0f189e725c6c"><tt>prod_(i=1)^4 i</tt> — the factorial of 4 written as a product. <strong>Expected outcome.</strong> <tt>24</tt>.</p>
</example>

<example id="_af323111-c7d2-acf6-be68-d951a6aca18d"><p id="_6abb6fe7-48ac-aa29-6c63-13709d9e7086"><tt>sum_(i=5)^4 i</tt> — an empty range. <strong>Expected outcome.</strong> <tt>0</tt>, the addition identity; no error, no evaluation of the body.</p>
</example>
</clause>

<clause id="_3f016555-d760-d4e8-0d20-35eb7f9045c2" obligation="normative">
<title id="_c3354061-d087-0a53-fe4e-c7b9d0914946">The index definition, precisely</title>
<p id="_2063e259-c0fc-4127-fe73-8f707b59fbca">The lower bound parses as the two-part form <tt>name = start</tt>. The name becomes the index; anything else in the lower-bound position is an <tt>UnsupportedExpressionError</tt>. The start evaluates once, to an integer; a non-integer start refuses with the typed error the platform names for it.</p>
</clause>

<clause id="_8bf59c96-6645-143b-a9a9-b18937c24d45" obligation="normative">
<title id="_6e67432f-2b9b-5c47-605b-23127645d2b9">Bounds validation</title>
<p id="_374038d1-4c39-d307-1fdd-4ca4ed11f3e3">After the start, the upper bound evaluates once, to an integer. Validation is order-fixed: start first, end second, both integers, then the step limit. The error each check raises names its stage, so a caller with a malformed bound learns which one it was.</p>
</clause>

<clause id="_8b04d1f4-bd41-9f52-48fa-678d46de9f89" obligation="normative">
<title id="_509e114b-8efc-10a0-c543-4beb74bc6c04">The step limit’s value</title>
<p id="_2e7331dd-eebf-ce53-11a9-9acd86e85f00">The implementation carries a fixed maximum range width; the corpus pins it as behaviour (a range one past it refuses, one within it runs). The limit exists so that <tt>sum_(i=1)<sup>10</sup>9</tt> — an infinite work order in the caller’s clothing — is a refusal the caller handles, not a hang they kill.</p>
</clause>

<clause id="_5f3f0deb-9298-8672-0b85-96904a333660" obligation="normative">
<title id="_1d34f70d-88f8-a247-a2ca-cb557dadc7aa">Nested iteration</title>
<p id="_2aa62fe1-dda7-847e-24cf-48ba96228760">A body may itself carry an iteration: the inner index shadows the outer for the inner body, and the ranges compose. The corpus carries nested vectors to fixed depth; the step limits apply per range.</p>
</clause>
</clause>

<clause id="_36988909-8fde-8726-c0af-f13bb70e1119" obligation="normative">
<title id="_fdbb643c-9ef8-81cd-c8eb-77febd523c5d">The error contract</title>
<clause id="_58940563-0476-078a-4a25-0c0864d91b89" obligation="normative">
<title id="_63700aaf-f927-1c02-f42e-8e9f6bff2fe5">The eight errors</title>
<table id="_a0052ed8-738e-097b-9a06-f7eaa46c8243"><colgroup><col width="25%"/><col width="37.5%"/><col width="37.5%"/></colgroup>
<name id="_05d7f5ae-983c-5599-8a49-344b536a46a8">The typed errors of evaluation</name>
<thead><tr id="_4299a2d4-3080-d280-1d52-a714f77dc1f8"><th id="_ec9595f0-8737-564c-7b06-7257eddf4e1e" valign="top" align="left">Error</th>
<th id="_0b63f4f1-9b9b-4784-144c-320e3b775041" valign="top" align="left">Raised when</th>
<th id="_9b3a4791-f496-06f6-bd7e-f132f3f51a32" valign="top" align="left">Carries</th>
</tr></thead>
<tbody><tr id="_e121528f-344c-85fb-9f12-3bd7dbefbfa2"><td id="_885de91a-137a-0de6-2895-7a846cd12c5b" valign="top" align="left"><tt>DivisionByZeroError</tt></td>
<td id="_6cb403d1-3356-d1ea-d6a0-815089563e04" valign="top" align="left">a division or modulo by an evaluated zero</td>
<td id="_07c7413f-80a9-5d70-ed43-283bece868fa" valign="top" align="left">nothing beyond the platform’s message where one exists</td>
</tr><tr id="_bc8d07bc-4507-f65d-8bf1-594980806956"><td id="_14566c2d-94c9-22c1-232f-65fc667e5911" valign="top" align="left"><tt>InvalidBindingError</tt></td>
<td id="_0564b9fb-6695-c9ae-ae55-054f5d497817" valign="top" align="left">a binding value is not a real number</td>
<td id="_7d7eb4ab-65d0-16b9-3559-204cb1f53c7d" valign="top" align="left">the key and the value</td>
</tr><tr id="_52a28ba0-bd2d-86d9-1797-fd259a28097b"><td id="_ed52ba41-3274-2279-ca33-654d129a135d" valign="top" align="left"><tt>InvalidBindingKeyError</tt></td>
<td id="_7ce3e223-7f27-363d-6d68-e71e97764194" valign="top" align="left">a binding key is neither string nor symbol</td>
<td id="_a966ea40-de11-0e2a-c779-d434c9fb8e0b" valign="top" align="left">the key</td>
</tr><tr id="_fecfe391-b9cc-6f4f-ea82-a4fa2ffc17c5"><td id="_18292b59-98ed-b2e8-e229-9f44be754153" valign="top" align="left"><tt>MathDomainError</tt></td>
<td id="_c9441580-d35a-5178-6046-ed8a212922ed" valign="top" align="left">an operation or function outside its real domain</td>
<td id="_031f24fb-daaf-6059-ad99-06edf70c0434" valign="top" align="left">the platform’s message</td>
</tr><tr id="_1c5b7170-8845-08e0-abac-5588e7e21a4e"><td id="_b882ea3f-1bbc-9b80-2b89-c02d714416aa" valign="top" align="left"><tt>MissingVariableError</tt></td>
<td id="_24975c9e-e323-a86f-f812-3a8a40ada14a" valign="top" align="left">a name the tree needs is unbound</td>
<td id="_8cf4e313-17d0-79e5-bd97-b34115e0c5dc" valign="top" align="left">the name</td>
</tr><tr id="_2a56faed-a542-135a-5001-0e2c4e177b39"><td id="_87d649b4-2fcd-fbc4-9309-7878d92a5325" valign="top" align="left"><tt>NonFiniteResultError</tt></td>
<td id="_00fb402d-b414-2d7a-5cca-ab6884215ed1" valign="top" align="left">a result or intermediate is not real-and-finite</td>
<td id="_6874c0f1-5402-60a4-eb83-8f1f3bc687a2" valign="top" align="left">nothing</td>
</tr><tr id="_be1a46c3-4b58-4b5c-f626-8b3ea8e90487"><td id="_716d6b7b-c39c-a402-1e93-0d65a3511865" valign="top" align="left"><tt>UnsupportedExpressionError</tt></td>
<td id="_26ecf679-72ff-620a-64af-c7ba300854fb" valign="top" align="left">the tree contains a node evaluation does not define</td>
<td id="_fa30b66e-6823-e2d6-5d6a-e0462681677c" valign="top" align="left">the node</td>
</tr><tr id="_d2f11680-6a57-07f7-5390-fd4a854fde14"><td id="_70ef5920-00e7-5837-f37e-b9b2db544189" valign="top" align="left"><tt>Error</tt></td>
<td id="_6efcdea9-a3c6-d6e4-a085-ba939ba14b83" valign="top" align="left">the base class</td>
<td id="_46437b45-f584-f9b3-6ec9-b4784b50e704" valign="top" align="left">—</td>
</tr></tbody>
</table>

<p id="_f958e7d5-98d7-bcc1-295b-5c547f23f446">Catching the base class catches them all; catching a subclass catches the specific refusal. The errors are the contract’s vocabulary: everything a caller can do about a refusal starts from one of these names.</p>
</clause>

<clause id="_e11b0ba0-1175-5817-c964-dbc43edc78ca" obligation="normative">
<title id="_d45104fa-9b92-8f83-e510-f1fe4e201987">Refusal points</title>
<p id="_c0be1cfb-32bd-c0e4-c2bc-7da00253ba68">Where each error can arise:</p>

<ol id="_ab7330cf-7b6f-5a66-4917-73f146dc657c" type="arabic"><li><p id="_755e636b-48d7-3de0-c646-dd69dbfd29d8">bindings — <tt>InvalidBindingKeyError</tt>, <tt>InvalidBindingError</tt>, at entry;</p>
</li>
<li><p id="_70edf0df-dc12-6c26-c477-fcc9b7f1c278">names — <tt>MissingVariableError</tt>, at first use;</p>
</li>
<li><p id="_e4c8a175-ae01-b242-4ced-b8f503e1c8b9">unsupported content — <tt>UnsupportedExpressionError</tt>, at the node;</p>
</li>
<li><p id="_5f3a1816-dd9e-ee65-fd4c-c523c360dc19">arithmetic and functions — <tt>DivisionByZeroError</tt>, <tt>MathDomainError</tt>, at the fold;</p>
</li>
<li><p id="_af4b79ff-7ddd-4274-26e6-30f016fe773d">the boundary — <tt>NonFiniteResultError</tt>, at every fold and at the end.</p>
</li>
</ol>
</clause>

<clause id="_a5f80f40-db33-8622-151f-bdffed527161" obligation="normative">
<title id="_836880ca-108a-5f7e-8933-480979ceb90f">What the contract forbids</title>
<p id="_4b3a39e6-38db-404c-cfbd-5f87b260cdcd">No default values for missing names, no complex-number escape hatch, no unsigned infinity, no NaN, no evaluation of part of a tree, no second chance. Each of those would turn a refusal the caller can handle into a value the caller must guess about — the contract prefers the refusal.</p>
</clause>

<clause id="_ed4a9be6-d491-4aba-87c4-b27e95ac0356" obligation="normative">
<title id="_9478cb86-899d-0ad6-59c1-573556bce9db">Messages</title>
<p id="_16958d4d-205d-14f1-6865-962b8416cae4">Message shapes are stable within an edition. The identifying data travels in the message: the missing name, the offending binding, the node class refused. The corpus pins the shapes with one vector per error.</p>
</clause>

<clause id="_5aba0be0-9b5a-ee86-f871-c6128a098ce1" obligation="normative">
<title id="_be70fccc-fdfe-fad5-857e-1348508bbec2">Causes, not substitutes</title>
<p id="_a6f2f503-43c4-c134-13e6-ab961d27e586">Where a typed error wraps a platform exception, the platform’s error is the cause — preserved for diagnostics, never raised in its place. Callers match on the typed name; the cause answers “what exactly did the platform say”.</p>
</clause>

<clause id="_336409b0-7bae-a7cc-be85-968115e23685" obligation="normative">
<title id="_d37e33ab-e55a-45c7-f066-e6ec90d7a32f">Catching guidance</title>
<p id="_707070df-fa04-79aa-2ae7-6e07e2e3c6e8">Handle the specific errors you can act on: retry with corrected bindings for <tt>MissingVariableError</tt>, report the input for <tt>UnsupportedExpressionError</tt>, treat <tt>DivisionByZeroError</tt> and <tt>MathDomainError</tt> as mathematical facts about the input. Catching the base class is for the boundary of a long pipeline; everywhere else, the specific name is the better match, and the corpus holds a vector for each name.</p>
</clause>

<clause id="_6044c8d9-e0b8-61f4-93df-59727c0d2a50" obligation="normative">
<title id="_fc998805-d7da-8bfb-3828-dc9d9797785b">Errors are results too</title>
<p id="_0d52c9af-b2d4-26e0-84cb-133a23e8dc92">A refusal is a well-defined outcome, deterministic as any number: the same tree and bindings produce the same error with the same message. The evaluation corpus treats errors exactly like results — frozen, replayed, drift-checked — because a caller’s error handling is only as reliable as the errors are repeatable.</p>
</clause>
</clause>

<clause id="_f9aa542d-1910-03d6-cb03-e70a07263f47" obligation="normative">
<title id="_d2d7152c-1ed6-5f9f-1517-5b8051c0728e">What this edition does not do</title>
<clause id="_f8f5ec23-e690-dfed-c77d-8426b5855b56" obligation="normative">
<title id="_ab346e59-dc9c-796e-7332-d14888fe6946">Uncertainty propagation</title>
<p id="_fd34890b-0ab5-9ba7-6c0e-7d752a83363b">The model carries uncertainty nodes (PM 1002); this edition’s evaluator does not compute with them. An evaluation whose tree contains an uncertainty node refuses with <tt>UnsupportedExpressionError</tt> — the honest answer, rather than an arithmetic that quietly drops the uncertainty. The propagation rules — sensitivities, the propagation law, second-order terms, coverage — enter this document in the edition whose implementation carries them.</p>
</clause>

<clause id="_dfca36f7-14a4-885c-9b7f-38402a008fc2" obligation="normative">
<title id="_8016740e-bb87-16ec-3cdc-9fc13c3040bf">Simplification</title>
<p id="_dfbb7d83-0737-6148-8a32-01eccc14630a">The evaluator never rewrites the tree: no folding of constants into nodes, no canonicalisation of equivalent forms, no algebra. Evaluation is a reading of the tree, and two equal trees evaluate identically while two different trees evaluate as written even when their values coincide.</p>
</clause>

<clause id="_f8d2df06-5d91-89ef-7219-4915b281aae9" obligation="normative">
<title id="_51747155-e4bd-5098-56bc-7783463b9b83">Units and quantities</title>
<p id="_f651561f-f615-f08f-b7f8-37e76ed0bb4d">Evaluation works on numbers. Unit conversions, quantity arithmetic and the absolute/difference typing of the UnitsML series are that series’ contracts; an evaluator applied to unit-bearing trees evaluates the numeric content as the bindings supply it and the units ride with the tree, unconverted.</p>
</clause>

<clause id="_b7c330ca-e28b-d11d-bdaa-9f2c173bb490" obligation="normative">
<title id="_4aad2990-abee-7bf0-5eda-ecd35b8490f6">Solving</title>
<p id="_8a8cff78-f7b3-c275-64a1-a76aaaee875f">No root-finding, no inversion, no symbolic manipulation. The evaluator answers one tree with one number, given complete bindings; everything else is a different tool.</p>
</clause>

<clause id="_88507309-edad-8419-8d6e-4933fc718723" obligation="normative">
<title id="_fa0d0f9e-ded7-46bc-316d-e435d81a3614">Why the limits are stated</title>
<p id="_2479c688-257b-6a8d-5570-30dfb8734781">Each non-goal is a contract someone will eventually ask for. Stating them keeps the boundary honest: an evaluator that quietly simplified would surprise every caller who diffed two trees; one that silently propagated uncertainty would make reported results and computed results behave differently in the same expression; one that converted units would need the whole UnitsML typing inside arithmetic. The limits are the design; the clauses above are the contract they protect.</p>
</clause>

<clause id="_3efb9e37-79cb-7991-b7ca-368975250ace" obligation="normative">
<title id="_6dd58f81-79e4-ea16-9339-0b79e8a5f8b2">The road in</title>
<p id="_683d069b-e042-1d81-c7d6-ca729c460a6d">When propagation arrives, it arrives in this document: its operations, its error extensions if any, its corpus, its conformance class — the same structure this edition uses for arithmetic. The uncertainty nodes of PM 1002 were built to carry everything propagation will need: category, fields, exact decimals. Nothing in the model blocks the road; the evaluator simply has not walked it yet.</p>
</clause>
</clause>

<clause id="_a9bb9fb4-83c2-6bd1-a0eb-655247a7b9cf" obligation="normative">
<title id="_be1d665a-abde-6b0e-a587-e76ed7c9a3ce">Conformance</title>
<clause id="_8eeb361d-f7ee-1302-80c0-dec549eaa77d" obligation="normative">
<title id="_510dfe68-ccc0-083d-47f6-bcc43b374f03">General</title>
<p id="_9844d965-aedb-5b62-2282-cdf7f264ab05">Conformance to this document is the implementation of the evaluator per clauses 5 to 11. One class covers it, with the corpus as its evidence; a partial implementation claims nothing.</p>
</clause>

<clause id="_c0964d6d-7dbb-269c-890a-7eeade18f07b" obligation="normative">
<title id="_ffccb181-b41a-1259-88b3-cd0e8eeffe38">Conformance classes</title>
<table id="_e627b4d0-d357-f5fd-5b23-f4e372bd45ca"><colgroup><col width="14.2857%"/><col width="42.8571%"/><col width="42.8572%"/></colgroup>
<name id="_7fbd892d-b74b-85b0-7e5f-406b93566b9f">Conformance classes</name>
<thead><tr id="_2bfc73f2-d695-beb0-fb4e-f80611c99135"><th id="_8af2c86f-fb22-6930-77d6-b04edd71e407" valign="top" align="left">Class</th>
<th id="_c3b0d272-7098-4564-71ed-131c78d7f1ea" valign="top" align="left">Licenses the implementation to claim</th>
<th id="_a7ab9297-d57c-e4e5-1285-6ff007037c66" valign="top" align="left">Replay requirements</th>
</tr></thead>
<tbody><tr id="_9132773b-15c2-da6e-27b1-128b7201620f"><td id="_0995ae3c-2552-6d69-5887-5e2bbd6166ee" valign="top" align="left">evaluation</td>
<td id="_a5cbf7b4-2d62-edd4-db1c-206b8da894d0" valign="top" align="left">evaluates trees against bindings per this document</td>
<td id="_0b0f9124-073e-792d-bd01-7e85d9c26e5d" valign="top" align="left">the evaluation corpus: results, errors, and message shapes, replayed identically</td>
</tr></tbody>
</table>

<p id="_570328e2-870c-5730-ef42-a1046c254981">The claim carries the model claim of PM 1001: an evaluator over trees is an implementation of trees first.</p>
</clause>

<clause id="_2439a030-bd67-d0bb-fdfc-96d462a9df8d" obligation="normative">
<title id="_5c2559e3-128e-ed1f-22fb-3c87817ea57a">The evaluation corpus</title>
<p id="_cd37a88e-0943-1bc2-8de8-423f592c8ceb">The corpus freezes, per entry: the tree (in a canonical reading), the bindings, and the outcome — the exact result or the typed error with its message shape. Entries come from this document’s examples first and from defect fixes and community reports as they arrive; a generation is immutable once published.</p>
</clause>

<clause id="_7c5019ea-7ae5-17d1-56a9-5b659174c339" obligation="normative">
<title id="_5755e8f5-80bc-6c73-414b-9b1041237ada">Drift</title>
<p id="_541d8363-41f0-5f8a-5dc6-642bbfc41f2c">An implementation whose result or error differs from the corpus for the same tree and bindings does not conform. Floating-point-order differences that change results are drift: the corpus, not the platform, defines the expected values, and an implementation adjusts or the document moves an edition.</p>
</clause>
</clause>

<clause id="_b3962836-6fa2-2cd4-433f-16837dc00532" obligation="normative">
<title id="_fb243dfd-7853-b40b-92c8-2134b360caa9">Annex A: precedence and operations</title>
<clause id="_308e4756-8939-f753-e791-6441664f212d" obligation="normative">
<title id="_18c14753-04ab-7092-6e93-a187369c3214">The precedence chain in full</title>
<table id="_5ec3df60-d5f4-3aa2-6400-a064ace930b7"><colgroup><col width="14.2857%"/><col width="28.5714%"/><col width="28.5714%"/><col width="28.5715%"/></colgroup>
<name id="_3d247827-4d10-f57e-f9dc-2922e7cb0531">Precedence, strictest binding last</name>
<thead><tr id="_9652da88-18de-8397-1f64-96823726bbda"><th id="_0d3fa7c4-372f-e1eb-2cb9-9ae2c0f56a6f" valign="top" align="left">Level</th>
<th id="_7cb01a6a-e83d-701a-efe6-661220ae2c78" valign="top" align="left">Constructs</th>
<th id="_12de6dd7-e3b5-7216-d34c-98b2a1ca7d45" valign="top" align="left">Associativity</th>
<th id="_bdbdc865-f1b3-2599-0115-d72458141a7f" valign="top" align="left">Folds to</th>
</tr></thead>
<tbody><tr id="_da605b4d-6662-d8f1-7c7c-90ddf3f25591"><td id="_9ce0596a-b6a1-aaad-1b1b-25b9921a4182" valign="top" align="left">relation</td>
<td id="_409eabac-3c04-334c-f685-c1bda281ba91" valign="top" align="left"><tt>=</tt>, <tt>≠</tt>, <tt>&lt;</tt>, <tt>&gt;</tt>, comparisons</td>
<td id="_e08f446e-e77e-fd92-427e-6c8933fd9daa" valign="top" align="left">left</td>
<td id="_9e1a7b12-d05a-75b9-4f0c-f1f65e5c8802" valign="top" align="left">relation evaluation</td>
</tr><tr id="_83d2776a-b6c8-55e6-1392-70794fd3fa87"><td id="_83e16f3e-4daf-8c7a-9be7-6ccb287ecce8" valign="top" align="left">additive</td>
<td id="_3ea4113f-ebf1-fe9d-c6d2-a6b8f42aaa38" valign="top" align="left"><tt>+</tt>, <tt>−</tt></td>
<td id="_a7fe8785-22da-5f9b-6c5c-769fb2eaed74" valign="top" align="left">left</td>
<td id="_706c5685-062f-3744-8a9e-2d0cdb3fed85" valign="top" align="left">add, subtract</td>
</tr><tr id="_46c61efd-1547-db2c-5774-c60c59c4dac8"><td id="_57cbcd3d-80a6-1065-2005-4a4f0986a9e6" valign="top" align="left">multiplicative</td>
<td id="_7bca44ba-7968-3da4-2b78-8e9e95b360d4" valign="top" align="left">implicit product, <tt>*</tt>, <tt>/</tt>, <tt>mod</tt></td>
<td id="_d09b96cd-0178-dc12-0e7c-0953e28c3869" valign="top" align="left">left</td>
<td id="_56b683f9-f940-6c2f-38e6-af414b12931d" valign="top" align="left">multiply, divide, modulo</td>
</tr><tr id="_956f15a3-e621-92db-ec51-fa408e331ef6"><td id="_972bc6a7-80bd-3a04-c1d4-dd223dd51d39" valign="top" align="left">unary</td>
<td id="_fae24cc5-28c4-f549-4dd6-3ace957bf445" valign="top" align="left"><tt>−</tt>, <tt>+</tt></td>
<td id="_e535d67f-a4f0-72ca-c4c0-018939fafb1b" valign="top" align="left">prefix</td>
<td id="_880f065f-a7d8-2674-e770-8400751b84bc" valign="top" align="left">negate, identity</td>
</tr><tr id="_c533c99d-f5dd-f4d0-c5d1-9ea4550d64c7"><td id="_dbd9302e-d1c4-c405-62e7-355f721ff041" valign="top" align="left">power</td>
<td id="_fea59cab-ae2e-a5ae-cd18-a58fd550c15f" valign="top" align="left"><tt>^</tt></td>
<td id="_037def4f-ea6f-9e7a-6917-aeaac6697d7e" valign="top" align="left">right</td>
<td id="_f6e64e6b-870c-03b9-474f-a8eec45d7697" valign="top" align="left">power</td>
</tr><tr id="_0d8852ad-3170-dbda-82ef-0cc3618dd661"><td id="_e39b69a3-8837-0de5-7235-f15585239a62" valign="top" align="left">operand</td>
<td id="_19c51413-434f-1c13-5cc2-34918efa7447" valign="top" align="left">numbers, names, groups, calls</td>
<td id="_6b160f55-7c0c-64d2-4d13-0afd2ddd742f" valign="top" align="left">—</td>
<td id="_300c43f1-2d87-d4ef-fcf5-e4a334d6e2d5" valign="top" align="left">leaf or recursion</td>
</tr><tr id="_05ffe65d-0144-f7f7-2541-520c7414928d"><td id="_1a3aacee-9f7b-46f3-fa02-0cc808d79abe" valign="top" align="left">group</td>
<td id="_282b6e75-b6e8-2f6c-b81e-e33a9c1e0ef9" valign="top" align="left">parentheses</td>
<td id="_5157516a-4a15-f2dd-886c-eb2e415ea9c0" valign="top" align="left">—</td>
<td id="_505ae931-4322-fa42-a250-913823c977c8" valign="top" align="left">recursion</td>
</tr></tbody>
</table>
</clause>

<clause id="_c900bce7-06f8-ca6b-55ce-389391c6ec94" obligation="normative">
<title id="_413246a2-0cb8-21d0-3ec0-e6a69d39bd92">The operations in full</title>
<table id="_cebbe0a7-be81-ac80-4377-362b708de737"><colgroup><col width="25%"/><col width="37.5%"/><col width="37.5%"/></colgroup>
<name id="_d87de602-e113-fd89-8152-66d57eb2549e">The arithmetic, normative summary</name>
<thead><tr id="_ef44fa49-e1ac-3197-9683-86aee30cc22e"><th id="_ee8c6ec7-3553-db63-152b-851739bf696c" valign="top" align="left">Operation</th>
<th id="_c6f82221-b36a-f0a4-c2c6-d33d10683df4" valign="top" align="left">Result</th>
<th id="_96c09e65-c1d2-c51a-6767-c520bd7f7e6b" valign="top" align="left">Refusals</th>
</tr></thead>
<tbody><tr id="_e70568c9-fb51-dfd9-8f2b-088bec6e96e3"><td id="_bf93871e-0cd6-b684-47a5-b84b4d2129db" valign="top" align="left">add</td>
<td id="_b43cc774-da11-7b40-8809-21fe1d7842fc" valign="top" align="left"><tt>a + b</tt></td>
<td id="_469402b1-d9f8-2682-287e-99820a1c4757" valign="top" align="left">non-finite intermediate</td>
</tr><tr id="_1f1bf106-84cc-75b8-5404-108591ef1a80"><td id="_12aa7d99-16d2-eb73-8017-c7896b0eaa1b" valign="top" align="left">subtract</td>
<td id="_9a1e2cd5-f64e-5a15-d35e-e04cc90f38be" valign="top" align="left"><tt>a − b</tt></td>
<td id="_1e1bf6e8-1019-ed9f-4d5a-df5ee50d4648" valign="top" align="left">non-finite intermediate</td>
</tr><tr id="_6a87bb99-67af-ecc3-e80c-2e366d0875ad"><td id="_5882b5ef-8414-5713-7a17-dc47b4f768d5" valign="top" align="left">multiply</td>
<td id="_45fce909-5636-0136-32f2-9f016214738c" valign="top" align="left"><tt>a · b</tt></td>
<td id="_24847aa3-fc0c-875c-d348-8fd3d4ff033b" valign="top" align="left">non-finite intermediate</td>
</tr><tr id="_3b716983-f2cc-c92a-8f17-d97ca2994250"><td id="_db12c1f6-65be-9d7f-fb4d-c5559a615b6e" valign="top" align="left">divide</td>
<td id="_9e4260e1-f8d0-7943-6c31-6b361e13fb7f" valign="top" align="left"><tt>a / b</tt></td>
<td id="_a59645fb-1b78-edb4-5f56-d930b10d82a4" valign="top" align="left">zero divisor; non-finite</td>
</tr><tr id="_a318766c-7db5-990a-9bf2-fe1cd401662e"><td id="_4eed5d8c-0050-9b6a-ce44-577e182a69f9" valign="top" align="left">modulo</td>
<td id="_3edd214a-5f15-4265-58c6-e3eb6a319293" valign="top" align="left">platform modulo</td>
<td id="_00f73be2-0813-e4e9-27d8-d1753fdc9030" valign="top" align="left">zero divisor</td>
</tr><tr id="_c49c57b5-73e1-ad3d-4a93-360f74d2ba59"><td id="_c8e52bb8-b150-f857-f1f3-0f4a5c33b72d" valign="top" align="left">power</td>
<td id="_7ce52cd9-9e53-559d-5887-64d750338c93" valign="top" align="left"><tt>a^b</tt> in the real domains of clause 7</td>
<td id="_542e4566-16ea-9448-6edb-5b1e7a4c42a0" valign="top" align="left">domain; non-finite</td>
</tr><tr id="_1cee3245-7f06-0a26-5f9f-ea96819c3071"><td id="_ea7d249f-246b-a67b-1599-2cdbeb4cc720" valign="top" align="left">negate</td>
<td id="_6e332d00-0e63-5760-dba7-e0a12f5deeaf" valign="top" align="left"><tt>−a</tt></td>
<td id="_02275f9f-07ed-56a3-744e-22c9806a2862" valign="top" align="left">none</td>
</tr><tr id="_8f66cc54-81b0-2ee6-fda3-8e5273c3b786"><td id="_eb7230f2-5ea0-981c-b1cc-a7eba32797a1" valign="top" align="left">identity</td>
<td id="_a23f1460-aa14-41df-44ac-45b9f6245842" valign="top" align="left"><tt>a</tt></td>
<td id="_49eaa9e6-d876-c6b3-5c1c-ffabdbe243f0" valign="top" align="left">none</td>
</tr></tbody>
</table>
</clause>

<clause id="_f1c016ad-df62-3a6e-29ad-4f02b7587f37" obligation="normative">
<title id="_553d5ad0-ef01-b939-eba5-03fbc7267852">Function domains, normative summary</title>
<table id="_0e48a60c-2072-355a-af8a-93157113c095"><colgroup><col width="40%"/><col width="60%"/></colgroup>
<name id="_13a9b97d-cd14-2a56-b1ef-d9c8a2a1abf5">Function refusals</name>
<thead><tr id="_a2cd741b-339f-671b-3012-c760e8b3bdca"><th id="_7b78e53e-4886-620e-294c-1a7de7459c99" valign="top" align="left">Function</th>
<th id="_8f97bf05-b678-515f-804f-0d0907337c80" valign="top" align="left">Refusal domain</th>
</tr></thead>
<tbody><tr id="_6bc4c473-b7ea-a6cd-5e10-792c9818852d"><td id="_deeb5f2c-8d7b-60dd-e4cf-31e5aee26631" valign="top" align="left">inverse trigonometric</td>
<td id="_5fa37da9-b0ef-d557-14e4-3a7ea774d23a" valign="top" align="left">argument outside the closed interval of arcsine and arccosine</td>
</tr><tr id="_32487f3a-abf3-54e1-93ec-a33638b69c9f"><td id="_fa02fe23-587e-10d0-44a1-2bf2c0af1667" valign="top" align="left">logarithms</td>
<td id="_8fdd0bac-a626-2d3b-7cd6-a8f9e0c3626b" valign="top" align="left">argument ≤ 0; base ≤ 0 or base = 1</td>
</tr><tr id="_bedea98b-a8fe-f130-3e31-dec9bf92d7fa"><td id="_a8659d74-36b5-06d5-91b0-3811fae55bc1" valign="top" align="left">exponential, hyperbolic</td>
<td id="_946cdecc-fb77-27a1-5af8-36202f282f41" valign="top" align="left">overflow only</td>
</tr><tr id="_7f382f16-63a1-5c6c-9bf7-831d1e970848"><td id="_989781a3-c047-232e-b200-e163a43f7b7d" valign="top" align="left">trigonometric, <tt>abs</tt>, <tt>floor</tt>, <tt>ceil</tt>, <tt>min</tt>, <tt>max</tt></td>
<td id="_6c132888-691a-adcc-0223-dfff9e14e042" valign="top" align="left">no domain refusals</td>
</tr></tbody>
</table>

<p id="_9b255313-2b0b-c680-1349-eaa6cbfb1295">Every refusal raises <tt>MathDomainError</tt> with the platform’s message; every overflow raises <tt>NonFiniteResultError</tt>.</p>
</clause>
</clause>

<clause id="_b80b094c-60ed-0776-a5bd-8503bb522745" obligation="normative">
<title id="_19a141cb-a1e2-880f-d6d0-cf8266a49f03">Annex B: the error messages</title>
<table id="_12ea6f58-e857-c817-78d3-436a99ce099a"><colgroup><col width="33.3333%"/><col width="66.6667%"/></colgroup>
<name id="_89a133e4-d1a3-14cb-9384-ef0b1b667dfd">Message shapes</name>
<thead><tr id="_e1bf85a2-d2b0-7dd5-3f2a-7e6102af3d20"><th id="_3a0424c1-9c29-1695-e7a5-00443cfaea1b" valign="top" align="left">Error</th>
<th id="_1ab33bfd-f8c0-83be-510f-e67c6f76d80c" valign="top" align="left">Message carries</th>
</tr></thead>
<tbody><tr id="_c0fd67b4-e377-b2ee-ce9e-8c306ef4929f"><td id="_12d3b31c-9791-acea-752d-0643d2630265" valign="top" align="left"><tt>DivisionByZeroError</tt></td>
<td id="_429c1fe4-3730-187a-3ae7-9f82c993e254" valign="top" align="left">the platform’s division message, where one exists</td>
</tr><tr id="_f8067943-a925-9dbe-71b1-fede7ef2da55"><td id="_605127f0-7453-862e-5870-6f505ecd02d0" valign="top" align="left"><tt>InvalidBindingError</tt></td>
<td id="_b9bd5be8-eaa9-cc9c-e8a5-641907d6efec" valign="top" align="left">the key, and the inspection of the rejected value</td>
</tr><tr id="_5f6a8c8e-87fa-b35f-8751-75f4f128415d"><td id="_06452fc6-d292-31f3-ed3e-69b6db9029bf" valign="top" align="left"><tt>InvalidBindingKeyError</tt></td>
<td id="_057f0747-1eaf-629e-ca32-f7c7a2786aed" valign="top" align="left">the inspection of the rejected key</td>
</tr><tr id="_9ebc18f8-6ebf-7dfc-58f2-e01bd38f33b8"><td id="_6d87145a-a9d3-4107-3ffa-38ecb4f24ea4" valign="top" align="left"><tt>MathDomainError</tt></td>
<td id="_87bc7398-cfcd-5f80-da1a-42ad3e7c98ae" valign="top" align="left">the platform’s domain message</td>
</tr><tr id="_5d2706bb-c42d-4df2-de88-4bfb08501323"><td id="_1b1d4685-755c-702c-ad85-75b7ee5b2873" valign="top" align="left"><tt>MissingVariableError</tt></td>
<td id="_4c75e04e-32ce-4f89-b3e9-e7fbca756dd5" valign="top" align="left">the missing name, alone</td>
</tr><tr id="_c1095b3c-616c-123c-0c19-96f56705cbe7"><td id="_22c99d2f-2703-c612-6d27-a5119a66d456" valign="top" align="left"><tt>NonFiniteResultError</tt></td>
<td id="_7ebe17a0-b586-8c17-6699-283f04123470" valign="top" align="left">nothing — the class is the message</td>
</tr><tr id="_17169ef0-b8a1-bb87-153b-1e3c30747a1e"><td id="_7bda77e5-01c7-d9a7-c8e9-e6de62935136" valign="top" align="left"><tt>UnsupportedExpressionError</tt></td>
<td id="_5fb8fcf1-40f0-096f-329e-aa70a5291534" valign="top" align="left">the class of the refused node</td>
</tr></tbody>
</table>

<p id="_02d6fc51-5b0d-abe1-3fcc-84b7cf8ec237">One vector per row exists in the corpus, so an implementation’s messages are checked against the shapes, not against prose in this document.</p>

<clause id="_2e78ce41-f232-5753-65ee-5f0a6511777a" obligation="normative">
<title id="_1618e322-0948-aaae-0386-e3c0d4bc031a">Refusal vectors in the corpus</title>
<p id="_a619561c-9643-a99b-7dd6-78f4d3c5bf97">The message shapes of this annex carry one corpus vector each, plus: a missing name deep inside an iteration body (the name reported is the body’s first use), an unsupported node inside a group (the group does not shield it), and a non-finite intermediate inside an argument (refused at the argument, before the call). The corpus, not this annex, is the checkable form; this annex is its key.</p>
</clause>
</clause>

<clause id="_5f8b5f9c-3bc6-f437-07d0-feb089bb1554" obligation="normative">
<title id="_f198a04b-480c-45f1-f7e1-1e58f2d02e8f">Annex C: test-suite examples</title>
<p id="_eb11af0f-d8cf-ae07-a9b9-3df821c12ed7">Vectors illustrative of the evaluation corpus. Each states the tree, the bindings, and the outcome.</p>

<clause id="_8f6acdf3-b779-5d28-ae47-74c99eec1fa7" obligation="normative">
<title id="_74f8e8be-282c-4e39-fc61-356a9c7e3357">Results</title>
<example id="_2f7a8f35-2660-84ed-788b-b0de5b4a3522"><p id="_664173a8-1932-e51f-c791-85b0a19cbee8"><tt>x^2 + 1</tt> with <tt>x → 3</tt>. <strong>Expected outcome.</strong> <tt>10</tt>.</p>
</example>

<example id="_a9c8e8a2-b9a7-4bd4-7378-2be03f630efc"><p id="_0b942008-aeaa-2835-5b77-a45470fc34d7"><tt>2<sup>3</sup>2</tt>. <strong>Expected outcome.</strong> <tt>512</tt> — right-associative powers.</p>
</example>

<example id="_dfece719-ab53-5776-822f-ecddd8832e15"><p id="_6ee4e87d-540b-66e4-4920-364f26fbf0e4"><tt>(a + b) * (a − b)</tt> with <tt>a → 5</tt>, <tt>b → 2</tt>. <strong>Expected outcome.</strong> <tt>21</tt> — groups first, then the product.</p>
</example>

<example id="_2e867569-c9bb-e02a-25ba-5a0c904004e2"><p id="_b007385d-f607-e86e-a4c4-351fcb0a0cfa"><tt>sum_(i=1)^4 i^2</tt>. <strong>Expected outcome.</strong> <tt>30</tt>.</p>
</example>

<example id="_88fd4f0f-ec40-6bdd-e8d1-2584f96232ea"><p id="_936e982a-fdb7-99ae-fb9b-fae920ad681e"><tt>prod_(i=1)^4 i</tt>. <strong>Expected outcome.</strong> <tt>24</tt>.</p>
</example>

<example id="_2b75c8a0-7a07-d95a-2f02-1e281711f998"><p id="_eb4d0b6b-95c6-e65e-1116-2e2c36a76561"><tt>sum_(i=5)^4 i</tt>. <strong>Expected outcome.</strong> <tt>0</tt> — the empty range, no error.</p>
</example>

<example id="_baf2e150-9234-68cc-e896-c59a2cedf8af"><p id="_81430bd4-4914-8234-865a-8dca2127be4e"><tt>i + sum_(i=1)^3 i</tt> with <tt>i → 10</tt>. <strong>Expected outcome.</strong> <tt>16</tt> — shadowing scoped to the body; the outer binding survives.</p>
</example>
</clause>

<clause id="_cb4deebc-c961-449a-0bd3-c4e74365c4d3" obligation="normative">
<title id="_2088f6d9-b81b-37dc-8d8d-6d001cabc419">Refusals</title>
<example id="_56a0ccbb-5ca5-7ced-bd68-8852f2df8b28"><p id="_5957df4a-3963-ac7d-46c1-52a4106df7da"><tt>1/0</tt> and <tt>x/(y − y)</tt> with any <tt>x</tt>, <tt>y</tt> bound. <strong>Expected outcome.</strong> <tt>DivisionByZeroError</tt> — the second through an evaluated zero.</p>
</example>

<example id="_036bd105-c8e8-b5c2-4f04-fb7821433149"><p id="_0709dc4d-2949-a7ec-f0ea-b16c4e6e0f53"><tt>sqrt(−1)</tt> written as a power <tt>(−2)^(1/2)</tt>. <strong>Expected outcome.</strong> <tt>MathDomainError</tt>.</p>
</example>

<example id="_48ab0119-0875-0b17-33fb-6caf31cbad83"><p id="_31d2b41f-c919-98cf-c019-f18859444e75"><tt>log(0)</tt>. <strong>Expected outcome.</strong> <tt>MathDomainError</tt>.</p>
</example>

<example id="_39627450-2918-93f3-8b83-73cd45be6260"><p id="_94711dfd-8a56-d4c3-561d-00c73326274d"><tt>x + 1</tt> with no bindings. <strong>Expected outcome.</strong> <tt>MissingVariableError</tt> carrying <tt>x</tt>.</p>
</example>

<example id="_70bfafa2-05ae-15a6-d241-944e41368d8d"><p id="_e7847a80-2fc1-5575-47a4-49a2ff274185">The tree of a text node: <tt>text("hello")</tt>. <strong>Expected outcome.</strong> <tt>UnsupportedExpressionError</tt> naming the node class.</p>
</example>

<example id="_eceb2aab-6722-bd9c-1955-66cff28275d7"><p id="_f66dcbba-dbaa-cee0-a79b-2f0cc75471b7">A tree containing an uncertainty node (PM 1002). <strong>Expected outcome.</strong> <tt>UnsupportedExpressionError</tt> — clause 12’s rule, tested.</p>
</example>

<example id="_7840c42a-25de-7a47-f4f1-6dda2c02793f"><p id="_e6cc0db1-69d6-be46-f594-75a2f26afd9e">The binding <tt>x → "three"</tt>. <strong>Expected outcome.</strong> <tt>InvalidBindingError</tt> with the key and value.</p>
</example>

<example id="_ef73e6b3-da00-b10e-5ee8-ed71d5bbc199"><p id="_981c8fef-74a6-375f-bce1-2e7e29bd0ffe">The binding key <tt>2</tt>. <strong>Expected outcome.</strong> <tt>InvalidBindingKeyError</tt> with the key.</p>
</example>

<example id="_e9dde70f-3560-fc62-5173-12a5f00bd80d"><p id="_27719267-2438-7fab-ea5d-3b58b9c69bf1">An exponentiation whose magnitude overflows the platform’s numbers. <strong>Expected outcome.</strong> <tt>NonFiniteResultError</tt> at the fold, not at the end — intermediate checks refuse early.</p>
</example>
</clause>

<clause id="_ff43c662-5d1f-b947-3942-2b0b66a0ea83" obligation="normative">
<title id="_e0cf604d-df0e-f964-b7d0-daf0e9748f8c">Determinism</title>
<example id="_60517c7c-8dae-3c97-6b82-10d7ddee5879"><p id="_0a070250-ed98-66ce-e6c3-6852da7a46f5">The same tree and bindings evaluated twice, in one process and across processes. <strong>Expected outcome.</strong> the identical result or the identical error, every time; the corpus replays the whole set.</p>
</example>
</clause>

<clause id="_9112d8dc-f2c3-69c9-f244-4ea8e49cebf0" obligation="normative">
<title id="_3ce274f4-a55c-1aeb-f3f8-a470644e9401">Precedence vectors</title>
<example id="_12aa89fb-fbb8-ce59-eb82-b02c15b576c6"><p id="_362d190b-8c70-c4b0-50ec-581c09623f6e"><tt>−3 + 4 * 2^2 / (1 + 1)</tt>. <strong>Expected outcome.</strong> <tt>5</tt>, per the walk of Annex A.</p>
</example>

<example id="_b90dc427-290d-bd50-9a55-71a0f00bb254"><p id="_17a725bb-f49f-085b-f2d3-bba983721b57"><tt>8 / 4 / 2</tt>. <strong>Expected outcome.</strong> <tt>1</tt> — left-associative division.</p>
</example>

<example id="_1eb8d59c-28e5-96ca-67af-f40f426df874"><p id="_a1a2c3ea-a47a-c9c8-ee0a-3709f94926a6"><tt>2 − 3 − 4</tt>. <strong>Expected outcome.</strong> <tt>−5</tt> — left-associative subtraction, not <tt>3</tt>.</p>
</example>
</clause>

<clause id="_be4a04f1-cd83-bc62-999c-b1c0336b09ba" obligation="normative">
<title id="_3d926578-e263-0876-6048-a31ee90a9cac">Binding vectors</title>
<example id="_dd173d54-e344-fedc-ef8a-99e391ede92a"><p id="_306d62e4-c6fa-ad54-daa0-c8b5b33b14a4"><tt>:x</tt> and <tt>"x"</tt> given together with different values. <strong>Expected outcome.</strong> one binding, the last given; the corpus pins which spelling survives.</p>
</example>

<example id="_0d509786-d939-7fa3-ef1e-e1e0f5d43653"><p id="_fde84dcd-5182-bcc2-b0c1-b55a45a17f01">A rational binding <tt>1/3</tt> in <tt>x * 3</tt>. <strong>Expected outcome.</strong> <tt>1</tt> — exact under the platform’s rational arithmetic, and the corpus states the type-observable result.</p>
</example>
</clause>

<clause id="_d24e44e2-922f-eb1a-8743-04ddb04020d1" obligation="normative">
<title id="_f070201a-5a53-7ea2-4828-22f95c4e2ce0">Iteration vectors</title>
<example id="_54c9bd8a-34a1-ef33-62be-08e1586952cc"><p id="_9adc9417-17e1-a681-c4cb-d872a67ecc70"><tt>sum_(i=1)^n i</tt> with <tt>n → 0</tt>. <strong>Expected outcome.</strong> <tt>0</tt> — the empty range for a bound that evaluated to zero.</p>
</example>

<example id="_95dbbcad-dd5c-eb11-99b3-aa54a3380e31"><p id="_bb40f8dd-95ea-cd35-9a79-88e9f1e0b0bb">A range past the step limit. <strong>Expected outcome.</strong> <tt>UnsupportedExpressionError</tt> naming the iteration; the limit’s edge is a corpus vector on both sides.</p>
</example>
</clause>
</clause>

<clause id="_74d23fb6-295a-92f2-627e-9fc811eeaf9c" obligation="normative">
<title id="_7bccf831-5242-470e-83c4-8093e6ff4ae1">Annex D: worked evaluations</title>
<p id="_b2426653-040d-46bb-98b5-4cab9e4ed741">Two evaluations end to end, from tree to outcome.</p>

<clause id="_fbc98544-3b01-4f96-c587-b2e1bb203117" obligation="normative">
<title id="_2f95f1f4-98d4-c8f5-0790-ee7216fc2e6f">The quadratic discriminant</title>
<p id="_bd3834ce-fd51-822f-8aff-06928c984c1e">The tree of <tt>b^2 − 4ac</tt>, bindings <tt>b → −3</tt>, <tt>a → 1</tt>, <tt>c → 2</tt>.</p>

<ol id="_ce2f0f68-dd9b-a6e7-8fa9-ccf312e66f94" type="arabic"><li><p id="_f52e1e50-fbea-1c65-8f42-c0bc858e85e0">The power level: <tt>b^2</tt> folds to <tt>9</tt>.</p>
</li>
<li><p id="_82a2b53c-99cc-c196-0523-174dd658322f">The multiplicative level: <tt>4</tt>, <tt>a</tt>, <tt>c</tt> fold to <tt>8</tt> — implicit products fold left: <tt>4·1 = 4</tt>, <tt>4·2 = 8</tt>.</p>
</li>
<li><p id="_eb307716-57c0-8e20-0c5c-50823c0b1d3e">The additive level: <tt>9 − 8</tt> folds to <tt>1</tt>.</p>
</li>
</ol>

<p id="_bbea40b0-c94f-31f9-91c2-730a2a27a2df"><strong>Expected outcome.</strong> <tt>1</tt>. The discriminant is positive; nothing in this document says what that means — the caller reads their own mathematics into the number.</p>
</clause>

<clause id="_c4e21e83-a41f-0e5e-d52c-ddfc6e9ceadf" obligation="normative">
<title id="_94b81ff3-95af-5ea1-cddd-8027bce4ef3f">A series sum with shadowing</title>
<p id="_7f47a173-21bc-9d5f-fb84-a9884286525d">The tree of <tt>x_0 + sum_(n=1)^5 (n * x_0 / n)</tt> — a deliberately redundant form to exercise the machinery — bindings <tt>x_0 → 2</tt>.</p>

<ol id="_f89b57af-5a5b-a8da-0849-892628895f1e" type="arabic"><li><p id="_1526b635-7e76-87e7-555c-f2fa55595938">The iteration’s lower bound reads <tt>n = 1</tt>; the upper bound evaluates to <tt>5</tt>; the range is <tt>1..5</tt>.</p>
</li>
<li><p id="_50f7d79f-65ce-018e-a49c-41fe58a8e3bd">For each <tt>n</tt> in order, the body folds: the product <tt>n · 2</tt> then the division by the bound <tt>n</tt>, yielding <tt>2</tt> each time — the index shadows nothing here (no outer <tt>n</tt>), but binds itself for the body.</p>
</li>
<li><p id="_80caa9ba-1914-03cb-9637-f5d7a93bd967">The five values fold additively from <tt>0</tt>: <tt>10</tt>.</p>
</li>
<li><p id="_422cf60d-6f50-2621-c759-1f448730be28">The additive level: <tt>2 + 10</tt>.</p>
</li>
</ol>

<p id="_1bf186d7-5d30-06ba-cf46-fa6529193ef3"><strong>Expected outcome.</strong> <tt>12</tt>. The outer <tt>x_0</tt> binding is untouched by the iteration; a second evaluation of the same tree with the same bindings yields <tt>12</tt> again, byte for byte.</p>
</clause>

<clause id="_60d76ccf-7a7a-9d0e-e01b-cabfa20a7bad" obligation="normative">
<title id="_e4754a4d-2840-c208-779e-6289f67f7f76">What the walk-through shows</title>
<ul id="_69af584f-c840-8d4d-b102-93979d18aac8"><li><p id="_35802d78-c31b-8a90-205f-f8913d8dca4b">the precedence chain in action: powers, products, then the sum, then the addition;</p>
</li>
<li><p id="_eb540ef0-3c56-4f9e-3fc3-047f5404c27d">the binding discipline: entry validation, use-time missing-name refusals, scoped index binding;</p>
</li>
<li><p id="_f30196e5-88a0-d4c3-0d6d-c18450880813">determinism as an observable property, not a promise.</p>
</li>
</ul>
</clause>
</clause>


</sections><bibliography><references id="_f7982d1a-fb71-3d54-7e96-c194d1378af3" normative="true" obligation="informative">
<title id="_270c5ee6-077e-f285-ff95-287984a30140">Normative references</title><p id="_49996d2b-65c1-916b-9bbf-42b933aa0025">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.</p>


<bibitem anchor="pm1001" id="_1f6a185a-e724-a925-1e3b-9498271665e5"><formattedref format="application/x-isodoc+xml">of this series — the tree, the node classes and their operand orders.</formattedref><docidentifier>PM 1001 (math model)</docidentifier><docnumber>1001 (math model)</docnumber><language>en</language><script>Latn</script></bibitem>
<bibitem anchor="pm1002" id="_6a496175-ee94-579e-64f0-60ab83dbbc06"><formattedref format="application/x-isodoc+xml">of this series — the nodes this edition does not compute with.</formattedref><docidentifier>PM 1002 (uncertainty model)</docidentifier><docnumber>1002 (uncertainty model)</docnumber><language>en</language><script>Latn</script></bibitem>
<bibitem anchor="cc36813" id="_580a0b20-2496-4e49-715f-667d985efb4e"><formattedref format="application/x-isodoc+xml">of the UnitsML series — the exact-decimal discipline of the data, distinct from this evaluator’s binding values.</formattedref><docidentifier>CalConnect 36813 (numeric contract)</docidentifier><docnumber>36813 (numeric contract)</docnumber><language>en</language><script>Latn</script></bibitem>
</references><references id="_23905fa8-4c3e-cc51-1a72-5c68c6daaa19" normative="false" obligation="informative">
<title id="_50ceb1e1-516f-2673-d73d-4f0c58b4d023">Bibliography</title><bibitem anchor="plurimath-repo" id="_7f4a376c-24dc-0918-6b87-18b3d6d13554">
  <formattedref format="application/x-isodoc+xml">— <link target="https://github.com/plurimath/plurimath"/></formattedref>
  <docidentifier>Plurimath repository</docidentifier>
  <language>en</language>
  <script>Latn</script>
</bibitem><bibitem anchor="pm-eval-impl" id="_a7122481-c5c3-4092-2e45-7d25aae9ef47">
  <formattedref format="application/x-isodoc+xml">— the reference implementation of this document</formattedref>
  <docidentifier><tt>Plurimath::Math::Evaluation</tt> implementation</docidentifier>
  <language>en</language>
  <script>Latn</script>
</bibitem><bibitem anchor="pm1001-b" id="_354edbf2-917c-f6fe-949d-9b2ce77a5888">
  <formattedref format="application/x-isodoc+xml">of this series</formattedref>
  <docidentifier>PM 1001</docidentifier>
  <docnumber>1001</docnumber>
  <language>en</language>
  <script>Latn</script>
</bibitem><bibitem anchor="pm1002-b" id="_6a47138f-67bd-9e12-ec37-1fb8c45bc4e5">
  <formattedref format="application/x-isodoc+xml">of this series</formattedref>
  <docidentifier>PM 1002</docidentifier>
  <docnumber>1002</docnumber>
  <language>en</language>
  <script>Latn</script>
</bibitem><bibitem anchor="pm1003-b" id="_e01ae777-d7d3-e8c6-2c7c-455bd06695a4">
  <formattedref format="application/x-isodoc+xml">of this series</formattedref>
  <docidentifier>PM 1003</docidentifier>
  <docnumber>1003</docnumber>
  <language>en</language>
  <script>Latn</script>
</bibitem><bibitem id="_635564d1-c27b-5ed8-0792-6738bbde5f00" type="standard" schema-version="v1.5.6" anchor="jcgm100-c">
  <fetched>2026-11-05</fetched>
  
<title language="en" script="Latn">Guide to the expression of uncertainty in measurement</title>

  
<title language="fr" script="Latn">Guide pour l’expression de l’incertitude de mesure</title>

  <uri language="en" script="Latn" type="citation">https://www.bipm.org/documents/20126/2071204/JCGM_100_2008_E.pdf/cb0ef43f-baa5-11cf-3f85-4dcd86f77bd6</uri>
  <uri language="fr" script="Latn" type="citation">https://www.bipm.org/documents/20126/2071204/JCGM_100_2008_F.pdf/53384399-1e6d-b598-dd17-2831a6b5b812</uri>
  <docidentifier language="en" script="Latn" type="BIPM" primary="true">JCGM 100:2008</docidentifier>
  <docidentifier language="fr" script="Latn" type="BIPM" primary="true">JCGM 100:2008</docidentifier>
  <docidentifier type="BIPM" primary="true">JCGM 100:2008</docidentifier>
  <docnumber>JCGM 100:2008</docnumber>
  <date type="published">
    <on>2008-09</on>
  </date>
  <contributor>
    <role type="publisher"/>
    <organization>
      
<name language="en" script="Latn">International Bureau of Weights and Measures</name>

      
<name language="fr" script="Latn">Bureau international des poids et mesures</name>

      <abbreviation language="fr" script="Latn">BIPM</abbreviation>
      <uri>www.bipm.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="publisher"/>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Organization for Standardization</name>

      
<name language="fr" script="Latn">Organisation internationale de normalisation</name>

      <abbreviation language="en" script="Latn">ISO</abbreviation>
      <uri>www.iso.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="publisher"/>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Electrotechnical Commission</name>

      
<name language="fr" script="Latn">Commission électrotechnique internationale</name>

      <abbreviation language="en" script="Latn">IEC</abbreviation>
      <uri>www.iec.ch</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Organization of Legal Metrology</name>

      
<name language="fr" script="Latn">Organisation Internationale de Métrologie Légale</name>

      <abbreviation language="fr" script="Latn">OIML</abbreviation>
      <uri>www.oiml.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Union of Pure and Applied Chemistry</name>

      
<name language="fr" script="Latn">Union internationale de chimie pure et appliquée</name>

      <abbreviation language="en" script="Latn">IUPAC</abbreviation>
      <uri>www.iupac.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Union of Pure and Applied Physics</name>

      
<name language="fr" script="Latn">Union internationale de physique pure et appliquée</name>

      <abbreviation language="en" script="Latn">IUPAP</abbreviation>
      <uri>www.iupap.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Federation of Clinical Chemistry and Laboratory Medicine</name>

      
<name language="fr" script="Latn">Fédération internationale de chimie clinique et de biologie moléculaire</name>

      <abbreviation language="en" script="Latn">IFCC</abbreviation>
      <uri>www.ifcc.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author"/>
    <organization>
      
<name language="en" script="Latn">International Laboratory Accreditation Cooperation</name>

      
<name language="fr" script="Latn">Coopération internationale d’accréditation des laboratoires</name>

      <abbreviation language="en" script="Latn">ILAC</abbreviation>
      <uri>www.ilac.org</uri>
    </organization>
  </contributor>
  <contributor>
    <role type="author">
      <description>committee</description>
    </role>
    <organization>
      
<name language="fr" script="Latn">Bureau international des poids et mesures</name>

      <subdivision>
        
<name language="en" script="Latn">Joint Committee for Guides in Metrology</name>

        
<name language="fr" script="Latn">Comité commun pour les guides en métrologie</name>

        <abbreviation>JCGM</abbreviation>
      </subdivision>
      <abbreviation language="fr" script="Latn">BIPM</abbreviation>
    </organization>
  </contributor>
  <edition>1</edition>
  <language>en</language>
  <language>fr</language>
  <script>Latn</script>
  <place>
    <city>Paris</city>
  </place>
</bibitem>






</references></bibliography>
</metanorma>
