class CompiletimeIRContext extends Scalan with IRContext
IR context to be used by script development tools to compile ErgoScript into ErgoTree bytecode.
- Alphabetic
- By Inheritance
- CompiletimeIRContext
- IRContext
- GraphBuilding
- TreeBuilding
- SigmaLibrary
- SigmaDslModule
- SigmaDslDefs
- SigmaDsl
- WrappersModule
- Library
- CollsModule
- CollsDefs
- Colls
- WrappersModule
- WRTypesModule
- WRTypesDefs
- WRTypes
- WOptionsModule
- WOptionsDefs
- WOptions
- WSpecialPredefsModule
- WSpecialPredefsDefs
- WSpecialPredefs
- Scalan
- DefRewriting
- Modules
- Entities
- Thunks
- IfThenElse
- Functions
- ProgramGraphs
- AstGraphs
- Transforming
- UniversalOps
- Equal
- OrderingOps
- LogicalOps
- UnBinOps
- NumericOps
- Tuples
- MethodCalls
- TypeDescs
- Base
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new CompiletimeIRContext()
Type Members
-
abstract
class
BaseDef[+T] extends Scalan.Node with Scalan.Def[T]
Base class for most predefined operations.
Base class for most predefined operations.
- Definition Classes
- Base
-
abstract
class
CompanionDef[T] extends Scalan.Node with Scalan.Def[T]
Base class for virtualized instances of type companions.
Base class for virtualized instances of type companions. Each virtualized entity type (trait or class) may have virtualized companion class.
- Definition Classes
- Base
-
case class
Const[T](x: T)(implicit eT: Scalan.Elem[T]) extends Scalan.BaseDef[T] with Product with Serializable
Default node type for embedding of literal values to graph IR.
Default node type for embedding of literal values to graph IR. This can be used or those types
T
whenElem[T]
is defined, butLiftable[_,T]
is not, i.e. for non-liftable types.- x
literal value
- eT
type descriptor of IR type T
- Definition Classes
- Base
-
trait
Def[+T] extends Scalan.Node
Base type for all graph nodes (aka computable value definitions).
Base type for all graph nodes (aka computable value definitions). Each graph node or definition represent one operation node of the data flow graph.
- Definition Classes
- Base
-
class
EntityObject extends AnyRef
Base class for all objects generated for virtualized types to support staged evaluation machinery.
Base class for all objects generated for virtualized types to support staged evaluation machinery. Each object contains definitions which can be imported when necessary. All that objects are registered in
entityObjects
hash map, which is done while IR cake is constructed.- Definition Classes
- Base
-
case class
EntityObjectOwner(obj: Scalan.EntityObject) extends Scalan.OwnerKind with Product with Serializable
- Definition Classes
- Base
-
abstract
class
Node extends Product
Base class for all IR nodes/operations/definitions.
Base class for all IR nodes/operations/definitions.
- Definition Classes
- Base
-
class
NotImplementedStagingException extends Scalan.StagingException
- Definition Classes
- Base
-
sealed abstract
class
OwnerKind extends AnyRef
Variants of
owner
parameter of constructors of nested classes: 1) predefined node classes are owned by IR cake (ScalanOwner) 2) entity classes are owned by enclosing EntityObjectVariants of
owner
parameter of constructors of nested classes: 1) predefined node classes are owned by IR cake (ScalanOwner) 2) entity classes are owned by enclosing EntityObject- Definition Classes
- Base
-
case class
Placeholder[T](eT: Scalan.LElem[T]) extends Scalan.Node with Scalan.Def[T] with Product with Serializable
Symbols may temporary refer to this node until their target node is updated.
Symbols may temporary refer to this node until their target node is updated.
- Definition Classes
- Base
-
abstract
class
Ref[+T] extends AnyRef
Abstract representation of a computable value.
Abstract representation of a computable value. Default implementation is a simple lightweight reference to the corresponding definition. Every Ref have direct access to its Def via
node
property. Every Ref is typed, and the type is avaliable viaelem
property.- Definition Classes
- Base
- See also
SingleRep
-
final
class
SingleRef[+T] extends Scalan.Ref[T]
A Ref is a symbolic reference used internally to refer to graph nodes.
A Ref is a symbolic reference used internally to refer to graph nodes. Light weight stateless immutable reference to a graph node (Def[T]). Two symbols are equal if they refer to the nodes with the same id, which is due to Def unification means equal symbols refer to the same instance of Def.
- Definition Classes
- Base
-
class
StagingException extends RuntimeException
- Definition Classes
- Base
-
abstract
class
Transformer extends AnyRef
Base class for Ref to Ref transformations.
Base class for Ref to Ref transformations. Each transformer keeps a mapping data between references to original nodes and references to the corresponding transformed nodes.
- Definition Classes
- Base
-
case class
Variable[T](varId: Int)(implicit eT: Scalan.LElem[T]) extends Scalan.Node with Scalan.Def[T] with Product with Serializable
Node class for typed variables.
Node class for typed variables. In particular for lambda-bound variables.
- varId
is independent from nodeId, shouldn't be used as node id.
- eT
type descriptor of the variable type
- Definition Classes
- Base
-
abstract
class
CompanionElem[T] extends Scalan.Elem[T]
Base class for all descriptors of staged companions
Base class for all descriptors of staged companions
- Definition Classes
- Entities
-
trait
ConcreteElem[TData, TClass] extends Scalan.EntityElem[TClass]
Base class for all descriptors of staged classes.
Base class for all descriptors of staged classes.
- Definition Classes
- Entities
-
trait
ConcreteElem1[A, TData, TClass, C[_]] extends Scalan.EntityElem1[A, TClass, C]
Base class for all descriptors of staged classes with one type parameter.
Base class for all descriptors of staged classes with one type parameter. Note, it doesn't inherit from ConcreteElem
- Definition Classes
- Entities
-
abstract
class
EntityElem[A] extends Scalan.Elem[A] with Equals
Base class for all descriptors of staged traits.
Base class for all descriptors of staged traits. See derived classes in
impl
packages.- Definition Classes
- Entities
-
abstract
class
EntityElem1[A, To, C[_]] extends Scalan.EntityElem[To]
Base class for all descriptors of staged traits with one type parameter.
Base class for all descriptors of staged traits with one type parameter.
- Definition Classes
- Entities
-
case class
InvokeFailure(exception: Throwable) extends Scalan.InvokeResult with Product with Serializable
Exception thrown during MethodCall invocation.
Exception thrown during MethodCall invocation.
- Definition Classes
- MethodCalls
-
sealed abstract
class
InvokeResult extends AnyRef
Result of MethodCall invocation.
Result of MethodCall invocation.
- Definition Classes
- MethodCalls
- See also
tryInvoke
-
case class
InvokeSuccess(result: Scalan.Ref[_]) extends Scalan.InvokeResult with Product with Serializable
Successful MethodCall invocation with the given result.
Successful MethodCall invocation with the given result.
- Definition Classes
- MethodCalls
-
case class
MethodCall extends Scalan.Node with Scalan.Def[Any] with Product with Serializable
Graph node to represent invocation of the method of some class.
Graph node to represent invocation of the method of some class.
- Definition Classes
- MethodCalls
-
case class
NewObject[A](eA: Scalan.Elem[A], args: Seq[Any]) extends Scalan.BaseDef[A] with Product with Serializable
Represents invocation of constructor of the class described by
eA
.Represents invocation of constructor of the class described by
eA
.- eA
class descriptor for new instance
- args
arguments of class constructor
- Definition Classes
- MethodCalls
-
abstract
class
BaseElem[A] extends Scalan.Elem[A] with Serializable with Equals
- Definition Classes
- TypeDescs
-
class
BaseElemLiftable[A] extends Scalan.BaseElem[A]
Type descriptor for primitive types.
Type descriptor for primitive types. There is implicit
val
declaration for each primitive type.- Definition Classes
- TypeDescs
-
abstract
class
Cont[F[_]] extends Scalan.TypeDesc
Descriptor of type constructor of
* -> *
kind.Descriptor of type constructor of
* -> *
kind. Type constructor is not a type, but rather a function from type to type. It contains methods which abstract relationship between typesT
,F[T]
etc.- Definition Classes
- TypeDescs
- Annotations
- @implicitNotFound( "No Cont available for ${F}." )
-
abstract
class
Elem[A] extends Scalan.TypeDesc
Type descriptor of staged types, which correspond to source (unstaged) RTypes defined outside of IR cake.
Type descriptor of staged types, which correspond to source (unstaged) RTypes defined outside of IR cake.
- A
the type represented by this descriptor
- Definition Classes
- TypeDescs
- Annotations
- @implicitNotFound( "No Elem available for ${A}." )
-
class
ElemCacheEntry extends AnyRef
Elements cache information for each Elem class.
Elements cache information for each Elem class.
- Definition Classes
- TypeDescs
-
case class
EnvRep[A](run: (Scalan.DataEnv) ⇒ (Scalan.DataEnv, Scalan.Ref[A])) extends Product with Serializable
State monad for symbols computed in a data environment.
State monad for symbols computed in a data environment.
DataEnv
is used as the state of the state monad.- Definition Classes
- TypeDescs
-
case class
FuncElem[A, B](eDom: Scalan.Elem[A], eRange: Scalan.Elem[B]) extends Scalan.Elem[(A) ⇒ B] with Product with Serializable
Type descriptor for
A => B
type where descriptors forA
andB
are given as arguments.Type descriptor for
A => B
type where descriptors forA
andB
are given as arguments.- Definition Classes
- TypeDescs
-
trait
Functor[F[_]] extends Scalan.Cont[F]
- Definition Classes
- TypeDescs
-
sealed abstract
class
MethodDesc extends AnyRef
Abstract class for a method descriptors to assist invocation of MethodCall nodes.
Abstract class for a method descriptors to assist invocation of MethodCall nodes.
- Definition Classes
- TypeDescs
-
case class
PairElem[A, B](eFst: Scalan.Elem[A], eSnd: Scalan.Elem[B]) extends Scalan.Elem[(A, B)] with Product with Serializable
Type descriptor for
(A, B)
type where descriptors forA
andB
are given as arguments.Type descriptor for
(A, B)
type where descriptors forA
andB
are given as arguments.- Definition Classes
- TypeDescs
-
case class
RMethodDesc(method: RMethod) extends Scalan.MethodDesc with Product with Serializable
Decriptor for a method of a class.
Decriptor for a method of a class.
- method
The RMethod object representing the method.
- Definition Classes
- TypeDescs
-
case class
SumElem[A, B](eLeft: Scalan.Elem[A], eRight: Scalan.Elem[B]) extends Scalan.Elem[Scalan.|[A, B]] with Product with Serializable
Type descriptor for
A | B
type where descriptors forA
andB
are given as arguments.Type descriptor for
A | B
type where descriptors forA
andB
are given as arguments.- Definition Classes
- TypeDescs
-
abstract
class
TypeDesc extends Serializable
- Definition Classes
- TypeDescs
-
case class
WMethodDesc(wrapSpec: WrapSpec, method: RMethod) extends Scalan.MethodDesc with Product with Serializable
Descriptor for a method of a wrapper class.
Descriptor for a method of a wrapper class.
- wrapSpec
The wrapping specification of the method.
- method
The RMethod object representing the method.
- Definition Classes
- TypeDescs
-
implicit
class
EqualOps[A] extends AnyRef
Extension methods to construct ApplyBinOp nodes
Extension methods to construct ApplyBinOp nodes
- Definition Classes
- Equal
-
case class
Equals[A]()(implicit evidence$1: Scalan.Elem[A]) extends Scalan.BinOp[A, Boolean] with Product with Serializable
Binary operation representing structural equality between arguments.
Binary operation representing structural equality between arguments.
- Definition Classes
- Equal
-
case class
NotEquals[A]()(implicit evidence$2: Scalan.Elem[A]) extends Scalan.BinOp[A, Boolean] with Product with Serializable
Binary operation representing structural inequality between arguments.
Binary operation representing structural inequality between arguments.
- Definition Classes
- Equal
-
case class
Apply[A, B](f: Scalan.Ref[(A) ⇒ B], arg: Scalan.Ref[A], mayInline: Boolean = true) extends Scalan.Node with Scalan.Def[B] with Product with Serializable
- Definition Classes
- Functions
-
implicit
class
FuncExtensions[A, B] extends AnyRef
- Definition Classes
- Functions
-
class
Lambda[A, B] extends Scalan.AstGraph with Scalan.Def[(A) ⇒ B]
Represent lambda expression as IR node.
Represent lambda expression as IR node.
- Definition Classes
- Functions
-
implicit
class
LambdaOps[A, B] extends AnyRef
- Definition Classes
- Functions
-
class
LambdaStack extends AnyRef
- Definition Classes
- Functions
-
class
ElseIfBranch[T] extends AnyRef
Defines syntax available after
IF (cond) THEN thenp ELSEIF (cond1)
Defines syntax available after
IF (cond) THEN thenp ELSEIF (cond1)
- Definition Classes
- IfThenElse
-
class
IfBranch extends AnyRef
Defines syntax available after
IF (cond)
Defines syntax available after
IF (cond)
- Definition Classes
- IfThenElse
-
case class
IfThenElseLazy[T](cond: Scalan.Ref[Boolean], thenp: Scalan.Ref[Scalan.Thunk[T]], elsep: Scalan.Ref[Scalan.Thunk[T]]) extends Scalan.Node with Scalan.Def[T] with Product with Serializable
IR node to represent IF condition with lazy branches.
IR node to represent IF condition with lazy branches.
- Definition Classes
- IfThenElse
-
class
ThenIfBranch[T] extends AnyRef
Defines syntax available after
IF (cond) THEN thenp
Defines syntax available after
IF (cond) THEN thenp
- Definition Classes
- IfThenElse
-
implicit
class
RepBooleanOps extends AnyRef
Extension methods over
Ref[Boolean]
.Extension methods over
Ref[Boolean]
.- Definition Classes
- LogicalOps
-
abstract
class
DivOp[T] extends Scalan.EndoBinOp[T]
Base class for descriptors of binary division operations.
Base class for descriptors of binary division operations.
- Definition Classes
- NumericOps
-
case class
IntegralDivide[T](i: ExactIntegral[T])(implicit elem: Scalan.Elem[T]) extends Scalan.DivOp[T] with Product with Serializable
Descriptor of binary
/
operation (integral division).Descriptor of binary
/
operation (integral division).- Definition Classes
- NumericOps
-
case class
IntegralMod[T](i: ExactIntegral[T])(implicit elem: Scalan.Elem[T]) extends Scalan.DivOp[T] with Product with Serializable
Descriptor of binary
%
operation (remainder of integral division).Descriptor of binary
%
operation (remainder of integral division).- Definition Classes
- NumericOps
-
implicit
class
IntegralOpsCls[T] extends AnyRef
Extension methods over
Ref[T]
where T is instance of ExactIntegral type-class.Extension methods over
Ref[T]
where T is instance of ExactIntegral type-class.- Definition Classes
- NumericOps
-
case class
NumericMinus[T](n: ExactNumeric[T])(implicit evidence$4: Scalan.Elem[T]) extends Scalan.EndoBinOp[T] with Product with Serializable
Descriptor of binary
-
operation.Descriptor of binary
-
operation.- Definition Classes
- NumericOps
-
case class
NumericNegate[T](n: ExactNumeric[T])(implicit evidence$7: Scalan.Elem[T]) extends Scalan.UnOp[T, T] with Product with Serializable
Descriptor of unary
-
operation.Descriptor of unary
-
operation.- Definition Classes
- NumericOps
-
implicit
class
NumericOpsCls[T] extends AnyRef
Extension methods over
Ref[T]
where T is instance of ExactNumeric type-class.Extension methods over
Ref[T]
where T is instance of ExactNumeric type-class.- Definition Classes
- NumericOps
-
case class
NumericPlus[T](n: ExactNumeric[T])(implicit evidence$3: Scalan.Elem[T]) extends Scalan.EndoBinOp[T] with Product with Serializable
Descriptor of binary
+
operation.Descriptor of binary
+
operation.- Definition Classes
- NumericOps
-
case class
NumericTimes[T](n: ExactNumeric[T])(implicit evidence$5: Scalan.Elem[T]) extends Scalan.EndoBinOp[T] with Product with Serializable
Descriptor of binary
*
operation.Descriptor of binary
*
operation.- Definition Classes
- NumericOps
-
case class
NumericToInt[T](n: ExactNumeric[T]) extends Scalan.UnOp[T, Int] with Product with Serializable
Descriptor of unary
ToInt
conversion operation.Descriptor of unary
ToInt
conversion operation.- Definition Classes
- NumericOps
-
case class
NumericToLong[T](n: ExactNumeric[T]) extends Scalan.UnOp[T, Long] with Product with Serializable
Descriptor of unary
ToLong
conversion operation.Descriptor of unary
ToLong
conversion operation.- Definition Classes
- NumericOps
-
case class
OrderingCompare[T](ord: ExactOrdering[T]) extends Scalan.BinOp[T, Int] with Product with Serializable
Descriptor of binary
compare
operation.Descriptor of binary
compare
operation.- Definition Classes
- OrderingOps
-
case class
OrderingGT[T](ord: ExactOrdering[T]) extends Scalan.BinOp[T, Boolean] with Product with Serializable
Descriptor of binary
>
operation.Descriptor of binary
>
operation.- Definition Classes
- OrderingOps
-
case class
OrderingGTEQ[T](ord: ExactOrdering[T]) extends Scalan.BinOp[T, Boolean] with Product with Serializable
Descriptor of binary
>=
operation.Descriptor of binary
>=
operation.- Definition Classes
- OrderingOps
-
case class
OrderingLT[T](ord: ExactOrdering[T]) extends Scalan.BinOp[T, Boolean] with Product with Serializable
Descriptor of binary
<
operation.Descriptor of binary
<
operation.- Definition Classes
- OrderingOps
-
case class
OrderingLTEQ[T](ord: ExactOrdering[T]) extends Scalan.BinOp[T, Boolean] with Product with Serializable
Descriptor of binary
<=
operation.Descriptor of binary
<=
operation.- Definition Classes
- OrderingOps
-
case class
OrderingMax[T](ord: ExactOrdering[T])(implicit evidence$1: Scalan.Elem[T]) extends Scalan.BinOp[T, T] with Product with Serializable
Descriptor of binary
max
operation.Descriptor of binary
max
operation.- Definition Classes
- OrderingOps
-
case class
OrderingMin[T](ord: ExactOrdering[T])(implicit evidence$2: Scalan.Elem[T]) extends Scalan.BinOp[T, T] with Product with Serializable
Descriptor of binary
min
operation.Descriptor of binary
min
operation.- Definition Classes
- OrderingOps
-
class
OrderingOpsCls[T] extends AnyRef
Extension method over
Ref[T]
given an instance of ExactOrdering for T.Extension method over
Ref[T]
given an instance of ExactOrdering for T.- Definition Classes
- OrderingOps
-
case class
LiftableThunk[ST, T](lT: Liftable[ST, T]) extends Liftable[Scalan.SThunk[ST], Scalan.Thunk[T]] with Product with Serializable
Implementation of Liftable type class for
Thunk[T]
given liftable forT
.Implementation of Liftable type class for
Thunk[T]
given liftable forT
.- Definition Classes
- Thunks
-
implicit
class
RepThunkOps[T] extends AnyRef
Extension methods on
Ref[Thunk[T]]
values.Extension methods on
Ref[Thunk[T]]
values.- Definition Classes
- Thunks
-
trait
Thunk[+A] extends AnyRef
Phantom type to define thunk-typed graph nodes and thunk based lazy operations.
-
class
ThunkCompanion extends AnyRef
A class of factory to create new Thunks by use
Thunk { ... }
expressions.A class of factory to create new Thunks by use
Thunk { ... }
expressions.- Definition Classes
- Thunks
-
case class
ThunkConst[ST, T](constValue: Scalan.SThunk[ST], lT: Liftable[ST, T]) extends Scalan.BaseDef[Scalan.Thunk[T]] with LiftedConst[Scalan.SThunk[ST], Scalan.Thunk[T]] with Product with Serializable
Graph node to represent constants of type Thunk.
-
class
ThunkDef[A] extends Scalan.AstGraph with Scalan.Def[Scalan.Thunk[A]]
Graph node representing thunk with reified body.
Graph node representing thunk with reified body. Each thunk node is a specialized implementation of AstGraph abstract class.
- Definition Classes
- Thunks
-
case class
ThunkElem[A](eItem: Scalan.Elem[A]) extends Scalan.EntityElem1[A, Scalan.Thunk[A], Scalan.Thunk] with Product with Serializable
Implements a type descriptor of
Thunk[A]
type given the instance ofA
.Implements a type descriptor of
Thunk[A]
type given the instance ofA
.- Definition Classes
- Thunks
-
case class
ThunkForce[A](thunk: Scalan.Ref[Scalan.Thunk[A]]) extends Scalan.Node with Scalan.Def[A] with Product with Serializable
Graph node to represent thunk forcing operation.
Graph node to represent thunk forcing operation.
- Definition Classes
- Thunks
-
class
ThunkScope extends AnyRef
Helper object to handle construction of nested thunks.
Helper object to handle construction of nested thunks. One instance is created for each ThunkDef under construction. This corresponds to syntactic nesting of thunks.
- Definition Classes
- Thunks
-
class
ThunkStack extends AnyRef
The stack of nested thunks during graph construction.
The stack of nested thunks during graph construction.
- Definition Classes
- Thunks
-
case class
First[A, B](pair: Scalan.Ref[(A, B)]) extends Scalan.Node with Scalan.Def[A] with Product with Serializable
- Definition Classes
- Tuples
-
implicit
class
ListOps[A, B] extends AnyRef
- Definition Classes
- Tuples
-
case class
Second[A, B](pair: Scalan.Ref[(A, B)]) extends Scalan.Node with Scalan.Def[B] with Product with Serializable
- Definition Classes
- Tuples
-
case class
Tup[A, B](a: Scalan.Ref[A], b: Scalan.Ref[B]) extends Scalan.Node with Scalan.Def[(A, B)] with Product with Serializable
- Definition Classes
- Tuples
-
implicit
class
TupleOps2[A, B] extends AnyRef
- Definition Classes
- Tuples
-
implicit
class
TupleOps3[A, B, C] extends AnyRef
- Definition Classes
- Tuples
-
implicit
class
TupleOps4[A, B, C, D] extends AnyRef
- Definition Classes
- Tuples
-
implicit
class
TupleOps5[A, B, C, D, E] extends AnyRef
- Definition Classes
- Tuples
-
case class
ApplyBinOp[A, R](op: Scalan.BinOp[A, R], lhs: Scalan.Ref[A], rhs: Scalan.Ref[A]) extends Scalan.BaseDef[R] with Product with Serializable
Graph node which represents application of the given binary operation to the given arguments.
Graph node which represents application of the given binary operation to the given arguments.
- Definition Classes
- UnBinOps
-
case class
ApplyBinOpLazy[A, R](op: Scalan.BinOp[A, R], lhs: Scalan.Ref[A], rhs: Scalan.Ref[Scalan.Thunk[A]]) extends Scalan.BaseDef[R] with Product with Serializable
Graph node which represents application of the given binary operation to the given arguments where the second argument is lazy.
Graph node which represents application of the given binary operation to the given arguments where the second argument is lazy.
- Definition Classes
- UnBinOps
-
case class
ApplyUnOp[A, R](op: Scalan.UnOp[A, R], arg: Scalan.Ref[A]) extends Scalan.BaseDef[R] with Product with Serializable
Graph node which represents application of the given unary operation to the given argument.
Graph node which represents application of the given unary operation to the given argument.
- Definition Classes
- UnBinOps
-
abstract
class
BinOp[A, R] extends AnyRef
Base class for descriptors of binary operations.
Base class for descriptors of binary operations.
- Definition Classes
- UnBinOps
-
abstract
class
UnOp[A, R] extends AnyRef
Base class for descriptors of unary operations.
Base class for descriptors of unary operations.
- Definition Classes
- UnBinOps
-
case class
Convert[From, To](eFrom: Scalan.Elem[From], eTo: Scalan.Elem[To], x: Scalan.Ref[Scalan.Def[_]], conv: Scalan.Ref[(From) ⇒ To]) extends Scalan.BaseDef[To] with Product with Serializable
- Definition Classes
- UniversalOps
-
case class
Downcast[From, To](input: Scalan.Ref[From], eTo: Scalan.Elem[To]) extends Scalan.BaseDef[To] with Product with Serializable
- Definition Classes
- UniversalOps
-
case class
HashCode[A]() extends Scalan.UnOp[A, Int] with Product with Serializable
- Definition Classes
- UniversalOps
-
case class
OpCost(lambdaVar: Scalan.Sym, costedValueId: Int, args: Seq[Scalan.Ref[Int]], opCost: Scalan.Ref[Int]) extends Scalan.BaseDef[Int] with Product with Serializable
Special graph node to represent accumulation of the operation costs.
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.
- lambdaVar
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.
- costedValueId
The id of the node for which this node represents cost
- args
costs of the arguments, which are here represent dependency information.
- opCost
operation cost, which should be added to the current scope accumulated cost
- Definition Classes
- UniversalOps
-
implicit
class
RepUniversalOps[A] extends AnyRef
- Definition Classes
- UniversalOps
-
case class
SizeOf[T](value: Scalan.Ref[T]) extends Scalan.BaseDef[Long] with Product with Serializable
Represents calculation of size in bytes of the given value.
Represents calculation of size in bytes of the given value. The descriptor value.elem can be used to decompose value into components.
- Definition Classes
- UniversalOps
-
case class
ToString[A]() extends Scalan.UnOp[A, String] with Product with Serializable
- Definition Classes
- UniversalOps
-
case class
Upcast[From, To](input: Scalan.Ref[From], eTo: Scalan.Elem[To]) extends Scalan.BaseDef[To] with Product with Serializable
- Definition Classes
- UniversalOps
-
abstract
class
AstGraph extends Scalan.Node
Base class for all compound nodes with schedule (e.g.
Base class for all compound nodes with schedule (e.g. Lambda, ThunkDef). The graph is directed acyclic (i.e. DAG) in which edges go from
boundVars
down toroots
.- Definition Classes
- AstGraphs
-
case class
GraphNode(sym: Scalan.Sym, usages: Buffer[Int]) extends Product with Serializable
GraphNode is created for each symbol of the AstGraph and represents graph linking structure
GraphNode is created for each symbol of the AstGraph and represents graph linking structure
- Definition Classes
- AstGraphs
-
class
PGraphUsages extends DFunc[Int, Buffer[Int]]
Deboxed function to obtain usages of a given node.
Deboxed function to obtain usages of a given node. Represents adjacency matrix of the reversed graph
g
.- Definition Classes
- ProgramGraphs
-
case class
ProgramGraph(roots: Seq[Scalan.Sym], mapping: Nullable[Scalan.Transformer], filterNode: Nullable[(Scalan.Sym) ⇒ Boolean]) extends Scalan.AstGraph with Product with Serializable
Immutable graph collected from
roots
following Ref.node.deps links.Immutable graph collected from
roots
following Ref.node.deps links.- Definition Classes
- ProgramGraphs
-
class
DefaultPass extends Scalan.Pass
Default pass to be used when IR is used without special compiler configuration.
Default pass to be used when IR is used without special compiler configuration.
- Definition Classes
- Transforming
-
case class
MapTransformer(subst: HashMap[Scalan.Sym, Scalan.Sym]) extends Scalan.Transformer with Product with Serializable
Concrete and default implementation of Transformer using underlying HashMap.
Concrete and default implementation of Transformer using underlying HashMap. HOTSPOT: don't beatify the code
- Definition Classes
- Transforming
-
abstract
class
Mirror extends AnyRef
Base class for mirrors of graph nodes.
Base class for mirrors of graph nodes. Provides default implementations which can be overriden if special logic is required. HOTSPOT: don't beautify the code
- Definition Classes
- Transforming
-
implicit
class
PartialRewriter extends Scalan.Rewriter
Turns partial function into rewriter (i.e.
Turns partial function into rewriter (i.e. set of rewriting rules)
- Definition Classes
- Transforming
-
abstract
class
Pass extends AnyRef
Descriptor of a current compiler pass.
Descriptor of a current compiler pass. Compiler can be configured to perform one pass after another. Each pass has name, configuration parameters, finalizaton logic etc.
- Definition Classes
- Transforming
-
case class
PassConfig(shouldUnpackTuples: Boolean = false, shouldExtractFields: Boolean = true, constantPropagation: Boolean = true, shouldSlice: Boolean = false) extends Product with Serializable
Configuration parameters of the Pass descriptor.
Configuration parameters of the Pass descriptor.
- Definition Classes
- Transforming
-
abstract
class
Rewriter extends AnyRef
- Definition Classes
- Transforming
-
type
CompilingEnv = Map[Any, Ref[_]]
Type of the mapping between variable names (see Ident) or definition ids (see ValDef) and graph nodes.
Type of the mapping between variable names (see Ident) or definition ids (see ValDef) and graph nodes. Thus, the key is either String or Int. Used in
buildNode
method.- Attributes
- protected
- Definition Classes
- GraphBuilding
-
type
DataEnv = Map[Sym, AnyRef]
Immutable data environment used to assign data values to graph nodes.
Immutable data environment used to assign data values to graph nodes.
- Definition Classes
- TypeDescs
-
type
DefEnv = Map[Sym, (Int, SType)]
Describes assignment of valIds for symbols which become ValDefs.
Describes assignment of valIds for symbols which become ValDefs. Each ValDef in current scope have entry in this map
- Definition Classes
- TreeBuilding
-
type
EndoBinOp[A] = BinOp[A, A]
- Definition Classes
- UnBinOps
-
type
EndoUnOp[A] = UnOp[A, A]
- Definition Classes
- UnBinOps
-
type
LElem[A] = Lazy[Elem[A]]
Type descriptor which is computed lazily on demand.
Type descriptor which is computed lazily on demand.
- Definition Classes
- TypeDescs
-
type
LambdaData[A, B] = (Lambda[A, B], Nullable[(Ref[A]) ⇒ Ref[B]], Ref[A], Ref[B])
- Definition Classes
- Functions
-
type
LazyRep[T] = MutableLazy[Ref[T]]
- Definition Classes
- Library
-
type
PGraph = ProgramGraph
- Definition Classes
- ProgramGraphs
-
type
RColl[T] = Ref[Coll[T]]
- Definition Classes
- GraphBuilding
-
type
RFunc[-A, +B] = Ref[(A) ⇒ B]
- Definition Classes
- Base
-
type
ROption[T] = Ref[WOption[T]]
- Definition Classes
- GraphBuilding
-
type
RPair[+A, +B] = Ref[(A, B)]
- Definition Classes
- Base
-
type
SThunk[T] = () ⇒ T
Runtime representation of lazy values.
-
type
Schedule = Seq[Sym]
Type synonim for graph schedules.
Type synonim for graph schedules.
- Definition Classes
- AstGraphs
-
type
ScheduleIds = Buffer[Int]
Alternative representation of schedules using node ids.
Alternative representation of schedules using node ids.
- Definition Classes
- AstGraphs
-
type
Subst = HashMap[Sym, Sym]
- Definition Classes
- Functions
-
type
Sym = Ref[_]
Untyped shortcut sinonim of Ref, which is used as untyped reference to graph nodes (definitions).
Untyped shortcut sinonim of Ref, which is used as untyped reference to graph nodes (definitions). Following a tradition in compiler engineering we call references to definitions as symbols.
- Definition Classes
- Base
-
type
Th[+T] = Ref[Thunk[T]]
- Definition Classes
- Thunks
-
type
|[+A, +B] = Either[A, B]
- Definition Classes
- Base
-
trait
Coll[A] extends scalan.Library.Node with scalan.Library.Def[scalan.Library.Coll[A]]
- Definition Classes
- Colls
-
trait
CollBuilder extends scalan.Library.Node with scalan.Library.Def[scalan.Library.CollBuilder]
- Definition Classes
- Colls
-
trait
CollBuilderCompanion extends AnyRef
- Definition Classes
- Colls
-
trait
CollCompanion extends AnyRef
- Definition Classes
- Colls
-
class
CollCls extends scalan.Library.EntityObject
- Definition Classes
- CollsDefs
-
trait
AvlTree extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.AvlTree]
- Definition Classes
- SigmaDsl
-
trait
AvlTreeCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
BigInt extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.BigInt]
- Definition Classes
- SigmaDsl
-
trait
BigIntCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
Box extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.Box]
- Definition Classes
- SigmaDsl
-
trait
BoxCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
Context extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.Context]
- Definition Classes
- SigmaDsl
-
trait
ContextCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
CostModelCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
GroupElement extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.GroupElement]
- Definition Classes
- SigmaDsl
-
trait
GroupElementCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
Header extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.Header]
- Definition Classes
- SigmaDsl
-
trait
HeaderCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
PreHeader extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.PreHeader]
- Definition Classes
- SigmaDsl
-
trait
PreHeaderCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
SigmaContractCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
SigmaDslBuilder extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.SigmaDslBuilder]
- Definition Classes
- SigmaDsl
-
trait
SigmaDslBuilderCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
SigmaProp extends scalan.SigmaLibrary.Node with scalan.SigmaLibrary.Def[scalan.SigmaLibrary.SigmaProp]
- Definition Classes
- SigmaDsl
-
trait
SigmaPropCompanion extends AnyRef
- Definition Classes
- SigmaDsl
-
trait
WOption[A] extends special.wrappers.WrappersModule.Node with special.wrappers.WrappersModule.Def[special.wrappers.WrappersModule.WOption[A]]
- Definition Classes
- WOptions
-
class
WOptionCls extends special.wrappers.WrappersModule.EntityObject
- Definition Classes
- WOptionsDefs
-
trait
WRType[A] extends special.wrappers.WrappersModule.Node with special.wrappers.WrappersModule.Def[special.wrappers.WrappersModule.WRType[A]]
- Definition Classes
- WRTypes
-
trait
WRTypeCompanion extends AnyRef
- Definition Classes
- WRTypes
-
class
WRTypeCls extends special.wrappers.WrappersModule.EntityObject
IR implementation for RType methods.
IR implementation for RType methods. Prefix
W
means that this is implementation of IR wrapper over RType.- Definition Classes
- WRTypesDefs
- See also
-
trait
WSpecialPredef extends special.wrappers.WrappersModule.Node with special.wrappers.WrappersModule.Def[special.wrappers.WrappersModule.WSpecialPredef]
- Definition Classes
- WSpecialPredefs
-
trait
WSpecialPredefCompanion extends AnyRef
- Definition Classes
- WSpecialPredefs
Value Members
-
object
&&
Logical AND between two pattern matches of the save value
x
.Logical AND between two pattern matches of the save value
x
. Can be used to construct patterns likecase P1 && P2 => ...
- Definition Classes
- Base
-
object
Def
- Definition Classes
- Base
-
object
ExpWithElem
- Definition Classes
- Base
-
object
Liftables
Data type
ST
is liftable is there is Liftable[ST, T] instance for some typeT
.Data type
ST
is liftable is there is Liftable[ST, T] instance for some typeT
. Liftable typeclass allows to define which types can have values embedded as literals into graph IR.- Definition Classes
- Base
-
object
NoOwner extends Scalan.OwnerKind with Product with Serializable
- Definition Classes
- Base
-
object
ScalanOwner extends Scalan.OwnerKind with Product with Serializable
- Definition Classes
- Base
-
object
IsNumericToInt
- Definition Classes
- Library
-
object
IsNumericToLong
- Definition Classes
- Library
-
object
InvokeImpossible extends Scalan.InvokeResult with Product with Serializable
Invocation is not possible, e.g.
Invocation is not possible, e.g. when receiver doesn't implemented the method.
- Definition Classes
- MethodCalls
-
object
Elem extends Serializable
- Definition Classes
- TypeDescs
-
object
EnvRep extends Serializable
- Definition Classes
- TypeDescs
-
object
ConstantLambda
Matcher for lambdas which don't depend on their arguments (but can close over other expressions, unlike VeryConstantLambda).
Matcher for lambdas which don't depend on their arguments (but can close over other expressions, unlike VeryConstantLambda).
- Definition Classes
- Functions
-
object
IdentityLambda
- Definition Classes
- Functions
-
object
Lambda
- Definition Classes
- Functions
-
object
VeryConstantLambda
Matcher for lambdas which return staging-time constants.
Matcher for lambdas which return staging-time constants. VeryConstantLambda(x) should be equivalent to ConstantLambda(Def(Const(x)))
- Definition Classes
- Functions
-
object
ConstantThunk
- Definition Classes
- Thunks
-
object
ThunkDef
- Definition Classes
- Thunks
-
object
IsPair
- Definition Classes
- Tuples
-
object
Pair
- Definition Classes
- Tuples
-
object
ProgramGraph extends Serializable
- Definition Classes
- ProgramGraphs
-
object
MapTransformer extends Serializable
- Definition Classes
- Transforming
-
object
Pass
- Definition Classes
- Transforming
-
def
!!!(msg: String, e: Throwable, syms: Ref[_]*): Nothing
- Definition Classes
- Base
-
def
!!!(msg: String, syms: Ref[_]*): Nothing
- Definition Classes
- Base
-
def
!!!: Nothing
Helper methods to throw errors
Helper methods to throw errors
- Definition Classes
- Base
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
???(value: Any, syms: Ref[_]*): Nothing
- Definition Classes
- Base
-
def
???: Nothing
- Definition Classes
- Base
-
val
And: EndoBinOp[Boolean]
Logical AND binary operation.
Logical AND binary operation.
- Definition Classes
- LogicalOps
-
val
AnyElement: Elem[Any]
Type descriptor for
Any
, cannot be used implicitly.Type descriptor for
Any
, cannot be used implicitly.- Definition Classes
- TypeDescs
-
val
BinaryXorOp: EndoBinOp[Boolean]
Logical XOR binary operation.
Logical XOR binary operation.
- Definition Classes
- LogicalOps
-
implicit
val
BooleanElement: Elem[Boolean]
- Definition Classes
- TypeDescs
-
val
BooleanToInt: UnOp[Boolean, Int]
Boolean to Int conversion unary operation.
Boolean to Int conversion unary operation.
- Definition Classes
- LogicalOps
-
implicit
val
ByteElement: Elem[Byte]
- Definition Classes
- TypeDescs
-
val
CM: special.collection.impl.CollsDefs.Coll.CollMethods.type
- Definition Classes
- Library
-
val
DefaultMirror: Mirror
Default Mirror instance which is used in core IR methods.
Default Mirror instance which is used in core IR methods.
- Definition Classes
- Transforming
-
val
EmptyArrayOfSym: Array[Sym]
Immutable empty array of symbols, can be used to avoid unnecessary allocations.
Immutable empty array of symbols, can be used to avoid unnecessary allocations.
- Definition Classes
- Base
-
val
EmptyDSetOfInt: Set[Int]
Used internally in IR and should be used with care since it is mutable.
Used internally in IR and should be used with care since it is mutable. At the same time, it is used in the hotspot and allows to avoid roughly tens of thousands of allocations per second. WARNING: Mutations of this instance can lead to undefined behavior.
- Attributes
- protected
- Definition Classes
- Base
-
val
EmptySeqOfSym: Seq[Sym]
Immutable empty Seq, can be used to avoid unnecessary allocations.
Immutable empty Seq, can be used to avoid unnecessary allocations.
- Definition Classes
- Base
-
val
EmptyTypeArgs: ListMap[String, (TypeDesc, Variance)]
Since ListMap is immutable this empty map can be shared by all other maps created from it.
Since ListMap is immutable this empty map can be shared by all other maps created from it.
- Definition Classes
- TypeDescs
-
implicit final
def
FuncElemExtensions[A, B](eAB: Elem[(A) ⇒ B]): FuncElem[A, B]
- Definition Classes
- TypeDescs
-
def
IF(cond: Ref[Boolean]): IfBranch
If c then t else e construction with standard lazy evaluation of branches.
If c then t else e construction with standard lazy evaluation of branches. The representation uses Thunk for each branch
- Definition Classes
- IfThenElse
-
implicit
val
IntElement: Elem[Int]
- Definition Classes
- TypeDescs
-
final
def
IntZero: Ref[Int]
Zero literal node, which is lazily created and can be efficiently reused.
Zero literal node, which is lazily created and can be efficiently reused. Much faster alternative to
(0: Rep[Int])
ortoRep(0)
.- Definition Classes
- Base
- Annotations
- @inline()
-
val
LazyAnyElement: Lazy[Elem[Any]]
Predefined Lazy value saved here to be used in hotspot code.
Predefined Lazy value saved here to be used in hotspot code.
- Definition Classes
- TypeDescs
-
implicit
val
LongElement: Elem[Long]
- Definition Classes
- TypeDescs
-
val
NoRewriting: Rewriter
Identity rewriter, i.e.
Identity rewriter, i.e. doesn't change the graph when applied.
- Definition Classes
- Transforming
-
val
Not: EndoUnOp[Boolean]
Logical NOT unary operation.
Logical NOT unary operation.
- Definition Classes
- LogicalOps
-
val
Or: EndoBinOp[Boolean]
Logical AND binary operation.
Logical AND binary operation.
- Definition Classes
- LogicalOps
-
implicit
def
OrderingToOrderingOps[T](x: T)(implicit n: ExactOrdering[T], et: Elem[T]): OrderingOpsCls[T]
- Definition Classes
- OrderingOps
-
implicit final
def
PairElemExtensions[A, B](eAB: Elem[(A, B)]): PairElem[A, B]
- Definition Classes
- TypeDescs
-
implicit
val
ShortElement: Elem[Short]
- Definition Classes
- TypeDescs
-
implicit
val
StringElement: Elem[String]
- Definition Classes
- TypeDescs
-
implicit final
def
SumElemExtensions[A, B](eAB: Elem[|[A, B]]): SumElem[A, B]
- Definition Classes
- TypeDescs
-
val
Thunk: ThunkCompanion
Allow expressions like
Thunk { ... }
to create new Thunks.Allow expressions like
Thunk { ... }
to create new Thunks.- Definition Classes
- Thunks
-
final
def
TypeArgs(descs: (String, (TypeDesc, Variance))*): ListMap[String, (TypeDesc, Variance)]
- Definition Classes
- TypeDescs
-
implicit
val
UnitElement: Elem[Unit]
- Definition Classes
- TypeDescs
-
val
_currentPass: Pass
- Definition Classes
- Transforming
-
def
alphaEqual(s1: Sym, s2: Sym): Boolean
- Definition Classes
- Functions
-
def
applyBinOp[A, R](op: BinOp[A, R], lhs: Ref[A], rhs: Ref[A]): Ref[R]
Overridable constructor of a binary operation node.
Overridable constructor of a binary operation node.
- Definition Classes
- UnBinOps
-
def
applyBinOpLazy[A, R](op: BinOp[A, R], lhs: Ref[A], rhs: Ref[Thunk[A]]): Ref[R]
Overridable constructor of a binary operation node with lazy argument.
Overridable constructor of a binary operation node with lazy argument.
- Definition Classes
- UnBinOps
-
def
applyUnOp[A, R](op: UnOp[A, R], arg: Ref[A]): Ref[R]
Overridable constructor of an unary operation node.
Overridable constructor of an unary operation node.
- Definition Classes
- UnBinOps
-
final
def
asElem[T](d: TypeDesc): Elem[T]
Helper type case method.
Helper type case method.
- Definition Classes
- TypeDescs
- Annotations
- @inline()
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
final
def
asRep[T](x: Ref[_]): Ref[T]
Helper to type cast node references.
Helper to type cast node references.
- Definition Classes
- Base
- Annotations
- @inline()
-
def
assertElem(value: Ref[_], elem: Elem[_], hint: ⇒ String): Unit
- Definition Classes
- TypeDescs
-
def
assertElem(value: Ref[_], elem: Elem[_]): Unit
- Definition Classes
- TypeDescs
-
def
assertEqualElems[A](e1: Elem[A], e2: Elem[A], m: ⇒ String): Unit
- Definition Classes
- TypeDescs
-
def
assertValueIdForOpCost[A, B](value: Ref[A], cost: Ref[B]): Unit
- Definition Classes
- UniversalOps
-
def
beginPass(pass: Pass): Unit
Called to setup IR before the new pass is executed.
Called to setup IR before the new pass is executed.
- Definition Classes
- Transforming
-
def
buildGraph[T](env: ScriptEnv, typed: SValue): Ref[(Context) ⇒ T]
Translates the given typed expression to IR graph representing a function from Context to some type T.
Translates the given typed expression to IR graph representing a function from Context to some type T.
- env
contains values for each named constant used
- Definition Classes
- GraphBuilding
-
def
buildNode[T <: SType](ctx: Ref[Context], env: CompilingEnv, node: Value[T]): Ref[GraphBuilding.buildNode.T.WrappedType]
Builds IR graph for the given ErgoTree expression
node
.Builds IR graph for the given ErgoTree expression
node
.- ctx
reference to a graph node that represents Context value passed to script interpreter
- env
compilation environment which resolves variables to graph nodes
- node
ErgoTree expression to be translated to graph
- returns
reference to the graph node which represents
node
expression as part of in the IR graph data structure
- Attributes
- protected
- Definition Classes
- GraphBuilding
-
def
buildTree[T <: SType](f: Ref[(Context) ⇒ Any], constantsProcessing: Option[ConstantStore] = None): Value[T]
Transforms the given function
f
from graph-based IR to ErgoTree expression.Transforms the given function
f
from graph-based IR to ErgoTree expression.- f
reference to the graph node representing function from Context.
- constantsProcessing
if Some(store) is specified, then each constant is segregated and a placeholder is inserted in the resulting expression.
- returns
expression of ErgoTree which corresponds to the function
f
- Definition Classes
- TreeBuilding
-
val
builder: TransformingSigmaBuilder.type
Should be specified in the final cake
Should be specified in the final cake
- Definition Classes
- IRContext → GraphBuilding
-
val
cacheElems: Boolean
Whether IR type descriptors should be cached.
Whether IR type descriptors should be cached.
- Definition Classes
- Base
-
val
cachePairs: Boolean
Whether Tup instances should be cached.
Whether Tup instances should be cached.
- Definition Classes
- Base
-
final
def
cachedElemByClass[E <: Elem[_]](args: AnyRef*)(implicit clazz: RClass[E]): E
Retrieve an instance of the given Elem class by either looking up in the cache or creating a new one.
Retrieve an instance of the given Elem class by either looking up in the cache or creating a new one. We assume that all Elem instances are uniquely defined by (clazz, args)
- args
arguments of Elem class constructor
- clazz
Elem class
- Definition Classes
- TypeDescs
-
def
canBeInvoked(d: Def[_], m: RMethod, args: Array[AnyRef]): Boolean
Method invocation checker.
Method invocation checker.
- Attributes
- protected
- Definition Classes
- MethodCalls
-
def
checkTupleType[Ctx <: IRContext, T](ctx: Ctx)(e: GraphBuilding.checkTupleType.Ctx.Elem[_]): Unit
Check the tuple type is valid.
Check the tuple type is valid. In v5.x this code is taken from CheckTupleType validation rule which is no longer part of consensus.
- Definition Classes
- GraphBuilding
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
colBuilder: Ref[CollBuilder]
- Definition Classes
- GraphBuilding → Library
- Annotations
- @inline()
-
def
compose[A, B, C](f: Ref[(B) ⇒ C], g: Ref[(A) ⇒ B]): Ref[(A) ⇒ C]
Composition of two functions (in mathematical notation), where first
g
is applied and themf
.Composition of two functions (in mathematical notation), where first
g
is applied and themf
.- Definition Classes
- Functions
-
def
constFun[A, B](x: Ref[B])(implicit e: Elem[A]): Ref[(A) ⇒ B]
- Definition Classes
- Functions
-
final
def
container[F[_]](implicit arg0: Cont[F]): Cont[F]
- Definition Classes
- TypeDescs
-
implicit final
def
containerElem[F[_], A](implicit arg0: Cont[F], arg1: Elem[A]): Elem[F[A]]
- Definition Classes
- TypeDescs
-
def
createDefinition[T](optScope: Nullable[ThunkScope], s: Ref[T], d: Def[T]): Ref[T]
Create new definition entry in either given Thunk or in the global hash table.
Create new definition entry in either given Thunk or in the global hash table.
- optScope
optional thunk scope to put given definition
- s
symbol refering to
d
- d
definition node to add to the scope of globally
- returns
reference to
d
(which iss
)
- Attributes
- protected
- Definition Classes
- Base
-
def
currentPass: Pass
IR global current Pass, changes when the compier switches from one pass to the next one.
IR global current Pass, changes when the compier switches from one pass to the next one. Should remain constant during the whole pass execution.
- Definition Classes
- Transforming
-
val
debugModeSanityChecks: Boolean
Whether to perform extended checks of correctness, expected invariants and data consistency.
Whether to perform extended checks of correctness, expected invariants and data consistency. NOTE: Since it may add substantial overhead, set it to
false
before using in production.- Definition Classes
- Base
-
def
defCount: Int
Returns a number of definitions added to this IR context.
Returns a number of definitions added to this IR context.
- Definition Classes
- Base
-
def
def_unapply[T](e: Ref[T]): Nullable[Def[T]]
- Definition Classes
- Base
-
def
delayInvoke: Nothing
- Definition Classes
- MethodCalls
-
def
downcast[To](value: Ref[_])(implicit arg0: Elem[To]): Ref[To]
- Definition Classes
- UniversalOps
-
val
elemCache: AVHashMap[RClass[_], ElemCacheEntry]
- Attributes
- protected
- Definition Classes
- TypeDescs
-
def
elemToExactIntegral[T](e: Elem[T]): ExactIntegral[T]
- returns
ExactIntegral instance for the given type
- Definition Classes
- GraphBuilding
-
def
elemToExactNumeric[T](e: Elem[T]): ExactNumeric[T]
- returns
ExactNumeric instance for the given type
- Definition Classes
- GraphBuilding
-
def
elemToExactOrdering[T](e: Elem[T]): ExactOrdering[T]
- returns
ExactOrdering instance for the given type
- Definition Classes
- GraphBuilding
-
lazy val
elemToExactOrderingMap: Map[Elem[_], ExactOrdering[_]]
- Attributes
- protected
- Definition Classes
- GraphBuilding
-
def
elemToSType[T](e: Elem[T]): SType
Translates Elem descriptor to SType descriptor used in ErgoTree.
Translates Elem descriptor to SType descriptor used in ErgoTree. Should be inverse to
stypeToElem
.- Definition Classes
- GraphBuilding
-
final
def
element[A](implicit ea: Elem[A]): Elem[A]
- Definition Classes
- TypeDescs
-
final
def
emptyDBufferOfSym: Buffer[Sym]
Create a new empty buffer around pre-allocated empty array.
Create a new empty buffer around pre-allocated empty array. This method is preferred, rather that creating empty debox.Buffer directly because it allows to avoid allocation of the empty array.
- Definition Classes
- Base
- Annotations
- @inline()
-
def
emptyMatchSubst: Subst
- Definition Classes
- Functions
- Annotations
- @inline()
-
def
endPass(pass: Pass): Unit
Called to let this IR context to finalized the given pass.
Called to let this IR context to finalized the given pass.
- Definition Classes
- Transforming
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equalValues[A](x: Any, y: Any)(implicit eA: Elem[A]): Boolean
- Attributes
- protected
- Definition Classes
- Equal
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
error(msg: String, srcCtx: Option[SourceContext]): Nothing
- Definition Classes
- GraphBuilding
-
def
error(msg: String): Nothing
- Definition Classes
- GraphBuilding
-
implicit
def
extendThunkElement[T](elem: Elem[Thunk[T]]): ThunkElem[T]
Implicit conversion (downcast) to access
ThunkElem.eItem
field.Implicit conversion (downcast) to access
ThunkElem.eItem
field.- Definition Classes
- Thunks
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
findGlobalDefinition[T](d: Def[T]): Ref[T]
Lookup definition in this IR context's hash table of definitions.
Lookup definition in this IR context's hash table of definitions.
- returns
node reference to an instance stored in hash table, which is equal to
d
and null if there is no definition which is equal tod
- Definition Classes
- Base
-
def
findIsProven[T](f: Ref[(Context) ⇒ T]): Option[Sym]
Finds SigmaProp.isProven method calls in the given Lambda
f
Finds SigmaProp.isProven method calls in the given Lambda
f
- Definition Classes
- IRContext
-
def
findOrCreateDefinition[T](d: Def[T], newSym: ⇒ Ref[T]): Ref[T]
Lookup
d
in the heap of nodes.Lookup
d
in the heap of nodes. If the lookup is successfull, then its reference is returned. If the node is not found in the heap, then it is added andd.self
reference is returned.- d
node to be added to the head of nodes
- newSym
producer of the reference to be used as the reference to
d
node.- returns
return a reference to
d
node in the heap HOTSPOT:
- Definition Classes
- Base
-
def
forceThunkByMirror[A](thunk: Th[A], subst: MapTransformer = MapTransformer.empty()): Ref[A]
Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).
Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).
- thunk
reference to the thunk node
- subst
transformer to be applied for each mirrored (cloned) node.
- returns
the reference to the graph node, which represents the resulting value of the thunk
- Definition Classes
- Thunks
-
def
forceThunkDefByMirror[A](th: ThunkDef[A], subst: MapTransformer = MapTransformer.empty()): Ref[A]
Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).
Inlines the given thunk by cloning all its nodes and applying the given substitution (transformer).
- th
the thunk node
- subst
transformer to be applied for each mirrored (cloned) node.
- returns
the reference to the graph node, which represents the resulting value of the thunk
- Definition Classes
- Thunks
-
final
def
freshId: Int
Get next fresh node id
Get next fresh node id
- Definition Classes
- Base
- Annotations
- @inline()
-
final
def
freshSym[T](d: Def[T]): Ref[T]
Lookup of create reference to the given definition.
Lookup of create reference to the given definition. To lookup
d.nodeId
is used as the index in the_symbolTable
. If Ref is not found in_symbolTable
, then new Ref instance is created and stored in_symbolTable
atd.nodeId
index.- Definition Classes
- Base
- Annotations
- @inline()
-
implicit final
def
fun[A, B](f: (Ref[A]) ⇒ Ref[B])(implicit eA: LElem[A]): Ref[(A) ⇒ B]
Executes given lambda to construct Lambda node.
Executes given lambda to construct Lambda node. The function
f
can be called with any symbol and has an effect of growing a graph starting from the argument symbol. If a reference toVariable
node is passed as argument, then the constructed graph nodes can be collected to Lambda node forming its body and schedule.- f
function which execution will create body nodes
- eA
arguments type descriptor
- Definition Classes
- Functions
-
implicit final
def
fun2[A, B, C](f: (Ref[A], Ref[B]) ⇒ Ref[C])(implicit eA: LElem[A], eB: LElem[B]): Ref[((A, B)) ⇒ C]
- Definition Classes
- Functions
-
implicit final
def
funcElement[A, B](implicit ea: Elem[A], eb: Elem[B]): Elem[(A) ⇒ B]
Implicitly defines element type for functions.
Implicitly defines element type for functions.
- Definition Classes
- TypeDescs
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getEntityObject(name: String): Nullable[EntityObject]
- Definition Classes
- Base
- Annotations
- @inline()
-
def
getOwnerKind(constructor: RConstructor[_]): OwnerKind
Returns OwnerKind for the given constructor, using its first parameter.
Returns OwnerKind for the given constructor, using its first parameter.
- Attributes
- protected
- Definition Classes
- Base
-
final
def
getSourceValues(dataEnv: DataEnv, forWrapper: Boolean, stagedValues: AnyRef*): Seq[AnyRef]
- Definition Classes
- TypeDescs
-
final
def
getSym(id: Int): Sym
Lookup node reference by its id.
Lookup node reference by its id. This is simple array access by index O(1) operation.
- Definition Classes
- Base
- Annotations
- @inline()
-
implicit
def
groupElementToECPoint(g: special.sigma.GroupElement): EcPointType
- Attributes
- protected
- Definition Classes
- GraphBuilding
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
identityFun[A](implicit e: Elem[A]): Ref[(A) ⇒ A]
- Definition Classes
- Functions
-
def
ifThenElseLazy[T](cond: Ref[Boolean], thenp: ⇒ Ref[T], elsep: ⇒ Ref[T]): Ref[T]
Constructs IfThenElse node wrapping by-name args into ThunkDef nodes.
Constructs IfThenElse node wrapping by-name args into ThunkDef nodes.
- Definition Classes
- IfThenElse
-
def
integral[T](implicit arg0: ExactIntegral[T]): ExactIntegral[T]
Return an ExactIntegral for a given type T.
Return an ExactIntegral for a given type T.
- Definition Classes
- NumericOps
-
def
invokeUnlifted(e: Elem[_], mc: MethodCall, dataEnv: DataEnv): Any
Invoke source type method corresponding to the given MethodCall node.
Invoke source type method corresponding to the given MethodCall node. This method delegated the work to the given element instance.
- e
type descriptor of receiver node
- mc
IR node representing method invocation
- dataEnv
environment where each symbol of 'mc' has associated data value
- returns
data value returned from invoked method
-
val
isInlineThunksOnForce: Boolean
Specifies thunk staging strategy with respect to handling thunk_force operation.
Specifies thunk staging strategy with respect to handling thunk_force operation.
- Definition Classes
- Thunks
- See also
thunk_force
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isInvokeEnabled(d: Def[_], m: RMethod): Boolean
Method invocation enabler.
Method invocation enabler.
- returns
true if the given method can be invoked on the given node.
- Definition Classes
- MethodCalls
-
final
def
isOne[T](x: T, n: ExactNumeric[T]): Boolean
Compares the given value with 1 of the given ExactNumeric instance.
Compares the given value with 1 of the given ExactNumeric instance.
- Definition Classes
- NumericOps
- Annotations
- @inline()
-
final
def
isZero[T](x: T, n: ExactNumeric[T]): Boolean
Compares the given value with zero of the given ExactNumeric instance.
Compares the given value with zero of the given ExactNumeric instance.
- Definition Classes
- NumericOps
- Annotations
- @inline()
-
val
keepOriginalFunc: Boolean
Global flag governing lambda reification in
fun
andmkLambda
.Global flag governing lambda reification in
fun
andmkLambda
. If this flag istrue
then originalf: Ref[A] => Ref[B]
function is stored in Lambda node. As a consequence iff
is not stored, thenunfoldLambda
is done bymirrorLambda
.- Definition Classes
- Functions
-
val
lambdaStack: List[Lambda[_, _]]
- Definition Classes
- Functions
-
implicit
def
liftElem[T](eT: Elem[T]): Ref[WRType[T]]
- Definition Classes
- Library
-
implicit
def
liftToRep[A](x: A)(implicit arg0: Elem[A]): Ref[A]
- Definition Classes
- Base
- Annotations
- @inline()
-
def
liftableFromElem[WT](eWT: Elem[WT]): Liftable[_, WT]
Translates Elem to the corresponding Liftable instance.
Translates Elem to the corresponding Liftable instance.
- eWT
type descriptor
- Definition Classes
- GraphBuilding
-
implicit
def
liftableThunk[ST, T](implicit lT: Liftable[ST, T]): Liftable[SThunk[ST], Thunk[T]]
- Definition Classes
- Thunks
-
val
lock: ReentrantLock
Can be used to synchronize access to this IR object from multiple threads.
Can be used to synchronize access to this IR object from multiple threads.
- Definition Classes
- IRContext
-
def
logWarn(msg: ⇒ String): Unit
Log warning message to the log.
Log warning message to the log. This is default and simple implementation, which can be overriden.
- Definition Classes
- Base
-
def
matchAny(a1: Any, a2: Any, allowInexactMatch: Boolean, subst: Subst): Nullable[Subst]
- Attributes
- protected
- Definition Classes
- Functions
- def matchDefs(d1: Def[_], d2: Def[_], allowInexactMatch: Boolean, subst: Subst): Nullable[Subst]
-
def
matchExps(s1: Sym, s2: Sym, allowInexactMatch: Boolean, subst: Subst): Nullable[Subst]
- Attributes
- protected
- Definition Classes
- Functions
-
def
matchIterators(i1: Iterator[_], i2: Iterator[_], allowInexactMatch: Boolean, subst: Subst): Nullable[Subst]
- Attributes
- protected
- Definition Classes
- Functions
-
def
mirrorApply[A, B](lam: Lambda[A, B], s: Ref[A]): Ref[B]
- Definition Classes
- Functions
-
def
mkApply[A, B](f: Ref[(A) ⇒ B], x: Ref[A]): Ref[B]
- Definition Classes
- Functions
-
def
mkLambda[A, B, C](f: (Ref[A], Ref[B]) ⇒ Ref[C])(implicit eA: LElem[A], eB: LElem[B]): Ref[((A, B)) ⇒ C]
- Definition Classes
- Functions
-
def
mkLambda[A, B, C](f: (Ref[A]) ⇒ (Ref[B]) ⇒ Ref[C])(implicit eA: LElem[A], eB: Elem[B]): Ref[(A) ⇒ (B) ⇒ C]
- Definition Classes
- Functions
-
def
mkLambda[A, B](f: (Ref[A]) ⇒ Ref[B], mayInline: Boolean, alphaEquality: Boolean, keepOriginalFunc: Boolean)(implicit eA: LElem[A]): Ref[(A) ⇒ B]
- Definition Classes
- Functions
-
def
mkMethodCall(receiver: Sym, method: RMethod, args: Seq[AnyRef], neverInvoke: Boolean, isAdapterCall: Boolean, resultElem: Elem[_]): Sym
Creates new MethodCall node and returns its node ref.
Creates new MethodCall node and returns its node ref.
- Definition Classes
- MethodCalls
-
val
nInitialDefs: Int
- Definition Classes
- Base
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
newObjEx[A](args: Any*)(implicit eA: Elem[A]): Ref[A]
Creates new NewObject node and returns its node ref.
Creates new NewObject node and returns its node ref.
- Definition Classes
- MethodCalls
-
lazy val
noConstPropagationPass: DefaultPass
Pass configuration which is used to turn-off constant propagation.
Pass configuration which is used to turn-off constant propagation.
- Definition Classes
- IRContext
- See also
beginPass(noCostPropagationPass)
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
numeric[T](implicit arg0: ExactNumeric[T]): ExactNumeric[T]
Return an ExactNumeric for a given type T.
Return an ExactNumeric for a given type T.
- Definition Classes
- NumericOps
-
val
okMeasureOperationTime: Boolean
- Definition Classes
- GraphBuilding
-
def
okRegisterModules: Boolean
Whether staged modules should be registered when cake is constructed and initialized.
Whether staged modules should be registered when cake is constructed and initialized.
- Definition Classes
- Modules
-
def
onReset(): Unit
Called during resetContext() operation after the core context state has been reset.
Called during resetContext() operation after the core context state has been reset. Derived classes can override to define application specific initialization. Don't forget to call super method in the beginning of your overriding method.
- Attributes
- protected
- Definition Classes
- GraphBuilding → Library → Base
-
def
opCost(costedValue: Sym, args: Seq[Ref[Int]], opCost: Ref[Int]): Ref[Int]
- Definition Classes
- UniversalOps
-
def
opcodeToBinOp[A](opCode: Byte, eA: Elem[A]): BinOp[A, _]
- returns
binary operation for the given opCode and type
- Definition Classes
- GraphBuilding
-
def
opcodeToEndoBinOp[T](opCode: Byte, eT: Elem[T]): EndoBinOp[T]
- returns
binary operation for the given opCode and type
- Definition Classes
- GraphBuilding
-
implicit final
def
pairElement[A, B](implicit ea: Elem[A], eb: Elem[B]): Elem[(A, B)]
Implicitly defines element type for pairs.
Implicitly defines element type for pairs.
- Definition Classes
- TypeDescs
-
def
patternMatch(s1: Sym, s2: Sym): Nullable[Subst]
- Definition Classes
- Functions
-
def
placeholder[T](implicit eT: LElem[T]): Ref[T]
- Definition Classes
- Base
- Annotations
- @inline()
-
def
propagateBinOp[T, R](op: BinOp[T, R], x: Ref[T], y: Ref[T]): Ref[R]
Perform constant propagation if enabled and both arguments are Const.
Perform constant propagation if enabled and both arguments are Const.
- returns
null if propagation is not done
- Definition Classes
- DefRewriting
-
def
propagateUnOp[T, R](op: UnOp[T, R], x: Ref[T]): Ref[R]
Perform constant propagation if enabled and argument is Const.
Perform constant propagation if enabled and argument is Const.
- returns
null if propagation is not done
- Definition Classes
- DefRewriting
-
def
registerEntityObject(name: String, obj: EntityObject): Unit
- Attributes
- protected
- Definition Classes
- Base
-
def
registerModule(moduleInfo: ModuleInfo): Unit
Called once for each staged module during this cake initialization.
Called once for each staged module during this cake initialization.
- Attributes
- protected
- Definition Classes
- Modules
-
implicit
def
reifyObject[A](obj: Def[A]): Ref[A]
Implicit injection of new definition (graph node) into universum of nodes with collapsing semantics.
Implicit injection of new definition (graph node) into universum of nodes with collapsing semantics. If there exists node
n
in this IR such thatobj equals n
, then the value ofn.self
is returned, i.e. the new nodeobj
is collapsed with already existing one. This has an effect of Common Subexpression Elimination (CSE) when an expression tree is transformed to the graph and identical subtrees are collapsed. After a reference to the node is obtained, global rewriting rules are examined and the reference may be replaced with a new one.- Definition Classes
- Base
-
def
removeIsProven[T, R](f: (Ref[T]) ⇒ Ref[R]): (Ref[T]) ⇒ Ref[R]
If
f
returnsisValid
graph node, then it is filtered out.If
f
returnsisValid
graph node, then it is filtered out.- Definition Classes
- GraphBuilding
-
implicit
def
repOrderingToOrderingOps[T](x: Ref[T])(implicit n: ExactOrdering[T]): OrderingOpsCls[T]
- Definition Classes
- OrderingOps
-
implicit
def
repToThunk[A](block: Ref[A]): Ref[Thunk[A]]
- Definition Classes
- Thunks
- def resetContext(): Unit
-
final
def
rewriteBinOp[A, R](op: BinOp[A, R], x: Ref[A], y: Ref[A]): Ref[_]
Rewrites application of given binary operation to the given arguments.
Rewrites application of given binary operation to the given arguments.
- returns
null if no rewriting is defined.
- Definition Classes
- DefRewriting
-
final
def
rewriteBoolConsts(lhs: Sym, rhs: Sym, ifTrue: (Sym) ⇒ Sym, ifFalse: (Sym) ⇒ Sym, ifEqual: (Sym) ⇒ Sym, ifNegated: (Sym) ⇒ Sym): Sym
Helper method which defines rewriting rules with boolean constants.
Helper method which defines rewriting rules with boolean constants.
- Definition Classes
- LogicalOps
- Annotations
- @inline()
-
def
rewriteDef[T](d: Def[T]): Ref[_]
For performance reasons the patterns are organized in special (non-declarative) way.
For performance reasons the patterns are organized in special (non-declarative) way. Unfortunately, this is less readable, but gives significant performance boost Look at comments to understand the logic of the rules.
HOTSPOT: executed for each node of the graph, don't beautify.
- d
node to be matched against rewrite patterns
- returns
reference of new node if RW pattern is found and applied null if no rewriting is defined.
- Definition Classes
- GraphBuilding → Library → DefRewriting
-
def
rewriteNonInvokableMethodCall(mc: MethodCall): Ref[_]
This method is called for each MethodCall node which is about to be added to the graph.
This method is called for each MethodCall node which is about to be added to the graph. This means
mc
has been examined by all the rewrite rules, but has not need rewritten. Now, if this method returns null, then mc will be added to the graph. However, in this method,mc
can be examined by a second set of RW rules (kind of lower priority rules). These rules kind of context dependent, because at this point we know that the first RW set didn't triggered any rewrite.- Definition Classes
- MethodCalls
-
final
def
rewriteUnOp[A, R](op: UnOp[A, R], x: Ref[A]): Ref[_]
Rewrites application of given unary operation to the given argument.
Rewrites application of given unary operation to the given argument.
- returns
null if no rewriting is defined.
- Definition Classes
- DefRewriting
-
val
saveGraphsInFile: Boolean
Whether to save calcF and costF graphs in the file given by ScriptNameProp environment variable
Whether to save calcF and costF graphs in the file given by ScriptNameProp environment variable
- Definition Classes
- GraphBuilding
-
def
sigmaDslBuilder: Ref[SigmaDslBuilder]
During compilation represent a global value Global, see also SGlobal type.
During compilation represent a global value Global, see also SGlobal type.
- Definition Classes
- GraphBuilding → SigmaLibrary
- Annotations
- @inline()
-
val
sigmaDslBuilderValue: CostingSigmaDslBuilder.type
The value of Global ErgoTree operation
The value of Global ErgoTree operation
- Definition Classes
- IRContext
-
def
sizeOf[T](value: Ref[T]): Ref[Long]
- Definition Classes
- UniversalOps
-
def
specialPredef: Ref[WSpecialPredefCompanionCtor]
- Definition Classes
- Library
-
def
stagingExceptionMessage(message: String, syms: Seq[Ref[_]]): String
Prettyprint exception message
Prettyprint exception message
- Attributes
- protected
- Definition Classes
- Base
-
def
stypeToElem[T <: SType](t: T): Elem[GraphBuilding.stypeToElem.T.WrappedType]
Translates SType descriptor to Elem descriptor used in graph IR.
Translates SType descriptor to Elem descriptor used in graph IR. Should be inverse to
elemToSType
.- Definition Classes
- GraphBuilding
-
val
substFromCostTable: Boolean
Whether to create CostOf nodes or substutute costs from CostTable as constants in the graph.
Whether to create CostOf nodes or substutute costs from CostTable as constants in the graph. true - substitute; false - create CostOf nodes
- Definition Classes
- GraphBuilding
-
implicit final
def
sumElement[A, B](implicit ea: Elem[A], eb: Elem[B]): Elem[|[A, B]]
Implicitly defines element type for sum types.
Implicitly defines element type for sum types.
- Definition Classes
- TypeDescs
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
throwInvocationException(whatFailed: String, cause: Throwable, receiver: Sym, m: RMethod, args: Seq[Any]): Nothing
- Definition Classes
- MethodCalls
-
implicit
val
thunkCont: Cont[Thunk]
Thunk is an instance of container type class Cont.
Thunk is an instance of container type class Cont.
- Definition Classes
- Thunks
-
implicit
def
thunkElement[T](implicit eItem: Elem[T]): Elem[Thunk[T]]
Implicitly defines element type for thunks (aka lazy values).
Implicitly defines element type for thunks (aka lazy values).
- Definition Classes
- Thunks
-
val
thunkStack: ThunkStack
- Attributes
- protected
- Definition Classes
- Thunks
-
def
thunk_create[A](block: ⇒ Ref[A]): Ref[Thunk[A]]
Constructs a new thunk node by executing the given
block
and collecting all the graph node created along the way.Constructs a new thunk node by executing the given
block
and collecting all the graph node created along the way. This methods: 1) starts a new nested ThunkScope, 2) executes theblock
to obtain resulting graph node 3) schedule thunk body for execution order 4) adds a new ThunkDef node and returns its reference.- returns
a reference to the newly created ThunkDef node
- Definition Classes
- Thunks
-
def
thunk_force[A](t: Th[A]): Ref[A]
Logical force of the thunk.
Logical force of the thunk. Depending on isInlineThunksOnForce it either inlines the thunk body or creates a new ThunkForce node.
- returns
a reference to the graph node, which represent the result of the thunk's evaluation.
- Definition Classes
- Thunks
-
def
thunk_map[A, B](t: Th[A], f: Ref[(A) ⇒ B]): Th[B]
- Definition Classes
- Thunks
-
def
thunk_map1[A, B](t: Th[A], f: (Ref[A]) ⇒ Ref[B]): Th[B]
- Definition Classes
- Thunks
-
def
toExp[T](d: Def[T], newSym: ⇒ Ref[T]): Ref[T]
Updates the universe of symbols and definitions, then rewrites until fix-point
Updates the universe of symbols and definitions, then rewrites until fix-point
- d
A new graph node to add to the universe
- newSym
A symbol that will be used if d doesn't exist in the universe
- returns
The symbol of the graph which is semantically(up to rewrites) equivalent to d
-
implicit final
def
toLazyElem[A](implicit eA: Elem[A]): LElem[A]
- Definition Classes
- TypeDescs
-
def
toRep[A](x: A)(implicit eA: Elem[A]): Ref[A]
Lifting of data values to IR nodes.
Lifting of data values to IR nodes.
- Definition Classes
- Base
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
def
transformProductParam(x: Any, t: Transformer): Any
Transforms this object into new one by applying
t
to every Ref inside its structure.Transforms this object into new one by applying
t
to every Ref inside its structure. The structure is build out of Seq, Array, Option and Def values. Other structure items remain unchanged and copied to the new instance. HOTSPOT: don't beautify the code- Attributes
- protected
- Definition Classes
- Base
-
def
tryConvert[From, To](eFrom: Elem[From], eTo: Elem[To], x: Ref[Def[_]], conv: Ref[(From) ⇒ To]): Ref[To]
- Definition Classes
- UniversalOps
-
val
tuplesCache: AVHashMap[Ref[_], (Ref[_], Ref[_])]
- Definition Classes
- Tuples
-
def
unfoldLambda[A, B](f: Ref[(A) ⇒ B], x: Ref[A]): Ref[B]
- Definition Classes
- Functions
-
def
unfoldLambda[A, B](lam: Lambda[A, B], x: Ref[A]): Ref[B]
- Definition Classes
- Functions
-
val
unfoldWithOriginalFunc: Boolean
Turns on/off lambda unfolding using original function
f
stored in the Lambda node.Turns on/off lambda unfolding using original function
f
stored in the Lambda node. If this flag isfalse
then this function cannot be used even if it is present in the node.- Definition Classes
- Functions
-
def
unrefDelegate[T <: AnyRef](x: Ref[T])(implicit ct: ClassTag[T]): T
Create delegate instance suitable for method invocation.
Create delegate instance suitable for method invocation. It is used when T is a class or a trait and the node referred by x doesn't conform to T. This method returns dynamically constructed instance, which conforms to T. Whenever a method of T is called on that instance, the call is intercepted and
DelegatedInterceptionHandler.invoke
method is called, then a new MethodCall can be constructed (which is befavior by default).- Attributes
- protected
- Definition Classes
- MethodCalls
-
def
unzipPair[A, B](p: Ref[(A, B)]): (Ref[A], Ref[B])
- Definition Classes
- Tuples
-
def
upcast[To](value: Ref[_])(implicit arg0: Elem[To]): Ref[To]
- Definition Classes
- UniversalOps
-
def
upcastFun[A, B >: A](implicit arg0: Elem[A]): Ref[(A) ⇒ B]
- Definition Classes
- Functions
-
final
def
updateSymbolTable[T](s: Ref[T], d: Def[T]): Ref[T]
Create or find symbol (node Ref) which refers to the given node in the table of all created symbols.
Create or find symbol (node Ref) which refers to the given node in the table of all created symbols. The d.nodeId is the index in the _symbolTable which is DBuffer (backed by Array)
- returns
new of existing symbol HOTSPOT: the method should be allocation-free (make it sure by examining the generated Java code)
- Definition Classes
- Base
-
val
useAlphaEquality: Boolean
Global lambda equality mode used by default.
Global lambda equality mode used by default. It is used in
fun
andfun2
lambda builders. If this flag istrue
then Lambda nodes are equal if they are the same up to renaming of symbols. (see Lambda.equals()). Each Lambda node has independent equality mode flag which is setup in the constructor.- Definition Classes
- Functions
-
final
def
valueFromRep[A](x: Ref[A]): A
Extract data value from Const node or throw an exception.
Extract data value from Const node or throw an exception.
- Definition Classes
- Base
- Annotations
- @inline()
-
def
variable[T](implicit eT: LElem[T]): Ref[T]
- Definition Classes
- Base
- Annotations
- @inline()
-
def
verifyIsProven[T](f: Ref[(Context) ⇒ T]): Try[Unit]
Checks that if SigmaProp.isProven method calls exists in the given Lambda's schedule, then it is the last operation.
Checks that if SigmaProp.isProven method calls exists in the given Lambda's schedule, then it is the last operation.
- Definition Classes
- IRContext
-
implicit
lazy val
wRTypeAnyElement: Elem[WRType[Any]]
- Definition Classes
- SigmaLibrary
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
implicit
def
zipPair[A, B](p: (Ref[A], Ref[B])): Ref[(A, B)]
- Definition Classes
- Tuples
-
object
AllOf
Recognizer of SigmaDslBuilder.allOf method call in Graph-IR.
Recognizer of SigmaDslBuilder.allOf method call in Graph-IR. This method call represents
allOf
predefined function.- Definition Classes
- GraphBuilding
-
object
AllZk
Recognizer of SigmaDslBuilder.allZK method call in Graph-IR.
Recognizer of SigmaDslBuilder.allZK method call in Graph-IR. This method call represents
allZK
predefined function.- Definition Classes
- GraphBuilding
-
object
AnyOf
Recognizer of SigmaDslBuilder.anyOf method call in Graph-IR.
Recognizer of SigmaDslBuilder.anyOf method call in Graph-IR. This method call represents
anyOf
predefined function.- Definition Classes
- GraphBuilding
-
object
AnyZk
Recognizer of SigmaDslBuilder.anyZK method call in Graph-IR.
Recognizer of SigmaDslBuilder.anyZK method call in Graph-IR. This method call represents
anyZK
predefined function.- Definition Classes
- GraphBuilding
-
object
HasSigmas
Pattern match extractor which recognizes
isValid
nodes among items.Pattern match extractor which recognizes
isValid
nodes among items.- returns
None
if there is noisValid
node among itemsSome((bs, ss)) if there are
isValidnodes where
ssare
SigmaProparguments of those nodes and
bscontains all the other nodes.
- Definition Classes
- GraphBuilding
-
object
IsArithOp
Recognizes arithmetic operation of graph IR and returns its ErgoTree code.
Recognizes arithmetic operation of graph IR and returns its ErgoTree code.
- Definition Classes
- TreeBuilding
-
object
IsConstantDef
Recognizes constants in graph IR.
Recognizes constants in graph IR.
- Definition Classes
- TreeBuilding
-
object
IsContextProperty
Recognizes context property in the graph IR and returns the corresponding ErgoTree node.
Recognizes context property in the graph IR and returns the corresponding ErgoTree node.
- Definition Classes
- TreeBuilding
-
object
IsInternalDef
Recognizes special graph IR nodes which typically have many usages, but for which no ValDefs should be created.
Recognizes special graph IR nodes which typically have many usages, but for which no ValDefs should be created.
- Definition Classes
- TreeBuilding
-
object
IsLogicalBinOp
Recognizes logical binary operation of graph IR and returns the corresponding ErgoTree builder function.
Recognizes logical binary operation of graph IR and returns the corresponding ErgoTree builder function.
- Definition Classes
- TreeBuilding
-
object
IsLogicalUnOp
Recognizes unary logical operation of graph IR and returns the corresponding ErgoTree builder function.
Recognizes unary logical operation of graph IR and returns the corresponding ErgoTree builder function.
- Definition Classes
- TreeBuilding
-
object
IsNumericUnOp
Recognizes unary numeric operation of graph IR and returns the corresponding ErgoTree builder function.
Recognizes unary numeric operation of graph IR and returns the corresponding ErgoTree builder function.
- Definition Classes
- TreeBuilding
-
object
IsRelationOp
Recognizes comparison operation of graph IR and returns the corresponding ErgoTree builder function.
Recognizes comparison operation of graph IR and returns the corresponding ErgoTree builder function.
- Definition Classes
- TreeBuilding
-
object
Coll extends scalan.Library.CollCls
- Definition Classes
- CollsDefs
-
object
CollBuilder extends scalan.Library.EntityObject
- Definition Classes
- CollsDefs
-
object
AvlTree extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
BigInt extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
Box extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
Context extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
GroupElement extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
Header extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
PreHeader extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
SigmaDslBuilder extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
SigmaProp extends scalan.SigmaLibrary.EntityObject
- Definition Classes
- SigmaDslDefs
-
object
WOption extends special.wrappers.WrappersModule.WOptionCls
- Definition Classes
- WOptionsDefs
-
object
WRType extends special.wrappers.WrappersModule.WRTypeCls
- Definition Classes
- WRTypesDefs
-
object
WSpecialPredef extends special.wrappers.WrappersModule.EntityObject
- Definition Classes
- WSpecialPredefsDefs