jacopy.Sum¶
- class jacopy.Sum(*children)¶
Bases:
Exprn-ary sum. Order of children is preserved as given.
- Parameters:
children (Expr)
Methods
__init__(*children)clone()Return
self.find(predicate)Yield descendants (including self) satisfying
predicate.make(*args)Smart constructor.
replace_at(path, new)Return a new tree with
newspliced atpath.substitute_atom(dummy, target)Return
selfwith every occurrence ofdummyreplaced bytarget.walk()Pre-order traversal yielding
selffollowed by descendants throughchildrenonly.Attributes
Tuple of immediate children.
is_atom- classmethod make(*args)¶
Smart constructor.
Flattens nested sums (associativity), drops integer zeros, and collapses trivial cases (no terms ->
0; one term -> that term). No commutative reordering or like-term collection, that belongs to the algorithms layer.