curry.backends.py.graph package
- class curry.backends.py.graph.DataType(name, ctorinfos)[source]
Bases:
object- property constructors
- class curry.backends.py.graph.InfoTable(name, arity, tag, flags, step, pyformat)[source]
Bases:
objectRuntime info for a node. Every Curry node stores an InfoTable` instance, which contains instance-independent data.
- property is_bool
- property is_char
- property is_float
- property is_int
- property is_io
- property is_list
- property is_monadic
- property is_operator
- property is_partial
- property is_primitive
- property is_special
- property is_tuple
- property step
- property typedef
- property typetag
- class curry.backends.py.graph.Node(info, *args, target=None, partial_info=None, **kwds)[source]
Bases:
objectA node in a Curry expression graph.
- info
- successors
- curry.backends.py.graph.iterexpr(expr)[source]
Generate each node in a Curry expression exactly once.
- curry.backends.py.graph.walk(root, realpath=None)[source]
Walk a Curry expression.
This yields a “state” objects for each successor of the given root. The state consists of a cursor pointing to a subexpression, current path to the cursor, and other attributes. Iteration may be pruned or deepened by modifying the state. The subexpression under the cursor may be modified.
- Variables:
stack – The remaining iteration state. May be modified to control the search. Call
pushto add the successors of the node under the cursor.realpath – A list of integers giving the real path from the root to the cursor. Not to be modified.
spine – A list of nodes, equal in length to
realpath, giving the node at each point along the path. Not to be modified.cursor – The node currently being visited. Equivalent to spine[-1].
parent – The parent of the node at the cursor. Equivalent to spine[-2].
Submodules
- curry.backends.py.graph.copy module
- curry.backends.py.graph.equality module
- curry.backends.py.graph.indexing module
- curry.backends.py.graph.infotable module
- curry.backends.py.graph.node module
- curry.backends.py.graph.utility module
- curry.backends.py.graph.variable module
VariableVariable.extend()Variable.from_logicalpath()Variable.from_root()Variable.guardsVariable.hnf()Variable.hnf_or_free()Variable.infoVariable.is_boxedVariable.is_rootVariable.realpathVariable.replace_target()Variable.rewrite()Variable.rootVariable.rtsVariable.rvalueVariable.successorsVariable.tagVariable.targetVariable.typedefVariable.unboxed_value
variable()
- curry.backends.py.graph.walkexpr module