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

Documentation.SBV.Examples.Puzzles.Rabbits

Description

A puzzle, attributed to Lewis Caroll:

  • All rabbits, that are not greedy, are black
  • No old rabbits are free from greediness
  • Therefore: Some black rabbits are not old

What's implicit here is that there is a rabbit that must be not-greedy; which we add to our constraints.

Synopsis

Documentation

data Rabbit Source #

A universe of rabbits

Instances

Instances details
Arbitrary Rabbit Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Rabbits

SymVal Rabbit Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Rabbits

HasKind Rabbit Source # 
Instance details

Defined in Documentation.SBV.Examples.Puzzles.Rabbits

cv2Rabbit :: String -> [CV] -> Rabbit Source #

Conversion from SMT values to Rabbit values.

_undefiner_Rabbit :: a Source #

Autogenerated definition to avoid unused-variable warnings from GHC.

type SRabbit = SBV Rabbit Source #

Symbolic version of the type Rabbit.

greedy :: SRabbit -> SBool Source #

Identify those rabbits that are greedy. Note that we leave the predicate uninterpreted.

black :: SRabbit -> SBool Source #

Identify those rabbits that are black. Note that we leave the predicate uninterpreted.

old :: SRabbit -> SBool Source #

Identify those rabbits that are old. Note that we leave the predicate uninterpreted.

rabbits :: Predicate Source #

Express the puzzle.

rabbitsAreOK :: IO ThmResult Source #

Prove the claim. We have:

>>> rabbitsAreOK
Q.E.D.