diff options
| -rw-r--r-- | docs/spec/inferred.html | 2 | ||||
| -rw-r--r-- | spec/inferred.md | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/docs/spec/inferred.html b/docs/spec/inferred.html index 47cb341e..4dfc7f34 100644 --- a/docs/spec/inferred.html +++ b/docs/spec/inferred.html @@ -122,7 +122,7 @@ <p>Fill elements of iteration modifiers such as <code><span class='Modifier'>Β¨β</span></code> are not specified. It is reasonable to define the fill element of <code><span class='Function'>π½</span><span class='Modifier'>β</span></code> or <code><span class='Function'>π½</span><span class='Modifier'>Β¨</span></code> to be <code><span class='Function'>π½</span></code> applied to the fill elements of the arguments. Regardless of definition, computing the fill element cannot cause side effects or an error.</p> <h2 id="undo"><a class="header" href="#undo">Undo</a></h2> <p>The Undo 1-modifier <code><span class='Modifier'>βΌ</span></code>, given an operand <code><span class='Function'>π½</span></code> and argument <code><span class='Value'>π©</span></code>, and possibly a left argument <code><span class='Value'>π¨</span></code>, finds a value <code><span class='Value'>y</span></code> such that <code><span class='Value'>π©</span><span class='Function'>β‘</span><span class='Value'>π¨</span><span class='Function'>π½</span><span class='Value'>y</span></code>, that is, an element of the pre-image of <code><span class='Value'>π©</span></code> under <code><span class='Function'>π½</span></code> or <code><span class='Value'>π¨</span><span class='Function'>π½β’</span></code>. Thus it satisfies the constraint <code><span class='Value'>π©</span> <span class='Function'>β‘</span> <span class='Value'>π¨</span><span class='Function'>π½</span><span class='Value'>π¨</span><span class='Function'>π½</span><span class='Modifier'>βΌ</span><span class='Value'>π©</span></code> (<code><span class='Value'>π¨</span><span class='Function'>π½</span><span class='Modifier'>βΌ</span><span class='Function'>β’</span></code> is a <em>right inverse</em> of <code><span class='Value'>π¨</span><span class='Function'>π½β’</span></code>) provided <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span></code> and <code><span class='Function'>π½</span></code> both complete without error. <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span></code> should of course give an error if no inverse element exists, and can also fail if no inverse can be found. It is also preferred for <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span></code> to give an error if there are many choices of inverse with no clear way to choose one of them: for example, <code><span class='Number'>0</span><span class='Ligature'>βΏ</span><span class='Number'>0</span><span class='Function'>β</span><span class='Value'>m</span></code> returns the diagonal of matrix <code><span class='Value'>m</span></code>; <code><span class='Number'>0</span><span class='Ligature'>βΏ</span><span class='Number'>0</span><span class='Function'>β</span><span class='Modifier'>βΌ</span><span class='Number'>2</span><span class='Ligature'>βΏ</span><span class='Number'>3</span></code> requires values to be chosen for the off-diagonal elements in its result. It is better to give an error, encouraging the programmer to use a fully-specified approach like <code><span class='Number'>2</span><span class='Ligature'>βΏ</span><span class='Number'>3</span><span class='Modifier2'>βΎ</span><span class='Paren'>(</span><span class='Number'>0</span><span class='Ligature'>βΏ</span><span class='Number'>0</span><span class='Modifier2'>βΈ</span><span class='Function'>β</span><span class='Paren'>)</span></code> applied to a matrix of initial elements, than to return a result that could be very different from other implementations.</p> -<p>If a value <code><span class='Value'>π©</span></code> isn't in the range of <code><span class='Function'>π½</span></code>, then no result satisfies the rule for <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span><span class='Value'>π©</span></code>. As <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span><span class='Value'>π©</span></code> would then always give an error by the above rules, a BQN implementation with extensions could define it in any way. However, two such extensions are specified: <code><span class='Function'>F</span><span class='Modifier'>βΌβΌ</span></code> and <code><span class='Function'>F</span><span class='Modifier2'>β</span><span class='Paren'>(</span><span class='Function'>-</span><span class='Value'>n</span><span class='Paren'>)</span><span class='Modifier'>βΌ</span></code> are extended to the full domain of <code><span class='Function'>F</span></code> and <code><span class='Function'>/</span><span class='Modifier'>βΌ</span></code> to any list of natural numbers, as noted below.</p> +<p>If a value <code><span class='Value'>π©</span></code> isn't in the range of <code><span class='Function'>π½</span></code>, then no result satisfies the rule for <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span><span class='Value'>π©</span></code>. As <code><span class='Function'>π½</span><span class='Modifier'>βΌ</span><span class='Value'>π©</span></code> would then always give an error by the above rules, a BQN implementation with extensions could define it in any way. However, a few such extensions are specified: <code><span class='Function'>β</span><span class='Modifier'>βΌ</span></code> is defined on all numbers, and <code><span class='Function'>F</span><span class='Modifier'>βΌβΌ</span></code> and <code><span class='Function'>F</span><span class='Modifier2'>β</span><span class='Paren'>(</span><span class='Function'>-</span><span class='Value'>n</span><span class='Paren'>)</span><span class='Modifier'>βΌ</span></code> are extended to the full domain of <code><span class='Function'>F</span></code> and <code><span class='Function'>/</span><span class='Modifier'>βΌ</span></code> to any list of natural numbers, as noted below.</p> <p>When working with limited-precision numbers, it may be difficult or impossible to exactly invert the operand function. Instead, it is generally acceptable to perform a computation that, if done with unlimited precision, would exactly invert <code><span class='Function'>π½</span></code> computed with unlimited precision. This principle is the basis for the numeric inverses specified below. It is also acceptable to find an inverse by numeric methods, provided that the error in the inverse value found relative to an unlimited-precision inverse can be kept close to the inherent error in the implementation's number format.</p> <p>Regardless of which cases for Undo are supported, the result of a call, and whether it is an error, must depend only on the values of the inputs <code><span class='Function'>π½</span></code>, <code><span class='Value'>π©</span></code>, and (if present) <code><span class='Value'>π¨</span></code>.</p> <h3 id="required-functions"><a class="header" href="#required-functions">Required functions</a></h3> diff --git a/spec/inferred.md b/spec/inferred.md index 680f75b9..0be0cc6c 100644 --- a/spec/inferred.md +++ b/spec/inferred.md @@ -62,7 +62,7 @@ Fill elements of iteration modifiers such as `Β¨β` are not specified. It is re The Undo 1-modifier `βΌ`, given an operand `π½` and argument `π©`, and possibly a left argument `π¨`, finds a value `y` such that `π©β‘π¨π½y`, that is, an element of the pre-image of `π©` under `π½` or `π¨π½β’`. Thus it satisfies the constraint `π© β‘ π¨π½π¨π½βΌπ©` (`π¨π½βΌβ’` is a *right inverse* of `π¨π½β’`) provided `π½βΌ` and `π½` both complete without error. `π½βΌ` should of course give an error if no inverse element exists, and can also fail if no inverse can be found. It is also preferred for `π½βΌ` to give an error if there are many choices of inverse with no clear way to choose one of them: for example, `0βΏ0βm` returns the diagonal of matrix `m`; `0βΏ0ββΌ2βΏ3` requires values to be chosen for the off-diagonal elements in its result. It is better to give an error, encouraging the programmer to use a fully-specified approach like `2βΏ3βΎ(0βΏ0βΈβ)` applied to a matrix of initial elements, than to return a result that could be very different from other implementations. -If a value `π©` isn't in the range of `π½`, then no result satisfies the rule for `π½βΌπ©`. As `π½βΌπ©` would then always give an error by the above rules, a BQN implementation with extensions could define it in any way. However, two such extensions are specified: `FβΌβΌ` and `Fβ(-n)βΌ` are extended to the full domain of `F` and `/βΌ` to any list of natural numbers, as noted below. +If a value `π©` isn't in the range of `π½`, then no result satisfies the rule for `π½βΌπ©`. As `π½βΌπ©` would then always give an error by the above rules, a BQN implementation with extensions could define it in any way. However, a few such extensions are specified: `ββΌ` is defined on all numbers, and `FβΌβΌ` and `Fβ(-n)βΌ` are extended to the full domain of `F` and `/βΌ` to any list of natural numbers, as noted below. When working with limited-precision numbers, it may be difficult or impossible to exactly invert the operand function. Instead, it is generally acceptable to perform a computation that, if done with unlimited precision, would exactly invert `π½` computed with unlimited precision. This principle is the basis for the numeric inverses specified below. It is also acceptable to find an inverse by numeric methods, provided that the error in the inverse value found relative to an unlimited-precision inverse can be kept close to the inherent error in the implementation's number format. |
