"Everything that exists is the result of a selection" (Jorge Wagensberg).
"To create is to select" (Hector M. Sánchez)
Direct Selection
Semantics
Select, from a closed expression (sequence or set) x, all components that meet the selection criterion y from the first level of the hierarchy of x. The result is an open expression, provided that more than one component is selected.
The selection criterion y is an expression starting with a comparison operator (<, ≤, >, ≥, =, ≠), but other operators (#, ∈, ⊂, etc.) can also be used. )
Syntax
x⇓y or (x ⇓ y)
Select the elements y from x
Definition
〈( x⇓y = [⌊x⇓ ⌋ ← ⌊x⇓y⇓⌋] )〉
Justification
This operation corresponds to the mental function of focusing attention on a part of something, disregarding the rest.
Examples
(x = (a b c a b c))
x⇓(=b) // ev. b b b
(x = (aa bb cc))
x⇓(=bb) // ev. bb
(x = (a b1 c a b2 c))
x⇓(=bα) // ev. b1 b2
(selects sequences of length 2 starting with b)
x⇓(=bαα) // ev. θ
(selects sequences of length 3 starting with b)
(x = (a b c a b c))
x⇓(=u) // ev. θ
(there is no u element)
(x = (a b c a b c))
( x⇓(⇓a) ) // ev. ( b c b c b c )
(selects elements other than a)
(x = {a b1 c12 d123))
x⇓(# = 2) // ev. c12
(selects elements of length 2)
x⇓(# ≥ 2) // ev. c12 d123
(selects the elements of length ≥2)
Remarks
The result of the selection operation, if more than one element is selected, is an open expression, composed by as many elements as elements fulfill the selection pattern. If there are no components meeting the selection criterion y in x, the result is θ (the null expression).
The selection is usually not an isolated operation. It is associated with another one, which indicates what is to be done with the selected components.
The selection refers to the contents. For example,
(x⇓ = a)
replaces the contents of x with a
(x⇓>3 = a)
replaces the components of x greater than 3 with a
((x ⇓ y) = a)
replaces the components of x that satisfy the selection criterion y by a
(x = (2 7 4 9))
[[x⇓>5 = a)] = a]
replaces each of the components of x greater than 5 by a x // ev. (2 to 4 a)
(x = (2 7 4 9))
[[x⇓>5 = a)] = θ]
removes the components of x greater than 5
x // ev. (2 4)
Properties
〈( θ⇓(=x) = θ )〉
〈(x⇓(=θ) = θ )〉
〈( x⇓(=α) = x⇓ )〉
select all components of x
〈( Ω⇓(=x) = x )〉
since every expression is in Ω
〈( x∈y ↔ (x⇓(=y) ≠ θ) )〉
〈( x∉y ↔ (x⇓(=y) = θ) )〉
The expression x⇓(=y), as a condition, is the way to find out if y is a component or not of x.
Top order selection
This is when another selection is applied to the result of the selection. It is equivalent to the traditional logical operator "and" (and). Examples:
It is performed by applying the selection operator to the corresponding level. The level is specified by a series of operators ⇓. Example:
(x = (a (a (b1 b2) (c1 c2) d))
( x↓↓ ) // ev. ( b1 b2 c1 c2 )
( x↓↓ )⇓(=bα) ) // ev. ( b1 b2 )
Selects sequences of length 2 starting with b from the second level of x.
Contrary (or Complementary) Selection
Semantics
Select, from a closed expression x, all components that do not satisfy the selection criterion y of the first level of the hierarchy of x.
The definition of contrary selection differs from direct selection only in the appearance of the "contrary" symbol in the condition. This symbol could be parameterized.