Boolean valued operators and functions on enumerated sequences exist to test whether entries are defined (see previous section), to test for membership and containment, and to compare sequences with respect to an ordering on its entries. On formal sequences, only element membership can be tested.
Boolean valued function, returning true if and only if each of the terms S[i] for 1≤i≤#S is defined, for an enumerated sequence S.
Given an enumerated sequence S and an index i, this returns true if and only if S[i] is defined. (Hence the result is false if i>#S, but an error results if i<1.) Note that the index i is allowed to be a multi-index; if i=[i1, ..., ir] is a multi-index and ij>#S[i1, ..., ij - 1] the function returns false, but if S is s levels deep and r>s while ij≤#S[i1, ..., ij - 1] for 1≤j≤s, then an error occurs.
Boolean valued function, returning true if and only if the enumerated sequence S is empty.
Boolean valued function, returning true if and only if the enumerated sequence S is empty and its universe is undefined, false otherwise.
Here, S and T denote sequences. The element x is always assumed to be compatible with S.
Returns true if the object x occurs as a term of the enumerated or formal sequence S, false otherwise. If x is not in the universe of S, coercion is attempted. If that fails, an error results.
Returns true if the object x does not occur as a term of the enumerated or formal sequence S, false otherwise. If x is not in the universe of S, coercion is attempted. If that fails, an error results.
Kind: MonStgElt Default: "Consecutive"
Returns true if the enumerated sequence S appears as a subsequence of consecutive elements of the enumerated sequence T, false otherwise.By changing the default value "Consecutive" of the parameter Kind to "Sequential" or to "Setwise", this returns true if and only if the elements of S appear in order (but not necessarily consecutively) in T, or if and only if all elements of S appear as elements of T; so in the latter case the test is merely whether the set of elements of S is contained in the set of elements of T.
If the universes of S and T are not the same, coercion is attempted.
Returns true if the enumerated sequences S and T are equal, false otherwise. If the universes of S and T are not the same, coercion is attempted.
Returns true if the enumerated sequences S and T are not equal, false otherwise. If the universes of S and T are not the same, coercion is attempted.
Here, S and T denote complete enumerated sequences with universe U and V respectively, such that a common overstructure W for U and V can be found (as outlined in the Introduction), and such that on W an ordering on the elements is defined allowing the Magma operators eq (=), le (≤), lt (<), gt (>), and ge (≥) to be invoked on its elements.
With these comparison operators the lexicographical ordering is used to order complete enumerated sequences. Sequences S and T are equal (S eq T) if and only if they have the same length and all terms are the same. A sequence S precedes T (S lt T) in the ordering imposed by that of the terms if at the first index i where S and T differ then S[i] < T[i]. If the length of T exceeds that of S and S and T agree in all places where S until after the length of S, then S lt T is true also. In all other cases where S≠T one has S gt T.
Returns true if the sequence S precedes the sequence T under the ordering induced from S, false otherwise. Thus, true is returned if and only if either S[k] < T[k] and S[i] = T[i] (for 1≤i< k) for some k, or S[i] = T[i] for 1≤i≤#S and #S < #T.
Returns true if the sequence S either precedes the sequence T, under the ordering induced from S, or is equal to T, false otherwise. Thus, true is returned if and only if either S[k] < T[k] and S[i] = T[i] (for 1≤i< k) for some k, or S[i] = T[i] for 1≤i≤#S and #S≤#T.
Returns true if the sequence S either comes after the sequence T, under the ordering induced from S, or is equal to T, false otherwise. Thus, true is returned if and only if either S[k] > T[k] and S[i] = T[i] (for 1≤i< k) for some k, or S[i] = T[i] for 1≤i≤#T and #S≥#T.
Returns true if the sequence S comes after the sequence T under the ordering induced from S, false otherwise. Thus, true is returned if and only if either S[k] > T[k] and S[i] = T[i] (for 1≤i< k) for some k, or S[i] = T[i] for 1≤i≤#T and #S > #T.