satchmo-2.9.5: SAT encoding monad

Safe HaskellNone
LanguageHaskell98

Satchmo.Unary.Op.Common

Synopsis

Documentation

minimum :: MonadSAT m => [Number] -> m Number Source

minimum (x:xs) = foldM min x xs

maximum :: MonadSAT m => [Number] -> m Number Source

maximum (x:xs) = foldM max x xs

select :: MonadSAT m => Boolean -> Number -> m Number Source

when f is False, switch off all bits

antiselect :: MonadSAT m => Boolean -> Number -> m Number Source

when p is True, switch ON all bits

add_quadratic :: MonadSAT m => Maybe Int -> Number -> Number -> m Number Source

for both "add" methods: if first arg is Nothing, then result length is sum of argument lengths (cannot overflow). else result is cut off (overflow => unsatisfiable)

add_by_odd_even_merge :: MonadSAT m => Maybe Int -> Number -> Number -> m Number Source

works for all widths

add_by_bitonic_sort :: MonadSAT m => Maybe Int -> Number -> Number -> m Number Source

will fill up the input such that length is a power of two. it seems to be hard to improve this, cf http://www.cs.technion.ac.il/users/wwwb/cgi-bin/tr-info.cgi/2009/CS/CS-2009-07