MENTAL
 Main Menu
 Language
 Techniques
 Addressing by Name


Addressing by Name
 ADDRESSING
BY NAME

Nomen is numen” (To name is to know. Latin saying)

"We live in a universe of nameables" (Gregory Bateson).

"To name is to have individuality" (Nikolái Luzin).

"When I name an object with a word I affirm its existence" (Andréi Bely).



Address vs. name

In the classical von Neumann architecture of computers, each memory cell has two fundamental attributes: its address and its value (or content). In MENTAL there are no addresses, there are names, because the address is an implementing concept. In MENTAL the distinction between names (which represent addresses) and data is diluted. Both are expressions. For example, The name n refers to the contents of n, or the value associated with n.

The expression of adding 1 to n is interpreted as: "the content of n is equal to the content of n plus one". It is not interpreted as (7 = 7+1). In this case, the new value of n is 8.

In a value, for example, 13, the name and the value meet.

Names are evaluated automatically. One type of evaluation is self-evaluation, which can be forced by the "no evaluation" primitive. A typical case is, for example,

(n = 7)
(n° = n + 1)
// add 1 to n

The first n is not evaluated (it evaluates itself), the second one is evaluated. In this case, the expressions (n° = n + 1) and (n = n+1) are equivalent.

In MENTAL:
Addressing in sequences

In case we have a sequence x and we want to replace the content of the second component of x, we use the expression x to the left of the sign "=". For example,

(x = (a b c d)) // sequence definition

(x = 123) // update of the second component of the sequence
x // ev. (a 123 c d)


In case the component order number is variable, the technique is the same.For example,

(s = (a b c d)) // sequence definition
(n = 2)

(s = 123) // update of the second component of the sequence
s // ev. (a 123 c d)


In this case, (s\n = 123) and ((s\n)° = 123) are not equivalent.

If we use (x\2)° to the right of the = sign, we are referring to x\2, but in deferred. For example,

(x = (a b c (x2)° d)
x // ev. (a b c x2 d)
x // ev. (a b c b d)



Addressing closed expressions (sequences and sets)

If we have a closed expression, for example, (x = (a b c)), then: Examples:
  1. x = (a b c)
    x↓
    // ev. a b c (open expression)
    (x↓= u+v) // replace the contents of x by u+v
    x // ev. u+v

  2. (x = {a b c})
    (x↓ = θ)
    // remove the contents of x
    x // ev. {θ} ev. {} (empty set)

  3. (x = (a b c))
    (x↓ = θ)
    // remove the contents of x
    x // ev. (θ) ev. () (empty sequence)

  4. (y = (u v))
    (x = (a b (y↓)° c)))
    x // ev. (a b y↓ c)
    x // ev. (a b u v c)

Name parameters and values

Parameters can be of three types: input, output or input/output. Examples:
  1. ⟨( f(x y) = x+y )⟩

    This is the definition of a function, so it returns a result. The parameters are input, but they can be expressions of any type, since no restrictions are imposed.

    f(3 4) // ev. 7
    f(a b) // ev. a+b
    (a = 3) (b = "abc")
    f(a b) // ev. 3+"abc".
    f(ab cd) // ev. ab+cd


  2. In a sequence, replace numbers greater than n by n.

    In this case we have an input/output parameter(x, the sequence), and an input parameter (the reference n number).

    ⟨( sust(x n) = ([(x/b> n)→(x(i) = n)/(i=[1.... (x#))]))] )⟩
    (x = (4 7 6 5 2))
    sust(x 5) // the name of the sequence is passed as parameter
    x // ev. (4 5 5 5 5 2)

Subindexes

In traditional languages it is common to have expressions of the type x(i) = value, where i is a natural number (subscript). In MENTAL, x(i) would be interpreted as the sequence (x i), not as the element address i of x. Subscripts in MENTAL can be represented by a qualitative particularization by a natural number. For example, x/3, which is equivalent to x3.