"Depth is the first and most primordial dimension" (Maurice Merlau-Ponty).
"Depth is the dimension by which things or the elements of things envelop one another" (Maurice Merlau-Ponty).
Semantics
The depth of an expression is equal to the number of levels in the hierarchy of that expression. It is equal to the number of levels of parentheses (explicit or implicit).
Syntax
x$ (depth of x)
Definition
〈( x$ = (1 ← (x = x↓) →' (1 + x↓$))) )〉
The definition is recursive:
If we are at the last level of the hierarchy (i.e., lower terminal, where it is verified that x = x↓), the depth of the expression is 1.
Otherwise, the result is 1 plus the depth of the expression of the next level.
Justification
Depth is the other property of expressions, which complements length.
Examples
3$ // ev. 1 (an atom has depth 1)
(3)$ // ev. 1
(a b)$ // ev. 1
(a (b c))$ // ev. 2
(a + (b*c))$ // ev. 2
(a^(a^(a^(a^a)))$ // ev. 3
(a b c)↓$ // ev. 0 (expression is open)
(a (b c) d)↓$ // ev. 1
Conceptual recursion
The expression x$$$ specifies the depth of order 2 (depth of the depth of x). The result is always 1, since x$ is always a natural number.
〈( (x$$ = 1 )〉
Examples:
(x = (a b c))
x$ // ev. 1
x$$ // ev. 1 (the depth of 1)
(x = (a (b (c) d))
x$ // ev. 2
x$$ // ev. 1 (the depth of 2)
Properties
((α°)$ = 1) // the depth, in this case, refers to the pure symbol
((Ω°)$ = 1) // id.
〈( (x$$ = 1 )〉 // since x$ is always a natural number
(θ$ = $) // the depth cannot be applied to the null expression