sbv-7.13: SMT Based Verification: Symbolic Haskell theorem prover using SMT solving.

Copyright | (c) Levent Erkok
License | BSD3
Maintainer | erkokl@gmail.com
Stability | experimental
Safe Haskell | None
Language | Haskell2010

Documentation.SBV.Examples.Puzzles.Fish

Description

Solves the following logic puzzle:

- The Briton lives in the red house.
- The Swede keeps dogs as pets.
- The Dane drinks tea.
- The green house is left to the white house.
- The owner of the green house drinks coffee.
- The person who plays football rears birds.
- The owner of the yellow house plays baseball.
- The man living in the center house drinks milk.
- The Norwegian lives in the first house.
- The man who plays volleyball lives next to the one who keeps cats.
- The man who keeps the horse lives next to the one who plays baseball.
- The owner who plays tennis drinks beer.
- The German plays hockey.
- The Norwegian lives next to the blue house.
- The man who plays volleyball has a neighbor who drinks water.

Who owns the fish?

Synopsis

- data Color
  - = Red
  - | Green
  - | White
  - | Yellow
  - | Blue
- data Nationality
  - = Briton
  - | Dane
  - | Swede
  - | Norwegian
  - | German
- data Beverage
  - = Tea
  - | Coffee
  - | Milk
  - | Beer
  - | Water
- data Pet
  - = Dog
  - | Horse
  - | Cat
  - | Bird
  - | Fish
- data Sport
  - = Football
  - | Baseball
  - | Volleyball
  - | Hockey
  - | Tennis
- fishOwner :: IO ()

# Documentation

data Color Source #

Colors of houses

Constructors

Red |
Green |
White |
Yellow |
Blue |

Instances

Eq Color Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods (==) :: Color -> Color -> Bool Source # (/=) :: Color -> Color -> Bool Source #
Data Color Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

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

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

toConstr :: Color -> Constr Source #

dataTypeOf :: Color -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Color Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods compare :: Color -> Color -> Ordering Source # (<) :: Color -> Color -> Bool Source # (<=) :: Color -> Color -> Bool Source # (>) :: Color -> Color -> Bool Source # (>=) :: Color -> Color -> Bool Source # max :: Color -> Color -> Color Source # min :: Color -> Color -> Color Source #
Read Color Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods readsPrec :: Int -> ReadS Color Source # readList :: ReadS [Color] Source # readPrec :: ReadPrec Color Source # readListPrec :: ReadPrec [Color] Source #
Show Color Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods showsPrec :: Int -> Color -> ShowS Source # show :: Color -> String Source # showList :: [Color] -> ShowS Source #
HasKind Color Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

kindOf :: Color -> Kind Source #

hasSign :: Color -> Bool Source #

intSizeOf :: Color -> Int Source #

isBoolean :: Color -> Bool Source #

isBounded :: Color -> Bool Source #

isReal :: Color -> Bool Source #

isFloat :: Color -> Bool Source #

isDouble :: Color -> Bool Source #

isInteger :: Color -> Bool Source #

isUninterpreted :: Color -> Bool Source #

isChar :: Color -> Bool Source #

isString :: Color -> Bool Source #

isList :: Color -> Bool Source #

showType :: Color -> String Source #

SymWord Color Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

forall :: String -> Symbolic (SBV Color) Source #

forall_ :: Symbolic (SBV Color) Source #

mkForallVars :: Int -> Symbolic [SBV Color] Source #

exists :: String -> Symbolic (SBV Color) Source #

exists_ :: Symbolic (SBV Color) Source #

mkExistVars :: Int -> Symbolic [SBV Color] Source #

free :: String -> Symbolic (SBV Color) Source #

free_ :: Symbolic (SBV Color) Source #

mkFreeVars :: Int -> Symbolic [SBV Color] Source #

symbolic :: String -> Symbolic (SBV Color) Source #

symbolics :: [String] -> Symbolic [SBV Color] Source #

literal :: Color -> SBV Color Source #

unliteral :: SBV Color -> Maybe Color Source #

fromCW :: CW -> Color Source #

isConcrete :: SBV Color -> Bool Source #

isSymbolic :: SBV Color -> Bool Source #

isConcretely :: SBV Color -> (Color -> Bool) -> Bool Source #

mkSymWord :: Maybe Quantifier -> Maybe String -> Symbolic (SBV Color) Source #

SatModel Color Source # | Make `Color` a symbolic value.
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods parseCWs :: [CW] -> Maybe (Color, [CW]) Source # cvtModel :: (Color -> Maybe b) -> Maybe (Color, [CW]) -> Maybe (b, [CW]) Source #
SMTValue Color Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods sexprToVal :: SExpr -> Maybe Color Source #

data Nationality Source #

Nationalities of the occupants

Constructors

Briton |
Dane |
Swede |
Norwegian |
German |

Instances

Eq Nationality Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods (==) :: Nationality -> Nationality -> Bool Source # (/=) :: Nationality -> Nationality -> Bool Source #
Data Nationality Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

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

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

toConstr :: Nationality -> Constr Source #

dataTypeOf :: Nationality -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Nationality Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

compare :: Nationality -> Nationality -> Ordering Source #

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

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

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

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

max :: Nationality -> Nationality -> Nationality Source #

min :: Nationality -> Nationality -> Nationality Source #

Read Nationality Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods readsPrec :: Int -> ReadS Nationality Source # readList :: ReadS [Nationality] Source # readPrec :: ReadPrec Nationality Source # readListPrec :: ReadPrec [Nationality] Source #
Show Nationality Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods showsPrec :: Int -> Nationality -> ShowS Source # show :: Nationality -> String Source # showList :: [Nationality] -> ShowS Source #
HasKind Nationality Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

kindOf :: Nationality -> Kind Source #

hasSign :: Nationality -> Bool Source #

intSizeOf :: Nationality -> Int Source #

isBoolean :: Nationality -> Bool Source #

isBounded :: Nationality -> Bool Source #

isReal :: Nationality -> Bool Source #

isFloat :: Nationality -> Bool Source #

isDouble :: Nationality -> Bool Source #

isInteger :: Nationality -> Bool Source #

isUninterpreted :: Nationality -> Bool Source #

isChar :: Nationality -> Bool Source #

isString :: Nationality -> Bool Source #

isList :: Nationality -> Bool Source #

showType :: Nationality -> String Source #

SymWord Nationality Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

forall :: String -> Symbolic (SBV Nationality) Source #

forall_ :: Symbolic (SBV Nationality) Source #

mkForallVars :: Int -> Symbolic [SBV Nationality] Source #

exists :: String -> Symbolic (SBV Nationality) Source #

exists_ :: Symbolic (SBV Nationality) Source #

mkExistVars :: Int -> Symbolic [SBV Nationality] Source #

free :: String -> Symbolic (SBV Nationality) Source #

free_ :: Symbolic (SBV Nationality) Source #

mkFreeVars :: Int -> Symbolic [SBV Nationality] Source #

symbolic :: String -> Symbolic (SBV Nationality) Source #

symbolics :: [String] -> Symbolic [SBV Nationality] Source #

literal :: Nationality -> SBV Nationality Source #

unliteral :: SBV Nationality -> Maybe Nationality Source #

fromCW :: CW -> Nationality Source #

isConcrete :: SBV Nationality -> Bool Source #

isSymbolic :: SBV Nationality -> Bool Source #

isConcretely :: SBV Nationality -> (Nationality -> Bool) -> Bool Source #

mkSymWord :: Maybe Quantifier -> Maybe String -> Symbolic (SBV Nationality) Source #

SatModel Nationality Source # | Make `Nationality` a symbolic value.
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods parseCWs :: [CW] -> Maybe (Nationality, [CW]) Source # cvtModel :: (Nationality -> Maybe b) -> Maybe (Nationality, [CW]) -> Maybe (b, [CW]) Source #
SMTValue Nationality Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods sexprToVal :: SExpr -> Maybe Nationality Source #

data Beverage Source #

Beverage choices

Constructors

Tea |
Coffee |
Milk |
Beer |
Water |

Instances

Eq Beverage Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods (==) :: Beverage -> Beverage -> Bool Source # (/=) :: Beverage -> Beverage -> Bool Source #
Data Beverage Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

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

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

toConstr :: Beverage -> Constr Source #

dataTypeOf :: Beverage -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Beverage Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

compare :: Beverage -> Beverage -> Ordering Source #

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

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

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

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

max :: Beverage -> Beverage -> Beverage Source #

min :: Beverage -> Beverage -> Beverage Source #

Read Beverage Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods readsPrec :: Int -> ReadS Beverage Source # readList :: ReadS [Beverage] Source # readPrec :: ReadPrec Beverage Source # readListPrec :: ReadPrec [Beverage] Source #
Show Beverage Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods showsPrec :: Int -> Beverage -> ShowS Source # show :: Beverage -> String Source # showList :: [Beverage] -> ShowS Source #
HasKind Beverage Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

kindOf :: Beverage -> Kind Source #

hasSign :: Beverage -> Bool Source #

intSizeOf :: Beverage -> Int Source #

isBoolean :: Beverage -> Bool Source #

isBounded :: Beverage -> Bool Source #

isReal :: Beverage -> Bool Source #

isFloat :: Beverage -> Bool Source #

isDouble :: Beverage -> Bool Source #

isInteger :: Beverage -> Bool Source #

isUninterpreted :: Beverage -> Bool Source #

isChar :: Beverage -> Bool Source #

isString :: Beverage -> Bool Source #

isList :: Beverage -> Bool Source #

showType :: Beverage -> String Source #

SymWord Beverage Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

forall :: String -> Symbolic (SBV Beverage) Source #

forall_ :: Symbolic (SBV Beverage) Source #

mkForallVars :: Int -> Symbolic [SBV Beverage] Source #

exists :: String -> Symbolic (SBV Beverage) Source #

exists_ :: Symbolic (SBV Beverage) Source #

mkExistVars :: Int -> Symbolic [SBV Beverage] Source #

free :: String -> Symbolic (SBV Beverage) Source #

free_ :: Symbolic (SBV Beverage) Source #

mkFreeVars :: Int -> Symbolic [SBV Beverage] Source #

symbolic :: String -> Symbolic (SBV Beverage) Source #

symbolics :: [String] -> Symbolic [SBV Beverage] Source #

literal :: Beverage -> SBV Beverage Source #

unliteral :: SBV Beverage -> Maybe Beverage Source #

fromCW :: CW -> Beverage Source #

isConcrete :: SBV Beverage -> Bool Source #

isSymbolic :: SBV Beverage -> Bool Source #

isConcretely :: SBV Beverage -> (Beverage -> Bool) -> Bool Source #

mkSymWord :: Maybe Quantifier -> Maybe String -> Symbolic (SBV Beverage) Source #

SatModel Beverage Source # | Make `Beverage` a symbolic value.
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods parseCWs :: [CW] -> Maybe (Beverage, [CW]) Source # cvtModel :: (Beverage -> Maybe b) -> Maybe (Beverage, [CW]) -> Maybe (b, [CW]) Source #
SMTValue Beverage Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods sexprToVal :: SExpr -> Maybe Beverage Source #

data Pet Source #

Pets they keep

Constructors

Dog |
Horse |
Cat |
Bird |
Fish |

Instances

Eq Pet Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods (==) :: Pet -> Pet -> Bool Source # (/=) :: Pet -> Pet -> Bool Source #
Data Pet Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

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

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

toConstr :: Pet -> Constr Source #

dataTypeOf :: Pet -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Pet Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods compare :: Pet -> Pet -> Ordering Source # (<) :: Pet -> Pet -> Bool Source # (<=) :: Pet -> Pet -> Bool Source # (>) :: Pet -> Pet -> Bool Source # (>=) :: Pet -> Pet -> Bool Source # max :: Pet -> Pet -> Pet Source # min :: Pet -> Pet -> Pet Source #
Read Pet Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods readsPrec :: Int -> ReadS Pet Source # readList :: ReadS [Pet] Source # readPrec :: ReadPrec Pet Source # readListPrec :: ReadPrec [Pet] Source #
Show Pet Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods showsPrec :: Int -> Pet -> ShowS Source # show :: Pet -> String Source # showList :: [Pet] -> ShowS Source #
HasKind Pet Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

kindOf :: Pet -> Kind Source #

hasSign :: Pet -> Bool Source #

intSizeOf :: Pet -> Int Source #

isBoolean :: Pet -> Bool Source #

isBounded :: Pet -> Bool Source #

isReal :: Pet -> Bool Source #

isFloat :: Pet -> Bool Source #

isDouble :: Pet -> Bool Source #

isInteger :: Pet -> Bool Source #

isUninterpreted :: Pet -> Bool Source #

isChar :: Pet -> Bool Source #

isString :: Pet -> Bool Source #

isList :: Pet -> Bool Source #

showType :: Pet -> String Source #

SymWord Pet Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

forall :: String -> Symbolic (SBV Pet) Source #

forall_ :: Symbolic (SBV Pet) Source #

mkForallVars :: Int -> Symbolic [SBV Pet] Source #

exists :: String -> Symbolic (SBV Pet) Source #

exists_ :: Symbolic (SBV Pet) Source #

mkExistVars :: Int -> Symbolic [SBV Pet] Source #

free :: String -> Symbolic (SBV Pet) Source #

free_ :: Symbolic (SBV Pet) Source #

mkFreeVars :: Int -> Symbolic [SBV Pet] Source #

symbolic :: String -> Symbolic (SBV Pet) Source #

symbolics :: [String] -> Symbolic [SBV Pet] Source #

literal :: Pet -> SBV Pet Source #

unliteral :: SBV Pet -> Maybe Pet Source #

fromCW :: CW -> Pet Source #

isConcrete :: SBV Pet -> Bool Source #

isSymbolic :: SBV Pet -> Bool Source #

isConcretely :: SBV Pet -> (Pet -> Bool) -> Bool Source #

mkSymWord :: Maybe Quantifier -> Maybe String -> Symbolic (SBV Pet) Source #

SatModel Pet Source # | Make `Pet` a symbolic value.
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods parseCWs :: [CW] -> Maybe (Pet, [CW]) Source # cvtModel :: (Pet -> Maybe b) -> Maybe (Pet, [CW]) -> Maybe (b, [CW]) Source #
SMTValue Pet Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods sexprToVal :: SExpr -> Maybe Pet Source #

data Sport Source #

Sports they engage in

Constructors

Football |
Baseball |
Volleyball |
Hockey |
Tennis |

Instances

Eq Sport Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods (==) :: Sport -> Sport -> Bool Source # (/=) :: Sport -> Sport -> Bool Source #
Data Sport Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

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

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

toConstr :: Sport -> Constr Source #

dataTypeOf :: Sport -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord Sport Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods compare :: Sport -> Sport -> Ordering Source # (<) :: Sport -> Sport -> Bool Source # (<=) :: Sport -> Sport -> Bool Source # (>) :: Sport -> Sport -> Bool Source # (>=) :: Sport -> Sport -> Bool Source # max :: Sport -> Sport -> Sport Source # min :: Sport -> Sport -> Sport Source #
Read Sport Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods readsPrec :: Int -> ReadS Sport Source # readList :: ReadS [Sport] Source # readPrec :: ReadPrec Sport Source # readListPrec :: ReadPrec [Sport] Source #
Show Sport Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods showsPrec :: Int -> Sport -> ShowS Source # show :: Sport -> String Source # showList :: [Sport] -> ShowS Source #
HasKind Sport Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

kindOf :: Sport -> Kind Source #

hasSign :: Sport -> Bool Source #

intSizeOf :: Sport -> Int Source #

isBoolean :: Sport -> Bool Source #

isBounded :: Sport -> Bool Source #

isReal :: Sport -> Bool Source #

isFloat :: Sport -> Bool Source #

isDouble :: Sport -> Bool Source #

isInteger :: Sport -> Bool Source #

isUninterpreted :: Sport -> Bool Source #

isChar :: Sport -> Bool Source #

isString :: Sport -> Bool Source #

isList :: Sport -> Bool Source #

showType :: Sport -> String Source #

SymWord Sport Source # |

Instance details

Defined in Documentation.SBV.Examples.Puzzles.Fish

Methods

forall :: String -> Symbolic (SBV Sport) Source #

forall_ :: Symbolic (SBV Sport) Source #

mkForallVars :: Int -> Symbolic [SBV Sport] Source #

exists :: String -> Symbolic (SBV Sport) Source #

exists_ :: Symbolic (SBV Sport) Source #

mkExistVars :: Int -> Symbolic [SBV Sport] Source #

free :: String -> Symbolic (SBV Sport) Source #

free_ :: Symbolic (SBV Sport) Source #

mkFreeVars :: Int -> Symbolic [SBV Sport] Source #

symbolic :: String -> Symbolic (SBV Sport) Source #

symbolics :: [String] -> Symbolic [SBV Sport] Source #

literal :: Sport -> SBV Sport Source #

unliteral :: SBV Sport -> Maybe Sport Source #

fromCW :: CW -> Sport Source #

isConcrete :: SBV Sport -> Bool Source #

isSymbolic :: SBV Sport -> Bool Source #

isConcretely :: SBV Sport -> (Sport -> Bool) -> Bool Source #

mkSymWord :: Maybe Quantifier -> Maybe String -> Symbolic (SBV Sport) Source #

SatModel Sport Source # | Make `Sport` a symbolic value.
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods parseCWs :: [CW] -> Maybe (Sport, [CW]) Source # cvtModel :: (Sport -> Maybe b) -> Maybe (Sport, [CW]) -> Maybe (b, [CW]) Source #
SMTValue Sport Source # |
Instance details Defined in Documentation.SBV.Examples.Puzzles.Fish Methods sexprToVal :: SExpr -> Maybe Sport Source #

fishOwner :: IO () Source #

We have:

    >>> fishOwner
    German

It's not hard to modify this program to grab the values of all the assignments, i.e., the full solution to the puzzle. We leave that as an exercise to the interested reader!