scalus.uplc.eval

Members list

Type members

Classlikes

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
case class BuiltinCostModel(addInteger: DefaultCostingFun[TwoArguments], subtractInteger: DefaultCostingFun[TwoArguments], multiplyInteger: DefaultCostingFun[TwoArguments], divideInteger: DefaultCostingFun[TwoArguments], quotientInteger: DefaultCostingFun[TwoArguments], remainderInteger: DefaultCostingFun[TwoArguments], modInteger: DefaultCostingFun[TwoArguments], equalsInteger: DefaultCostingFun[TwoArguments], lessThanInteger: DefaultCostingFun[TwoArguments], lessThanEqualsInteger: DefaultCostingFun[TwoArguments], appendByteString: DefaultCostingFun[TwoArguments], consByteString: DefaultCostingFun[TwoArguments], sliceByteString: DefaultCostingFun[ThreeArguments], lengthOfByteString: DefaultCostingFun[OneArgument], indexByteString: DefaultCostingFun[TwoArguments], equalsByteString: DefaultCostingFun[TwoArguments], lessThanByteString: DefaultCostingFun[TwoArguments], lessThanEqualsByteString: DefaultCostingFun[TwoArguments], sha2_256: DefaultCostingFun[OneArgument], sha3_256: DefaultCostingFun[OneArgument], blake2b_256: DefaultCostingFun[OneArgument], verifyEd25519Signature: DefaultCostingFun[ThreeArguments], verifyEcdsaSecp256k1Signature: DefaultCostingFun[ThreeArguments], verifySchnorrSecp256k1Signature: DefaultCostingFun[ThreeArguments], appendString: DefaultCostingFun[TwoArguments], equalsString: DefaultCostingFun[TwoArguments], encodeUtf8: DefaultCostingFun[OneArgument], decodeUtf8: DefaultCostingFun[OneArgument], ifThenElse: DefaultCostingFun[ThreeArguments], chooseUnit: DefaultCostingFun[TwoArguments], trace: DefaultCostingFun[TwoArguments], fstPair: DefaultCostingFun[OneArgument], sndPair: DefaultCostingFun[OneArgument], chooseList: DefaultCostingFun[ThreeArguments], mkCons: DefaultCostingFun[TwoArguments], headList: DefaultCostingFun[OneArgument], tailList: DefaultCostingFun[OneArgument], nullList: DefaultCostingFun[OneArgument], chooseData: DefaultCostingFun[SixArguments], constrData: DefaultCostingFun[TwoArguments], mapData: DefaultCostingFun[OneArgument], listData: DefaultCostingFun[OneArgument], iData: DefaultCostingFun[OneArgument], bData: DefaultCostingFun[OneArgument], unConstrData: DefaultCostingFun[OneArgument], unMapData: DefaultCostingFun[OneArgument], unListData: DefaultCostingFun[OneArgument], unIData: DefaultCostingFun[OneArgument], unBData: DefaultCostingFun[OneArgument], equalsData: DefaultCostingFun[TwoArguments], mkPairData: DefaultCostingFun[TwoArguments], mkNilData: DefaultCostingFun[OneArgument], mkNilPairData: DefaultCostingFun[OneArgument], serialiseData: DefaultCostingFun[OneArgument], blake2b_224: DefaultCostingFun[OneArgument], keccak_256: DefaultCostingFun[OneArgument], bls12_381_G1_add: DefaultCostingFun[TwoArguments], bls12_381_G1_neg: DefaultCostingFun[OneArgument], bls12_381_G1_scalarMul: DefaultCostingFun[TwoArguments], bls12_381_G1_equal: DefaultCostingFun[TwoArguments], bls12_381_G1_compress: DefaultCostingFun[OneArgument], bls12_381_G1_uncompress: DefaultCostingFun[OneArgument], bls12_381_G1_hashToGroup: DefaultCostingFun[TwoArguments], bls12_381_G2_add: DefaultCostingFun[TwoArguments], bls12_381_G2_neg: DefaultCostingFun[OneArgument], bls12_381_G2_scalarMul: DefaultCostingFun[TwoArguments], bls12_381_G2_equal: DefaultCostingFun[TwoArguments], bls12_381_G2_compress: DefaultCostingFun[OneArgument], bls12_381_G2_uncompress: DefaultCostingFun[OneArgument], bls12_381_G2_hashToGroup: DefaultCostingFun[TwoArguments], bls12_381_millerLoop: DefaultCostingFun[TwoArguments], bls12_381_mulMlResult: DefaultCostingFun[TwoArguments], bls12_381_finalVerify: DefaultCostingFun[TwoArguments], integerToByteString: IntegerToByteStringCostingFun, byteStringToInteger: DefaultCostingFun[TwoArguments])

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
class BuiltinError(builtin: DefaultFun, term: Term, cause: Throwable, env: CekValEnv) extends StackTraceMachineError

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class BuiltinException(msg: String) extends MachineError

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class CekMachine(val params: MachineParams, budgetSpender: BudgetSpender, logger: Logger, platformSpecific: PlatformSpecific) extends BuiltinsMeaning

CEK machine implementation based on Cardano Plutus CEK machine.

CEK machine implementation based on Cardano Plutus CEK machine.

The CEK machine is a stack-based abstract machine that is used to evaluate UPLC terms.

Value parameters

budgetSpender

The budget spender implementation

logger

The logger implementation

params

The machine parameters MachineParams

platformSpecific

The platform specific implementation of certain functions used by builtins

Attributes

See also
Note

The machine is stateless and can be reused for multiple evaluations. All the state is expected to be in the budgetSpender and logger implementations.

Example
 val term = LamAbs("x", Apply(Var(NamedDeBruijn("x", 0)), Var(NamedDeBruijn("x", 0))))
 val cek = new CekMachine(MachineParams.defaultParams, NoBudgetSpender, NoLogger, JVMPlatformSpecific)
 val res = cek.runCek(term)
Supertypes
class Object
trait Matchable
class Any
case class CekMachineCosts(startupCost: ExBudget, varCost: ExBudget, constCost: ExBudget, lamCost: ExBudget, delayCost: ExBudget, forceCost: ExBudget, applyCost: ExBudget, builtinCost: ExBudget, constrCost: ExBudget, caseCost: ExBudget)

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
class CekResult(t: Term, val budget: ExBudget, val logs: Array[String])

Attributes

Supertypes
class Object
trait Matchable
class Any
enum CekValue

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ConstantOrLinear(constant: CostingInteger, intercept: Intercept, slope: Slope)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ConstantOrOneArgument(constant: CostingInteger, model: OneArgument)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ConstantOrTwoArguments(constant: CostingInteger, model: TwoArguments)

Attributes

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

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait CostingFun

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class CountingBudgetSpender extends BudgetSpender

Attributes

Supertypes
class Object
trait Matchable
class Any
case class DefaultCostingFun[+M <: CostModel](cpu: M, memory: M) extends CostingFun

Attributes

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

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
case class ExBudget(cpu: ExCPU, memory: ExMemory)

Attributes

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

Attributes

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

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ExCPU

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ExCPU.type
object ExMemory

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
ExMemory.type
trait FiveArguments extends CostModel

Attributes

Companion
object
Supertypes
trait CostModel
class Object
trait Matchable
class Any
Known subtypes
class ConstantCost
object FiveArguments

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait FourArguments extends CostModel

Attributes

Companion
object
Supertypes
trait CostModel
class Object
trait Matchable
class Any
Known subtypes
class ConstantCost
object FourArguments

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type

When invoking integerToByteString built-in function, its second argument is a built-in Integer but with a different size measure, specifying the width (in bytes) of the output bytestring (zero-padded to the desired size). The memory consumed by the function is given by w, not the size of w. Its MemoryUsage is equal to the number of eight-byte words required to contain w bytes, allowing its costing function to work properly.

When invoking integerToByteString built-in function, its second argument is a built-in Integer but with a different size measure, specifying the width (in bytes) of the output bytestring (zero-padded to the desired size). The memory consumed by the function is given by w, not the size of w. Its MemoryUsage is equal to the number of eight-byte words required to contain w bytes, allowing its costing function to work properly.

Attributes

See also
Supertypes
trait Serializable
trait Product
trait Equals
trait CostingFun
class Object
trait Matchable
class Any
Show all
class KnownTypeUnliftingError(expected: DefaultUni, actual: CekValue) extends BuiltinException

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class Log extends Logger

Attributes

Supertypes
trait Logger
class Object
trait Matchable
class Any
trait Logger

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
class MachineError(msg: String) extends RuntimeException

Attributes

Supertypes
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
case class MachineParams(machineCosts: CekMachineCosts, builtinCostModel: BuiltinCostModel, semanticVariant: BuiltinSemanticsVariant)

The Plutus CEK machine parameters.

The Plutus CEK machine parameters.

Value parameters

builtinCostModel

The builtin cost model

machineCosts

The machine costs

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
trait MemoryUsage[A]

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object MemoryUsage

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class MissingCaseBranch(val tag: Long, env: CekValEnv) extends StackTraceMachineError

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
object NoLogger extends Logger

Attributes

Supertypes
trait Logger
class Object
trait Matchable
class Any
Self type
NoLogger.type

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
trait OneArgument extends CostModel

Attributes

Companion
object
Supertypes
trait CostModel
class Object
trait Matchable
class Any
Known subtypes
class ConstantCost
class LinearInX
object OneArgument

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class OneVariableLinearFunction(intercept: Intercept, slope: Slope)

Attributes

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

Attributes

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

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
class PlutusVM(platformSpecific: PlatformSpecific)

Plutus VM facade.

Plutus VM facade.

Value parameters

platformSpecific

The platform specific implementation of certain functions used by VM builtins

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object VM
final class RestrictingBudgetSpender(val maxBudget: ExBudget) extends BudgetSpender

Attributes

Supertypes
class Object
trait Matchable
class Any
enum Result

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait SixArguments extends CostModel

Attributes

Companion
object
Supertypes
trait CostModel
class Object
trait Matchable
class Any
Known subtypes
class ConstantCost
object SixArguments

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
class StackTraceMachineError(msg: String, val env: CekValEnv) extends MachineError

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
Known subtypes
enum StepKind

Attributes

Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class SubtractedSizesLinearFunction(intercept: Intercept, slope: Slope, minimum: CostingInteger)

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final class TallyingBudgetSpender(val budgetSpender: BudgetSpender) extends BudgetSpender

Attributes

Supertypes
class Object
trait Matchable
class Any
final class TallyingBudgetSpenderLogger(val budgetSpender: BudgetSpender) extends BudgetSpender, Logger

Attributes

Supertypes
trait Logger
class Object
trait Matchable
class Any
trait ThreeArguments extends CostModel

Attributes

Companion
object
Supertypes
trait CostModel
class Object
trait Matchable
class Any
Known subtypes
class ConstantCost
class LinearInX
class LinearInY
class LinearInZ
class QuadraticInZ
Show all

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
trait TwoArguments extends CostModel

Attributes

Companion
object
Supertypes
trait CostModel
class Object
trait Matchable
class Any
Known subtypes
object TwoArguments

Attributes

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
case class TwoVariableLinearFunction(intercept: Intercept, slopeX: Slope, slopeY: Slope)

Attributes

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

c00 + c10x + c01y + c20x^2 + c11cy + c02y^2

c00 + c10x + c01y + c20x^2 + c11cy + c02y^2

Attributes

Note

Minimum values for two-variable quadratic costing functions. Unlike most of our other costing functions our use cases for two-variable quadratic costing functions may require one or more negative coefficients, so there's a danger that we could return a negative cost. This is unlikely, but we make certain that it never happens by returning a result that is at never smaller than a minimum value that is stored along with the coefficients of the function.

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

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all

Attributes

Supertypes
class MachineError
class RuntimeException
class Exception
class Throwable
trait Serializable
class Object
trait Matchable
class Any
Show all
object VM extends PlutusVM

Attributes

Supertypes
class PlutusVM
class Object
trait Matchable
class Any
Self type
VM.type

Deprecated classlikes

object Cek

Attributes

Deprecated
true
Supertypes
class Object
trait Matchable
class Any
Self type
Cek.type

Types

type ArgStack = Seq[CekValue]
type CekValEnv = Seq[(String, CekValue)]
type CostingInteger = Long
opaque type ExCPU
opaque type ExMemory