sbvPlugin-0.8: Formally prove properties of Haskell programs using SBV/SMT

Copyright(c) Levent Erkok
LicenseBSD3
Maintainererkokl@gmail.com
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

Data.SBV.Plugin.Examples.BitTricks

Description

Checks the correctness of a few tricks from the large collection found in: https://graphics.stanford.edu/~seander/bithacks.html

Synopsis

Documentation

elem :: Eq a => a -> [a] -> Bool Source #

SBVPlugin can only see definitions in the current module. So we define elem ourselves.

oneIf :: Num a => Bool -> a Source #

Returns 1 if bool is True