Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Monadic interface for writing Dynamic Logic properties.
This interface offers a much nicer experience than manipulating the
expressions it is implemented on top of, especially as it improves
readability. It's still possible to express properties as pure
expressions using the Internal
module
and it might make sense depending on the context and the kind of
properties one wants to express.
Synopsis
- data DL s a
- action :: (Typeable a, Eq (Action s a), Show (Action s a)) => Action s a -> DL s (Var a)
- failingAction :: (Typeable a, Eq (Action s a), Show (Action s a)) => Action s a -> DL s ()
- anyAction :: DL s ()
- anyActions :: Int -> DL s ()
- anyActions_ :: DL s ()
- stopping :: DL s ()
- weight :: Double -> DL s ()
- getSize :: DL s Int
- getModelStateDL :: DL s s
- getVarContextDL :: DL s VarContext
- forAllVar :: forall a s. Typeable a => DL s (Var a)
- assert :: String -> Bool -> DL s ()
- assertModel :: String -> (s -> Bool) -> DL s ()
- monitorDL :: (Property -> Property) -> DL s ()
- forAllQ :: Quantifiable q => q -> DL s (Quantifies q)
- forAllNonVariableQ :: QuantifyConstraints (HasNoVariables a) => Quantification a -> DL s a
- forAllDL :: (DynLogicModel s, Testable a) => DL s () -> (Actions s -> a) -> Property
- forAllMappedDL :: (DynLogicModel s, Testable a) => (rep -> DynLogicTest s) -> (DynLogicTest s -> rep) -> (Actions s -> srep) -> DL s () -> (srep -> a) -> Property
- forAllUniqueDL :: (DynLogicModel s, Testable a) => Annotated s -> DL s () -> (Actions s -> a) -> Property
- class StateModel s => DynLogicModel s where
- restricted :: Action s a -> Bool
- module Test.QuickCheck.DynamicLogic.Quantify
Documentation
The DL
monad provides a nicer interface to dynamic logic formulae than the plain API.
It's a continuation monad producing a DynFormula
formula, with a state component (with
variable context) threaded through.
anyActions :: Int -> DL s () Source #
anyActions_ :: DL s () Source #
getModelStateDL :: DL s s Source #
getVarContextDL :: DL s VarContext Source #
assert :: String -> Bool -> DL s () Source #
Fail if the boolean is False
.
Equivalent to
assert msg b = unless b (fail msg)
forAllQ :: Quantifiable q => q -> DL s (Quantifies q) Source #
Generate a random value using the given Quantification
(or list/tuple of quantifications).
Generated values will only shrink to smaller values that could also have been generated.
forAllNonVariableQ :: QuantifyConstraints (HasNoVariables a) => Quantification a -> DL s a Source #
Generate a random value using the given Quantification
(or list/tuple of quantifications).
Generated values will only shrink to smaller values that could also have been generated.
forAllMappedDL :: (DynLogicModel s, Testable a) => (rep -> DynLogicTest s) -> (DynLogicTest s -> rep) -> (Actions s -> srep) -> DL s () -> (srep -> a) -> Property Source #
forAllUniqueDL :: (DynLogicModel s, Testable a) => Annotated s -> DL s () -> (Actions s -> a) -> Property Source #
class StateModel s => DynLogicModel s where Source #
Restricted calls are not generated by AfterAny; they are included in tests explicitly using After in order to check specific properties at controlled times, so they are likely to fail if invoked at other times.
Nothing
restricted :: Action s a -> Bool Source #