jacopy.Neg

class jacopy.Neg(arg)

Bases: Expr

Unary negation -x.

Kept as a first-class node rather than -1 * x so that the sign is easy to pattern-match against later, many rewrite rules and proof-display routines care about whether a term is negated.

Parameters:

arg (Expr)

__init__(arg)
Parameters:

arg (Expr)

Methods

__init__(arg)

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

arg

children

Tuple of immediate children.

is_atom

property children: Tuple[Expr, ...]

Tuple of immediate children. Atoms return ().