"Iterating is human, recursivizing is divine" (L. Peter Deutsch).
"The quanta of consciousness is recursion" (Dan Winter).
"I think about thinking" (Douglas Hofstadter).
Definition
A recursive expression is an expression that refers to itself.
Remarks
Recursive expressions may or may not be parameterized.
Recursive expressions can be of all types: generic, specific, functions, sequences, sets, etc.
Recursive expressions greatly simplify the specification, having been widely used in the definition of derivatives such as, for example, in range, repetition, length, depth, decimal point, etc.
Recursive expressions can be evaluated as a finite or infinite expression. In the latter case, one must use potential substitution (the representation).
Examples
Recursive sequence:
(x =: (a b c x↓)) // rep. (a b c a b c a b c a b c ...)
x // ev. a
x5 // ev. b
x\6 // ev. c
x7 // ev. a
We have n disks (of sizes 1 to n) inserted, from largest to smallest on a A axis. It is to move the n disks from the A axis to the C axis, using the intermediate B axis as work, so that a disk cannot be placed on top of another disk of smaller size.
The solution strategy is as follows:
Move the n−1 upper disks from A to B, using the working axis C.
Move the n disk from A to C.
Move the n−1 upper disks from B to C, using the A working axis.
We will represent the motion of a disk i from the x axis to the y axis as (i x y).
Move n disks from the x axis to the z axis using the y working axis.
〈( hanoi(n x y z) = ((1 x z) ← n=1 →' ( hanoi(n−1 x z y) (n x z) hanoi(n−1 y x z) ) )〉
hanoi(1 A B C) // ev.( (1 A C) )
hanoi(2 A B C) // ev. ( (1 A B) (2 A C) (1 B C) )
hanoi(3 A B C) // ev. ( (1 A C) (2 A B) (1 C B) (3 A C) (1 B A) (2 B C) (1 A C) )