MENTAL
 Main Menu
 Language
 Expressions
 Hyperoperators


Hyperoperators
 HYPEROPERATORS

"Number is the exponent of an operation" (Wittgenstein, Tractatus 6.021).

"Everything that can be discovered by means of an operation must exist independently of this operation" (Bertrand Russell).



Higher Order Operations

Definición

Higher-order operations are operations performed by successive or recursive application of a dyadic (two-argument) operator.

If we have an expression of the type x⊥y being x and y two arguments of the dyadic operator , the need arises for a notation that simplifies the specification of expressions of the forms i.e., the specification of expressions with a single argument x repeated n times and with associativity to the right and to the left, respectively. The occurrences of x must be 3 or more.

In MENTAL they can be represented as follows:

ExpressionAssociativitySpecification
x⊥(x⊥(x⊥…(x⊥x))))Right((x★n)⊢⊥)∼
((((x⊥x)…)⊥x)⊥x)⊥xLeft∼(⊥⊣(x★n))

In the expression ∼(⊥⊣(x★n)) you can dispense with , since the default aociativity is left-handed.

But this notation, despite simplifying things, is not sufficient. If is, for example, the power operator ^, we want to be able to specify powers of powers (powers of order 2), powers of powers of powers of powers (powers of order 3), and so on. In general, powers of order n.

In MENTAL we will use the following notation for higher level powers:

ExpressionSemantics
x^nxn
x(^^)nx^x^x…x^x
(n términos x)
x(^^^)nx(^^)x(^^)x…x(^^)x
(n términos x)
......

This notation is similar to those used by other authors in the so-called "superpowering" [see Addendum].

By default, the associativity is leftward, i.e., the evaluation of the expression is performed from left to right. If we wanted associativity to the right, we would have to indicate the operator to the right of the expression, for example, (x(^^^)n)∼.

In general, for any operator :

x(⊥★m)n = (⊥★(m−1))⊣(x★n)

And so we have the following formal definition (in the form of a recursive generic expression) of the dyadic hyperoperator : where 4 parameters appear, including the dyadic operator (in bold).

By default, it assumes left associativity. If we wanted associativity to the right, we would have to indicate the operator to the right of the expression. And the parameterized generic expression would be the following:
Examples with ^ (exponentiation)

ExpressionSemantics
2^323 = 8
(2 ^^ 2)2^2 = 4
(2 ^^ 3)(2^2) ^2 = 4^2 = 16
(2 ^^ 3)∼2^ (2^2) = 2^4 = 16
(2 ^^^^ 3)((2 ^^ 2) ^^ 2) = ((2^2) ^^ 2) = (4 ^^ 2) = 4^4 = 256
(2 ^^^^ 3)∼(2 ^^ (2 ^^ (2 ^^ 2))∼ = (2 ^^ (2 ^^ (2 ^^ 2))∼ = 2^ (2^ (2^ (2^2)) = 2^ (2^4) = 2^16 = 65536[[/code>
3^23^2 = 9
(3 ^^ 2)3^3 = 3^3 = 27
(3 ^^ 3)(3^3) ^3 = 27^3 = 19683
(3 ^^ 3)∼3^ (3^3) = 3^27 = 7625593484987
(3 ^^^^ 3)(3 ^^ 3) ^^ 3)) = (19683 ^^ 3) = ((19683 ^ 19683) ^ 19683)
(3 ^^^^ 3)∼(3 ^^ (3 ^^ 3 ^^ 3))∼ = (3 ^^ 19683)∼ = (3^3^3... ^3)∼
(the 3 repeated 19683 times).


Examples with v (root)

ExpressionSemantics
2v2√2
(2 vv 2)2v2 = √(√2)
(2 vv 3)(2v2)v2
(2 vv 3)∼2v(2v2)
(2 vv 4)((2v2)v2)v2
(2 vv 4)∼2v(2v(2v2))


Examples with (union)

ExpressionSemantics
a∪3a3
(a ∪∪ 5)(((a∪a)∪a)∪a)∪a = aaaaa
(a ∪∪ 5)∼a∪(a∪(a∪(a∪a))) = aaaaa
(2 ∪∪∪ 3)((2 ∪∪ 2) ∪∪ 2) = ((2 ∪ 2) ∪∪ 2) = (22 ∪∪ 2) = (22 ∪ 22) = 2222
(2 ∪∪∪ 3)∼(2 ∪∪ (2 ∪∪ 2)) = (2 ∪∪ (2 ∪ 2 ∪ 2)) = (2 ∪∪ 22) = 2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2∪2 = 2222222222222222222222

By definition, we establish the following equivalences between arithmetic operators: That is, two consecutive occurrences of an operator are equivalent to the higher-order operator. Therefore,
Contrary hyperoperators

Right contrary hyperoperator:

⟨( (x (⊥★n)' y) = z) ↔ (z (⊥★n) y) = x) )⟩

Counterclockwise hyperoperator:

⟨( (x '(⊥★n) y) = z) ↔ (y (⊥★n) z) = x) )⟩

Examples:
  1. x(^')y is root of x in base y

  2. x('^)y is logyx (logarithm of x in base y)

  3. (x (^^)' y) is the hyperroot of order 2 of x in base y, that is, an expression z such that z(^^)y = x

  4. (x '(^^) y ) is the hyperlogarithm of order 2 of x in base y, that is, an expression z such that y(^^)z = x
In general,

(x (^★n)' y) is the hyperroot of order n of x in base y

(x '(^★n) y) is the hyperlogarithm of order n of x in base y


Infinite hyperoperations

They are those that are repeated indefinitely. They can be expressed as follows For the case of power and n=1, we have infinite hyperpowers: which assumes associativity on the left, which is the same as associativity on the right.



Addendum

Superpotentiation

Superpotentiation is a term used to express higher order numerical powers. There is no standard notation. The most commonly used notations are the following:


Knuth's notation

In 1972, Donald Knuth invented the "arrow" notation (↑) to represent higher order powers: The second expression is variously called: tower of powers, superpower, hyperpower, super exponentiation, super exponentiation and tetration (which refers to the fourth arithmetic operation, after addition, multiplication and exponentiation).

In all cases, right-handed associativity is assumed, i.e., evaluation takes place from right to left. For example,
Conway's notation

Knuth's notation has the drawback that it requires specifying the arrows repetitively. Therefore, John Conway introduced a notation with horizontal arrows of three arguments, the last one being the number of arrows: For example, Knuth later changed his notation to m↑pn, which was equivalent to Conway's notation, where p (as superscript) indicates the number of arrows: m→n→p ≡ m↑pn


The "hyper" notation

This notation is based on the generalization of the following recursive definitions: It is defined: This last (recursive) definition is that of the "hyper" function, which is triadic (the arguments are a, n and b).

For example, for the case n=4,

a(4)b = a^a^...^a^a (b terms)

The relationship between the three notations is as follows: For example,

a↑2b ≡ a↑↑b ≡ a→b→2 ≡ a(4)b

a↑3b a↑↑↑↑b ≡ a→b→3 ≡ a(5)b


There is an extension of the hyper notation for the case where left associativity is desired. It is based on the following recursive definitions: It is defined: For example, for the case n=4 and b=5,

a(4)5 = ((((a^a)^a)^a)^a (5 terms).


Ackermann's function

The above notations (Knuth, Conway, hyper) have a close relationship with the Ackermann function. It is a recursive function, defined in 1928 by Wilhelm Ackermann, and is widely used in the theory of computation. It is defined (recursively) as follows:

A(0, n) = n + 1 (n≥0)
A(m, 0) = A(m−1, 1) (m≥1)
A(m, n) = A(m−1, A(m, n−1)) (m, n≥1)


An equivalent definition, using Knuth's notation, is: The following equivalences are satisfied:

A(m, n) ≡ 2↑(m−2)(n+3) − 3 ≡ 2→(n+3)→(m−2) − 3 ≡ 2(m)(n+3) − 3

The Ackermann function grows extremely fast. For example: The values. are called "Ackermann numbers": The Ackermann function is often used as a benchmark: to evaluate the capability of a compiler in the task of recursion optimization.


Bibliography