| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
PlutusCore.Evaluation.Machine.CostingFun.Core
Synopsis
- data CostingFun model = CostingFun {
- costingFunCpu :: model
- costingFunMemory :: model
- class UnimplementedCostingFun a where
- unimplementedCostingFun :: b -> CostingFun a
- newtype Intercept = Intercept {}
- newtype Slope = Slope {}
- newtype Coefficient0 = Coefficient0 {}
- newtype Coefficient1 = Coefficient1 {}
- newtype Coefficient2 = Coefficient2 {}
- newtype Coefficient00 = Coefficient00 {}
- newtype Coefficient10 = Coefficient10 {}
- newtype Coefficient01 = Coefficient01 {}
- newtype Coefficient20 = Coefficient20 {}
- newtype Coefficient11 = Coefficient11 {}
- newtype Coefficient02 = Coefficient02 {}
- newtype Coefficient12 = Coefficient12 {}
- data OneVariableLinearFunction = OneVariableLinearFunction {}
- data OneVariableQuadraticFunction = OneVariableQuadraticFunction {}
- data TwoVariableLinearFunction = TwoVariableLinearFunction {}
- data TwoVariableQuadraticFunction = TwoVariableQuadraticFunction {
- twoVariableQuadraticFunctionMinimum :: CostingInteger
- twoVariableQuadraticFunctionC00 :: Coefficient00
- twoVariableQuadraticFunctionC10 :: Coefficient10
- twoVariableQuadraticFunctionC01 :: Coefficient01
- twoVariableQuadraticFunctionC20 :: Coefficient20
- twoVariableQuadraticFunctionC11 :: Coefficient11
- twoVariableQuadraticFunctionC02 :: Coefficient02
- data TwoVariableWithInteractionFunction = TwoVariableWithInteractionFunction {}
- data ExpModCostingFunction = ExpModCostingFunction {}
- data ModelSubtractedSizes = ModelSubtractedSizes {}
- data ModelConstantOrLinear = ModelConstantOrLinear {}
- data ModelConstantOrOneArgument = ModelConstantOrOneArgument {}
- data ModelConstantOrTwoArguments = ModelConstantOrTwoArguments {}
- data ModelOneArgument
- data ModelTwoArguments
- = ModelTwoArgumentsConstantCost CostingInteger
- | ModelTwoArgumentsLinearInX OneVariableLinearFunction
- | ModelTwoArgumentsLinearInY OneVariableLinearFunction
- | ModelTwoArgumentsLinearInXAndY TwoVariableLinearFunction
- | ModelTwoArgumentsAddedSizes OneVariableLinearFunction
- | ModelTwoArgumentsSubtractedSizes ModelSubtractedSizes
- | ModelTwoArgumentsMultipliedSizes OneVariableLinearFunction
- | ModelTwoArgumentsMinSize OneVariableLinearFunction
- | ModelTwoArgumentsMaxSize OneVariableLinearFunction
- | ModelTwoArgumentsLinearOnDiagonal ModelConstantOrLinear
- | ModelTwoArgumentsConstOffDiagonal ModelConstantOrOneArgument
- | ModelTwoArgumentsConstAboveDiagonal ModelConstantOrTwoArguments
- | ModelTwoArgumentsConstBelowDiagonal ModelConstantOrTwoArguments
- | ModelTwoArgumentsQuadraticInY OneVariableQuadraticFunction
- | ModelTwoArgumentsQuadraticInXAndY TwoVariableQuadraticFunction
- | ModelTwoArgumentsWithInteractionInXAndY TwoVariableWithInteractionFunction
- data ModelThreeArguments
- = ModelThreeArgumentsConstantCost CostingInteger
- | ModelThreeArgumentsLinearInX OneVariableLinearFunction
- | ModelThreeArgumentsLinearInY OneVariableLinearFunction
- | ModelThreeArgumentsLinearInZ OneVariableLinearFunction
- | ModelThreeArgumentsQuadraticInZ OneVariableQuadraticFunction
- | ModelThreeArgumentsLiteralInYOrLinearInZ OneVariableLinearFunction
- | ModelThreeArgumentsLinearInMaxYZ OneVariableLinearFunction
- | ModelThreeArgumentsLinearInYAndZ TwoVariableLinearFunction
- | ModelThreeArgumentsQuadraticInYAndZ TwoVariableQuadraticFunction
- | ModelThreeArgumentsExpModCost ExpModCostingFunction
- data ModelFourArguments
- data ModelFiveArguments = ModelFiveArgumentsConstantCost CostingInteger
- data ModelSixArguments = ModelSixArgumentsConstantCost CostingInteger
- runCostingFunOneArgument :: ExMemoryUsage a1 => CostingFun ModelOneArgument -> a1 -> ExBudgetStream
- runCostingFunTwoArguments :: (ExMemoryUsage a1, ExMemoryUsage a2) => CostingFun ModelTwoArguments -> a1 -> a2 -> ExBudgetStream
- runCostingFunThreeArguments :: (ExMemoryUsage a1, ExMemoryUsage a2, ExMemoryUsage a3) => CostingFun ModelThreeArguments -> a1 -> a2 -> a3 -> ExBudgetStream
- runCostingFunFourArguments :: (ExMemoryUsage a1, ExMemoryUsage a2, ExMemoryUsage a3, ExMemoryUsage a4) => CostingFun ModelFourArguments -> a1 -> a2 -> a3 -> a4 -> ExBudgetStream
- runCostingFunFiveArguments :: (ExMemoryUsage a1, ExMemoryUsage a2, ExMemoryUsage a3, ExMemoryUsage a4, ExMemoryUsage a5) => CostingFun ModelFiveArguments -> a1 -> a2 -> a3 -> a4 -> a5 -> ExBudgetStream
- runCostingFunSixArguments :: (ExMemoryUsage a1, ExMemoryUsage a2, ExMemoryUsage a3, ExMemoryUsage a4, ExMemoryUsage a5, ExMemoryUsage a6) => CostingFun ModelSixArguments -> a1 -> a2 -> a3 -> a4 -> a5 -> a6 -> ExBudgetStream
- class Eq a => Hashable a
Documentation
data CostingFun model #
A type of costing functions parametric over a model type. In practice the we have one model type `ModelNArguments` for every N, where N is the arity of the builtin whose costs we want to model. Each model type has a number of constructors defining different "shapes" of N-parameter functions which calculate a cost given the sizes of the builtin's arguments.
Constructors
| CostingFun | |
Fields
| |
Instances
class UnimplementedCostingFun a where #
In the initial stages of implementing a new builtin it is necessary to
provide a temporary costing function which is used until the builtin has been
properly costed: `see CostModelGeneration.md`. Each `ModelNArguments` type
defines an instance of this class where unimplementedCostingFun is a
constant costing function which returns a very high cost for all inputs.
This prevents new functions from being used in situations where costs are
important until a sensible costing function has been implemented.
Methods
unimplementedCostingFun :: b -> CostingFun a #
Instances
A wrapped CostingInteger that is supposed to be used as an intercept.
Constructors
| Intercept | |
Fields | |
Instances
| ToJSON Slope # | |
Defined in PlutusCore.Evaluation.Machine.CostingFun.JSON Methods toEncoding :: Slope -> Encoding toJSONList :: [Slope] -> Value toEncodingList :: [Slope] -> Encoding | |
| Generic Slope # | |
| Num Slope # | |
| Show Slope # | |
| NFData Slope # | |
| Eq Slope # | |
| Lift Slope # | |
| type Rep Slope # | |
Defined in PlutusCore.Evaluation.Machine.CostingFun.Core type Rep Slope = D1 ('MetaData "Slope" "PlutusCore.Evaluation.Machine.CostingFun.Core" "plutus-core-1.60.0.0-inplace" 'True) (C1 ('MetaCons "Slope" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSlope") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 CostingInteger))) | |
newtype Coefficient0 #
A wrapped CostingInteger that is supposed to be used as the degree 0
coefficient of a polynomial.
Constructors
| Coefficient0 | |
Fields | |
Instances
newtype Coefficient1 #
A wrapped CostingInteger that is supposed to be used as the degree 1
coefficient of a polynomial.
Constructors
| Coefficient1 | |
Fields | |
Instances
newtype Coefficient2 #
A wrapped CostingInteger that is supposed to be used as the degree 2
coefficient of a polynomial.
Constructors
| Coefficient2 | |
Fields | |
Instances
newtype Coefficient00 #
A wrapped CostingInteger that is supposed to be used as the degree (0,0)
coefficient of a two-variable polynomial.
Constructors
| Coefficient00 | |
Fields | |
Instances
newtype Coefficient10 #
A wrapped CostingInteger that is supposed to be used as the degree (1,0)
coefficient of a two-variable polynomial.
Constructors
| Coefficient10 | |
Fields | |
Instances
newtype Coefficient01 #
A wrapped CostingInteger that is supposed to be used as the degree (0,1)
coefficient of a two-variable polynomial.
Constructors
| Coefficient01 | |
Fields | |
Instances
newtype Coefficient20 #
A wrapped CostingInteger that is supposed to be used as the degree (2,0)
coefficient of a two-variable polynomial.
Constructors
| Coefficient20 | |
Fields | |
Instances
newtype Coefficient11 #
A wrapped CostingInteger that is supposed to be used as the degree (1,1)
coefficient of a two-variable polynomial.
Constructors
| Coefficient11 | |
Fields | |
Instances
newtype Coefficient02 #
A wrapped CostingInteger that is supposed to be used as the degree (0,2)
coefficient of a two-variable polynomial.
Constructors
| Coefficient02 | |
Fields | |
Instances
newtype Coefficient12 #
A wrapped CostingInteger that is supposed to be used as the degree (1,2)
coefficient of a two-variable polynomial.
Constructors
| Coefficient12 | |
Fields | |
Instances
data ExpModCostingFunction #
c00 + c01x*y + c12x*y^2
This is used only for expModInteger, whose costing is quite complex.
Constructors
| ExpModCostingFunction | |
Fields | |
Instances
| hashWithSalt.
If you are looking for Instances
| ||||