RecursiveAggregate SΒΆ
aggcat.spad line 1046 [edit on github]
S: Type
A recursive aggregate over a type S
is a model for a a directed graph containing values of type S
. Recursively, a recursive aggregate is either empty or a node consisting of a value from S
and 0 or more children which are also nodes. A node with no children is called a leaf node. A recursive aggregate may be cyclic for which some operations as noted may go into an infinite loop.
- #: % -> NonNegativeInteger if % has finiteAggregate
from Aggregate
- =: (%, %) -> Boolean if % has finiteAggregate and S has BasicType or S has SetCategory
from BasicType
- ~=: (%, %) -> Boolean if % has finiteAggregate and S has BasicType or S has SetCategory
from BasicType
- any?: (S -> Boolean, %) -> Boolean if % has finiteAggregate
from HomogeneousAggregate S
- children: % -> List %
children(u)
returns a list of the children of aggregateu
. Error: ifu
is empty.
- coerce: % -> OutputForm if S has CoercibleTo OutputForm
from CoercibleTo OutputForm
- count: (S -> Boolean, %) -> NonNegativeInteger if % has finiteAggregate
from HomogeneousAggregate S
- count: (S, %) -> NonNegativeInteger if % has finiteAggregate and S has BasicType
from HomogeneousAggregate S
- cyclic?: % -> Boolean
cyclic?(u)
tests ifu
has a cycle.
- distance: (%, %) -> Integer
distance(u, v)
returns the path length (an integer) from nodeu
tov
.
- elt: (%, value) -> S
elt(u, "value")
(also written:u.value
) is equivalent tovalue(u)
.
- eval: (%, Equation S) -> % if S has SetCategory and S has Evalable S
from Evalable S
- eval: (%, List Equation S) -> % if S has SetCategory and S has Evalable S
from Evalable S
- eval: (%, List S, List S) -> % if S has SetCategory and S has Evalable S
from InnerEvalable(S, S)
- eval: (%, S, S) -> % if S has SetCategory and S has Evalable S
from InnerEvalable(S, S)
- every?: (S -> Boolean, %) -> Boolean if % has finiteAggregate
from HomogeneousAggregate S
- latex: % -> String if S has SetCategory
from SetCategory
- leaf?: % -> Boolean
leaf?(u)
tests ifu
is a terminal node.
- leaves: % -> List S
leaves(u)
returns the list of leaves in aggregateu
.
- less?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- map!: (S -> S, %) -> % if % has shallowlyMutable
from HomogeneousAggregate S
- map: (S -> S, %) -> %
from HomogeneousAggregate S
- max: % -> S if S has OrderedSet and % has finiteAggregate
from HomogeneousAggregate S
- max: ((S, S) -> Boolean, %) -> S if % has finiteAggregate
from HomogeneousAggregate S
- member?: (S, %) -> Boolean if % has finiteAggregate and S has BasicType
from HomogeneousAggregate S
- members: % -> List S if % has finiteAggregate
from HomogeneousAggregate S
- min: % -> S if S has OrderedSet and % has finiteAggregate
from HomogeneousAggregate S
- more?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- node?: (%, %) -> Boolean if S has BasicType
node?(u, v)
tests if nodeu
is contained in nodev
(either as a child, a child of a child, etc.).
- nodes: % -> List %
nodes(u)
returns a list of all of the nodes of aggregateu
.
- parts: % -> List S if % has finiteAggregate
from HomogeneousAggregate S
- setchildren!: (%, List %) -> % if % has shallowlyMutable
setchildren!(u, v)
replaces the current children of nodeu
with the members ofv
in left-to-right order.
- setelt!: (%, value, S) -> S if % has shallowlyMutable
setelt!(u, "value", x)
(also writtenu.value := x
) is equivalent tosetvalue!(u, x)
- setvalue!: (%, S) -> S if % has shallowlyMutable
setvalue!(u, x)
sets the value of nodeu
tox
.
- size?: (%, NonNegativeInteger) -> Boolean
from Aggregate
- value: % -> S
value(u)
returns the value of the nodeu
.
BasicType if % has finiteAggregate and S has BasicType or S has SetCategory
CoercibleTo OutputForm if S has CoercibleTo OutputForm
Evalable S if S has SetCategory and S has Evalable S
InnerEvalable(S, S) if S has SetCategory and S has Evalable S
SetCategory if S has SetCategory