Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data SymIndexF f = SymIndex {}
- utxos :: forall f. Lens' (SymIndexF f) (f (TxOut CtxUTxO Era))
- txIns :: forall f. Lens' (SymIndexF f) (f TxIn)
- tokens :: forall f. Lens' (SymIndexF f) (f AssetId)
- class HasSymbolicRep t where
- bmapConst :: FunctorB b => (forall a. f a -> c) -> b f -> Container b c
- mappendSymIndexF :: forall f. (AllBF Semigroup f SymIndexF, Show (SymIndexF f)) => (forall a. f a -> Set String) -> SymIndexF f -> SymIndexF f -> SymIndexF f
- type SymIndex = SymIndexF (Map String)
- symIndex :: HasSymbolicRep t => String -> t -> SymIndex
- type SymCreationIndex = SymIndexF (Const (Set String))
- toCreationIndex :: SymIndex -> SymCreationIndex
- createIndex :: forall t. HasSymbolicRep t => String -> SymCreationIndex
- showCreateIndex :: SymCreationIndex -> String
- type SymCollectionIndex = SymIndexF SymSet
- newtype SymSet t = SymSet {}
- symCollect :: HasSymbolicRep t => Symbolic t -> SymCollectionIndex
- makeSymCollection :: SymCreationIndex -> Var SymIndex -> SymCollectionIndex
- symCollectionSubset :: SymCollectionIndex -> SymCollectionIndex -> Bool
- data Symbolic t = Symbolic {}
- type SymbolicSemantics = forall t. HasSymbolicRep t => Symbolic t -> t
- getSymbolics :: forall t. HasSymbolicRep t => SymCreationIndex -> Var SymIndex -> Set (Symbolic t)
- lookupSymbolic :: HasSymbolicRep t => SymIndex -> Symbolic t -> Maybe t
- type SymToken = Symbolic AssetId
- type SymTxOut = Symbolic (TxOut CtxUTxO Era)
- type SymTxIn = Symbolic TxIn
- data SymValue = SymValue {
- symValMap :: Map SymToken Quantity
- actualValPart :: Value
- pPrintValue :: Value -> Doc
- pPrintAssetId :: AssetId -> Doc
- symIsZero :: SymValue -> Bool
- symLeq :: SymValue -> SymValue -> Bool
- toValue :: (SymToken -> AssetId) -> SymValue -> Value
- toSymVal :: (AssetId -> Maybe SymToken) -> Value -> SymValue
- inv :: SymValue -> SymValue
- class SymValueLike v where
- toSymValue :: v -> SymValue
- class TokenLike t where
- symAssetIdValueOf :: SymValue -> t -> Quantity
- symAssetIdValue :: t -> Quantity -> SymValue
Documentation
Instances
class HasSymbolicRep t where Source #
Instances
HasSymbolicRep TxIn Source # | |
HasSymbolicRep AssetId Source # | |
HasSymbolicRep (TxOut CtxUTxO Era) Source # | |
mappendSymIndexF :: forall f. (AllBF Semigroup f SymIndexF, Show (SymIndexF f)) => (forall a. f a -> Set String) -> SymIndexF f -> SymIndexF f -> SymIndexF f Source #
type SymIndex = SymIndexF (Map String) Source #
For an assumed variable, what's the mapping of String indices to underlying actual values. This is what is returned by a contract model action when it runs.
type SymCreationIndex = SymIndexF (Const (Set String)) Source #
For a given action, what are the String indices used to construct symbolic variables when this action ran. NOTE: this purposefully does not include the variable because we might want to fake the variable with `Var 0` in some cases. See comment somewhere for why this is safe...
createIndex :: forall t. HasSymbolicRep t => String -> SymCreationIndex Source #
type SymCollectionIndex = SymIndexF SymSet Source #
What symbolic variables have been created in a given run of the
Spec
monad?
Instances
Semigroup SymCollectionIndex Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics (<>) :: SymCollectionIndex -> SymCollectionIndex -> SymCollectionIndex Source # sconcat :: NonEmpty SymCollectionIndex -> SymCollectionIndex Source # stimes :: Integral b => b -> SymCollectionIndex -> SymCollectionIndex Source # | |
Show (Symbolic t) => Show (SymSet t) Source # | |
Generic (SymSet t) Source # | |
Semigroup (SymSet t) Source # | |
Monoid (SymSet t) Source # | |
type Rep (SymSet t) Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics type Rep (SymSet t) = D1 ('MetaData "SymSet" "Test.QuickCheck.ContractModel.Internal.Symbolics" "quickcheck-contractmodel-0.1.4.1-3bqn4RrQanG11zXTiHDaXF" 'True) (C1 ('MetaCons "SymSet" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSymSet") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Set (Symbolic t))))) |
symCollect :: HasSymbolicRep t => Symbolic t -> SymCollectionIndex Source #
makeSymCollection :: SymCreationIndex -> Var SymIndex -> SymCollectionIndex Source #
Instances
TokenLike SymToken Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics symAssetIdValueOf :: SymValue -> SymToken -> Quantity Source # symAssetIdValue :: SymToken -> Quantity -> SymValue Source # | |
Eq (Symbolic t) Source # | |
Ord (Symbolic t) Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics compare :: Symbolic t -> Symbolic t -> Ordering Source # (<) :: Symbolic t -> Symbolic t -> Bool Source # (<=) :: Symbolic t -> Symbolic t -> Bool Source # (>) :: Symbolic t -> Symbolic t -> Bool Source # (>=) :: Symbolic t -> Symbolic t -> Bool Source # | |
HasSymbolicRep t => Show (Symbolic t) Source # | |
HasVariables (Symbolic t) Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics getAllVariables :: Symbolic t -> Set (Any Var) | |
HasSymbolicRep t => HasSymbolics (Symbolic t) Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Model getAllSymbolics :: Symbolic t -> SymCollectionIndex Source # |
type SymbolicSemantics = forall t. HasSymbolicRep t => Symbolic t -> t Source #
getSymbolics :: forall t. HasSymbolicRep t => SymCreationIndex -> Var SymIndex -> Set (Symbolic t) Source #
lookupSymbolic :: HasSymbolicRep t => SymIndex -> Symbolic t -> Maybe t Source #
type SymToken = Symbolic AssetId Source #
A symbolic token is a token that is only available at runtime
type SymTxOut = Symbolic (TxOut CtxUTxO Era) Source #
A SymTxOut is a `TxOut CtxUTxO Era` that is only available at runtime
A symbolic value is a combination of a real value and a value associating symbolic tokens with an amount
SymValue | |
|
Instances
pPrintValue :: Value -> Doc Source #
pPrintAssetId :: AssetId -> Doc Source #
symLeq :: SymValue -> SymValue -> Bool Source #
Check if one symbolic value is less than or equal to another
toValue :: (SymToken -> AssetId) -> SymValue -> Value Source #
Using a semantics function for symbolic tokens, convert a SymValue to a Value
toSymVal :: (AssetId -> Maybe SymToken) -> Value -> SymValue Source #
Invert a sym token mapping to turn a Value into a SymValue, useful for error reporting
class SymValueLike v where Source #
toSymValue :: v -> SymValue Source #
Instances
SymValueLike Value Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics toSymValue :: Value -> SymValue Source # | |
SymValueLike SymValue Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics toSymValue :: SymValue -> SymValue Source # |
class TokenLike t where Source #
symAssetIdValueOf :: SymValue -> t -> Quantity Source #
Get the value of a specific token in a SymValue
symAssetIdValue :: t -> Quantity -> SymValue Source #
Convert a token and an amount to a SymValue
Instances
TokenLike AssetId Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics symAssetIdValueOf :: SymValue -> AssetId -> Quantity Source # symAssetIdValue :: AssetId -> Quantity -> SymValue Source # | |
TokenLike SymToken Source # | |
Defined in Test.QuickCheck.ContractModel.Internal.Symbolics symAssetIdValueOf :: SymValue -> SymToken -> Quantity Source # symAssetIdValue :: SymToken -> Quantity -> SymValue Source # |