| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Circuit.Tools.Test
Contents
Description
Shared oracle helpers for the circuits-axioma* executables.
This library holds generic test machinery that is useful across multiple
executables: assertion printers, finite enumeration, and truth-table
helpers. Nothing here depends on circuits.
Synopsis
- check :: String -> Bool -> IO Bool
- approx :: Double -> Double -> Bool
- enumFunctions :: Eq a => [a] -> [b] -> [a -> b]
- enumCartesian :: [a] -> [b] -> [(a, b)]
- allBoolFns :: (Bounded a, Enum a) => [a -> Bool]
- pairBoolFns :: Enum b => [b] -> [(b, b) -> Bool]
- pairDoubleFns :: Enum b => [b] -> [(b, b) -> Double]
Assertions
check :: String -> Bool -> IO Bool Source #
Print PASS/FAIL for a named boolean assertion and return the result.
Finite enumeration
enumFunctions :: Eq a => [a] -> [b] -> [a -> b] Source #
Enumerate all functions from a finite domain to a finite codomain.
enumCartesian :: [a] -> [b] -> [(a, b)] Source #
Cartesian product of two lists.
allBoolFns :: (Bounded a, Enum a) => [a -> Bool] Source #
All functions from a finite bounded enumerable type to Bool.
pairBoolFns :: Enum b => [b] -> [(b, b) -> Bool] Source #