pystencils.flow.flowgraph.Cases#

class pystencils.flow.flowgraph.Cases(branches, predecessors, name=None)#

Case distinction.

Parameters:
property free_symbols: frozenset[Symbol]#

Free symbols of this node.

A symbol is free if it is used in this node’s equations but not defined in this node. Free symbols must be imported from predecessors.

property exports: frozenset[Symbol]#

Symbols exported by this node

property effects: frozenset[Store | Reduce]#

Effectful assignments in this node

subs(substitutions, **kwargs)#

Apply substitutions inside this case distinction. :rtype: Cases

Note

Substitutions of expressions for symbols (symbol -> expr) are only applied to a branch subgraph if symbol is a free symbol of that subgraph.

Parameters:

substitutions (Mapping[Basic, Basic])

Return type:

Cases

replace_predecessors(predecessors)#

Return a copy of this node with a new list of predecessors

Return type:

FlowgraphNode

Parameters:

predecessors (Iterable[FlowgraphNode])