scalus.sir.lowering

Members list

Packages

Type members

Classlikes

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
abstract class BaseRepresentationProxyLoweredValue(input: LoweredValue, val representation: LoweredValueRepresentation, val pos: SIRPosition) extends ProxyLoweredValue

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
Known subtypes

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
abstract class BuiltinApplyLoweredValue(val fun: Builtin, tp: SIRType, repr: LoweredValueRepresentation, inPos: SIRPosition, val args: LoweredValue*) extends ComplexLoweredValue

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
Known subtypes
trait ComplexLoweredValue(ownVars: Set[IdentifiableLoweredValue], subvalues: LoweredValue*) extends LoweredValue

ComplexLoweredValue is a base trait for lowered values that consist of multiple subvalues. ownVars - var that used in subvalues but defined in this value. (i.e. not propagated up in dominatedUplevelVars)

ComplexLoweredValue is a base trait for lowered values that consist of multiple subvalues. ownVars - var that used in subvalues but defined in this value. (i.e. not propagated up in dominatedUplevelVars)

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
Known subtypes
case class ConstantLoweredValue(sir: Const, representation: LoweredValueRepresentation) extends LoweredValue

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
case class DelayLoweredValue(input: LoweredValue, pos: SIRPosition) extends ProxyLoweredValue

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
case class DependendVariableLoweredValue(id: String, name: String, sir: Var, representation: LoweredValueRepresentation, rhs: LoweredValue, directDepended: Set[IdentifiableLoweredValue], directDependFrom: Set[IdentifiableLoweredValue]) extends IdentifiableLoweredValue

Represent a variable which is dependent on another variable. i.e. var x1 = (toOtherReperesentation(y))

Represent a variable which is dependent on another variable. i.e. var x1 = (toOtherReperesentation(y))

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Self type
case class ForceLoweredValue(input: LoweredValue, pos: SIRPosition) extends ProxyLoweredValue

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
sealed trait IdentifiableLoweredValue extends LoweredValue

Values with id which can be represented by variables (if needed).

Values with id which can be represented by variables (if needed).

Identificatin is id.

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
Known subtypes
case class IfThenElseLoweredValue(cond: LoweredValue, thenBranch: LoweredValue, elseBranch: LoweredValue, tp: SIRType, repr: LoweredValueRepresentation, inPos: SIRPosition) extends ComplexLoweredValue

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Representation for lambda function. By default, lanbda-s accept default reperesentation for input and output types. But when we pass functions to type-parametrized functions, then calling party does not know about real parameter types and can't use default representation, so pass parameters as packed data.

Representation for lambda function. By default, lanbda-s accept default reperesentation for input and output types. But when we pass functions to type-parametrized functions, then calling party does not know about real parameter types and can't use default representation, so pass parameters as packed data.

So, we translate higher-order functions to packed data representation when pass as arguments to type-parametrized functions.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
case class LocalScope(byId: Map[String, VariableLoweredValue], byName: Map[String, VariableLoweredValue])

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object LocalScope

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
LocalScope.type
trait LoweredValue

SEA of nodes - like representation. E.e. each value is node, which manage dependencies. LoweredValue:

SEA of nodes - like representation. E.e. each value is node, which manage dependencies. LoweredValue:

  • represents a value in lowered SIR, which is
  • a generator of a block of code with generate specific SIRType in specific representation. -- (representation is LoweredValueRepresentation, which can be term or data in specoific encoding)
  • some lowered values can be named (see IdentifiableLoweredValue and maintain a set of dependencies) The idea of SEA of nodes -- than we can generate code 'by need' based on dependencies. I.e. if value not used at all - code will not be generated, if value used once -- no intermediate construction will be created and code will be generated directly in place of usage. If value used multiple times -- it will be generated near the usage (i.e. in the nearest block, which contains all depended).

The idea of SEA of nodes described in the paper: Cliff Click. 1995. Global code motion/global value numbering. SIGPLAN Not. 30, 6 (June 1995), 246–257. "https://doi.org/10.1145/223428.207154"

We have a quite different code (non-SSA form, only dominators), but the main idea of relaxing order is the same,

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object LoweredValue

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

representation, depends on the type of the value.

representation, depends on the type of the value.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
object Lowering

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Lowering.type
class LoweringContext(var zCombinatorNeeded: Boolean, val decls: Map[String, DataDecl], var varIdSeq: Int, var scope: LocalScope, val plutusVersion: Int, val generateErrorTraces: Boolean, val uplcGeneratorPolicy: SIRType => SirTypeUplcGenerator, var typeUnifyEnv: Env, var debug: Boolean, var debugLevel: Int, var nestingLevel: Int)

Attributes

Supertypes
class Object
trait Matchable
class Any
case class LoweringException(msg: String, pos: SIRPosition, cause: Throwable) extends RuntimeException

Attributes

Supertypes
trait Product
trait Equals
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object Preprocess

Change in supplied SIR

Change in supplied SIR

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Preprocess.type
sealed trait PrimitiveRepresentation(val isPackedData: Boolean, val isDataCentric: Boolean) extends LoweredValueRepresentation

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Constant
object PackedData

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait ProductCaseClassRepresentation(val isPackedData: Boolean, val isDataCentric: Boolean) extends LoweredValueRepresentation

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object PackedDataMap
object PairData
object ProdDataList
object UplcConstr
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
trait ProxyLoweredValue(val origin: LoweredValue) extends LoweredValue

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
Known subtypes

A proxy which change only the representation of the input value (without changing the underlying generated code)

A proxy which change only the representation of the input value (without changing the underlying generated code)

Attributes

Companion
object
Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
object ScalusRuntime

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case class StaticLoweredValue(sir: AnnotatedSIR, term: Term, representation: LoweredValueRepresentation) extends LoweredValue

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait LoweredValue
class Object
trait Matchable
class Any
Show all
sealed trait SumCaseClassRepresentation(val isPackedData: Boolean, val isDataCentric: Boolean) extends LoweredValueRepresentation

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object DataConstr
object SumDataList
object UplcConstr
Show all

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
case class TermGenerationContext(generatedVars: Set[String], processUndefinedValues: Boolean, debug: Boolean)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class TypeRepresentationProxyLoweredValue(input: LoweredValue, inSirType: SIRType, val representation: LoweredValueRepresentation, inPos: SIRPosition) extends ProxyLoweredValue

A proxy which changes the input value to be specific type and representation.

A proxy which changes the input value to be specific type and representation.

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any
case class TypeVarRepresentation(isBuiltin: Boolean) extends LoweredValueRepresentation

TypeVarRepresentation is used for type variables. Usually this is a synonym for some other specific-type representation. When this is builtin type variable, it can be freely used in any type representation, but when it is not builtin (scala type-var) it can be used only with packed data representation.

TypeVarRepresentation is used for type variables. Usually this is a synonym for some other specific-type representation. When this is builtin type variable, it can be freely used in any type representation, but when it is not builtin (scala type-var) it can be used only with packed data representation.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
class VariableLoweredValue(val id: String, val name: String, val sir: Var, val representation: LoweredValueRepresentation, val otherRepresentations: Map[LoweredValueRepresentation, DependendVariableLoweredValue], val optRhs: Option[LoweredValue], val directDepended: Set[IdentifiableLoweredValue], val directDependFrom: Set[IdentifiableLoweredValue]) extends IdentifiableLoweredValue

Attributes

Supertypes
trait LoweredValue
class Object
trait Matchable
class Any