MENTAL
 Main Menu
 Language
 Techniques
 Special Techniques


Special Techniques
 SPECIAL
TECHNIQUES

"To understand a language means to master a technique" (Wittgenstein).



Conversion from sequence to set and vice versa

Conversion of sequence s to set: {s↓}

Conversion of set c in sequence: ( c↓ )

Examples:
  1. (s = (a b c))
    {s↓} // ev. {a b c}


  2. (c = {a b c})
    ( c↓ ) // ev. (a b c)

Access to the integer and decimal parts of a number

Examples:
  1. (r = 123.456) // positive number equivalent to (123 . 456)
    r\1 // ev. 123 (integer part)
    r\3 // ev. 456 (decimal part)


  2. (r = −123.456) // number equivalent to (− (123 . 456))
    r\2\1 // ev. 123 (whole part)
    r\2\3 // ev. 456 (decimal part)

Access to the content of a text

Although a text is always self-evaluating, it is possible to access its content, as a sequence that is, even change it.

It should be noted that the double quotation marks act as parentheses, but prevent against the evaluation of its components.

Example:
Removal of repeated components of a sequence

The process is as follows: The expression is: ( {x↓}↓ )

Example:
Hierarchical hyperaccess

These are hierarchical accesses with a variable number of levels. They are realized by the expression

(x ☆n) or (x ↑star;n)

where n is an integer equal to or greater than zero.

Examples:
  1. (x = (a (b (b (c d))))
    ⟨( v(n) = (x ↓☆n) )⟩
    v(0) // ev. (a (a (b (c (c d))))
    v(1) // ev. a (b (c d))
    v(2) // ev. b (c d)
    v(3) // ev. c d
    v(4) // ev. c d


  2. (x = (a*b + a*c + b*c))
    ⟨( v(n) = (x ↓☆n) )⟩
    v(0) // ev. (a*b + a*c + b*c)
    v(1) // ev. a*b + a*c + b*c
    v(2) // ev. a * b a * c b * c
    v(3) // ev. a * b a * c b * c

Distribution of repetitions

Corresponds to expressions in which ★n is distributed among the components of an expression. Examples:
  1. [[a b c]★2] // rep. a★2 b★2 c★2 rep. a a b b b c c

  2. [[a b c]★⌊1...3⌋] // rep. a★1 b★2 c★3 rep. a b b b c c c

  3. [[a b]★[1 2]] //rep. a★1 a★2 b★1 b★2 rep. a a a a b b b

Operator substitution

In an expression it is possible to perform substitutions of expressions in general and, therefore, also of operators. Examples:
  1. ((a+b+c)/(+° = *°) // ev. a*b*c
  2. (1/5)/(/° = ...°) // ev. 1...5 rep. 12345
  3. (x/3)/(/° = = =°) // ev. x=3

Insertion

Here are some illustrative examples of inserting an element into a sequence.
  1. (x = (a b c d))
    x = x/(b = (b u)↓) // insertion of element u after element b
    x // ev. (a b u c d)


  2. (x = (a b c d b))
    x = x/(b = (b u)↓) // insertion of element u after elements b
    x // ev. (a b u c c d b u)


  3. (x = (a b c d))
    x = x/(b = (b u v)↓) // insertion of elements u and v after elem. b // ev. (a b u v c d)


  4. (x = (a b c d))
    x = (u x↓) // insertion of element u in front of the first element of x
    x // ev. (u a b c d)


  5. (x = (a b c d))
    x = (x↓ u) // insertion of element u after the last element of x
    x // ev. (a b c d u)

Ranges and distribution

You can simplify the specification of expressions with ranges by a distribution operation.

Examples:
  1. (1...3 1 1...9 1...5) eq. ([1...[3 9 5]]) This is a sequence of three ranges, which share the same initial element.

  2. (3...1 4...1 5...1) eq. ([[3 4 5]...1]) eq. ([[3...5]...1])

    In this case the three ranks share the final element, with the initial elements forming another rank.

  3. (1...3 1...4 1...5) eq. ([1...[3 4 5]]) eq. ([1...[3...5]]) This is a sequence of three ranges that share the same initial element and whose final elements form, in turn, another range.

Ranges of variables

The specification of a range of variables x1 ... xn, can be done as follows:
x1...xn, since (x1+1 = x2), (x2+1 = x3), etc.

Example:

((x1 = ab) (x2 = 12) (x3 = 44) (x4 = cd))
( ( ( x1...x4 ) ) ) // rep. (ab 12 44 cd)



Operators as arguments

Operators can be arguments of generic expressions. Examples:
  1. ⟨( r(p) = (1p5) )⟩
    r(...) // rep. (1...5) rep. 1 2 3 4 5
    r(999) // ev. (1 999 5)


  2. ⟨( z(p) = 1p2p3p4p5 )⟩
    z(θ) // ev. 12345
    r(+) // ev. 1+2+3+4+4+5 ev. 15
    r(44) // ev. (1 44 2 44 3 44 4 44 5)

How to know if an expression is part of another

If we want to know if the expression x contains another y:

("x contains y" ←' (x/(y=θ) = (x/(y=θ)°) → "x does not contain y")

For example, if x=(a b c):

x/(b=θ) // ev. (a c) ≠ x (b is contained in x)
x/(r=θ) // (self-evaluates, r is not contained in x)



Parameterized variables vs. sequences

An alternative to sequences is to use parameterized variables. For example, the sequence x=(a b c d) could be replaced by To refer to the complete sequence you would have to do This technique has the advantage that the argument can be of any type and not just numeric.