sbv-8.17: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.
Copyright(c) Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Documentation.SBV.Examples.Queries.Enums

Description

Demonstrates the use of enumeration values during queries.

Synopsis

Documentation

data Day Source #

Days of the week. We make it symbolic using the mkSymbolicEnumeration splice.

Instances

Instances details
Data Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Day -> c Day Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Day Source #

toConstr :: Day -> Constr Source #

dataTypeOf :: Day -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Day) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Day) Source #

gmapT :: (forall b. Data b => b -> b) -> Day -> Day Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Day -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Day -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Day -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Day -> m Day Source #

Read Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Show Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Eq Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Methods

(==) :: Day -> Day -> Bool Source #

(/=) :: Day -> Day -> Bool Source #

Ord Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Methods

compare :: Day -> Day -> Ordering Source #

(<) :: Day -> Day -> Bool Source #

(<=) :: Day -> Day -> Bool Source #

(>) :: Day -> Day -> Bool Source #

(>=) :: Day -> Day -> Bool Source #

max :: Day -> Day -> Day Source #

min :: Day -> Day -> Day Source #

SymVal Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

HasKind Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

SatModel Day Source # 
Instance details

Defined in Documentation.SBV.Examples.Queries.Enums

Methods

parseCVs :: [CV] -> Maybe (Day, [CV]) Source #

cvtModel :: (Day -> Maybe b) -> Maybe (Day, [CV]) -> Maybe (b, [CV]) Source #

type SDay = SBV Day Source #

Make Day a symbolic value.

findDays :: IO [Day] Source #

A trivial query to find three consecutive days that's all before Thursday. The point here is that we can perform queries on such enumerated values and use getValue on them and return their values from queries just like any other value. We have:

>>> findDays
[Monday,Tuesday,Wednesday]