If this graph represent Lambda abstraction, the boundVars is lambda bound symbols.
Flatten the given schedule into single sequence of non-AstGraph definitions.
Flatten the given schedule into single sequence of non-AstGraph definitions.
All scope forming definitions like Lambda and ThunkDef are recursively unfolded in the given buffer flatBuf
.
NOTE: The symbols of AstGraph-like definitions are added to flatBuf
AFTER the unfolded body.
Build usage information induced by the given schedule.
Build usage information induced by the given schedule. For each symbol of the schedule a GraphNode is created and usages are collected.
Dependencies of this definition from other definitions.
Dependencies of this definition from other definitions.
If definition is interpreted as an operation, then dependencies are arguments
of the operation.
If definition if compound (like Lambda of ThunkDef) then deps
is equals to
free variables used in the body of the compound definition.
This array also refers to predecessors of this graph node, so it is used
to build topological ordering (execution schedule) of operations.
array of referencies to other definitions.
Set of symbol ids in the schedule.
Set of symbol ids in the schedule. Can be used to quickly recognize symbols belonging to the body of this definition.
All data elements of this graph node to be used in structural equality.
All data elements of this graph node to be used in structural equality.
equals where elements are used.
Default equality of definitions.
Collect a set of symbols used in the graph but which are not part of its schedule.
Collect a set of symbols used in the graph but which are not part of its schedule.
If the graph represents a compound definition (Lambda, Thunk etc),
then each item in freeVars
is used in the body, but not part of it.
Intersection of free vars with bound vars is empty.
Override to redefine how dependencies are computed.
NOTE on structural equality implementation Every Def is assigned fresh nodeId in the constructor.
Checks the symbol is lambda bound.
Checks the symbol is lambda bound.
Whether this graph represents identity function.
Clone this definition transforming all symbols using t
.
Clone this definition transforming all symbols using t
.
If new Def[A] is created, it is added to the graph with collapsing and rewriting.
Can be overriden to implement node-specific mirroring (see MethodCall).
mapping of symbols to symbols (Ref[_] => Ref[_])
symbol of the logical clone. If d
don't contain symbols, then d.self is returned.
Unique id of the graph node assigned for each new instance using
freshId
generator.
Unique id of the graph node assigned for each new instance using
freshId
generator.
Doesn't participate in equality of this Def, thus definitions with
different ids may still be structurally equal.
Used to provide global Def numbering.
Type of a resulting value produced by the operation represented by this definition.
Extract identifies out of roots
.
Terminal nodes of the graph.
Sequence of node references forming a schedule.
Sequence of node references forming a schedule.
Schedule represents a body of compound definition - topologically ordered sequence of nodes of the graph.
Reference to this definition created lazily on demand.
Reference to this definition created lazily on demand.
References to other nodes in this Def instance.
References to other nodes in this Def instance.
Note: This is different form deps
for compound definitions like Lambda and ThunkDef.
User readable string representation of this definition.
Create a copy of this definition applying the given transformer to all syms
.
Create a copy of this definition applying the given transformer to all syms
.
Symbol Usage information for this graph
Symbol Usage information for this graph