From 850d173aef48f907ce071608ee4469fb11f0b364 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sun, 21 Aug 2022 21:42:45 -0400 Subject: =?UTF-8?q?Point=20out=20that=20defining=20=E2=88=9A=E2=81=BC=20to?= =?UTF-8?q?=20be=20=C3=97=CB=9C=20gives=20it=20an=20extended=20domain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/spec/inferred.html | 2 +- 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 @@

Fill elements of iteration modifiers such as ¨⌜ are not specified. It is reasonable to define the fill element of π”½βŒœ or 𝔽¨ to be 𝔽 applied to the fill elements of the arguments. Regardless of definition, computing the fill element cannot cause side effects or an error.

Undo

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.

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 𝔽, 𝕩, and (if present) 𝕨.

Required functions

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. -- cgit v1.2.3