-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A monad for interfacing with external SMT solvers -- -- Hasmtlib is a library for generating SMTLib2-problems using a monad. -- It takes care of encoding your problem, marshaling the data to an -- external solver and parsing and interpreting the result into Haskell -- types. It is highly inspired by ekmett/ersatz which does the same for -- QSAT. Communication with external solvers is handled by -- tweag/smtlib-backends. @package hasmtlib @version 2.5.1 module Language.Hasmtlib.Boolean class Boolean b -- | Lift a Bool. bool :: Boolean b => Bool -> b -- | The true constant. true = bool True true :: Boolean b => b -- | The false constant. false = bool False false :: Boolean b => b -- | Logical conjunction. (&&) :: Boolean b => b -> b -> b -- | Logical disjunction (inclusive or). (||) :: Boolean b => b -> b -> b -- | Logical implication. (==>) :: Boolean b => b -> b -> b -- | Logical implication with arrow reversed. -- --
--   forall x y. (x ==> y) === (y <== x)
--   
(<==) :: Boolean b => b -> b -> b -- | Logical equivalence. (<==>) :: Boolean b => b -> b -> b -- | Logical negation. not :: Boolean b => b -> b -- | Exclusive-or. xor :: Boolean b => b -> b -> b infixr 3 && infixr 2 || infixr 0 ==> infixl 0 <== infixr 4 <==> infix 4 `xor` -- | The logical conjunction of several values. and :: (Foldable t, Boolean b) => t b -> b -- | The logical disjunction of several values. or :: (Foldable t, Boolean b) => t b -> b -- | The negated logical conjunction of several values. -- --
--   nand = not . and
--   
nand :: (Foldable t, Boolean b) => t b -> b -- | The negated logical disjunction of several values. -- --
--   nor = not . or
--   
nor :: (Foldable t, Boolean b) => t b -> b -- | The logical conjunction of the mapping of a function over several -- values. all :: (Foldable t, Boolean b) => (a -> b) -> t a -> b -- | The logical disjunction of the mapping of a function over several -- values. any :: (Foldable t, Boolean b) => (a -> b) -> t a -> b instance Language.Hasmtlib.Boolean.Boolean GHC.Types.Bool instance Language.Hasmtlib.Boolean.Boolean Data.Bit.Internal.Bit instance GHC.TypeNats.KnownNat n => Language.Hasmtlib.Boolean.Boolean (Data.Vector.Unboxed.Sized.Vector n Data.Bit.Internal.Bit) module Language.Hasmtlib.Internal.Constraint -- | AllC ensures that a list of constraints is applied to a poly-kinded -- Type k -- --
--   AllC '[]       k = ()
--   AllC (c ': cs) k = (c k, AllC cs k)
--   
type family AllC cs k :: Constraint module Language.Hasmtlib.Internal.Render -- | Render values to their SMTLib2-Lisp form, represented as -- Builder. class Render a render :: Render a => a -> Builder renderUnary :: Render a => Builder -> a -> Builder renderBinary :: (Render a, Render b) => Builder -> a -> b -> Builder renderTernary :: (Render a, Render b, Render c) => Builder -> a -> b -> c -> Builder renderNary :: Render a => Builder -> [a] -> Builder -- | Render values to their sequential SMTLib2-Lisp form, represented as a -- Seq Builder. class RenderSeq a renderSeq :: RenderSeq a => a -> Seq Builder instance Language.Hasmtlib.Internal.Render.Render GHC.Types.Bool instance Language.Hasmtlib.Internal.Render.Render GHC.TypeNats.Nat instance Language.Hasmtlib.Internal.Render.Render GHC.Num.Integer.Integer instance Language.Hasmtlib.Internal.Render.Render GHC.Types.Double instance Language.Hasmtlib.Internal.Render.Render GHC.Types.Char instance Language.Hasmtlib.Internal.Render.Render GHC.Base.String instance Language.Hasmtlib.Internal.Render.Render Data.ByteString.Builder.Internal.Builder instance Language.Hasmtlib.Internal.Render.Render Data.Text.Internal.Text module Language.Hasmtlib.Internal.Bitvec -- | Unsigned and length-indexed bitvector with MSB first. newtype Bitvec (n :: Nat) Bitvec :: Vector n Bit -> Bitvec (n :: Nat) [unBitvec] :: Bitvec (n :: Nat) -> Vector n Bit bvReverse :: Bitvec n -> Bitvec n bvReplicate :: forall n. KnownNat n => Bit -> Bitvec n bvReplicate' :: forall n proxy. KnownNat n => proxy n -> Bit -> Bitvec n bvGenerate :: forall n. KnownNat n => (Finite n -> Bit) -> Bitvec n bvConcat :: Bitvec n -> Bitvec m -> Bitvec (n + m) bvTake' :: forall n m proxy. KnownNat n => proxy n -> Bitvec (n + m) -> Bitvec n bvDrop' :: forall n m proxy. KnownNat n => proxy n -> Bitvec (n + m) -> Bitvec m bvSplitAt' :: forall n m proxy. KnownNat n => proxy n -> Bitvec (n + m) -> (Bitvec n, Bitvec m) bvToList :: Bitvec n -> [Bit] bvFromListN :: forall n. KnownNat n => [Bit] -> Maybe (Bitvec n) bvFromListN' :: forall n. KnownNat n => Proxy n -> [Bit] -> Maybe (Bitvec n) bvShL :: KnownNat n => Bitvec n -> Bitvec n -> Maybe (Bitvec n) bvLShR :: KnownNat n => Bitvec n -> Bitvec n -> Maybe (Bitvec n) bvZeroExtend :: KnownNat i => Proxy i -> Bitvec n -> Bitvec (n + i) bvExtract :: forall n i j. (KnownNat i, KnownNat ((j - i) + 1), (i + (n - i)) ~ n, (((j - i) + 1) + ((n - i) - ((j - i) + 1))) ~ (n - i)) => Proxy i -> Proxy j -> Bitvec n -> Bitvec ((j - i) + 1) instance GHC.TypeNats.KnownNat n => Language.Hasmtlib.Boolean.Boolean (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.Classes.Ord (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.Classes.Eq (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.TypeNats.KnownNat n => GHC.Bits.Bits (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.Show.Show (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.TypeNats.KnownNat n => GHC.Num.Num (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.TypeNats.KnownNat n => GHC.Enum.Bounded (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.TypeNats.KnownNat n => GHC.Enum.Enum (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.TypeNats.KnownNat n => GHC.Real.Real (Language.Hasmtlib.Internal.Bitvec.Bitvec n) instance GHC.TypeNats.KnownNat n => GHC.Real.Integral (Language.Hasmtlib.Internal.Bitvec.Bitvec n) module Language.Hasmtlib.Internal.Uniplate1 class Uniplate1 f cs | f -> cs uniplate1 :: (Uniplate1 f cs, Applicative m, AllC cs b) => (forall a. AllC cs a => f a -> m (f a)) -> f b -> m (f b) transformM1 :: (Monad m, Uniplate1 f cs, AllC cs b) => (forall a. AllC cs a => f a -> m (f a)) -> f b -> m (f b) lazyParaM1 :: (Monad m, Uniplate1 f cs, AllC cs b) => (forall a. AllC cs a => f a -> m (f a) -> m (f a)) -> f b -> m (f b) module Language.Hasmtlib.Solver.Bitwuzla -- | A Config for Bitwuzla. Requires binary bitwuzla to be -- in path. -- -- As of v0.5 Bitwuzla uses Cadical as SAT-Solver by default. Make sure -- it's default SAT-Solver binary - probably cadical - is in -- path too. bitwuzla :: Config module Language.Hasmtlib.Solver.CVC5 -- | A Config for CVC5. Requires binary cvc5 to be in path. cvc5 :: Config module Language.Hasmtlib.Solver.MathSAT -- | A Config for MathSAT. Requires binary mathsat to be in -- path. mathsat :: Config -- | A Config for OptiMathSAT. Requires binary optimathsat -- to be in path. optimathsat :: Config module Language.Hasmtlib.Solver.OpenSMT -- | A Config for OpenSMT. Requires binary opensmt to be in -- path. opensmt :: Config module Language.Hasmtlib.Solver.Yices -- | A Config for Yices. Requires binary yices-smt2 to be -- in path. yices :: Config module Language.Hasmtlib.Solver.Z3 -- | A Config for Z3. Requires binary z3 to be in path. z3 :: Config module Language.Hasmtlib.Type.ArrayMap -- | Class that allows access to a map-like array where any value is either -- the default value or an overwritten values. Every index has a value by -- default. Values at indices can be overwritten manually. -- -- Based on McCarthy`s basic array theory. -- -- Therefore the following axioms must hold: -- --
    --
  1. forall A i x: arrSelect (store A i x) == x
  2. --
  3. forall A i j x: i /= j ==> (arrSelect (arrStore A i x) j === -- arrSelect A j)
  4. --
class ArrayMap f k v asConst' :: ArrayMap f k v => Proxy f -> Proxy k -> v -> f k v viewConst :: ArrayMap f k v => f k v -> v arrSelect :: ArrayMap f k v => f k v -> k -> v arrStore :: ArrayMap f k v => f k v -> k -> v -> f k v -- | Wrapper for asConst' which hides the Proxy asConst :: forall f k v. ArrayMap f k v => v -> f k v -- | A map-like array with a default constant value and partially -- overwritten values. data ConstArray k v ConstArray :: v -> Map k v -> ConstArray k v [_arrConst] :: ConstArray k v -> v [_stored] :: ConstArray k v -> Map k v stored :: forall k_aj8g v_aj8h k_akAD. Lens (ConstArray k_aj8g v_aj8h) (ConstArray k_akAD v_aj8h) (Map k_aj8g v_aj8h) (Map k_akAD v_aj8h) arrConst :: forall k_aj8g v_aj8h. Lens' (ConstArray k_aj8g v_aj8h) v_aj8h instance GHC.Classes.Ord k => Language.Hasmtlib.Type.ArrayMap.ArrayMap Language.Hasmtlib.Type.ArrayMap.ConstArray k v instance Data.Traversable.Traversable (Language.Hasmtlib.Type.ArrayMap.ConstArray k) instance Data.Foldable.Foldable (Language.Hasmtlib.Type.ArrayMap.ConstArray k) instance GHC.Base.Functor (Language.Hasmtlib.Type.ArrayMap.ConstArray k) instance (GHC.Classes.Ord v, GHC.Classes.Ord k) => GHC.Classes.Ord (Language.Hasmtlib.Type.ArrayMap.ConstArray k v) instance (GHC.Classes.Eq v, GHC.Classes.Eq k) => GHC.Classes.Eq (Language.Hasmtlib.Type.ArrayMap.ConstArray k v) instance (GHC.Show.Show v, GHC.Show.Show k) => GHC.Show.Show (Language.Hasmtlib.Type.ArrayMap.ConstArray k v) module Language.Hasmtlib.Type.Option -- | Options for SMT-Solvers. data SMTOption -- | Print "success" after each operation PrintSuccess :: Bool -> SMTOption -- | Produce a satisfying assignment after each successful checkSat ProduceModels :: Bool -> SMTOption -- | Incremental solving Incremental :: Bool -> SMTOption -- | Custom options. First String is the option, second its value. Custom :: String -> String -> SMTOption instance Data.Data.Data Language.Hasmtlib.Type.Option.SMTOption instance GHC.Classes.Ord Language.Hasmtlib.Type.Option.SMTOption instance GHC.Classes.Eq Language.Hasmtlib.Type.Option.SMTOption instance GHC.Show.Show Language.Hasmtlib.Type.Option.SMTOption instance Language.Hasmtlib.Internal.Render.Render Language.Hasmtlib.Type.Option.SMTOption module Language.Hasmtlib.Type.SMTSort -- | Sorts in SMTLib2 - used as promoted type (data-kind). data SMTSort -- | Sort of Bool BoolSort :: SMTSort -- | Sort of Int IntSort :: SMTSort -- | Sort of Real RealSort :: SMTSort -- | Sort of BitVec with length n BvSort :: Nat -> SMTSort -- | Sort of Array with indices k and values v ArraySort :: SMTSort -> SMTSort -> SMTSort -- | Sort of String StringSort :: SMTSort -- | Injective type-family that computes the Haskell Type of an -- SMTSort. type family HaskellType (t :: SMTSort) = (r :: Type) | r -> t -- | Singleton for SMTSort. data SSMTSort (t :: SMTSort) [SIntSort] :: SSMTSort IntSort [SRealSort] :: SSMTSort RealSort [SBoolSort] :: SSMTSort BoolSort [SBvSort] :: KnownNat n => Proxy n -> SSMTSort (BvSort n) [SArraySort] :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => Proxy k -> Proxy v -> SSMTSort (ArraySort k v) [SStringSort] :: SSMTSort StringSort -- | Compute singleton SSMTSort from it's promoted type -- SMTSort. class KnownSMTSort (t :: SMTSort) sortSing :: KnownSMTSort t => SSMTSort t -- | Wrapper for sortSing which takes a Proxy sortSing' :: forall prxy t. KnownSMTSort t => prxy t -> SSMTSort t -- | An existential wrapper that hides some SMTSort and a list of -- Constraints holding for it. data SomeSMTSort cs f [SomeSMTSort] :: forall cs f (t :: SMTSort). AllC cs t => f t -> SomeSMTSort cs f -- | An existential wrapper that hides some known SMTSort. type SomeKnownSMTSort f = SomeSMTSort '[KnownSMTSort] f instance GHC.Show.Show (Language.Hasmtlib.Type.SMTSort.SSMTSort t) instance GHC.Classes.Eq (Language.Hasmtlib.Type.SMTSort.SSMTSort t) instance GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.SSMTSort t) instance (forall (t :: Language.Hasmtlib.Type.SMTSort.SMTSort). GHC.Show.Show (f t)) => GHC.Show.Show (Language.Hasmtlib.Type.SMTSort.SomeSMTSort cs f) instance Data.GADT.Internal.GEq Language.Hasmtlib.Type.SMTSort.SSMTSort instance Data.GADT.Internal.GCompare Language.Hasmtlib.Type.SMTSort.SSMTSort instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort 'Language.Hasmtlib.Type.SMTSort.IntSort instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort 'Language.Hasmtlib.Type.SMTSort.RealSort instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort 'Language.Hasmtlib.Type.SMTSort.BoolSort instance GHC.TypeNats.KnownNat n => Language.Hasmtlib.Type.SMTSort.KnownSMTSort ('Language.Hasmtlib.Type.SMTSort.BvSort n) instance (Language.Hasmtlib.Type.SMTSort.KnownSMTSort k, Language.Hasmtlib.Type.SMTSort.KnownSMTSort v, GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.HaskellType k), GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.HaskellType v)) => Language.Hasmtlib.Type.SMTSort.KnownSMTSort ('Language.Hasmtlib.Type.SMTSort.ArraySort k v) instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort 'Language.Hasmtlib.Type.SMTSort.StringSort instance Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Type.SMTSort.SSMTSort t) module Language.Hasmtlib.Type.Value -- | A wrapper for values of SMTSorts. This wraps a Haskell-value -- into the SMT-Context. data Value (t :: SMTSort) [IntValue] :: HaskellType IntSort -> Value IntSort [RealValue] :: HaskellType RealSort -> Value RealSort [BoolValue] :: HaskellType BoolSort -> Value BoolSort [BvValue] :: KnownNat n => HaskellType (BvSort n) -> Value (BvSort n) [ArrayValue] :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => HaskellType (ArraySort k v) -> Value (ArraySort k v) [StringValue] :: HaskellType StringSort -> Value StringSort -- | Wraps a Haskell-value into the SMT-Context-Value. wrapValue :: forall t. KnownSMTSort t => HaskellType t -> Value t -- | Unwraps a Haskell-value from the SMT-Context-Value. unwrapValue :: Value t -> HaskellType t instance GHC.Classes.Eq (Language.Hasmtlib.Type.SMTSort.HaskellType t) => GHC.Classes.Eq (Language.Hasmtlib.Type.Value.Value t) instance GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.HaskellType t) => GHC.Classes.Ord (Language.Hasmtlib.Type.Value.Value t) instance Data.GADT.Internal.GEq Language.Hasmtlib.Type.Value.Value instance Data.GADT.Internal.GCompare Language.Hasmtlib.Type.Value.Value module Language.Hasmtlib.Type.Expr -- | An internal SMT variable with a phantom-type which holds an Int -- as it's identifier. newtype SMTVar (t :: SMTSort) SMTVar :: Int -> SMTVar (t :: SMTSort) [_varId] :: SMTVar (t :: SMTSort) -> Int varId :: forall t_au4I t_av0e. Iso (SMTVar t_au4I) (SMTVar t_av0e) Int Int -- | A wrapper for values of SMTSorts. This wraps a Haskell-value -- into the SMT-Context. data Value (t :: SMTSort) [IntValue] :: HaskellType IntSort -> Value IntSort [RealValue] :: HaskellType RealSort -> Value RealSort [BoolValue] :: HaskellType BoolSort -> Value BoolSort [BvValue] :: KnownNat n => HaskellType (BvSort n) -> Value (BvSort n) [ArrayValue] :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => HaskellType (ArraySort k v) -> Value (ArraySort k v) [StringValue] :: HaskellType StringSort -> Value StringSort -- | Unwraps a Haskell-value from the SMT-Context-Value. unwrapValue :: Value t -> HaskellType t -- | Wraps a Haskell-value into the SMT-Context-Value. wrapValue :: forall t. KnownSMTSort t => HaskellType t -> Value t -- | An SMT-Expression. For building expressions use the corresponding -- instances: Boolean, Num, Equatable, ... -- -- With a lot of criminal energy you may build invalid expressions -- regarding the SMTLib Version 2.6 - Specification. Therefore it is -- highly recommended to rely on the instances. data Expr (t :: SMTSort) [Var] :: KnownSMTSort t => SMTVar t -> Expr t [Constant] :: Value t -> Expr t [Plus] :: Num (HaskellType t) => Expr t -> Expr t -> Expr t [Minus] :: Num (HaskellType t) => Expr t -> Expr t -> Expr t [Neg] :: Num (HaskellType t) => Expr t -> Expr t [Mul] :: Num (HaskellType t) => Expr t -> Expr t -> Expr t [Abs] :: Num (HaskellType t) => Expr t -> Expr t [Mod] :: Integral (HaskellType t) => Expr t -> Expr t -> Expr t [IDiv] :: Integral (HaskellType t) => Expr t -> Expr t -> Expr t [Div] :: Expr RealSort -> Expr RealSort -> Expr RealSort [LTH] :: (Ord (HaskellType t), KnownSMTSort t) => Expr t -> Expr t -> Expr BoolSort [LTHE] :: (Ord (HaskellType t), KnownSMTSort t) => Expr t -> Expr t -> Expr BoolSort [EQU] :: (Eq (HaskellType t), KnownSMTSort t, KnownNat n) => Vector (n + 2) (Expr t) -> Expr BoolSort [Distinct] :: (Eq (HaskellType t), KnownSMTSort t, KnownNat n) => Vector (n + 2) (Expr t) -> Expr BoolSort [GTHE] :: (Ord (HaskellType t), KnownSMTSort t) => Expr t -> Expr t -> Expr BoolSort [GTH] :: (Ord (HaskellType t), KnownSMTSort t) => Expr t -> Expr t -> Expr BoolSort [Not] :: Boolean (HaskellType t) => Expr t -> Expr t [And] :: Boolean (HaskellType t) => Expr t -> Expr t -> Expr t [Or] :: Boolean (HaskellType t) => Expr t -> Expr t -> Expr t [Impl] :: Boolean (HaskellType t) => Expr t -> Expr t -> Expr t [Xor] :: Boolean (HaskellType t) => Expr t -> Expr t -> Expr t [Pi] :: Expr RealSort [Sqrt] :: Expr RealSort -> Expr RealSort [Exp] :: Expr RealSort -> Expr RealSort [Sin] :: Expr RealSort -> Expr RealSort [Cos] :: Expr RealSort -> Expr RealSort [Tan] :: Expr RealSort -> Expr RealSort [Asin] :: Expr RealSort -> Expr RealSort [Acos] :: Expr RealSort -> Expr RealSort [Atan] :: Expr RealSort -> Expr RealSort [ToReal] :: Expr IntSort -> Expr RealSort [ToInt] :: Expr RealSort -> Expr IntSort [IsInt] :: Expr RealSort -> Expr BoolSort [Ite] :: Expr BoolSort -> Expr t -> Expr t -> Expr t [BvNand] :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) [BvNor] :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) [BvShL] :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) [BvLShR] :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) [BvConcat] :: (KnownNat n, KnownNat m) => Expr (BvSort n) -> Expr (BvSort m) -> Expr (BvSort (n + m)) [BvRotL] :: (KnownNat n, Integral a) => a -> Expr (BvSort n) -> Expr (BvSort n) [BvRotR] :: (KnownNat n, Integral a) => a -> Expr (BvSort n) -> Expr (BvSort n) [ArrSelect] :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => Expr (ArraySort k v) -> Expr k -> Expr v [ArrStore] :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k)) => Expr (ArraySort k v) -> Expr k -> Expr v -> Expr (ArraySort k v) [StrConcat] :: Expr StringSort -> Expr StringSort -> Expr StringSort [StrLength] :: Expr StringSort -> Expr IntSort [StrLT] :: Expr StringSort -> Expr StringSort -> Expr BoolSort [StrLTHE] :: Expr StringSort -> Expr StringSort -> Expr BoolSort [StrAt] :: Expr StringSort -> Expr IntSort -> Expr StringSort [StrSubstring] :: Expr StringSort -> Expr IntSort -> Expr IntSort -> Expr StringSort [StrPrefixOf] :: Expr StringSort -> Expr StringSort -> Expr BoolSort [StrSuffixOf] :: Expr StringSort -> Expr StringSort -> Expr BoolSort [StrContains] :: Expr StringSort -> Expr StringSort -> Expr BoolSort [StrIndexOf] :: Expr StringSort -> Expr StringSort -> Expr IntSort -> Expr IntSort [StrReplace] :: Expr StringSort -> Expr StringSort -> Expr StringSort -> Expr StringSort [StrReplaceAll] :: Expr StringSort -> Expr StringSort -> Expr StringSort -> Expr StringSort -- | Just v if quantified var has been created already, Nothing otherwise [ForAll] :: KnownSMTSort t => Maybe (SMTVar t) -> (Expr t -> Expr BoolSort) -> Expr BoolSort -- | Just v if quantified var has been created already, Nothing otherwise [Exists] :: KnownSMTSort t => Maybe (SMTVar t) -> (Expr t -> Expr BoolSort) -> Expr BoolSort isLeaf :: Expr t -> Bool -- | If condition (p :: b) then (t :: a) else (f :: a) -- --
--   >>> ite true "1" "2"
--       "1"
--   
--   >>> ite false 100 42
--       42
--   
class Iteable b a ite :: Iteable b a => b -> a -> a -> a ite :: (Iteable b a, Iteable b c, Applicative f, f c ~ a) => b -> a -> a -> a -- | Test two as on equality as SMT-Expression. -- -- You can derive an instance of this class if your type is -- Generic. -- --
--   x <- var @RealType
--   y <- var
--   assert $ y === x && not (y /== x)
--   
class Equatable a -- | Test whether two values are equal in the SMT-Problem. (===) :: Equatable a => a -> a -> Expr BoolSort -- | Test whether two values are equal in the SMT-Problem. (===) :: (Equatable a, Generic a, GEquatable (Rep a)) => a -> a -> Expr BoolSort -- | Test whether two values are not equal in the SMT-Problem. (/==) :: Equatable a => a -> a -> Expr BoolSort infix 4 === infix 4 /== -- | Compare two as as SMT-Expression. -- -- You can derive an instance of this class if your type is -- Generic. -- --
--   x <- var @RealSort
--   y <- var
--   assert $ x >? y
--   assert $ x === min' 42 100
--   
class Equatable a => Orderable a (<=?) :: Orderable a => a -> a -> Expr BoolSort (<=?) :: (Orderable a, Generic a, GOrderable (Rep a)) => a -> a -> Expr BoolSort (>=?) :: Orderable a => a -> a -> Expr BoolSort ( a -> a -> Expr BoolSort (>?) :: Orderable a => a -> a -> Expr BoolSort infix 4 <=? infix 4 >=? infix 4 ? -- | Minimum of two as SMT-Expression. min' :: (Orderable a, Iteable (Expr BoolSort) a) => a -> a -> a -- | Maximum of two as SMT-Expression. max' :: (Orderable a, Iteable (Expr BoolSort) a) => a -> a -> a -- | Test multiple expressions on equality within in the -- SMT-Problem. equal :: (Eq (HaskellType t), KnownSMTSort t, Foldable f) => f (Expr t) -> Expr BoolSort -- | Test multiple expressions on distinctness within in the -- SMT-Problem. distinct :: (Eq (HaskellType t), KnownSMTSort t, Foldable f) => f (Expr t) -> Expr BoolSort -- | A universal quantification for any specific SMTSort. If the -- type cannot be inferred, apply a type-annotation. Nested quantifiers -- are also supported. -- -- Usage: -- --
--   assert $
--      for_all @IntSort $ x ->
--         x + 0 === x && 0 + x === x
--   
--   
-- -- The lambdas x is all-quantified here. It will only be scoped -- for the lambdas body. for_all :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort -- | An existential quantification for any specific SMTSort If the -- type cannot be inferred, apply a type-annotation. Nested quantifiers -- are also supported. -- -- Usage: -- --
--   assert $
--      for_all @(BvSort 8) $ x ->
--          exists $ y ->
--            x - y === 0
--   
--   
-- -- The lambdas y is existentially quantified here. It will only -- be scoped for the lambdas body. exists :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort -- | Select a value from an array. select :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => Expr (ArraySort k v) -> Expr k -> Expr v -- | Store a value in an array. store :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k)) => Expr (ArraySort k v) -> Expr k -> Expr v -> Expr (ArraySort k v) -- | Bitvector shift left bvShL :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) -- | Bitvector logical shift right bvLShR :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) -- | Concat two bitvectors bvConcat :: (KnownNat n, KnownNat m) => Expr (BvSort n) -> Expr (BvSort m) -> Expr (BvSort (n + m)) -- | Converts an expression of type IntSort to type RealSort. toRealSort :: Expr IntSort -> Expr RealSort -- | Converts an expression of type RealSort to type IntSort. toIntSort :: Expr RealSort -> Expr IntSort -- | Checks whether an expression of type RealSort may be safely -- converted to type IntSort. isIntSort :: Expr RealSort -> Expr BoolSort -- | Length of a string. strLength :: Expr StringSort -> Expr IntSort -- | Singleton string containing a character at given position or empty -- string when position is out of range. The leftmost position is 0. strAt :: Expr StringSort -> Expr IntSort -> Expr StringSort -- | (strSubstring s i n) evaluates to the longest (unscattered) -- substring of s of length at most n starting at -- position i. It evaluates to the empty string if n is -- negative or i is not in the interval [0,l-1] where -- l is the length of s. strSubstring :: Expr StringSort -> Expr IntSort -> Expr IntSort -> Expr StringSort -- | First string is a prefix of second one. (str.prefixof s t) is -- true iff s is a prefix of t. strPrefixOf :: Expr StringSort -> Expr StringSort -> Expr BoolSort -- | First string is a suffix of second one. (str.suffixof s t) is -- true iff s is a suffix of t. strSuffixOf :: Expr StringSort -> Expr StringSort -> Expr BoolSort -- | First string contains second one (str.contains s t) iff -- s contains t. strContains :: Expr StringSort -> Expr StringSort -> Expr BoolSort -- | Index of first occurrence of second string in first one starting at -- the position specified by the third argument. (str.indexof s t -- i), with 0 <= i <= |s| is the position of the -- first occurrence of t in s at or after position -- i, if any. Otherwise, it is -1. Note that the result -- is i whenever i is within the range [0, -- |s|] and t is empty. strIndexOf :: Expr StringSort -> Expr StringSort -> Expr IntSort -> Expr IntSort -- | (str.replace s t t') is the string obtained by replacing the -- first occurrence of t in s, if any, by t'. -- Note that if t is empty, the result is to prepend t' -- to s; also, if t does not occur in s then -- the result is s. strReplace :: Expr StringSort -> Expr StringSort -> Expr StringSort -> Expr StringSort -- | (str.replace_all s t t’) is s if t is the -- empty string. Otherwise, it is the string obtained from s by -- replacing all occurrences of t in s by t’, -- starting with the first occurrence and proceeding in left-to-right -- order. strReplaceAll :: Expr StringSort -> Expr StringSort -> Expr StringSort -> Expr StringSort instance Language.Hasmtlib.Type.Expr.Orderable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.IntSort) instance Language.Hasmtlib.Type.Expr.Orderable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.RealSort) instance GHC.TypeNats.KnownNat n => Language.Hasmtlib.Type.Expr.Orderable (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance Language.Hasmtlib.Type.Expr.Orderable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.GOrderable (GHC.Generics.K1 i a) instance Language.Hasmtlib.Type.Expr.Orderable () instance Language.Hasmtlib.Type.Expr.Orderable GHC.Base.Void instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Int instance Language.Hasmtlib.Type.Expr.Orderable GHC.Num.Integer.Integer instance Language.Hasmtlib.Type.Expr.Orderable GHC.Num.Natural.Natural instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Word instance Language.Hasmtlib.Type.Expr.Orderable GHC.Word.Word8 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Word.Word16 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Word.Word32 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Word.Word64 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Int.Int8 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Int.Int16 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Int.Int32 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Int.Int64 instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Char instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Float instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Double instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Ordering instance Language.Hasmtlib.Type.Expr.Orderable GHC.Types.Bool instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b) => Language.Hasmtlib.Type.Expr.Orderable (a, b) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b, Language.Hasmtlib.Type.Expr.Orderable c) => Language.Hasmtlib.Type.Expr.Orderable (a, b, c) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b, Language.Hasmtlib.Type.Expr.Orderable c, Language.Hasmtlib.Type.Expr.Orderable d) => Language.Hasmtlib.Type.Expr.Orderable (a, b, c, d) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b, Language.Hasmtlib.Type.Expr.Orderable c, Language.Hasmtlib.Type.Expr.Orderable d, Language.Hasmtlib.Type.Expr.Orderable e) => Language.Hasmtlib.Type.Expr.Orderable (a, b, c, d, e) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b, Language.Hasmtlib.Type.Expr.Orderable c, Language.Hasmtlib.Type.Expr.Orderable d, Language.Hasmtlib.Type.Expr.Orderable e, Language.Hasmtlib.Type.Expr.Orderable f) => Language.Hasmtlib.Type.Expr.Orderable (a, b, c, d, e, f) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b, Language.Hasmtlib.Type.Expr.Orderable c, Language.Hasmtlib.Type.Expr.Orderable d, Language.Hasmtlib.Type.Expr.Orderable e, Language.Hasmtlib.Type.Expr.Orderable f, Language.Hasmtlib.Type.Expr.Orderable g) => Language.Hasmtlib.Type.Expr.Orderable (a, b, c, d, e, f, g) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b, Language.Hasmtlib.Type.Expr.Orderable c, Language.Hasmtlib.Type.Expr.Orderable d, Language.Hasmtlib.Type.Expr.Orderable e, Language.Hasmtlib.Type.Expr.Orderable f, Language.Hasmtlib.Type.Expr.Orderable g, Language.Hasmtlib.Type.Expr.Orderable h) => Language.Hasmtlib.Type.Expr.Orderable (a, b, c, d, e, f, g, h) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable [a] instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Tree.Tree a) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (GHC.Maybe.Maybe a) instance (Language.Hasmtlib.Type.Expr.Orderable a, Language.Hasmtlib.Type.Expr.Orderable b) => Language.Hasmtlib.Type.Expr.Orderable (Data.Either.Either a b) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Semigroup.Internal.Sum a) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Semigroup.Internal.Product a) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Monoid.First a) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Monoid.Last a) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Semigroup.Internal.Dual a) instance Language.Hasmtlib.Type.Expr.Orderable a => Language.Hasmtlib.Type.Expr.Orderable (Data.Functor.Identity.Identity a) instance GHC.Num.Num (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.IntSort) instance GHC.Num.Num (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.RealSort) instance Control.Lens.Cons.Cons (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Control.Lens.Cons.Snoc (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Language.Hasmtlib.Type.Expr.GOrderable GHC.Generics.U1 instance Language.Hasmtlib.Type.Expr.GOrderable GHC.Generics.V1 instance forall k (f :: k -> *) (g :: k -> *). (Language.Hasmtlib.Type.Expr.GOrderable f, Language.Hasmtlib.Type.Expr.GOrderable g) => Language.Hasmtlib.Type.Expr.GOrderable (f GHC.Generics.:*: g) instance forall k (f :: k -> *) (g :: k -> *). (Language.Hasmtlib.Type.Expr.GOrderable f, Language.Hasmtlib.Type.Expr.GOrderable g) => Language.Hasmtlib.Type.Expr.GOrderable (f GHC.Generics.:+: g) instance forall k (f :: k -> *) i (c :: GHC.Generics.Meta). Language.Hasmtlib.Type.Expr.GOrderable f => Language.Hasmtlib.Type.Expr.GOrderable (GHC.Generics.M1 i c f) instance (Language.Hasmtlib.Type.SMTSort.KnownSMTSort t, GHC.Classes.Eq (Language.Hasmtlib.Type.SMTSort.HaskellType t)) => Language.Hasmtlib.Type.Expr.Equatable (Language.Hasmtlib.Type.Expr.Expr t) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.GEquatable (GHC.Generics.K1 i a) instance Language.Hasmtlib.Type.Expr.Equatable () instance Language.Hasmtlib.Type.Expr.Equatable GHC.Base.Void instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Int instance Language.Hasmtlib.Type.Expr.Equatable GHC.Num.Integer.Integer instance Language.Hasmtlib.Type.Expr.Equatable GHC.Num.Natural.Natural instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Word instance Language.Hasmtlib.Type.Expr.Equatable GHC.Word.Word8 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Word.Word16 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Word.Word32 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Word.Word64 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Int.Int8 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Int.Int16 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Int.Int32 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Int.Int64 instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Char instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Float instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Double instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Ordering instance Language.Hasmtlib.Type.Expr.Equatable GHC.Types.Bool instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b) => Language.Hasmtlib.Type.Expr.Equatable (a, b) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b, Language.Hasmtlib.Type.Expr.Equatable c) => Language.Hasmtlib.Type.Expr.Equatable (a, b, c) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b, Language.Hasmtlib.Type.Expr.Equatable c, Language.Hasmtlib.Type.Expr.Equatable d) => Language.Hasmtlib.Type.Expr.Equatable (a, b, c, d) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b, Language.Hasmtlib.Type.Expr.Equatable c, Language.Hasmtlib.Type.Expr.Equatable d, Language.Hasmtlib.Type.Expr.Equatable e) => Language.Hasmtlib.Type.Expr.Equatable (a, b, c, d, e) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b, Language.Hasmtlib.Type.Expr.Equatable c, Language.Hasmtlib.Type.Expr.Equatable d, Language.Hasmtlib.Type.Expr.Equatable e, Language.Hasmtlib.Type.Expr.Equatable f) => Language.Hasmtlib.Type.Expr.Equatable (a, b, c, d, e, f) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b, Language.Hasmtlib.Type.Expr.Equatable c, Language.Hasmtlib.Type.Expr.Equatable d, Language.Hasmtlib.Type.Expr.Equatable e, Language.Hasmtlib.Type.Expr.Equatable f, Language.Hasmtlib.Type.Expr.Equatable g) => Language.Hasmtlib.Type.Expr.Equatable (a, b, c, d, e, f, g) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b, Language.Hasmtlib.Type.Expr.Equatable c, Language.Hasmtlib.Type.Expr.Equatable d, Language.Hasmtlib.Type.Expr.Equatable e, Language.Hasmtlib.Type.Expr.Equatable f, Language.Hasmtlib.Type.Expr.Equatable g, Language.Hasmtlib.Type.Expr.Equatable h) => Language.Hasmtlib.Type.Expr.Equatable (a, b, c, d, e, f, g, h) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable [a] instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Tree.Tree a) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (GHC.Maybe.Maybe a) instance (Language.Hasmtlib.Type.Expr.Equatable a, Language.Hasmtlib.Type.Expr.Equatable b) => Language.Hasmtlib.Type.Expr.Equatable (Data.Either.Either a b) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Semigroup.Internal.Sum a) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Semigroup.Internal.Product a) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Monoid.First a) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Monoid.Last a) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Semigroup.Internal.Dual a) instance Language.Hasmtlib.Type.Expr.Equatable a => Language.Hasmtlib.Type.Expr.Equatable (Data.Functor.Identity.Identity a) instance Language.Hasmtlib.Boolean.Boolean (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) instance Control.Lens.Empty.AsEmpty (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Language.Hasmtlib.Type.Expr.GEquatable GHC.Generics.U1 instance Language.Hasmtlib.Type.Expr.GEquatable GHC.Generics.V1 instance forall k (f :: k -> *) (g :: k -> *). (Language.Hasmtlib.Type.Expr.GEquatable f, Language.Hasmtlib.Type.Expr.GEquatable g) => Language.Hasmtlib.Type.Expr.GEquatable (f GHC.Generics.:*: g) instance forall k (f :: k -> *) (g :: k -> *). (Language.Hasmtlib.Type.Expr.GEquatable f, Language.Hasmtlib.Type.Expr.GEquatable g) => Language.Hasmtlib.Type.Expr.GEquatable (f GHC.Generics.:+: g) instance forall k (f :: k -> *) i (c :: GHC.Generics.Meta). Language.Hasmtlib.Type.Expr.GEquatable f => Language.Hasmtlib.Type.Expr.GEquatable (GHC.Generics.M1 i c f) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Language.Hasmtlib.Type.Expr.Expr t) instance Language.Hasmtlib.Type.Expr.Iteable GHC.Types.Bool a instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) [a] instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (GHC.Maybe.Maybe a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Sequence.Internal.Seq a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Tree.Tree a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Semigroup.Internal.Sum a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Semigroup.Internal.Product a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Monoid.First a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Monoid.Last a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Semigroup.Internal.Dual a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (Data.Functor.Identity.Identity a) instance Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) () instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b) instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) c) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b, c) instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) c, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) d) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b, c, d) instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) c, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) d, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) e) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b, c, d, e) instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) c, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) d, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) e, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) f) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b, c, d, e, f) instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) c, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) d, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) e, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) f, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) g) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b, c, d, e, f, g) instance (Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) a, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) b, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) c, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) d, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) e, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) f, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) g, Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) h) => Language.Hasmtlib.Type.Expr.Iteable (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) (a, b, c, d, e, f, g, h) instance Control.Lens.Prism.Prefixed (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Control.Lens.Prism.Suffixed (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance GHC.TypeNats.KnownNat n => GHC.Num.Num (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.Real.Fractional (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.RealSort) instance GHC.Float.Floating (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.RealSort) instance GHC.Real.Real (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.IntSort) instance GHC.Enum.Enum (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.IntSort) instance GHC.Real.Integral (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.IntSort) instance GHC.Real.Real (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.RealSort) instance GHC.Enum.Enum (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.RealSort) instance GHC.TypeNats.KnownNat n => GHC.Real.Real (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.TypeNats.KnownNat n => GHC.Enum.Enum (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.TypeNats.KnownNat n => GHC.Real.Integral (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.TypeNats.KnownNat n => Language.Hasmtlib.Boolean.Boolean (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.Enum.Bounded (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) instance GHC.TypeNats.KnownNat n => GHC.Enum.Bounded (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.Bits.Bits (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.BoolSort) instance GHC.TypeNats.KnownNat n => GHC.Bits.Bits (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.BvSort n)) instance GHC.Base.Semigroup (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance GHC.Base.Monoid (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Data.String.IsString (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Type.Value.Value t) instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Type.Expr.Expr t) instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => GHC.Show.Show (Language.Hasmtlib.Type.Expr.Expr t) instance Control.Lens.At.Ixed (Language.Hasmtlib.Type.Expr.Expr 'Language.Hasmtlib.Type.SMTSort.StringSort) instance (Language.Hasmtlib.Type.SMTSort.KnownSMTSort k, Language.Hasmtlib.Type.SMTSort.KnownSMTSort v, GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.HaskellType k), GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.HaskellType v)) => Control.Lens.At.Ixed (Language.Hasmtlib.Type.Expr.Expr ('Language.Hasmtlib.Type.SMTSort.ArraySort k v)) instance Language.Hasmtlib.Internal.Uniplate1.Uniplate1 Language.Hasmtlib.Type.Expr.Expr '[Language.Hasmtlib.Type.SMTSort.KnownSMTSort] instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => Control.Lens.Plated.Plated (Language.Hasmtlib.Type.Expr.Expr t) instance Data.GADT.DeepSeq.GNFData Language.Hasmtlib.Type.Expr.Expr instance GHC.Classes.Eq (Language.Hasmtlib.Type.Expr.Expr t) instance GHC.Classes.Ord (Language.Hasmtlib.Type.Expr.Expr t) instance Data.GADT.Internal.GEq Language.Hasmtlib.Type.Expr.Expr instance Data.GADT.Internal.GCompare Language.Hasmtlib.Type.Expr.Expr instance Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Type.Expr.SMTVar t) instance GHC.Show.Show (Language.Hasmtlib.Type.Value.Value t) instance GHC.Classes.Ord (Language.Hasmtlib.Type.Expr.SMTVar t) instance GHC.Classes.Eq (Language.Hasmtlib.Type.Expr.SMTVar t) instance GHC.Generics.Generic (Language.Hasmtlib.Type.Expr.SMTVar t) instance GHC.Show.Show (Language.Hasmtlib.Type.Expr.SMTVar t) module Language.Hasmtlib.Type.Solution -- | Function that turns a state into a result and a solution. type Solver s m = s -> m (Result, Solution) -- | Results of check-sat commands. data Result Unsat :: Result Unknown :: Result Sat :: Result -- | A Solution is a dependent map DMap from SSMTSorts t to -- IntMap t. type Solution = DMap SSMTSort IntValueMap -- | Newtype for IntMap Value so we can use it as -- right-hand-side of DMap. newtype IntValueMap t IntValueMap :: IntMap (Value t) -> IntValueMap t -- | A solution for a single variable. data SMTVarSol (t :: SMTSort) SMTVarSol :: SMTVar t -> Value t -> SMTVarSol (t :: SMTSort) -- | A variable in the SMT-Problem [_solVar] :: SMTVarSol (t :: SMTSort) -> SMTVar t -- | An assignment for this variable in a solution [_solVal] :: SMTVarSol (t :: SMTSort) -> Value t solVar :: forall t_a19at. Lens' (SMTVarSol t_a19at) (SMTVar t_a19at) solVal :: forall t_a19at. Lens' (SMTVarSol t_a19at) (Value t_a19at) -- | Alias class for constraint Ord (HaskellType t) class Ord (HaskellType t) => OrdHaskellType t -- | An existential wrapper that hides some known SMTSort with an -- Ord HaskellType type SomeKnownOrdSMTSort f = SomeSMTSort '[KnownSMTSort, OrdHaskellType] f -- | Create a Solution from some SMTVarSols. fromSomeVarSols :: [SomeKnownOrdSMTSort SMTVarSol] -> Solution instance GHC.Classes.Ord (Language.Hasmtlib.Type.SMTSort.HaskellType t) => Language.Hasmtlib.Type.Solution.OrdHaskellType t instance GHC.Classes.Ord Language.Hasmtlib.Type.Solution.Result instance GHC.Classes.Eq Language.Hasmtlib.Type.Solution.Result instance GHC.Show.Show Language.Hasmtlib.Type.Solution.Result instance GHC.Base.Monoid (Language.Hasmtlib.Type.Solution.IntValueMap t) instance GHC.Base.Semigroup (Language.Hasmtlib.Type.Solution.IntValueMap t) instance GHC.Show.Show (Language.Hasmtlib.Type.Solution.IntValueMap t) instance GHC.Show.Show (Language.Hasmtlib.Type.Solution.SMTVarSol t) module Language.Hasmtlib.Counting -- | Wrapper for count which takes a Proxy. count' :: forall t f. (Functor f, Foldable f, Num (Expr t)) => Proxy t -> f (Expr BoolSort) -> Expr t -- | Out of many bool-expressions build a formula which encodes how many of -- them are true. count :: forall t f. (Functor f, Foldable f, Num (Expr t)) => f (Expr BoolSort) -> Expr t -- | Out of many bool-expressions build a formula which encodes that at -- most k of them are true. atMost :: forall t f. (Functor f, Foldable f, Num (Expr t), Orderable (Expr t)) => Expr t -> f (Expr BoolSort) -> Expr BoolSort -- | Out of many bool-expressions build a formula which encodes that at -- least k of them are true. atLeast :: forall t f. (Functor f, Foldable f, Num (Expr t), Orderable (Expr t)) => Expr t -> f (Expr BoolSort) -> Expr BoolSort -- | Out of many bool-expressions build a formula which encodes that -- exactly k of them are true. exactly :: forall t f. (Functor f, Foldable f, Num (Expr t), Orderable (Expr t)) => Expr t -> f (Expr BoolSort) -> Expr BoolSort module Language.Hasmtlib.Codec -- | Computes a default Decoded Type by distributing -- Decoded to it's type arguments. type family DefaultDecoded a :: Type -- | Lift values to SMT-Values or decode them. -- -- You can derive an instance of this class if your type is -- Generic. class Codec a where { -- | Result of decoding a. type Decoded a :: Type; type Decoded a = DefaultDecoded a; } -- | Decode a value using given solution. decode :: Codec a => Solution -> a -> Maybe (Decoded a) -- | Decode a value using given solution. decode :: (Codec a, Generic a, Generic (Decoded a), GCodec (Rep a), GDecoded (Rep a) x ~ Rep (Decoded a) x) => Solution -> a -> Maybe (Decoded a) -- | Encode a value as constant. encode :: Codec a => Decoded a -> a -- | Encode a value as constant. encode :: (Codec a, Generic a, Generic (Decoded a), GCodec (Rep a), GDecoded (Rep a) x ~ Rep (Decoded a) x) => Decoded a -> a class GCodec f where { type GDecoded f :: Type -> Type; } gdecode :: GCodec f => Solution -> f a -> Maybe (GDecoded f a) gencode :: GCodec f => GDecoded f a -> f a instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => Language.Hasmtlib.Codec.Codec (Language.Hasmtlib.Type.Expr.Expr t) instance Language.Hasmtlib.Codec.Codec () instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b) => Language.Hasmtlib.Codec.Codec (a, b) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b, Language.Hasmtlib.Codec.Codec c) => Language.Hasmtlib.Codec.Codec (a, b, c) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b, Language.Hasmtlib.Codec.Codec c, Language.Hasmtlib.Codec.Codec d) => Language.Hasmtlib.Codec.Codec (a, b, c, d) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b, Language.Hasmtlib.Codec.Codec c, Language.Hasmtlib.Codec.Codec d, Language.Hasmtlib.Codec.Codec e) => Language.Hasmtlib.Codec.Codec (a, b, c, d, e) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b, Language.Hasmtlib.Codec.Codec c, Language.Hasmtlib.Codec.Codec d, Language.Hasmtlib.Codec.Codec e, Language.Hasmtlib.Codec.Codec f) => Language.Hasmtlib.Codec.Codec (a, b, c, d, e, f) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b, Language.Hasmtlib.Codec.Codec c, Language.Hasmtlib.Codec.Codec d, Language.Hasmtlib.Codec.Codec e, Language.Hasmtlib.Codec.Codec f, Language.Hasmtlib.Codec.Codec g) => Language.Hasmtlib.Codec.Codec (a, b, c, d, e, f, g) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b, Language.Hasmtlib.Codec.Codec c, Language.Hasmtlib.Codec.Codec d, Language.Hasmtlib.Codec.Codec e, Language.Hasmtlib.Codec.Codec f, Language.Hasmtlib.Codec.Codec g, Language.Hasmtlib.Codec.Codec h) => Language.Hasmtlib.Codec.Codec (a, b, c, d, e, f, g, h) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec [a] instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (GHC.Maybe.Maybe a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Tree.Tree a) instance (Language.Hasmtlib.Codec.Codec a, Language.Hasmtlib.Codec.Codec b) => Language.Hasmtlib.Codec.Codec (Data.Either.Either a b) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Semigroup.Internal.Sum a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Semigroup.Internal.Product a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Monoid.First a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Monoid.Last a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Semigroup.Internal.Dual a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Functor.Identity.Identity a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.IntMap.Internal.IntMap a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Sequence.Internal.Seq a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.Codec (Data.Map.Internal.Map k a) instance Language.Hasmtlib.Codec.Codec a => Language.Hasmtlib.Codec.GCodec (GHC.Generics.K1 i a) instance Language.Hasmtlib.Codec.GCodec GHC.Generics.U1 instance Language.Hasmtlib.Codec.GCodec GHC.Generics.V1 instance (Language.Hasmtlib.Codec.GCodec f, Language.Hasmtlib.Codec.GCodec g) => Language.Hasmtlib.Codec.GCodec (f GHC.Generics.:*: g) instance (Language.Hasmtlib.Codec.GCodec f, Language.Hasmtlib.Codec.GCodec g) => Language.Hasmtlib.Codec.GCodec (f GHC.Generics.:+: g) instance Language.Hasmtlib.Codec.GCodec f => Language.Hasmtlib.Codec.GCodec (GHC.Generics.M1 i c f) module Language.Hasmtlib.Type.MonadSMT -- | A MonadState that holds an SMT-Problem. class MonadState s m => MonadSMT s m -- | Construct a variable. This is mainly intended for internal use. In the -- API use var' instead. -- --
--   x :: SMTVar RealType <- smtvar' (Proxy @RealType)
--   
smtvar' :: forall t. (MonadSMT s m, KnownSMTSort t) => Proxy t -> m (SMTVar t) -- | Construct a variable as expression. -- --
--   x :: Expr RealType <- var' (Proxy @RealType)
--   
var' :: forall t. (MonadSMT s m, KnownSMTSort t) => Proxy t -> m (Expr t) -- | Assert a boolean expression. -- --
--   x :: Expr IntType <- var @IntType
--   assert $ x + 5 === 42
--   
assert :: MonadSMT s m => Expr BoolSort -> m () -- | Set an SMT-Solver-Option. -- --
--   setOption $ Incremental True
--   
setOption :: MonadSMT s m => SMTOption -> m () -- | Set the logic for the SMT-Solver to use. -- --
--   setLogic "QF_LRA"
--   
setLogic :: MonadSMT s m => String -> m () -- | Wrapper for var' which hides the Proxy. var :: forall t s m. (KnownSMTSort t, MonadSMT s m) => m (Expr t) -- | Wrapper for smtvar' which hides the Proxy. This is -- mainly intended for internal use. In the API use var instead. smtvar :: forall t s m. (KnownSMTSort t, MonadSMT s m) => m (SMTVar t) -- | Create a constant. -- --
--   >>> constant True
--       Constant (BoolValue True)
--   
-- --
--   >>> let x :: Integer = 10 ; constant x
--       Constant (IntValue 10)
--   
-- --
--   >>> constant @IntType 5
--       Constant (IntValue 5)
--   
-- --
--   >>> constant @(BvType 8) 5
--       Constant (BvValue 0000101)
--   
constant :: KnownSMTSort t => HaskellType t -> Expr t -- | Maybe assert a boolean expression. Asserts given expression if -- Maybe is a Just. Does nothing otherwise. assertMaybe :: MonadSMT s m => Maybe (Expr BoolSort) -> m () -- | Assign quantified variables to all quantified subexpressions of an -- expression. This shall only be used internally. Usually before -- rendering an assert. quantify :: MonadSMT s m => KnownSMTSort t => Expr t -> m (Expr t) -- | A MonadSMT that allows incremental solving. class MonadSMT s m => MonadIncrSMT s m -- | Push a new context (one) to the solvers context-stack. push :: MonadIncrSMT s m => m () -- | Pop the solvers context-stack by one. pop :: MonadIncrSMT s m => m () -- | Run check-sat on the current problem. checkSat :: MonadIncrSMT s m => m Result -- | Run get-model on the current problem. This can be used to decode -- temporary models within the SMT-Problem. -- --
--   x <- var @RealSort
--   y <- var
--   assert $ x >? y && y <? (-1)
--   res <- checkSat
--   case res of
--     Unsat -> print "Unsat. Cannot get model."
--     r     -> do
--       model <- getModel
--       liftIO $ print $ decode model x
--   
getModel :: MonadIncrSMT s m => m Solution -- | Evaluate any expressions value in the solvers model. Requires a -- Sat or Unknown check-sat response beforehand. -- --
--   x <- var @RealSort
--   assert $ x >? 10
--   res <- checkSat
--   case res of
--     Unsat -> print "Unsat. Cannot get value for x."
--     r     -> do
--       x' <- getValue x
--       liftIO $ print $ show r ++ ": x = " ++ show x'
--   
getValue :: (MonadIncrSMT s m, KnownSMTSort t) => Expr t -> m (Maybe (Decoded (Expr t))) -- | First run checkSat and then getModel on the current -- problem. solve :: (MonadIncrSMT s m, MonadIO m) => m (Result, Solution) -- | A MonadState that holds an OMT-Problem. An OMT-Problem is a -- 'SMT-Problem' with additional optimization targets. class MonadSMT s m => MonadOMT s m -- | Minimizes a numerical expression within the OMT-Problem. -- -- For example, below minimization: -- --
--   x <- var @IntSort
--   assert $ x >? -2
--   minimize x
--   
-- -- will give x := -1 as solution. minimize :: (MonadOMT s m, KnownSMTSort t, Num (Expr t)) => Expr t -> m () -- | Maximizes a numerical expression within the OMT-Problem. -- -- For example, below maximization: -- --
--   x <- var @(BvSort 8)
--   maximize x
--   
-- -- will give x := 11111111 as solution. maximize :: (MonadOMT s m, KnownSMTSort t, Num (Expr t)) => Expr t -> m () -- | Asserts a soft boolean expression. May take a weight and an identifier -- for grouping. -- -- For example, below a soft constraint with weight 2.0 and identifier -- "myId" for grouping: -- --
--   x <- var @BoolSort
--   assertSoft x (Just 2.0) (Just "myId")
--   
-- -- Omitting the weight will default it to 1.0. -- --
--   x <- var BoolSort
--   y <- var BoolSort
--   assertSoft x
--   assertSoft y (Just "myId")
--   
assertSoft :: MonadOMT s m => Expr BoolSort -> Maybe Double -> Maybe String -> m () -- | Like assertSoft but forces a weight and omits the group-id. assertSoftWeighted :: MonadOMT s m => Expr BoolSort -> Double -> m () module Language.Hasmtlib.Internal.Sharing -- | States that can share expressions by comparing their -- StableNames. class Sharing s where { -- | A constraint on the monad used when asserting the shared node in -- assertSharedNode. type SharingMonad s :: (Type -> Type) -> Constraint; } -- | A Lens' on a mapping between a StableName and it's -- Expr we may share. stableMap :: Sharing s => Lens' s (HashMap (StableName ()) (SomeKnownSMTSort Expr)) -- | Asserts that a node-expression is represented by it's auxiliary -- node-variable: nodeExpr :: Expr t === nodeVar. Also gives -- access to the StableName of the original expression. assertSharedNode :: (Sharing s, MonadState s m, SharingMonad s m) => StableName () -> Expr BoolSort -> m () -- | Sets the mode used for sharing common expressions. Defaults to -- StableNames. setSharingMode :: (Sharing s, MonadState s m) => SharingMode -> m () -- | Mode used for sharing. data SharingMode -- | Common expressions are not shared at all None :: SharingMode -- | Expressions that resolve to the same StableName are shared StableNames :: SharingMode -- | Shares all possible sub-expressions in given expression. Replaces each -- node in the expression-tree with an auxiliary variable. All nodes -- x y where makeStableName x == makeStableName -- y are replaced with the same auxiliary variable. Therefore this -- creates a DAG. runSharing :: (KnownSMTSort t, MonadSMT s m, Sharing s, SharingMonad s m) => SharingMode -> Expr t -> m (Expr t) -- | Returns an auxiliary variable representing this expression node. If -- such a shared auxiliary variable exists already, returns that. -- Otherwise creates one and returns it. share :: (Equatable (Expr t), KnownSMTSort t, MonadSMT s m, Sharing s, SharingMonad s m) => Expr t -> m (Expr t) -> m (Expr t) instance GHC.Show.Show Language.Hasmtlib.Internal.Sharing.SharingMode instance Data.Default.Class.Default Language.Hasmtlib.Internal.Sharing.SharingMode module Language.Hasmtlib.Type.SMT -- | The state of the SMT-problem. data SMT SMT :: {-# UNPACK #-} !Int -> !Seq (SomeKnownSMTSort SMTVar) -> !Seq (Expr BoolSort) -> Maybe String -> [SMTOption] -> !SharingMode -> !HashMap (StableName ()) (SomeKnownSMTSort Expr) -> SMT -- | Last Id assigned to a new var [_lastVarId] :: SMT -> {-# UNPACK #-} !Int -- | All constructed variables [_vars] :: SMT -> !Seq (SomeKnownSMTSort SMTVar) -- | All asserted formulas [_formulas] :: SMT -> !Seq (Expr BoolSort) -- | Logic for the SMT-Solver [_mlogic] :: SMT -> Maybe String -- | All manually configured SMT-Solver-Options [_options] :: SMT -> [SMTOption] -- | How to share common expressions [_sharingMode] :: SMT -> !SharingMode -- | Mapping between a StableName and it's Expr we may share [_stableMap] :: SMT -> !HashMap (StableName ()) (SomeKnownSMTSort Expr) vars :: Lens' SMT (Seq (SomeKnownSMTSort SMTVar)) stableMap :: Lens' SMT (HashMap (StableName ()) (SomeKnownSMTSort Expr)) sharingMode :: Lens' SMT SharingMode options :: Lens' SMT [SMTOption] mlogic :: Lens' SMT (Maybe String) lastVarId :: Lens' SMT Int formulas :: Lens' SMT (Seq (Expr 'BoolSort)) renderSetLogic :: Builder -> Builder renderDeclareVar :: forall t. KnownSMTSort t => SMTVar t -> Builder renderAssert :: Expr BoolSort -> Builder renderVars :: Seq (SomeKnownSMTSort SMTVar) -> Seq Builder instance Data.Default.Class.Default Language.Hasmtlib.Type.SMT.SMT instance Language.Hasmtlib.Internal.Sharing.Sharing Language.Hasmtlib.Type.SMT.SMT instance Control.Monad.State.Class.MonadState Language.Hasmtlib.Type.SMT.SMT m => Language.Hasmtlib.Type.MonadSMT.MonadSMT Language.Hasmtlib.Type.SMT.SMT m instance Language.Hasmtlib.Internal.Render.RenderSeq Language.Hasmtlib.Type.SMT.SMT module Language.Hasmtlib.Type.OMT -- | An assertion of a booolean expression in OMT that may be weighted. data SoftFormula SoftFormula :: Expr BoolSort -> Maybe Double -> Maybe String -> SoftFormula -- | The underlying soft formula [_formula] :: SoftFormula -> Expr BoolSort -- | Weight of the soft formula [_mWeight] :: SoftFormula -> Maybe Double -- | Group-Id of the soft formula [_mGroupId] :: SoftFormula -> Maybe String mWeight :: Lens' SoftFormula (Maybe Double) mGroupId :: Lens' SoftFormula (Maybe String) formula :: Lens' SoftFormula (Expr 'BoolSort) -- | A newtype for numerical expressions that are target of a minimization. newtype Minimize t Minimize :: Expr t -> Minimize t [_targetMin] :: Minimize t -> Expr t -- | A newtype for numerical expressions that are target of a maximization. newtype Maximize t Maximize :: Expr t -> Maximize t [_targetMax] :: Maximize t -> Expr t -- | The state of the OMT-problem. data OMT OMT :: !SMT -> !Seq (SomeKnownSMTSort Minimize) -> !Seq (SomeKnownSMTSort Maximize) -> !Seq SoftFormula -> OMT -- | The underlying SMT-Problem [_smt] :: OMT -> !SMT -- | All expressions to minimize [_targetMinimize] :: OMT -> !Seq (SomeKnownSMTSort Minimize) -- | All expressions to maximize [_targetMaximize] :: OMT -> !Seq (SomeKnownSMTSort Maximize) -- | All soft assertions of boolean expressions [_softFormulas] :: OMT -> !Seq SoftFormula targetMinimize :: Lens' OMT (Seq (SomeKnownSMTSort Minimize)) targetMaximize :: Lens' OMT (Seq (SomeKnownSMTSort Maximize)) softFormulas :: Lens' OMT (Seq SoftFormula) smt :: Lens' OMT SMT instance Data.Default.Class.Default Language.Hasmtlib.Type.OMT.OMT instance Language.Hasmtlib.Internal.Sharing.Sharing Language.Hasmtlib.Type.OMT.OMT instance Control.Monad.State.Class.MonadState Language.Hasmtlib.Type.OMT.OMT m => Language.Hasmtlib.Type.MonadSMT.MonadSMT Language.Hasmtlib.Type.OMT.OMT m instance Language.Hasmtlib.Type.MonadSMT.MonadSMT Language.Hasmtlib.Type.OMT.OMT m => Language.Hasmtlib.Type.MonadSMT.MonadOMT Language.Hasmtlib.Type.OMT.OMT m instance Language.Hasmtlib.Internal.Render.Render Language.Hasmtlib.Type.OMT.SoftFormula instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Type.OMT.Minimize t) instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => Language.Hasmtlib.Internal.Render.Render (Language.Hasmtlib.Type.OMT.Maximize t) instance Language.Hasmtlib.Internal.Render.RenderSeq Language.Hasmtlib.Type.OMT.OMT instance GHC.Show.Show Language.Hasmtlib.Type.OMT.SoftFormula module Language.Hasmtlib.Internal.Parser answerParser :: Parser (Result, Solution) resultParser :: Parser Result anyModelParser :: Parser Solution defaultModelParser :: Parser Solution smt2ModelParser :: Parser Solution parseSomeSol :: Parser (SomeKnownOrdSMTSort SMTVarSol) parseSomeSort :: Parser (SomeKnownOrdSMTSort SSMTSort) parseSomeBitVecSort :: Parser (SomeKnownOrdSMTSort SSMTSort) parseSomeArraySort :: Parser (SomeKnownOrdSMTSort SSMTSort) parseExpr' :: forall prxy t. KnownSMTSort t => prxy t -> Parser (Expr t) parseExpr :: forall t. KnownSMTSort t => Parser (Expr t) var :: KnownSMTSort t => Parser (Expr t) constant :: forall t. KnownSMTSort t => Parser (HaskellType t) constantExpr :: forall t. KnownSMTSort t => Parser (Expr t) anyBitvector :: KnownNat n => Proxy n -> Parser (Bitvec n) binBitvector :: KnownNat n => Proxy n -> Parser (Bitvec n) hexBitvector :: KnownNat n => Proxy n -> Parser (Bitvec n) literalBitvector :: KnownNat n => Proxy n -> Parser (Bitvec n) constArray :: forall k v. (KnownSMTSort v, Ord (HaskellType k)) => Proxy k -> Proxy v -> Parser (ConstArray (HaskellType k) (HaskellType v)) parseSmtString :: Parser Text unary :: forall t r. KnownSMTSort t => ByteString -> (Expr t -> Expr r) -> Parser (Expr r) binary :: forall t u r. (KnownSMTSort t, KnownSMTSort u) => ByteString -> (Expr t -> Expr u -> Expr r) -> Parser (Expr r) ternary :: forall t u v r. (KnownSMTSort t, KnownSMTSort u, KnownSMTSort v) => ByteString -> (Expr t -> Expr u -> Expr v -> Expr r) -> Parser (Expr r) nary :: forall t r. KnownSMTSort t => ByteString -> ([Expr t] -> Expr r) -> Parser (Expr r) smtPi :: Parser (Expr RealSort) anyValue :: Num a => Parser a -> Parser a negativeValue :: Num a => Parser a -> Parser a parseRatioDouble :: Parser Double parseToRealDouble :: Parser Double parseBool :: Parser Bool getValueParser :: KnownSMTSort t => SMTVar t -> Parser (SMTVarSol t) module Language.Hasmtlib.Type.Pipe -- | A pipe to the solver. If Solver is Queuing then all -- commands that do not expect an answer are sent to the queue. All -- commands that expect an answer have the queue to be sent to the solver -- before sending the command itself. If Solver is not -- Queuing, all commands are sent to the solver immediately. data Pipe Pipe :: {-# UNPACK #-} !Int -> Maybe String -> !SharingMode -> !HashMap (StableName ()) (SomeKnownSMTSort Expr) -> !Seq (Seq (StableName ())) -> !Solver -> !Bool -> Pipe -- | Last Id assigned to a new var [_lastPipeVarId] :: Pipe -> {-# UNPACK #-} !Int -- | Logic for the SMT-Solver [_mPipeLogic] :: Pipe -> Maybe String -- | How to share common expressions [_pipeSharingMode] :: Pipe -> !SharingMode -- | Mapping between a StableName and it's Expr we may share [_pipeStableMap] :: Pipe -> !HashMap (StableName ()) (SomeKnownSMTSort Expr) -- | Index of each Seq (StableName ()) is incremental stack -- height where StableName representing auxiliary var that has -- been shared [_incrSharedAuxs] :: Pipe -> !Seq (Seq (StableName ())) -- | Active pipe to the backend [_pipeSolver] :: Pipe -> !Solver -- | Flag if pipe shall debug [_isDebugging] :: Pipe -> !Bool pipeStableMap :: Lens' Pipe (HashMap (StableName ()) (SomeKnownSMTSort Expr)) pipeSolver :: Lens' Pipe Solver pipeSharingMode :: Lens' Pipe SharingMode mPipeLogic :: Lens' Pipe (Maybe String) lastPipeVarId :: Lens' Pipe Int isDebugging :: Lens' Pipe Bool incrSharedAuxs :: Lens' Pipe (Seq (Seq (StableName ()))) instance Language.Hasmtlib.Internal.Sharing.Sharing Language.Hasmtlib.Type.Pipe.Pipe instance (Control.Monad.State.Class.MonadState Language.Hasmtlib.Type.Pipe.Pipe m, Control.Monad.IO.Class.MonadIO m) => Language.Hasmtlib.Type.MonadSMT.MonadSMT Language.Hasmtlib.Type.Pipe.Pipe m instance (Control.Monad.State.Class.MonadState Language.Hasmtlib.Type.Pipe.Pipe m, Control.Monad.IO.Class.MonadIO m) => Language.Hasmtlib.Type.MonadSMT.MonadIncrSMT Language.Hasmtlib.Type.Pipe.Pipe m instance (Language.Hasmtlib.Type.MonadSMT.MonadSMT Language.Hasmtlib.Type.Pipe.Pipe m, Control.Monad.IO.Class.MonadIO m) => Language.Hasmtlib.Type.MonadSMT.MonadOMT Language.Hasmtlib.Type.Pipe.Pipe m module Language.Hasmtlib.Type.Solver -- | Data that can have a Solver which may be debugged. class WithSolver a -- | Create a datum with a Solver and a 'Bool for whether to debug -- the Solver. withSolver :: WithSolver a => Solver -> Bool -> a -- | solveWith solver prob solves a SMT problem -- prob with the given solver. It returns a pair -- consisting of: -- --
    --
  1. A Result that indicates if prob is satisfiable -- (Sat), unsatisfiable (Unsat), or if the solver could not -- determine any results (Unknown).
  2. --
  3. A Decoded answer that was decoded using the solution to -- prob. Note that this answer is only meaningful if the -- Result is Sat or Unknown and the answer value is -- in a Just.
  4. --
-- -- Here is a small example of how to use solveWith: -- --
--   import Language.Hasmtlib
--   
--   main :: IO ()
--   main = do
--     res <- solveWith SMT (solver cvc5) $ do
--       setLogic "QF_LIA"
--   
--       x <- var IntSort
--   
--       assert $ x >? 0
--   
--       return x
--   
--     print res
--   
solveWith :: (Default s, Monad m, Codec a) => Solver s m -> StateT s m a -> m (Result, Maybe (Decoded a)) -- | Pipes an SMT-problem interactively to the solver. Enables incremental -- solving by default. Here is a small example of how to use it for -- solving a problem utilizing the solvers incremental stack: -- --
--   import Language.Hasmtlib
--   import Control.Monad.IO.Class
--   
--   main :: IO ()
--   main = do
--     cvc5Living <- interactiveSolver cvc5
--     interactiveWith Pipe cvc5Living $ do
--       setOption $ Incremental True
--       setOption $ ProduceModels True
--       setLogic "QF_LIA"
--   
--       x <- var IntSort
--   
--       assert $ x >? 0
--   
--       (res, sol) <- solve
--       liftIO $ print res
--       liftIO $ print $ decode sol x
--   
--       push
--       y <- var @IntSort
--   
--       assert $ y <? 0
--       assert $ x === y
--   
--       res' <- checkSat
--       liftIO $ print res'
--       pop
--   
--       res'' <- checkSat
--       liftIO $ print res''
--   
--     return ()
--   
interactiveWith :: (WithSolver s, MonadIO m) => (Solver, Handle) -> StateT s m () -> m () -- | Like interactiveWith but it prints all communication with the -- solver to console. debugInteractiveWith :: (WithSolver s, MonadIO m) => (Solver, Handle) -> StateT s m () -> m () -- | Solves the current problem with respect to a minimal solution for a -- given numerical expression. -- -- Does not rely on MaxSMT/OMT. Instead uses iterative refinement. -- -- If you want access to intermediate results, use -- solveMinimizedDebug instead. solveMinimized :: (MonadIncrSMT Pipe m, MonadIO m, KnownSMTSort t, Orderable (Expr t)) => Expr t -> m (Result, Solution) -- | Like solveMinimized but with access to intermediate results. solveMinimizedDebug :: (MonadIncrSMT Pipe m, MonadIO m, KnownSMTSort t, Orderable (Expr t)) => (Solution -> IO ()) -> Expr t -> m (Result, Solution) -- | Solves the current problem with respect to a maximal solution for a -- given numerical expression. -- -- Does not rely on MaxSMT/OMT. Instead uses iterative refinement. -- -- If you want access to intermediate results, use -- solveMaximizedDebug instead. solveMaximized :: (MonadIncrSMT Pipe m, MonadIO m, KnownSMTSort t, Orderable (Expr t)) => Expr t -> m (Result, Solution) -- | Like solveMaximized but with access to intermediate results. solveMaximizedDebug :: (MonadIncrSMT Pipe m, MonadIO m, KnownSMTSort t, Orderable (Expr t)) => (Solution -> IO ()) -> Expr t -> m (Result, Solution) instance Language.Hasmtlib.Type.Solver.WithSolver Language.Hasmtlib.Type.Pipe.Pipe module Language.Hasmtlib.Solver.Common -- | Creates a Solver from a Config. solver :: (RenderSeq s, MonadIO m) => Config -> Solver s m -- | Creates a debugging Solver from a Config. debug :: (RenderSeq s, MonadIO m) => Config -> Debugger s -> Solver s m -- | Creates an interactive session with a solver by creating and returning -- an alive process-handle Handle. Queues commands by default, see -- Queuing. interactiveSolver :: MonadIO m => Config -> m (Solver, Handle) -- | A type holding actions for debugging states. data Debugger s Debugger :: (s -> IO ()) -> (Seq Builder -> IO ()) -> (ByteString -> IO ()) -> (ByteString -> IO ()) -> Debugger s -- | Debug the entire state [debugState] :: Debugger s -> s -> IO () -- | Debug the linewise-rendered problem [debugProblem] :: Debugger s -> Seq Builder -> IO () -- | Debug the solvers raw response for (check-sat) [debugResultResponse] :: Debugger s -> ByteString -> IO () -- | Debug the solvers raw response for (get-model) [debugModelResponse] :: Debugger s -> ByteString -> IO () -- | A Solver which holds an external process with a SMT-Solver. -- This will: -- --
    --
  1. Encode the SMT-problem,
  2. --
  3. Start a new external process for the SMT-Solver,
  4. --
  5. Send the problem to the SMT-Solver,
  6. --
  7. Wait for an answer and parse it and
  8. --
  9. close the process and clean up all resources.
  10. --
processSolver :: (RenderSeq s, MonadIO m) => Config -> Maybe (Debugger s) -> Solver s m instance Data.Default.Class.Default (Language.Hasmtlib.Solver.Common.Debugger Language.Hasmtlib.Type.SMT.SMT) instance Data.Default.Class.Default (Language.Hasmtlib.Solver.Common.Debugger Language.Hasmtlib.Type.OMT.OMT) module Language.Hasmtlib.Variable -- | Construct a variable datum of a data-type by creating variables for -- all its fields. -- -- You can derive an instance of this class if your type is -- Generic and has exactly one constructor. -- --
--   data V3 a = V3 a a a deriving Generic
--   instance Variable a => V3 a
--   
-- --
--   >>> varV3 :: V3 (Expr RealType) <- variable ; varV3
--       V3 (Expr RealType) (Expr RealType) (Expr RealType)
--   
class Variable a variable :: (Variable a, MonadSMT s m) => m a variable :: (Variable a, MonadSMT s m, Generic a, GVariable (Rep a)) => m a -- | Wrapper for variable which takes a Proxy variable' :: forall s m a. (MonadSMT s m, Variable a) => Proxy a -> m a class GVariable f gvariable :: (GVariable f, MonadSMT s m) => m (f a) instance Language.Hasmtlib.Type.SMTSort.KnownSMTSort t => Language.Hasmtlib.Variable.Variable (Language.Hasmtlib.Type.Expr.Expr t) instance Language.Hasmtlib.Variable.Variable () instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b) => Language.Hasmtlib.Variable.Variable (a, b) instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b, Language.Hasmtlib.Variable.Variable c) => Language.Hasmtlib.Variable.Variable (a, b, c) instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b, Language.Hasmtlib.Variable.Variable c, Language.Hasmtlib.Variable.Variable d) => Language.Hasmtlib.Variable.Variable (a, b, c, d) instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b, Language.Hasmtlib.Variable.Variable c, Language.Hasmtlib.Variable.Variable d, Language.Hasmtlib.Variable.Variable e) => Language.Hasmtlib.Variable.Variable (a, b, c, d, e) instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b, Language.Hasmtlib.Variable.Variable c, Language.Hasmtlib.Variable.Variable d, Language.Hasmtlib.Variable.Variable e, Language.Hasmtlib.Variable.Variable f) => Language.Hasmtlib.Variable.Variable (a, b, c, d, e, f) instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b, Language.Hasmtlib.Variable.Variable c, Language.Hasmtlib.Variable.Variable d, Language.Hasmtlib.Variable.Variable e, Language.Hasmtlib.Variable.Variable f, Language.Hasmtlib.Variable.Variable g) => Language.Hasmtlib.Variable.Variable (a, b, c, d, e, f, g) instance (Language.Hasmtlib.Variable.Variable a, Language.Hasmtlib.Variable.Variable b, Language.Hasmtlib.Variable.Variable c, Language.Hasmtlib.Variable.Variable d, Language.Hasmtlib.Variable.Variable e, Language.Hasmtlib.Variable.Variable f, Language.Hasmtlib.Variable.Variable g, Language.Hasmtlib.Variable.Variable h) => Language.Hasmtlib.Variable.Variable (a, b, c, d, e, f, g, h) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (Data.Semigroup.Internal.Sum a) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (Data.Semigroup.Internal.Product a) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (Data.Monoid.First a) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (Data.Monoid.Last a) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (Data.Semigroup.Internal.Dual a) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (Data.Functor.Identity.Identity a) instance forall k m (a :: k). Language.Hasmtlib.Variable.Variable m => Language.Hasmtlib.Variable.Variable (Data.Functor.Const.Const m a) instance forall k (f :: k -> *) (a :: k). Language.Hasmtlib.Variable.Variable (f a) => Language.Hasmtlib.Variable.Variable (Data.Semigroup.Internal.Alt f a) instance forall k k1 (f :: k -> *) (g :: k1 -> k) (a :: k1). Language.Hasmtlib.Variable.Variable (f (g a)) => Language.Hasmtlib.Variable.Variable (Data.Functor.Compose.Compose f g a) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.Variable (GHC.Maybe.Maybe a) instance Language.Hasmtlib.Variable.Variable b => Language.Hasmtlib.Variable.Variable (Data.Either.Either a b) instance Language.Hasmtlib.Variable.Variable a => Language.Hasmtlib.Variable.GVariable (GHC.Generics.K1 i a) instance Language.Hasmtlib.Variable.GVariable GHC.Generics.U1 instance forall k (f :: k -> *) (g :: k -> *). (Language.Hasmtlib.Variable.GVariable f, Language.Hasmtlib.Variable.GVariable g) => Language.Hasmtlib.Variable.GVariable (f GHC.Generics.:*: g) instance forall k (f :: k -> *) i (c :: GHC.Generics.Meta). Language.Hasmtlib.Variable.GVariable f => Language.Hasmtlib.Variable.GVariable (GHC.Generics.M1 i c f) module Language.Hasmtlib -- | Mode used for sharing. data SharingMode -- | Common expressions are not shared at all None :: SharingMode -- | Expressions that resolve to the same StableName are shared StableNames :: SharingMode -- | Sets the mode used for sharing common expressions. Defaults to -- StableNames. setSharingMode :: (Sharing s, MonadState s m) => SharingMode -> m ()