jacopy.Pairing

class jacopy.Pairing(alpha, X)

Bases: Expr

Canonical pairing ⟨α, X⟩.

Children (alpha, X) are stored in the order given; equality is structural. The semantic order (1-form, vector field) is under the caller’s control.

Parameters:
__init__(alpha, X)
Parameters:
Return type:

None

Methods

__init__(alpha, X)

clone()

Return self.

find(predicate)

Yield descendants (including self) satisfying predicate.

replace_at(path, new)

Return a new tree with new spliced at path.

substitute_atom(dummy, target)

Return self with every occurrence of dummy replaced by target.

walk()

Pre-order traversal yielding self followed by descendants through children only.

Attributes

X

alpha

children

Tuple of immediate children.

is_atom

property children: Tuple[Expr, ...]

Tuple of immediate children. Atoms return ().