quickcheck-state-machine-0.10.1: Test monadic programs using state machine based models
Copyright(C) 2017 ATS Advanced Telematic Systems GmbH
LicenseBSD-style (see the file LICENSE)
MaintainerStevan Andjelkovic <stevan.andjelkovic@strath.ac.uk>
Stabilityprovisional
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.StateMachine.Logic

Description

This module defines a predicate logic-like language and its counterexample semantics.

Synopsis

Documentation

data Logic Source #

Constructors

Bot 
Top 
Logic :&& Logic 
Logic :|| Logic 
Logic :=> Logic 
Not Logic 
LogicPredicate LogicPredicate 
forall a.Show a => Forall [a] (a -> Logic) 
forall a.Show a => Exists [a] (a -> Logic) 
Boolean Bool 
Annotate String Logic 

data LogicPredicate Source #

Constructors

forall a.(Eq a, Show a) => a :== a 
forall a.(Eq a, Show a) => a :/= a 
forall a.(Ord a, Show a) => a :< a 
forall a.(Ord a, Show a) => a :<= a 
forall a.(Ord a, Show a) => a :> a 
forall a.(Ord a, Show a) => a :>= a 
forall t a.(Foldable t, Eq a, Show a, Show (t a)) => Member a (t a) 
forall t a.(Foldable t, Eq a, Show a, Show (t a)) => NotMember a (t a) 

Instances

Instances details
Show LogicPredicate Source # 
Instance details

Defined in Test.StateMachine.Logic

data Value Source #

Constructors

VFalse Counterexample 
VTrue 

Instances

Instances details
Show Value Source # 
Instance details

Defined in Test.StateMachine.Logic

Methods

showsPrec :: Int -> Value -> ShowS #

show :: Value -> String #

showList :: [Value] -> ShowS #

gatherAnnotations :: Logic -> [String] Source #

Gather user annotations of a true logic expression.

>>> gatherAnnotations (Top .// "top")
["top"]
>>> gatherAnnotations ((Bot .// "bot") .|| (Top .// "top"))
["top"]
>>> gatherAnnotations (Top .// "top1" .&& Top .// "top2")
["top1","top2"]
>>> gatherAnnotations (Bot .// "bot" .&& Top .// "top")
[]
>>> gatherAnnotations (forAll [1,2,3] (\i -> 0 .< i .// "positive"))
["positive","positive","positive"]
>>> gatherAnnotations (forAll [0,1,2,3] (\i -> 0 .< i .// "positive"))
[]
>>> gatherAnnotations (exists [1,2,3] (\i -> 0 .< i .// "positive"))
["positive"]

(.==) :: (Eq a, Show a) => a -> a -> Logic infix 5 Source #

(./=) :: (Eq a, Show a) => a -> a -> Logic infix 5 Source #

(.<) :: (Ord a, Show a) => a -> a -> Logic infix 5 Source #

(.<=) :: (Ord a, Show a) => a -> a -> Logic infix 5 Source #

(.>) :: (Ord a, Show a) => a -> a -> Logic infix 5 Source #

(.>=) :: (Ord a, Show a) => a -> a -> Logic infix 5 Source #

member :: (Foldable t, Eq a, Show a, Show (t a)) => a -> t a -> Logic infix 8 Source #

notMember :: (Foldable t, Eq a, Show a, Show (t a)) => a -> t a -> Logic infix 8 Source #

(.//) :: Logic -> String -> Logic infixl 4 Source #

(.&&) :: Logic -> Logic -> Logic infixr 3 Source #

(.||) :: Logic -> Logic -> Logic infixr 2 Source #

(.=>) :: Logic -> Logic -> Logic infixr 1 Source #

forAll :: Show a => [a] -> (a -> Logic) -> Logic Source #

exists :: Show a => [a] -> (a -> Logic) -> Logic Source #