Cat::Set -- the category of sets of
complex numbers
IntroductionCat::Set represents the category of subsets of the
complex numbers.
Sets of this category allow set-theoretic operations as well as pointwise arithmetical operations.
Generating
the categoryCat::Set()
Cat::BaseCategory
DetailsCat::Set is a particular
overloading mechanism. It provides n-ary operators that can
handle operands from different domains of category
Cat::Set, as well as mixed input where some operands are
of types not belonging to Cat::Set. Hence, in the
methods of Cat::Set, operands of arbitrary type are
allowed.Cat::Set provides generic methods
for generating these kinds of operators, and uses them to define
default methods overloading the common set-theoretic and arithmetical
functions.Cat::Set must provide
particular slots and tables in order to achieve simplifications in
certain special cases.Cat::Set is mainly used by domains of sets returned by
solve.commassop(string
operatorname)operatorname, by searching applicable methods
in the domains the operands belong to.Cat::Set are handled by the usual overloading
mechanism, i.e. by the slot operatorname of one of their
domains. Out of the others, several operands belonging to the same
domain are handled by the slot "homog".operatorname of
that domain. Finally, the returned method tries to combine each
possible pair of operands. If they are from the same domain,
"bin".operatorname is called for them. The following is
done if the operands are from different domains: let T1
and T2 be their types; then their "inhomog".operatorname
slots are used. If such a slot exists in the domain T1, it
must contain a table indexed by possible types T2, and the
entry at that index must be a procedure that carries out the operation
for exactly two arguments, the first being a T1, the
second being a T2. Conversely, if such a slot exists in
the domain T2, it must contain a table indexed by possible
types T1, and the entry at that index must be a procedure
that carries out the operation for exactly two arguments, the first
being a T2, the second being a T1."homog ".operatorname, or a table entry in
the slot "inhomog".operatorname, may return
FAIL in order to indicate that it could not simplify its
input; if they are missing, this indicates that a simplification is
generally not possible for input of this type. In these cases, the
returned procedure proceeds by trying to combine another two of the
given arguments."bin".operatorname usually won't exist, except
for the case that there is no "homog".operatorname;
usually the latter can also take care for the case of exactly two
operands.binop(string operatorname)operatorname, by searching applicable methods
in the domains the operands belong to."bin".operatorname of its first argument if both arguments
are of the same type. Otherwise it uses the slot
"inhomogleft".operatorname of its first argument; if that
fails, it uses the slot "inhomogright".operatorname of its
second argument; each of these slots, if it exists, must contain
tables, indexed by the type of the other argument, such that
slot(T1, "inhomogleft".operatorname)[T2] and
slot(T2, "inhomogright".operatorname)[T1] carry out the
operation for objects of type T1 and T2, in
this order.FAIL, an unevaluated call to the operator is
returned.homogassop(string
operatorname)"bin".operatorname of the domain all operands stem
from._union(any S1...)"commassop", using the slots
"homog_union" and "inhomog_union" of the
domains of its operands._intersect(any S1...)"commassop", using the slots
"homog_intersect" and "inhomog_intersect" of
the domains of its operands._plus(any S1...)"commassop", using the slots
"homog_plus" and "inhomog_plus" of the
domains of its operands._mult(any S1...)"commassop", using the slots
"homog_mult" and "inhomog_mult of the domains
of its operands._minus(any S1, any
S2)"binop", using the slots "homog_minus",
"inhomogleft_minus", and "inhomogright_minus"
of its operands._power(any S1, any
S2)"binop", using the slots "homog_power",
"inhomogleft_power", and "inhomogright_power"
of its operands.map(any S, any
f)Dom::ImageSet.