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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs') 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

-- cgit v1.2.3