Safe Haskell | None |
---|---|
Language | Haskell2010 |
PlutusCore.Evaluation.Machine.MachineParameters
Synopsis
-
data
CostModel
machinecosts builtincosts =
CostModel
{
- _machineCostModel :: machinecosts
- _builtinCostModel :: builtincosts
- 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
MachineParameters
machinecosts term (uni ::
Type
->
Type
) (fun ::
Type
) =
MachineParameters
{
- machineCosts :: machinecosts
- builtinsRuntime :: BuiltinsRuntime fun (term uni fun)
- mkMachineParameters :: ( CostingPart uni fun ~ builtincosts, HasConstantIn uni (val uni fun), ToBuiltinMeaning uni fun) => UnliftingMode -> CostModel machinecosts builtincosts -> MachineParameters machinecosts val uni fun
Documentation
data CostModel machinecosts builtincosts Source #
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
|
machineCostModel :: forall machinecosts builtincosts machinecosts. Lens ( CostModel machinecosts builtincosts) ( CostModel machinecosts builtincosts) machinecosts machinecosts Source #
builtinCostModel :: forall machinecosts builtincosts builtincosts. Lens ( CostModel machinecosts builtincosts) ( CostModel machinecosts builtincosts) builtincosts builtincosts Source #
data MachineParameters machinecosts term (uni :: Type -> Type ) (fun :: Type ) Source #
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. The
term
type will be
CekValue when we're using this with the CEK machine.
Constructors
MachineParameters | |
Fields
|
Instances
Generic ( MachineParameters machinecosts term uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.MachineParameters Methods from :: MachineParameters machinecosts term uni fun -> Rep ( MachineParameters machinecosts term uni fun) x Source # to :: Rep ( MachineParameters machinecosts term uni fun) x -> MachineParameters machinecosts term uni fun Source # |
|
( NFData machinecosts, NFData fun) => NFData ( MachineParameters machinecosts term uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.MachineParameters Methods rnf :: MachineParameters machinecosts term uni fun -> () Source # |
|
NoThunks machinecosts => NoThunks ( MachineParameters machinecosts term uni fun) Source # | |
|
|
type Rep ( MachineParameters machinecosts term uni fun) Source # | |
Defined in PlutusCore.Evaluation.Machine.MachineParameters
type
Rep
(
MachineParameters
machinecosts term uni fun) =
D1
('
MetaData
"MachineParameters" "PlutusCore.Evaluation.Machine.MachineParameters" "plutus-core-1.0.0.1-76bWF9ZEWyb4eDyjHx0kCS" '
False
) (
C1
('
MetaCons
"MachineParameters" '
PrefixI
'
True
) (
S1
('
MetaSel
('
Just
"machineCosts") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedStrict
) (
Rec0
machinecosts)
:*:
S1
('
MetaSel
('
Just
"builtinsRuntime") '
NoSourceUnpackedness
'
NoSourceStrictness
'
DecidedStrict
) (
Rec0
(
BuiltinsRuntime
fun (term uni fun)))))
|
mkMachineParameters :: ( CostingPart uni fun ~ builtincosts, HasConstantIn uni (val uni fun), ToBuiltinMeaning uni fun) => UnliftingMode -> CostModel machinecosts builtincosts -> MachineParameters machinecosts val uni fun Source #
This just uses
toBuiltinsRuntime
function to convert a BuiltinCostModel to a BuiltinsRuntime.