plutus-core-1.60.0.0: Language library for Plutus Core
Safe HaskellSafe-Inferred
LanguageHaskell2010

PlutusCore.Evaluation.Machine.MachineParameters

Synopsis

Documentation

data CostModel machinecosts builtincosts #

We need to account for the costs of evaluator steps and also built-in function evaluation. The models for these have different structures and are used in different parts of the code, so inside the valuator we pass separate objects about most of the time . It's convenient for clients of the evaluator to only have to worry about a single object, so the CostModel type bundles the two together. We could conceivably have different evaluators with different internal costs, so we keep the machine costs abstract. The model for Cek machine steps is in UntypedPlutusCore.Evaluation.Machine.Cek.CekMachineCosts.

Constructors

CostModel 

Fields

Instances

Instances details
(Show machinecosts, Show builtincosts) => Show (CostModel machinecosts builtincosts) # 
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

Methods

showsPrec :: Int -> CostModel machinecosts builtincosts -> ShowS #

show :: CostModel machinecosts builtincosts -> String #

showList :: [CostModel machinecosts builtincosts] -> ShowS #

(Eq machinecosts, Eq builtincosts) => Eq (CostModel machinecosts builtincosts) # 
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

Methods

(==) :: CostModel machinecosts builtincosts -> CostModel machinecosts builtincosts -> Bool #

(/=) :: CostModel machinecosts builtincosts -> CostModel machinecosts builtincosts -> Bool #

machineCostModel :: forall machinecosts builtincosts machinecosts. Lens (CostModel machinecosts builtincosts) (CostModel machinecosts builtincosts) machinecosts machinecosts #

builtinCostModel :: forall machinecosts builtincosts builtincosts. Lens (CostModel machinecosts builtincosts) (CostModel machinecosts builtincosts) builtincosts builtincosts #

data MachineVariantParameters machineCosts fun val #

The part of MachineParameters that is individual for each semantics variant of DefaultFun.

CaserBuiltin isn't included, because it only explicitly depends on the protocol version and not the language version (even though there's an implicit dependency on the language version: older languages don't support Case in general, but it's safe to ignore that, because support for Case is controlled by the AST version, which is a separate check during deserialisation).

Constructors

MachineVariantParameters 

Fields

Instances

Instances details
Generic (MachineVariantParameters machineCosts fun val) # 
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

Associated Types

type ThunkInfo) #

showTypeOf :: Proxy (MachineVariantParameters machinecosts fun val) -> String #

type Rep (MachineVariantParameters machineCosts fun val) # 
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

type Rep (MachineVariantParameters machineCosts fun val) = D1 ('MetaData "MachineVariantParameters" "PlutusCore.Evaluation.Machine.MachineParameters" "plutus-core-1.60.0.0-inplace" 'False) (C1 ('MetaCons "MachineVariantParameters" 'PrefixI 'True) (S1 ('MetaSel ('Just "machineCosts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 machineCosts) :*: S1 ('MetaSel ('Just "builtinsRuntime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (BuiltinsRuntime fun val))))

data MachineParameters machineCosts fun val #

At execution time we need a BuiltinsRuntime object which includes both the cost model for builtins and their denotations. This bundles one of those together with the cost model for evaluator steps and a CaserBuiltin specifying how casing on values of built-in types works. The val type will be CekValue when we're using this with the CEK machine.

Instances

Instances details
Generic (MachineParameters machineCosts fun val) # 
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

Associated Types

type ThunkInfo) #

showTypeOf :: Proxy (MachineParameters machinecosts fun val) -> String #

type Rep (MachineParameters machineCosts fun val) # 
Instance details

Defined in PlutusCore.Evaluation.Machine.MachineParameters

type Rep (MachineParameters machineCosts fun val) = D1 ('MetaData "MachineParameters" "PlutusCore.Evaluation.Machine.MachineParameters" "plutus-core-1.60.0.0-inplace" 'False) (C1 ('MetaCons "MachineParameters" 'PrefixI 'True) (S1 ('MetaSel ('Just "machineCaserBuiltin") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (CaserBuiltin (UniOf val))) :*: S1 ('MetaSel ('Just "machineVariantParameters") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (MachineVariantParameters machineCosts fun val))))

mkMachineVariantParameters :: (CostingPart uni fun ~ builtincosts, HasMeaningIn uni val, ToBuiltinMeaning uni fun) => BuiltinSemanticsVariant fun -> CostModel machineCosts builtincosts -> MachineVariantParameters machineCosts fun val #

This just uses toBuiltinsRuntime function to convert a BuiltinCostModel to a BuiltinsRuntime.