A DynFormula may depend on the QuickCheck size parameter
Constructors
DynFormulaunDynFormula :: Int -> DynLogic s
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19
Modulequickcheck-dynamic-4.0.1Haskell2010
A DynFormula may depend on the QuickCheck size parameter
DynFormulaunDynFormula :: Int -> DynLogic sBase Dynamic logic formulae language.
Formulae are parameterised
over the type of state s to which they apply. A DynLogic value
cannot be constructed directly, one has to use the various "smart
constructors" provided, see the Building formulae section.
EmptySpecFalse
StopTrue
AfterAny (DynPred s)After any action the predicate should hold
Alt ChoiceType (DynLogic s) (DynLogic s)Choice (angelic or demonic)
Stopping (DynLogic s)Prefer this branch if trying to stop.
forall a. (Eq (Action s a), Show (Action s a), Typeable a) => After (ActionWithPolarity s a) (Var a -> DynPred s)After a specific action the predicate should hold
Error String (DynPred s)Weight Double (DynLogic s)Adjust the probability of picking a branch
forall a. QuantifyConstraints a => ForAll (Quantification a) (a -> DynLogic s)Generating a random value
Monitor (Property -> Property) (DynLogic s)Apply a QuickCheck property modifier (like tabulate or collect)
Eq ChoiceTypeDefined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalShow ChoiceTypeDefined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalIgnore this formula, i.e. backtrack and try something else. forAllScripts ignore (const True)
will discard all test cases (equivalent to False ==> True).
True for DL formulae.
Given f must be True given any state.
First-order quantification of variables.
Formula f is True iff. it is True for all possible values of q. The
underlying framework will generate values of q and check the formula holds
for those values. Quantifiable values are thus values that can be generated
and checked and the Test.QuickCheck.DynamicLogic.Quantify module defines
basic combinators to build those from building blocks.
Adjust weight for selecting formula.
This is mostly useful in relation with (|||) combinator, in order to tweak the
priority for generating the next step(s) of the test that matches the formula.
Get the current QuickCheck size parameter.
Prioritise doing this if we are trying to stop generation.
Successfully ends the test.
Ends test with given error message.
Embed QuickCheck's monitoring functions (eg. label, tabulate) in
a formula.
This is useful to improve the reporting from test execution, esp. in the
case of failures.
Formula should hold at any state.
In effect this leads to exploring alternatives from a given state s and ensuring
formula holds in all those states.
ErrorFail Stringforall a. (Typeable a, Eq (Action s a)) => ActionFail (ActionWithPolarity s a)StateModel s => Eq (FailingAction s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalStateModel s => Show (FailingAction s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalStateModel s => HasVariables (FailingAction s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalBadPrecondition (TestSequence s) (FailingAction s) (Annotated s)Looping (TestSequence s)Stuck (TestSequence s) (Annotated s)DLScript (TestSequence s)StateModel s => Show (DynLogicTest s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalFunctor WitnessesDefined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalFoldable WitnessesDefined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalTraversable WitnessesDefined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalEq r => Eq (Witnesses r)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalShow r => Show (Witnesses r)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalTestSeq (Witnesses (TestContinuation s))StateModel s => Eq (TestSequence s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalStateModel s => Show (TestSequence s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalContStep (Step s) (TestSequence s)ContStopStateModel s => Eq (TestContinuation s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.InternalStateModel s => Show (TestContinuation s)Defined in quickcheck-dynamic-4.0.1 · Test.QuickCheck.DynamicLogic.Internalpattern TestSeqWitness :: () => QuantifyConstraints a => a -> TestSequence s -> TestSequence sRestricted 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.
restricted :: Action s a -> BoolSimplest "execution" function for DynFormula. Turns a given a DynFormula paired with an interpreter function to produce some result from an Actions sequence into a proper Property that can be run by QuickCheck.
Property function suitable for formulae without choice.
Creates a Property from DynFormula with some specialised isomorphism for shrinking purpose.
Validate generated test case.
Test case generation does not always produce a valid test case. In some cases, we did not find a suitable test case matching some DynFormula and we are Stuck, hence we want to discard the test case and start over ; in other cases we found a genuine issue with the formula leading to the impossibility of producing a valid test case.
StoppingStepStepping (Witnesses (Step s)) (DynLogic s)NoStepBadAction (Witnesses (FailingAction s))If failed, return the prefix up to the failure. Also prunes the test in case the model has changed.