Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
A JSON representation of costing functions for Plutus Core builtins which produces a simple cost model which can be used from Agda and other executables
Synopsis
- data LinearFunction = LinearFunction {}
- data TwoVariableLinearFunction = TwoVariableLinearFunction {}
- data OneVariableQuadraticFunction = OneVariableQuadraticFunction {}
- data TwoVariableQuadraticFunction = TwoVariableQuadraticFunction {}
- data Model
- = ConstantCost Integer
- | AddedSizes LinearFunction
- | MultipliedSizes LinearFunction
- | MinSize LinearFunction
- | MaxSize LinearFunction
- | LinearInX LinearFunction
- | LinearInY LinearFunction
- | LinearInZ LinearFunction
- | LiteralInYOrLinearInZ LinearFunction
- | LinearInMaxYZ LinearFunction
- | LinearInYAndZ TwoVariableLinearFunction
- | QuadraticInY OneVariableQuadraticFunction
- | QuadraticInZ OneVariableQuadraticFunction
- | QuadraticInXAndY TwoVariableQuadraticFunction
- | SubtractedSizes LinearFunction Integer
- | ConstAboveDiagonal Integer Model
- | ConstBelowDiagonal Integer Model
- | ConstOffDiagonal Integer Model
- data CpuAndMemoryModel = CpuAndMemoryModel {}
Documentation
data LinearFunction Source #
Instances
FromJSON LinearFunction Source # | |
Show LinearFunction Source # | |
Lift LinearFunction Source # | |
Defined in PlutusCore.Evaluation.Machine.CostingFun.SimpleJSON lift ∷ Quote m ⇒ LinearFunction → m Exp Source # liftTyped ∷ ∀ (m ∷ Type → Type). Quote m ⇒ LinearFunction → Code m LinearFunction Source # |
data TwoVariableLinearFunction Source #
Instances
data OneVariableQuadraticFunction Source #
Instances
data TwoVariableQuadraticFunction Source #
Instances
This type reflects what is actually in the JSON. The stuff in CostingFun.Core and CostingFun.JSON is much more rigid, allowing parsing only for the model types applicable to the various ModelNArguments types; it also requires entries for everything in DefaultFun. Using the type defined here allows us to be more flexible and parse stuff that's not exactly what's expected in builtinCostModel.json.
data CpuAndMemoryModel Source #
A CPU usage modelling function and a memory usage modelling function bundled together
Instances
FromJSON CpuAndMemoryModel Source # | |
Show CpuAndMemoryModel Source # | |
Lift CpuAndMemoryModel Source # | |
Defined in PlutusCore.Evaluation.Machine.CostingFun.SimpleJSON lift ∷ Quote m ⇒ CpuAndMemoryModel → m Exp Source # liftTyped ∷ ∀ (m ∷ Type → Type). Quote m ⇒ CpuAndMemoryModel → Code m CpuAndMemoryModel Source # |