MENTAL
 Main Menu
 Language
 Derivatives
 Selection


Selection
 SELECTION
(Direct and Contrary)

"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
Definition

⟨( xy = [x⇓ ⌋ ← ⌊xy⇓⌋] )⟩


Justification

This operation corresponds to the mental function of focusing attention on a part of something, disregarding the rest.


Examples
  1. (x = (a b c a b c))
    x⇓(=b) // ev. b b b


  2. (x = (aa bb cc))
    x⇓(=bb) // ev. bb


  3. (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)

  4. (x = (6 12 7 5 -3))
    x⇓(>6) // ev. 12 7
    x⇓(<6) // ev. 5 -3
    x⇓(>15) // ev. θ


  5. (x = (a b c a b c))
    x⇓(=u) // ev. θ

    (there is no u element)

  6. (x = (a b c a b c))
    ( x⇓(⇓a) ) // ev. ( b c b c b c )

    (selects elements other than a)

  7. (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
Properties
  1. ⟨( θ⇓(=x) = θ )⟩

  2. ⟨(x⇓(=θ) = θ )⟩

  3. ⟨( x⇓(=α) = x⇓ )⟩
    select all components of x

  4. ⟨( Ω⇓(=x) = x )⟩
    since every expression is in Ω

  5. ⟨( x∈y ↔ (x⇓(=y) ≠ θ) )⟩

  6. ⟨( 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:
  1. (x = (6 12 7 8 9 5 -3))
    ( x⇓(>6) ) // ev. ( 12 7 8 9 )
    (( x⇓(>6) )⇓(<9) ) // ev. ( 7 8 )


  2. (x = (6 12 7 8 9 5 -3))
    y=( x⇓(>6) ) // ev. y=( 12 7 8 9 )
    ( y⇓(<9) ) // ev. ( 7 8 )

Alternative selection

Equivalent to the traditional logical operator "or" (or). Example:

(x = (6 12 7 8 9 5 -3))

Selection of elements less than 6 or greater than 9:

{x⇓(& <6) x⇓(>9)}⇓ // ev. 5 -3 12

This expression can be simplified and generalized:

⟨( sel(x y1 y2) = {xy1 xy2}⇓ )⟩
sel(x <6 >9) // ev. 5 -3 12



Selection at other hierarchical levels

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.


Syntax

x⇑y or (x ⇑ y) or (x ⇓' y)


Definition

⟨( xy = [x⇓⌋ ← ' ⌊xy⇓⌋] )⟩
or
⟨( xy = ({x} ∪' {xy})⇓ )⟩


Examples
  1. (x = (a b c d e))
    x⇑(=a) // ev. b c d e


  2. (x = ( 1...10 ))
    ( x⇑(>3) ) // ev. 1 2 3

Remarks
Properties
  1. ⟨( (x⇓=y) (x⇑=y) = x )⟩
    (complementarity)