MENTAL
 Main Menu
 Language
 Derivatives
 Reversal


Reversal
 REVERSAL

"Symmetry is a characteristic of the human mind" (Alexander Pushkin).

"Symmetry underlies the laws of the universe" (Brian Greene).

"Symmetry implies dynamics" (Eugene Wigner).



Semantics

Reveert an expression. If the expression is a sequence or an open expression, it is equivalent to evaluating the sequence starting from the right end. If the expression is a set, the operation has no effect, since all components are evaluated in parallel.


Syntax

x∼ // evaluate sequence x on the right-hand side


Definition

⟨( (x∼ = ([x/[x#… 1]])) ← (x=( x↓ )⟩ // case x sequence or open expression;

⟨( (x∼ = x) ← (x={x↓} )⟩ // case x set


Justification

This is a very useful operation, especially in arithmetic expressions.


Examples
  1. (a b c d)∼ // ev. (d c b a)

  2. (r1 ^ r2 ^ r3 ^ r4)∼ // ev. (r4 ^ r3 ^ r2 ^ r1)

    This expression would evaluate as ((r4^r3)^r2)^r1

  3. (x ← y ← z ← u)∼ // ev. (u → z → y → x) (are equivalent)

  4. (a/b/c/d)∼ // ev. d/c/b/a

  5. (xy/(x=3)/(y=2))∼ // ev. (y=2)/(x=3)/xy

  6. ∼(2^3^5) // ev. (2^3^5) ev. (2^3)^5 ev. 8^5 ev. 32768

  7. (2^3^5)∼ // ev. (5^3^2) ev. (5^3)^2 ev. 125^2 ev. 15625

  8. {a b c}∼ // ev. {a b c}

Remarks
Properties
  1. ⟨(x∼∼ = x)⟩ // by the definition of reversal

  2. ⟨( (x∼ = x) ← (x# = 1) )⟩ // atomic expression reversal

  3. ⟨( ( ( r1 ... r2 )∼ = ( r2 ... r1 )⟩ // range reversal