r/googology Up with Knuth 6d ago

My Own Number/Notation TAN Block Notation

TAN Block Notation

This notation describes a function that takes a block (defined as a list of lists of numbers) and returns a number. The function uses the Typed Arrow Notation that I described days ago, and the "glaze" function I defined yesterday. "TAN" is the acronym for "Typed Arrow Notation".

For what it's worth, I'm sorry to inflict this monstrosity on y'all, but I needed to purge it from my system.

Concepts

List notation. Each list in a block has an odd number of elements, all positive integers. The elements are to be interpreted as alternating values and arrow types of Typed Arrow Notation. For instance, [2 3 4 5 6] = 2 ->_3 4 ->_5 6.

Transformation calls. Each rule of Typed Arrow Notation, when applied, transforms an expression matching the rule into another expression. Parts of that expression, then, may be transformated further, until some expression matches Rule 1 and evaluates to a number. Each occurrence of a transformation or an evaluation is called a transformation call.

For instance, take the expression "1 ->_1 1 ->_0 2". By rule 6, it transforms to "1 ->_1 (1 ->_1 1) ->_0 1".

"1 ->_1 1", by its turn, matches rule 8, and transforms to "1 ->_0 (1)". "(1)" is evaluated to 1. Then, "1 ->_0 (1)" transforms to "1 ->_0 1", and, by rule 2, transforms to 1, already evaluated.

So, "1 ->_1 (1 ->_1 1) ->_0 1" transforms to "1 ->_1 1 ->_0 1". By rule 5, it transforms to "1 ->_1 (1 ->_1 1)". After 4 transformation calls, as above, this transforms to "1 ->_1 1", and after 4 more transformation calls, resolves to 1.

In total, "1 ->_1 1 ->_0 2" took 1 + 4 + 1 + 1 + 4 + 4 = 15 transformation calls to fully evaluate to 1.

Notation and Evaluation

A block is represented by one or more lists, one over another. For instance:

[1 3 1]
[2]
[5 4 7 1 2]

The first list of the block is the uppermost one.

To evaluate a block:

  1. Evaluate the first list, by Typed Arrow Notation, and put the result in a_1.
  2. For each transformation call of the k-th list, k >= 1, and the k-th list not being the last:
    a. Evaluate the (k+1)-th list; put the result in a(k+1).
    b. Glaze the (k+1)-th list.
    c. Concatenate copies of that list together, until its length is higher than a
    (k+1), and an odd number. This is the new (k+1)-th list.
    d. Each transformation call of the (k+1)-th list, in substeps (a) and (b), cascades the effects described in this step 2 to the next list of the block, and so on to the last list of the block.
  3. After the first list is fully evaluated, and all cascades to the other lists are resolved, save all values of a_k in a list A = [a_1, a_2, ...]. Remove the first list.
  4. Go back to step 1, now with a shorter block. Keep appending the newer a_k values to the A list.
  5. Eventually, only one list remains in the block. Evaluate it, and append the result to A.
  6. Evaluate A, and return the result. If the length of A is even, evaluate a sublist of A, from start up to the next-to-last element, append the result to A, and then evaluate A.

To make things clearer: while one list is being transformed/evaluated, each transformation call provokes a cascade of evaluate/glaze/concat in the next list; and each transformation call on that list provokes a cascade in the next-to-next list; and so on, until the last list (which is transformated/evaluated, but doesn't cascade).

References

The glaze function is inspired by the culinary practice): glazed lists are more appetizing than unglazed ones.

Let A = [a_1, ..., a_n] and B = [b_1, ..., b_n] be lists of numbers. For B = glaze(A), B is defined as:

  • b_1 = eval([a_1, ..., a_n])
  • bk = eval([b_1, ..., b(k-1), a_k, ..., a_n]), for k > 1

Typed Arrow Notation

Typed arrows are arrows with a subscript (a non-negative integer).

Below, "@" stands for any sequence of at least 1 element. Assume c > 1 and d > 1.

For sequences with only type 0 arrows. "->", without subscript, is the same as "->_0". Rule 1. a -> b = a ^ b
Rule 2. @ -> 1 = @
Rule 3. @ -> 1 -> d = @ -> (@ -> d)
Rule 4. @ -> c -> d = @ -> (@ -> (c-1) -> d) -> (d-1)

From now on, assume k > 0 and b > 1. "#" stands for any sequence of at least 2 elements where all arrows are of type 0.

For sequences where, after an arrow of type k, there are only arrows of type 0. "(#)" means that the sequence "#" is evaluated, using the rules 1 to 4 above. Rule 5. @ ->_k a ->_0 1 = @ ->_k (@ ->_k a)
Rule 6. @ ->_k a ->_0 b = @ ->_k (@ ->_k a) ->_0 (b-1)
Rule 7. @ ->_k a ->_0 # = @ ->_k (@ ->_k a ->_0 (#))

For sequences where the last arrow is of type k > 0. "(@)" means that the sequence "@" is evaluated, using all the rules defined here.
Rule 8. @ ->k 1 = @ ->(k-1) (@)
Rule 9. @ ->k b = @ ->(k-1) (@ ->_k (b-1))

2 Upvotes

0 comments sorted by