jacopy.brackets.BracketApply¶
- class jacopy.brackets.BracketApply(bracket, a, b)¶
Bases:
ExprInert application of a bracket:
B(a, b).Carries a reference to the
GradedBracketinstance so theexpand_bracket()algorithm (andexpand()) can delegate back to the bracket’s expansion rule. The bracket itself is not an Expr, treating it as such would invite accidental structural comparisons between two different brackets that happen to share a name or degree.- Parameters:
bracket (GradedBracket)
a (Expr)
b (Expr)
- __init__(bracket, a, b)¶
- Parameters:
bracket (GradedBracket)
a (Expr)
b (Expr)
- Return type:
None
Methods
__init__(bracket, a, b)clone()Return
self.expand([registry])Defer to the bracket's expansion rule.
find(predicate)Yield descendants (including self) satisfying
predicate.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
abbracketTuple of immediate children.
is_atom- expand(registry=None)¶
Defer to the bracket’s expansion rule.
- Parameters:
registry (PropertyRegistry | None)
- Return type: