the variable of the lambda in which scope this node is created. This makes this node belong to the lambda body, even if it doesn't otherwise depend on lambda argument.
The id of the node for which this node represents cost
costs of the arguments, which are here represent dependency information.
operation cost, which should be added to the current scope accumulated cost
costs of the arguments, which are here represent dependency information.
The id of the node for which this node represents cost
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.
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.
Default equality of definitions.
Two definitions are equal if they have same elements
.
Override to redefine how dependencies are computed.
Override to redefine how dependencies are computed.
For example, in core
implementation this is overriden in Lambda and ThunkDef using freeVars.
Computed once and saved to avoid repeated computations, which is not necessary because definitions are immutable by default.
Computed once and saved to avoid repeated computations, which is not necessary because definitions are immutable by default. If some definition require mutability, this method can be overriden accordingly.
the variable of the lambda in which scope this node is created.
the variable of the lambda in which scope this node is created. This makes this node belong to the lambda body, even if it doesn't otherwise depend on lambda argument.
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.
operation cost, which should be added to the current scope accumulated cost
Type of a resulting value produced by the operation represented by this definition.
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.
User readable string representation of this definition. (for debugging only)
When this node is mirrored (as part of mirrorLambda) we apply transformer t for all arguments with standard data flow semantics.
When this node is mirrored (as part of mirrorLambda) we apply transformer t for all arguments with standard data flow semantics. However this is not correct to do for lambdaVar. Instead we use current lambda from the top of the stack, which is always points to the most nested lambda.
(Since version ) see corresponding Javadoc for more information.
Special graph node to represent accumulation of the operation costs. In general, due to node sharing it is incorrect to just sum up all the
args
costs and addresCost
to that value. Example:val x = .. val y = op1(x) val z = op2(x) val res = op3(y, z)
The naive summation will lead to the cost of xis accumulated both into
cost of yand into
cost of z, so in the
cost of resit is accumulated twice. To avoid this problem OpCost nodes require special handling in during evaluation.
the variable of the lambda in which scope this node is created. This makes this node belong to the lambda body, even if it doesn't otherwise depend on lambda argument.
The id of the node for which this node represents cost
costs of the arguments, which are here represent dependency information.
operation cost, which should be added to the current scope accumulated cost