From c618ade174cc2b4e428457751ad8dd01130c2239 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 25 Jun 2022 22:20:19 -0400 Subject: Back to editing docs --- docs/doc/undo.html | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs/doc/undo.html') diff --git a/docs/doc/undo.html b/docs/doc/undo.html index daf1b60d..7e498365 100644 --- a/docs/doc/undo.html +++ b/docs/doc/undo.html @@ -21,7 +21,7 @@

Here it undoes a function to decrement the last character by incrementing that character. In part this is enabled by the clean design of BQN primitives, because better-behaved functions like those using structural Under are easier to invert.

The rules

-

If 𝔽 can be inverted exactly, then Undo just does that. However, there are also some other functions that BQN inverts. For example, the squaring function ט has both a positive and a negative inverse, and yet:

+

If 𝔽 can be inverted exactly, then Undo just does that (or tries). However, there are also some other functions that BQN inverts. For example, the squaring function ט has both a positive and a negative inverse, and yet:

↗️
    ט ¯3
 9
     ט⁼ ט ¯3  # It's not the same!
@@ -37,8 +37,9 @@
 

Arithmetic and simple combinators are usually invertible. A compound function that refers to its argument just once, like 6+⌽, can typically be undone, but one that uses the argument in two different ways, such as ⊢+⋆, probably can't.

A few notable inverses are the logarithm , un-Transpose , and Indices inverse /. Enclose inverse, <, is an alternative to First that requires its argument to be a unit array.

Structural functions like Take and shifts that remove elements from 𝕩 can't be inverted, because given the result there's no way to know what the elements should be. However, there are two special cases that have inverses defined despite losing data: these are and k where k is a constant (a data type, or k˙). For these, 𝕩 is required to match the always returned value 𝕨 or k, and this value is also used for the result—even though any result would be valid, as these functions ignore 𝕩.

-↗️
    3  4
+↗️
    3  4
 Error: ⁼: Inverse does not exist
+
     3  3
 3
 
@@ -49,4 +50,8 @@ 𝕊𝕩: 𝕩÷1-𝕩 }
-

The above function could also be defined with the automatically invertible 1+÷, but maybe there's a numerical reason to use the definition above. Like a normal header, an undo header reflects the normal use, but it includes and possibly ˜ addition to the function and arguments.

+

The above function could also be defined with the automatically invertible 1+÷, but maybe there's a numerical reason to use the definition above. Like a normal header, an undo header reflects the normal use, but it includes and possibly ˜ addition to the function and arguments. Any header that includes a function can have these modifiers added—even a fancy modifier header like 𝔽_m1⁼ab: or plain label like 𝕊:. The three forms are 𝕊𝕩:, 𝕨𝕊𝕩:, and 𝕨𝕊˜⁼𝕩:, and the two dyadic forms are also used to derive kF𝕩 and Fk𝕩 with a constant k.

+↗️
    G  { 𝕊˜⁼:𝕩-2×𝕨 ; 𝕨+2×𝕩 }
+    G2 7
+3
+
-- cgit v1.2.3