2.1.2 Set🔗ℹ
type-descriptor / procedure (set maybe-element-type maybe-size)
|
(set e ...) |
|
maybe-element-type | | = | | | | | | | | #:of-type element-type | | | | | | maybe-size | | = | | | | | | | | #:size size |
|
|
| element-type | | : | | type-descriptor? |
| size | | : | | value-descriptor? Natural? |
|
type-descriptor: When maybe-element-type is not specified, there is no restriction
on the element type of the set.
procedure: create a set with elements e ... .
NOT available inside verifier definitions
(subset-of superset maybe-size)
|
|
maybe-size | | = | | | | | | | | #:size natural-number | | | | | | #:size value-descriptor |
|
|
| superset | | : | | value-descriptor? Set? |
|
This value descriptor gives the abstract set consisting of all elements of given type.
(set-∈ e S) → boolean?
|
e : any |
S : set? |
Test if e is in set S.
(set-∉ e S) → boolean?
|
e : any |
S : set? |
Test if e is NOT in set S.
Get the size (cardinality) of set S, i.e.,
|S| where S is S
(set-∩ S ...+) → set?
|
S : set? |
Get the intersection of the sets S ... .
(set-∪ S ...+) → set?
|
S : set? |
Get the intersection of two sets S ... .
Get a set consisting of all elements in S1 but not S2, i.e.
S_1 \setminus S_2 where S_1, S_2 are S1,S2 respectively.
(∀ [x ∈ X] pred-x)
|
|
| pred-x | | : | | boolean-expression? |
|
Universial quantifier expression over set X.
Test if all element x in X satisfy pred-x.
(∃ [x ∈ X] pred-x)
|
|
| pred-x | | : | | boolean-expression? |
|
Existential quantifier expression over set X.
Test if there exists some element x of X satisfies pred-x.
(∃<=1 [x ∈ X] pred-x)
|
|
| pred-x | | : | | boolean-expression? |
|
Test if at most 1 element x in X satisfies pred-x.
(∃=1 [x ∈ X] pred-x)
|
|
| pred-x | | : | | boolean-expression? |
|
Test if exactly 1 element x in X satisfies pred-x.
(sum val-x for [x ∈ X] maybe-condition)
|
|
maybe-condition | | = | | | | | | | | if pred-x |
|
|
| val-x | | : | | interger-expression? |
| pred-x | | : | | boolean-expression? |
|
Calculate
\sum_{x \in X , P(x)}f(x)
where the expression val-x of x is f(x)
and the expression pred-x of x is P(x).
(max val-x for [x ∈ X] maybe-condition)
|
|
maybe-condition | | = | | | | | | | | if pred-x |
|
|
| val-x | | : | | interger-expression? |
| pred-x | | : | | boolean-expression? |
|
Calculate
\max_{x \in X , P(x)}\{f(x)\}
where the expression val-x of x is f(x)
and the expression pred-x of x is P(x).
(min val-x for [x ∈ X] maybe-condition)
|
|
maybe-condition | | = | | | | | | | | if pred-x |
|
|
| val-x | | : | | interger-expression? |
| pred-x | | : | | boolean-expression? |
|
Calculate
\min_{x \in X , P(x)}\{f(x)\}
where the expression val-x of x is f(x)
and the expression pred-x of x is P(x).
2.1.3 Tuple🔗ℹ
(tuple field-type ...+)
|
|
field-type | | = | | #:field-type type |
|
|
|
A tuple is a (ordered) sequence with fixed length.
(product-of a-set ...+)
|
|
| a-set | | : | | value-descriptor? Set? |
|
The value specified by this value descriptor is the set consisting of all tuples with
the element on each component coming from a-set ... in order.
(tpl e ...+) → tuple?
|
e : any |
Create a tuple with components e ... .
NOT available in verifier definitions
Get the first component of tuple t.
Get the second component of tuple t.
Get the third component of tuple t.
Get the forth component of tuple t.
Get the fifth component of tuple t.
(n-th t n) → any
|
t : tuple? |
n : natural? |
Get the n-th component of tuple t.