{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module What4.ProblemFeatures
( ProblemFeatures
, noFeatures
, useLinearArithmetic
, useNonlinearArithmetic
, useComputableReals
, useIntegerArithmetic
, useBitvectors
, useExistForall
, useQuantifiers
, useSymbolicArrays
, useStructs
, useStrings
, useFloatingPoint
, useUnsatCores
, useUnsatAssumptions
, hasProblemFeature
) where
import Data.Bits
import Data.Word
newtype ProblemFeatures = ProblemFeatures Word64
deriving (ProblemFeatures -> ProblemFeatures -> Bool
(ProblemFeatures -> ProblemFeatures -> Bool)
-> (ProblemFeatures -> ProblemFeatures -> Bool)
-> Eq ProblemFeatures
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProblemFeatures -> ProblemFeatures -> Bool
$c/= :: ProblemFeatures -> ProblemFeatures -> Bool
== :: ProblemFeatures -> ProblemFeatures -> Bool
$c== :: ProblemFeatures -> ProblemFeatures -> Bool
Eq, Eq ProblemFeatures
ProblemFeatures
Eq ProblemFeatures
-> (ProblemFeatures -> ProblemFeatures -> ProblemFeatures)
-> (ProblemFeatures -> ProblemFeatures -> ProblemFeatures)
-> (ProblemFeatures -> ProblemFeatures -> ProblemFeatures)
-> (ProblemFeatures -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> ProblemFeatures
-> (Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> Bool)
-> (ProblemFeatures -> Maybe Int)
-> (ProblemFeatures -> Int)
-> (ProblemFeatures -> Bool)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int -> ProblemFeatures)
-> (ProblemFeatures -> Int)
-> Bits ProblemFeatures
Int -> ProblemFeatures
ProblemFeatures -> Bool
ProblemFeatures -> Int
ProblemFeatures -> Maybe Int
ProblemFeatures -> ProblemFeatures
ProblemFeatures -> Int -> Bool
ProblemFeatures -> Int -> ProblemFeatures
ProblemFeatures -> ProblemFeatures -> ProblemFeatures
forall a.
Eq a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> a
-> (Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> Bool)
-> (a -> Maybe Int)
-> (a -> Int)
-> (a -> Bool)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int -> a)
-> (a -> Int)
-> Bits a
popCount :: ProblemFeatures -> Int
$cpopCount :: ProblemFeatures -> Int
rotateR :: ProblemFeatures -> Int -> ProblemFeatures
$crotateR :: ProblemFeatures -> Int -> ProblemFeatures
rotateL :: ProblemFeatures -> Int -> ProblemFeatures
$crotateL :: ProblemFeatures -> Int -> ProblemFeatures
unsafeShiftR :: ProblemFeatures -> Int -> ProblemFeatures
$cunsafeShiftR :: ProblemFeatures -> Int -> ProblemFeatures
shiftR :: ProblemFeatures -> Int -> ProblemFeatures
$cshiftR :: ProblemFeatures -> Int -> ProblemFeatures
unsafeShiftL :: ProblemFeatures -> Int -> ProblemFeatures
$cunsafeShiftL :: ProblemFeatures -> Int -> ProblemFeatures
shiftL :: ProblemFeatures -> Int -> ProblemFeatures
$cshiftL :: ProblemFeatures -> Int -> ProblemFeatures
isSigned :: ProblemFeatures -> Bool
$cisSigned :: ProblemFeatures -> Bool
bitSize :: ProblemFeatures -> Int
$cbitSize :: ProblemFeatures -> Int
bitSizeMaybe :: ProblemFeatures -> Maybe Int
$cbitSizeMaybe :: ProblemFeatures -> Maybe Int
testBit :: ProblemFeatures -> Int -> Bool
$ctestBit :: ProblemFeatures -> Int -> Bool
complementBit :: ProblemFeatures -> Int -> ProblemFeatures
$ccomplementBit :: ProblemFeatures -> Int -> ProblemFeatures
clearBit :: ProblemFeatures -> Int -> ProblemFeatures
$cclearBit :: ProblemFeatures -> Int -> ProblemFeatures
setBit :: ProblemFeatures -> Int -> ProblemFeatures
$csetBit :: ProblemFeatures -> Int -> ProblemFeatures
bit :: Int -> ProblemFeatures
$cbit :: Int -> ProblemFeatures
zeroBits :: ProblemFeatures
$czeroBits :: ProblemFeatures
rotate :: ProblemFeatures -> Int -> ProblemFeatures
$crotate :: ProblemFeatures -> Int -> ProblemFeatures
shift :: ProblemFeatures -> Int -> ProblemFeatures
$cshift :: ProblemFeatures -> Int -> ProblemFeatures
complement :: ProblemFeatures -> ProblemFeatures
$ccomplement :: ProblemFeatures -> ProblemFeatures
xor :: ProblemFeatures -> ProblemFeatures -> ProblemFeatures
$cxor :: ProblemFeatures -> ProblemFeatures -> ProblemFeatures
.|. :: ProblemFeatures -> ProblemFeatures -> ProblemFeatures
$c.|. :: ProblemFeatures -> ProblemFeatures -> ProblemFeatures
.&. :: ProblemFeatures -> ProblemFeatures -> ProblemFeatures
$c.&. :: ProblemFeatures -> ProblemFeatures -> ProblemFeatures
$cp1Bits :: Eq ProblemFeatures
Bits)
noFeatures :: ProblemFeatures
noFeatures :: ProblemFeatures
noFeatures = Word64 -> ProblemFeatures
ProblemFeatures Word64
0
useLinearArithmetic :: ProblemFeatures
useLinearArithmetic :: ProblemFeatures
useLinearArithmetic = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x01
useNonlinearArithmetic :: ProblemFeatures
useNonlinearArithmetic :: ProblemFeatures
useNonlinearArithmetic = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x03
useComputableReals :: ProblemFeatures
useComputableReals :: ProblemFeatures
useComputableReals = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x04 ProblemFeatures -> ProblemFeatures -> ProblemFeatures
forall a. Bits a => a -> a -> a
.|. ProblemFeatures
useNonlinearArithmetic
useIntegerArithmetic :: ProblemFeatures
useIntegerArithmetic :: ProblemFeatures
useIntegerArithmetic = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x08 ProblemFeatures -> ProblemFeatures -> ProblemFeatures
forall a. Bits a => a -> a -> a
.|. ProblemFeatures
useLinearArithmetic
useBitvectors :: ProblemFeatures
useBitvectors :: ProblemFeatures
useBitvectors = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x10
useExistForall :: ProblemFeatures
useExistForall :: ProblemFeatures
useExistForall = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x20
useQuantifiers :: ProblemFeatures
useQuantifiers :: ProblemFeatures
useQuantifiers = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x40 ProblemFeatures -> ProblemFeatures -> ProblemFeatures
forall a. Bits a => a -> a -> a
.|. ProblemFeatures
useExistForall
useSymbolicArrays :: ProblemFeatures
useSymbolicArrays :: ProblemFeatures
useSymbolicArrays = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x80
useStructs :: ProblemFeatures
useStructs :: ProblemFeatures
useStructs = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x100
useStrings :: ProblemFeatures
useStrings :: ProblemFeatures
useStrings = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x200
useFloatingPoint :: ProblemFeatures
useFloatingPoint :: ProblemFeatures
useFloatingPoint = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x400
useUnsatCores :: ProblemFeatures
useUnsatCores :: ProblemFeatures
useUnsatCores = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x800
useUnsatAssumptions :: ProblemFeatures
useUnsatAssumptions :: ProblemFeatures
useUnsatAssumptions = Word64 -> ProblemFeatures
ProblemFeatures Word64
0x1000
hasProblemFeature :: ProblemFeatures -> ProblemFeatures -> Bool
hasProblemFeature :: ProblemFeatures -> ProblemFeatures -> Bool
hasProblemFeature ProblemFeatures
x ProblemFeatures
y = (ProblemFeatures
x ProblemFeatures -> ProblemFeatures -> ProblemFeatures
forall a. Bits a => a -> a -> a
.&. ProblemFeatures
y) ProblemFeatures -> ProblemFeatures -> Bool
forall a. Eq a => a -> a -> Bool
== ProblemFeatures
y