Safe Haskell | Safe-Inferred |
---|---|
Language | GHC2021 |
Synopsis
- data SMTSort
- newtype SMTVar (t :: SMTSort) = SMTVar {}
- type family HaskellType (t :: SMTSort) = (r :: Type) | r -> t where ...
- data Value (t :: SMTSort) where
- IntValue :: HaskellType IntSort -> Value IntSort
- RealValue :: HaskellType RealSort -> Value RealSort
- BoolValue :: HaskellType BoolSort -> Value BoolSort
- BvValue :: HaskellType (BvSort n) -> Value (BvSort n)
- unwrapValue :: Value t -> HaskellType t
- wrapValue :: forall t. KnownSMTSort t => HaskellType t -> Value t
- data SSMTSort (t :: SMTSort) where
- class KnownSMTSort (t :: SMTSort) where
- data SomeKnownSMTSort f where
- SomeKnownSMTSort :: forall (t :: SMTSort) f. KnownSMTSort t => f t -> SomeKnownSMTSort f
- data Expr (t :: SMTSort)
- for_all :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort
- exists :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort
- 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, KnownNat i, KnownNat (Mod i n)) => Proxy i -> Expr (BvSort n) -> Expr (BvSort n)
- bvRotR :: (KnownNat n, KnownNat i, KnownNat (Mod i n)) => Proxy i -> Expr (BvSort n) -> Expr (BvSort n)
Documentation
Sorts in SMTLib2 - used as promoted type (data-kind).
newtype SMTVar (t :: SMTSort) Source #
An internal SMT variable with a phantom-type which holds an Int
as it's identifier.
type family HaskellType (t :: SMTSort) = (r :: Type) | r -> t where ... Source #
HaskellType IntSort = Integer | |
HaskellType RealSort = Double | |
HaskellType BoolSort = Bool | |
HaskellType (BvSort n) = Bitvec n |
data Value (t :: SMTSort) where Source #
A wrapper for values of SMTSort
s.
IntValue :: HaskellType IntSort -> Value IntSort | |
RealValue :: HaskellType RealSort -> Value RealSort | |
BoolValue :: HaskellType BoolSort -> Value BoolSort | |
BvValue :: HaskellType (BvSort n) -> Value (BvSort n) |
unwrapValue :: Value t -> HaskellType t Source #
Unwrap a value.
wrapValue :: forall t. KnownSMTSort t => HaskellType t -> Value t Source #
Wrap a value.
data SSMTSort (t :: SMTSort) where Source #
Singleton for SMTSort
.
SIntSort :: SSMTSort IntSort | |
SRealSort :: SSMTSort RealSort | |
SBoolSort :: SSMTSort BoolSort | |
SBvSort :: KnownNat n => Proxy n -> SSMTSort (BvSort n) |
Instances
Show (SSMTSort t) Source # | |
Eq (SSMTSort t) Source # | |
Ord (SSMTSort t) Source # | |
Defined in Language.Hasmtlib.Internal.Expr | |
Render (SSMTSort t) Source # | |
class KnownSMTSort (t :: SMTSort) where Source #
Instances
KnownSMTSort 'BoolSort Source # | |
KnownSMTSort 'IntSort Source # | |
KnownSMTSort 'RealSort Source # | |
KnownNat n => KnownSMTSort ('BvSort n) Source # | |
data SomeKnownSMTSort f where Source #
An existential wrapper that hides some SMTSort
.
SomeKnownSMTSort :: forall (t :: SMTSort) f. KnownSMTSort t => f t -> SomeKnownSMTSort f |
data Expr (t :: SMTSort) Source #
A SMT expression. For internal use only. For building expressions use the corresponding instances (Num, Boolean, ...).
Instances
for_all :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort Source #
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.
exists :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort Source #
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.
bvShL :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) Source #
Bitvector shift left
bvLShR :: KnownNat n => Expr (BvSort n) -> Expr (BvSort n) -> Expr (BvSort n) Source #
Bitvector logical shift right
bvConcat :: (KnownNat n, KnownNat m) => Expr (BvSort n) -> Expr (BvSort m) -> Expr (BvSort (n + m)) Source #
Concat two bitvectors