hasmtlib-2.8.1: A monad for interfacing with external SMT solvers
Safe HaskellSafe-Inferred
LanguageGHC2021

Language.Hasmtlib.Type.Expr

Description

This module provides the data-type Expr.

It represents SMTLib-expressions via an abstract syntax tree (AST), implemented as GADT.

Variables are just Ints wrapped in a newtype SMTVar with a phantom-type SMTSort.

Usually the end user of this library does not need to deal with this representation. Instead he should rely on the provided instances for building expressions. Some of the main classes of these include:

  1. Equatable and Orderable for symbolic comparisons,
  2. Iteable for symbolic branching via ite,
  3. Boolean for symbolic bool operations,
  4. Prelude classics like: Num, Floating, Integral, Bounded, ... for arithmetics
  5. Bits for BitVec-operations

Besides that, there are also some operations defined by the SMTLib-Standard Version 2.6 that do not fit into any classes and therefore are exported as plain functions, like for_all or bvConcat.

Synopsis

SMTVar

newtype SMTVar (t :: SMTSort) Source #

An internal SMT variable with a phantom-type which holds an Int as it's identifier.

Constructors

SMTVar 

Fields

Instances

Instances details
Generic (SMTVar t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Associated Types

type Rep (SMTVar t) :: Type -> Type #

Methods

from :: SMTVar t -> Rep (SMTVar t) x #

to :: Rep (SMTVar t) x -> SMTVar t #

Show (SMTVar t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

showsPrec :: Int -> SMTVar t -> ShowS #

show :: SMTVar t -> String #

showList :: [SMTVar t] -> ShowS #

Eq (SMTVar t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(==) :: SMTVar t -> SMTVar t -> Bool #

(/=) :: SMTVar t -> SMTVar t -> Bool #

Ord (SMTVar t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

compare :: SMTVar t -> SMTVar t -> Ordering #

(<) :: SMTVar t -> SMTVar t -> Bool #

(<=) :: SMTVar t -> SMTVar t -> Bool #

(>) :: SMTVar t -> SMTVar t -> Bool #

(>=) :: SMTVar t -> SMTVar t -> Bool #

max :: SMTVar t -> SMTVar t -> SMTVar t #

min :: SMTVar t -> SMTVar t -> SMTVar t #

Render (SMTVar t) Source # 
Instance details

Defined in Language.Hasmtlib.Internal.Render

Methods

render :: SMTVar t -> Builder Source #

type Rep (SMTVar t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

type Rep (SMTVar t) = D1 ('MetaData "SMTVar" "Language.Hasmtlib.Type.Expr" "hasmtlib-2.8.1-inplace" 'True) (C1 ('MetaCons "SMTVar" 'PrefixI 'True) (S1 ('MetaSel ('Just "_varId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))

varId :: forall t t. Iso (SMTVar t) (SMTVar t) Int Int Source #

Expr type

data Expr (t :: SMTSort) where Source #

An SMT-Expression. For building expressions use the corresponding instances.

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.

Constructors

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 
Rem :: 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 :: (KnownBvEnc enc, KnownNat n) => Expr (BvSort enc n) -> Expr (BvSort enc n) -> Expr (BvSort enc n) 
BvNor :: (KnownBvEnc enc, KnownNat n) => Expr (BvSort enc n) -> Expr (BvSort enc n) -> Expr (BvSort enc n) 
BvShL :: (KnownBvEnc enc, KnownNat n) => Expr (BvSort enc n) -> Expr (BvSort enc n) -> Expr (BvSort enc n) 
BvLShR :: KnownNat n => Expr (BvSort Unsigned n) -> Expr (BvSort Unsigned n) -> Expr (BvSort Unsigned n) 
BvAShR :: KnownNat n => Expr (BvSort Signed n) -> Expr (BvSort Signed n) -> Expr (BvSort Signed n) 
BvConcat :: (KnownBvEnc enc, KnownNat n, KnownNat m) => Expr (BvSort enc n) -> Expr (BvSort enc m) -> Expr (BvSort enc (n + m)) 
BvRotL :: (KnownBvEnc enc, KnownNat n, Integral a) => a -> Expr (BvSort enc n) -> Expr (BvSort enc n) 
BvRotR :: (KnownBvEnc enc, KnownNat n, Integral a) => a -> Expr (BvSort enc n) -> Expr (BvSort enc 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 
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 
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

Just v if quantified var has been created already, Nothing otherwise

Instances

Instances details
GNFData Expr Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

grnf :: forall (a :: k). Expr a -> () #

GCompare Expr Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

gcompare :: forall (a :: k) (b :: k). Expr a -> Expr b -> GOrdering a b #

GEq Expr Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

geq :: forall (a :: k) (b :: k). Expr a -> Expr b -> Maybe (a :~: b) #

Uniplate1 Expr '[KnownSMTSort] Source #

Caution for quantified expressions: uniplate1 will only be applied if quantification has taken place already.

Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

uniplate1 :: forall m (b :: k). (Applicative m, AllC '[KnownSMTSort] b) => (forall (a :: k). AllC '[KnownSMTSort] a => Expr a -> m (Expr a)) -> Expr b -> m (Expr b) Source #

IsString (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Monoid (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Semigroup (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Bits (Expr 'BoolSort) Source #

This instance is partial for testBit and popCount, it's only intended for use with constants (Constant).

Instance details

Defined in Language.Hasmtlib.Type.Expr

(KnownBvEnc enc, KnownNat n) => Bits (Expr ('BvSort enc n)) Source #

This instance is partial for testBit and popCount, it's only intended for use with constants (Constant).

Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(.&.) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) #

(.|.) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) #

xor :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) #

complement :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) #

shift :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

rotate :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

zeroBits :: Expr ('BvSort enc n) #

bit :: Int -> Expr ('BvSort enc n) #

setBit :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

clearBit :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

complementBit :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

testBit :: Expr ('BvSort enc n) -> Int -> Bool #

bitSizeMaybe :: Expr ('BvSort enc n) -> Maybe Int #

bitSize :: Expr ('BvSort enc n) -> Int #

isSigned :: Expr ('BvSort enc n) -> Bool #

shiftL :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

unsafeShiftL :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

shiftR :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

unsafeShiftR :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

rotateL :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

rotateR :: Expr ('BvSort enc n) -> Int -> Expr ('BvSort enc n) #

popCount :: Expr ('BvSort enc n) -> Int #

Bounded (Expr 'BoolSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

(KnownBvEnc enc, KnownNat n) => Bounded (Expr ('BvSort enc n)) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

minBound :: Expr ('BvSort enc n) #

maxBound :: Expr ('BvSort enc n) #

(KnownSMTSort t, Enum (HaskellType t)) => Enum (Expr t) Source #

This instance is partial for fromEnum, this method is only intended for use with constants.

Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

succ :: Expr t -> Expr t #

pred :: Expr t -> Expr t #

toEnum :: Int -> Expr t #

fromEnum :: Expr t -> Int #

enumFrom :: Expr t -> [Expr t] #

enumFromThen :: Expr t -> Expr t -> [Expr t] #

enumFromTo :: Expr t -> Expr t -> [Expr t] #

enumFromThenTo :: Expr t -> Expr t -> Expr t -> [Expr t] #

Floating (Expr 'RealSort) Source #

Not part of the SMTLib standard Version 2.6. Some solvers support it. At least valid for CVC5 and MathSAT.

Instance details

Defined in Language.Hasmtlib.Type.Expr

(KnownSMTSort t, Num (HaskellType t), Ord (HaskellType t)) => Num (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(+) :: Expr t -> Expr t -> Expr t #

(-) :: Expr t -> Expr t -> Expr t #

(*) :: Expr t -> Expr t -> Expr t #

negate :: Expr t -> Expr t #

abs :: Expr t -> Expr t #

signum :: Expr t -> Expr t #

fromInteger :: Integer -> Expr t #

Fractional (Expr 'RealSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

(KnownSMTSort t, Integral (HaskellType t)) => Integral (Expr t) Source #

This instance is partial for toInteger, this method is only intended for use with constants.

Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

quot :: Expr t -> Expr t -> Expr t #

rem :: Expr t -> Expr t -> Expr t #

div :: Expr t -> Expr t -> Expr t #

mod :: Expr t -> Expr t -> Expr t #

quotRem :: Expr t -> Expr t -> (Expr t, Expr t) #

divMod :: Expr t -> Expr t -> (Expr t, Expr t) #

toInteger :: Expr t -> Integer #

(KnownSMTSort t, Real (HaskellType t)) => Real (Expr t) Source #

This instance is partial for toRational, this method is only intended for use with constants.

Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

toRational :: Expr t -> Rational #

KnownSMTSort t => Show (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Internal.Render

Methods

showsPrec :: Int -> Expr t -> ShowS #

show :: Expr t -> String #

showList :: [Expr t] -> ShowS #

Eq (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(==) :: Expr t -> Expr t -> Bool #

(/=) :: Expr t -> Expr t -> Bool #

Ord (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

compare :: Expr t -> Expr t -> Ordering #

(<) :: Expr t -> Expr t -> Bool #

(<=) :: Expr t -> Expr t -> Bool #

(>) :: Expr t -> Expr t -> Bool #

(>=) :: Expr t -> Expr t -> Bool #

max :: Expr t -> Expr t -> Expr t #

min :: Expr t -> Expr t -> Expr t #

Boolean (Expr 'BoolSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

(KnownBvEnc enc, KnownNat n) => Boolean (Expr ('BvSort enc n)) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

bool :: Bool -> Expr ('BvSort enc n) Source #

true :: Expr ('BvSort enc n) Source #

false :: Expr ('BvSort enc n) Source #

(&&) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

(||) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

(==>) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

(<==) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

(<==>) :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

not :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

xor :: Expr ('BvSort enc n) -> Expr ('BvSort enc n) -> Expr ('BvSort enc n) Source #

KnownSMTSort t => Codec (Expr t) Source #

Decode and evaluate expressions

Instance details

Defined in Language.Hasmtlib.Codec

Associated Types

type Decoded (Expr t) Source #

Methods

decode :: Solution -> Expr t -> Maybe (Decoded (Expr t)) Source #

encode :: Decoded (Expr t) -> Expr t Source #

KnownSMTSort t => Render (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Internal.Render

Methods

render :: Expr t -> Builder Source #

(KnownSMTSort t, Eq (HaskellType t)) => Equatable (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(/==) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(KnownSMTSort t, Ord (HaskellType t)) => Orderable (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(>=?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(<?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(>?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

KnownSMTSort t => Variable (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Variable

Methods

variable :: MonadSMT s m => m (Expr t) Source #

(KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => Ixed (Expr ('ArraySort k v)) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ix :: Index (Expr ('ArraySort k v)) -> Traversal' (Expr ('ArraySort k v)) (IxValue (Expr ('ArraySort k v))) #

Ixed (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

AsEmpty (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

_Empty :: Prism' (Expr 'StringSort) () #

KnownSMTSort t => Plated (Expr t) Source #

Caution for quantified expressions: plate will only be applied if quantification has taken place already.

Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

plate :: Traversal' (Expr t) (Expr t) #

Prefixed (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Suffixed (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Iteable (Expr 'BoolSort) () Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> () -> () -> () Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Identity a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Identity a -> Identity a -> Identity a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (First a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> First a -> First a -> First a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Last a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Last a -> Last a -> Last a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Dual a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Dual a -> Dual a -> Dual a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Product a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Product a -> Product a -> Product a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Sum a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Sum a -> Sum a -> Sum a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Seq a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Seq a -> Seq a -> Seq a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Tree a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Tree a -> Tree a -> Tree a Source #

Iteable (Expr 'BoolSort) (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Expr t -> Expr t -> Expr t Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Maybe a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Maybe a -> Maybe a -> Maybe a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) [a] Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> [a] -> [a] -> [a] Source #

Cons (Expr 'StringSort) (Expr 'StringSort) (Expr 'StringSort) (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Snoc (Expr 'StringSort) (Expr 'StringSort) (Expr 'StringSort) (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b) => Iteable (Expr 'BoolSort) (a, b) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b) -> (a, b) -> (a, b) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c) => Iteable (Expr 'BoolSort) (a, b, c) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c) -> (a, b, c) -> (a, b, c) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d) => Iteable (Expr 'BoolSort) (a, b, c, d) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e) => Iteable (Expr 'BoolSort) (a, b, c, d, e) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e, Iteable (Expr 'BoolSort) f) => Iteable (Expr 'BoolSort) (a, b, c, d, e, f) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e, Iteable (Expr 'BoolSort) f, Iteable (Expr 'BoolSort) g) => Iteable (Expr 'BoolSort) (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e, Iteable (Expr 'BoolSort) f, Iteable (Expr 'BoolSort) g, Iteable (Expr 'BoolSort) h) => Iteable (Expr 'BoolSort) (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #

(Ix a, Ix b, a ~ c, b ~ d) => Each (Relation a b) (Relation c d) (Expr 'BoolSort) (Expr 'BoolSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Relation

Methods

each :: Traversal (Relation a b) (Relation c d) (Expr 'BoolSort) (Expr 'BoolSort) #

type Decoded (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Codec

type Decoded (Expr t) = HaskellType t
type Index (Expr ('ArraySort k v)) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

type Index (Expr ('ArraySort k v)) = Expr k
type Index (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

type IxValue (Expr ('ArraySort k v)) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

type IxValue (Expr ('ArraySort k v)) = Expr v
type IxValue (Expr 'StringSort) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

isLeaf :: Expr t -> Bool Source #

Indicates whether an expression is a leaf. All non-recursive contructors are leafs.

exprSize :: KnownSMTSort t => Expr t -> Integer Source #

Size of the expression.

Counts the amount of operations.

Examples

Expand
>>> nodeSize $ x + y === x + y
    3
>>> nodeSize $ false
    0

Compare

Equatable

Class

class Equatable a where Source #

Symbolically test two values on equality.

A generic default implementation with GEquatable is possible.

Example

Expand
x <- var @RealType
y <- var
assert $ y === x && not (y /== x) && x === 42

Minimal complete definition

Nothing

Methods

(===) :: a -> a -> Expr BoolSort infix 4 Source #

Test whether two values are equal in the SMT-Problem.

default (===) :: (Generic a, GEquatable (Rep a)) => a -> a -> Expr BoolSort Source #

(/==) :: a -> a -> Expr BoolSort infix 4 Source #

Test whether two values are not equal in the SMT-Problem.

Instances

Instances details
Equatable Void Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Int16 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Int32 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Int64 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Int8 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Word16 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Word32 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Word64 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Word8 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Ordering Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Integer Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Natural Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable () Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: () -> () -> Expr 'BoolSort Source #

(/==) :: () -> () -> Expr 'BoolSort Source #

Equatable Bool Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Char Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Double Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Float Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Int Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable Word Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable a => Equatable (Identity a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable a => Equatable (First a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: First a -> First a -> Expr 'BoolSort Source #

(/==) :: First a -> First a -> Expr 'BoolSort Source #

Equatable a => Equatable (Last a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Last a -> Last a -> Expr 'BoolSort Source #

(/==) :: Last a -> Last a -> Expr 'BoolSort Source #

Equatable a => Equatable (Dual a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Dual a -> Dual a -> Expr 'BoolSort Source #

(/==) :: Dual a -> Dual a -> Expr 'BoolSort Source #

Equatable a => Equatable (Product a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Equatable a => Equatable (Sum a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Sum a -> Sum a -> Expr 'BoolSort Source #

(/==) :: Sum a -> Sum a -> Expr 'BoolSort Source #

Equatable a => Equatable (Tree a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Tree a -> Tree a -> Expr 'BoolSort Source #

(/==) :: Tree a -> Tree a -> Expr 'BoolSort Source #

(KnownSMTSort t, Eq (HaskellType t)) => Equatable (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(/==) :: Expr t -> Expr t -> Expr 'BoolSort Source #

Equatable a => Equatable (Maybe a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Maybe a -> Maybe a -> Expr 'BoolSort Source #

(/==) :: Maybe a -> Maybe a -> Expr 'BoolSort Source #

Equatable a => Equatable [a] Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: [a] -> [a] -> Expr 'BoolSort Source #

(/==) :: [a] -> [a] -> Expr 'BoolSort Source #

(Equatable a, Equatable b) => Equatable (Either a b) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: Either a b -> Either a b -> Expr 'BoolSort Source #

(/==) :: Either a b -> Either a b -> Expr 'BoolSort Source #

(Equatable a, Equatable b) => Equatable (a, b) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b) -> (a, b) -> Expr 'BoolSort Source #

(/==) :: (a, b) -> (a, b) -> Expr 'BoolSort Source #

(Equatable a, Equatable b, Equatable c) => Equatable (a, b, c) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b, c) -> (a, b, c) -> Expr 'BoolSort Source #

(/==) :: (a, b, c) -> (a, b, c) -> Expr 'BoolSort Source #

(Equatable a, Equatable b, Equatable c, Equatable d) => Equatable (a, b, c, d) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b, c, d) -> (a, b, c, d) -> Expr 'BoolSort Source #

(/==) :: (a, b, c, d) -> (a, b, c, d) -> Expr 'BoolSort Source #

(Equatable a, Equatable b, Equatable c, Equatable d, Equatable e) => Equatable (a, b, c, d, e) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Expr 'BoolSort Source #

(/==) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Expr 'BoolSort Source #

(Equatable a, Equatable b, Equatable c, Equatable d, Equatable e, Equatable f) => Equatable (a, b, c, d, e, f) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Expr 'BoolSort Source #

(/==) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Expr 'BoolSort Source #

(Equatable a, Equatable b, Equatable c, Equatable d, Equatable e, Equatable f, Equatable g) => Equatable (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Expr 'BoolSort Source #

(/==) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Expr 'BoolSort Source #

(Equatable a, Equatable b, Equatable c, Equatable d, Equatable e, Equatable f, Equatable g, Equatable h) => Equatable (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Expr 'BoolSort Source #

(/==) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Expr 'BoolSort Source #

equal :: (Eq (HaskellType t), KnownSMTSort t, Foldable f) => f (Expr t) -> Expr BoolSort Source #

Symbolically test multiple expressions on equality.

Returns true if given less than two arguments.

distinct :: (Eq (HaskellType t), KnownSMTSort t, Foldable f) => f (Expr t) -> Expr BoolSort Source #

Symbolically test multiple expressions on distinctness.

Returns true if given less than two arguments.

Generic

class GEquatable f where Source #

Methods

(===#) :: f a -> f a -> Expr BoolSort Source #

Instances

Instances details
GEquatable (U1 :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===#) :: forall (a :: k0). U1 a -> U1 a -> Expr 'BoolSort Source #

GEquatable (V1 :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===#) :: forall (a :: k0). V1 a -> V1 a -> Expr 'BoolSort Source #

(GEquatable f, GEquatable g) => GEquatable (f :*: g :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===#) :: forall (a :: k0). (f :*: g) a -> (f :*: g) a -> Expr 'BoolSort Source #

(GEquatable f, GEquatable g) => GEquatable (f :+: g :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===#) :: forall (a :: k0). (f :+: g) a -> (f :+: g) a -> Expr 'BoolSort Source #

Equatable a => GEquatable (K1 i a :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===#) :: forall (a0 :: k0). K1 i a a0 -> K1 i a a0 -> Expr 'BoolSort Source #

GEquatable f => GEquatable (M1 i c f :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(===#) :: forall (a :: k0). M1 i c f a -> M1 i c f a -> Expr 'BoolSort Source #

Orderable

Class

class Equatable a => Orderable a where Source #

Symbolically compare two values.

A generic default implementation with GOrderable is possible.

Example

Expand
x <- var @RealSort
y <- var
assert $ x >? y
assert $ x === min' 42 100

Minimal complete definition

Nothing

Methods

(<=?) :: a -> a -> Expr BoolSort infix 4 Source #

default (<=?) :: (Generic a, GOrderable (Rep a)) => a -> a -> Expr BoolSort Source #

(>=?) :: a -> a -> Expr BoolSort infix 4 Source #

(<?) :: a -> a -> Expr BoolSort infix 4 Source #

(>?) :: a -> a -> Expr BoolSort infix 4 Source #

Instances

Instances details
Orderable Void Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Int16 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Int32 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Int64 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Int8 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Word16 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Word32 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Word64 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Word8 Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Ordering Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Integer Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Natural Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable () Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: () -> () -> Expr 'BoolSort Source #

(>=?) :: () -> () -> Expr 'BoolSort Source #

(<?) :: () -> () -> Expr 'BoolSort Source #

(>?) :: () -> () -> Expr 'BoolSort Source #

Orderable Bool Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Char Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Double Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Float Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Int Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable Word Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable a => Orderable (Identity a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable a => Orderable (First a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable a => Orderable (Last a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Last a -> Last a -> Expr 'BoolSort Source #

(>=?) :: Last a -> Last a -> Expr 'BoolSort Source #

(<?) :: Last a -> Last a -> Expr 'BoolSort Source #

(>?) :: Last a -> Last a -> Expr 'BoolSort Source #

Orderable a => Orderable (Dual a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Dual a -> Dual a -> Expr 'BoolSort Source #

(>=?) :: Dual a -> Dual a -> Expr 'BoolSort Source #

(<?) :: Dual a -> Dual a -> Expr 'BoolSort Source #

(>?) :: Dual a -> Dual a -> Expr 'BoolSort Source #

Orderable a => Orderable (Product a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable a => Orderable (Sum a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Sum a -> Sum a -> Expr 'BoolSort Source #

(>=?) :: Sum a -> Sum a -> Expr 'BoolSort Source #

(<?) :: Sum a -> Sum a -> Expr 'BoolSort Source #

(>?) :: Sum a -> Sum a -> Expr 'BoolSort Source #

Orderable a => Orderable (Tree a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Tree a -> Tree a -> Expr 'BoolSort Source #

(>=?) :: Tree a -> Tree a -> Expr 'BoolSort Source #

(<?) :: Tree a -> Tree a -> Expr 'BoolSort Source #

(>?) :: Tree a -> Tree a -> Expr 'BoolSort Source #

(KnownSMTSort t, Ord (HaskellType t)) => Orderable (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(>=?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(<?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

(>?) :: Expr t -> Expr t -> Expr 'BoolSort Source #

Orderable a => Orderable (Maybe a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Orderable a => Orderable [a] Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: [a] -> [a] -> Expr 'BoolSort Source #

(>=?) :: [a] -> [a] -> Expr 'BoolSort Source #

(<?) :: [a] -> [a] -> Expr 'BoolSort Source #

(>?) :: [a] -> [a] -> Expr 'BoolSort Source #

(Orderable a, Orderable b) => Orderable (Either a b) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: Either a b -> Either a b -> Expr 'BoolSort Source #

(>=?) :: Either a b -> Either a b -> Expr 'BoolSort Source #

(<?) :: Either a b -> Either a b -> Expr 'BoolSort Source #

(>?) :: Either a b -> Either a b -> Expr 'BoolSort Source #

(Orderable a, Orderable b) => Orderable (a, b) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b) -> (a, b) -> Expr 'BoolSort Source #

(>=?) :: (a, b) -> (a, b) -> Expr 'BoolSort Source #

(<?) :: (a, b) -> (a, b) -> Expr 'BoolSort Source #

(>?) :: (a, b) -> (a, b) -> Expr 'BoolSort Source #

(Orderable a, Orderable b, Orderable c) => Orderable (a, b, c) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b, c) -> (a, b, c) -> Expr 'BoolSort Source #

(>=?) :: (a, b, c) -> (a, b, c) -> Expr 'BoolSort Source #

(<?) :: (a, b, c) -> (a, b, c) -> Expr 'BoolSort Source #

(>?) :: (a, b, c) -> (a, b, c) -> Expr 'BoolSort Source #

(Orderable a, Orderable b, Orderable c, Orderable d) => Orderable (a, b, c, d) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b, c, d) -> (a, b, c, d) -> Expr 'BoolSort Source #

(>=?) :: (a, b, c, d) -> (a, b, c, d) -> Expr 'BoolSort Source #

(<?) :: (a, b, c, d) -> (a, b, c, d) -> Expr 'BoolSort Source #

(>?) :: (a, b, c, d) -> (a, b, c, d) -> Expr 'BoolSort Source #

(Orderable a, Orderable b, Orderable c, Orderable d, Orderable e) => Orderable (a, b, c, d, e) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Expr 'BoolSort Source #

(>=?) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Expr 'BoolSort Source #

(<?) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Expr 'BoolSort Source #

(>?) :: (a, b, c, d, e) -> (a, b, c, d, e) -> Expr 'BoolSort Source #

(Orderable a, Orderable b, Orderable c, Orderable d, Orderable e, Orderable f) => Orderable (a, b, c, d, e, f) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Expr 'BoolSort Source #

(>=?) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Expr 'BoolSort Source #

(<?) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Expr 'BoolSort Source #

(>?) :: (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> Expr 'BoolSort Source #

(Orderable a, Orderable b, Orderable c, Orderable d, Orderable e, Orderable f, Orderable g) => Orderable (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Expr 'BoolSort Source #

(>=?) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Expr 'BoolSort Source #

(<?) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Expr 'BoolSort Source #

(>?) :: (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> Expr 'BoolSort Source #

(Orderable a, Orderable b, Orderable c, Orderable d, Orderable e, Orderable f, Orderable g, Orderable h) => Orderable (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<=?) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Expr 'BoolSort Source #

(>=?) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Expr 'BoolSort Source #

(<?) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Expr 'BoolSort Source #

(>?) :: (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> Expr 'BoolSort Source #

min' :: (Orderable a, Iteable (Expr BoolSort) a) => a -> a -> a Source #

Symbolic evaluation of the minimum of two symbolic values.

max' :: (Orderable a, Iteable (Expr BoolSort) a) => a -> a -> a Source #

Symbolic evaluation of the maximum of two symbolic values.

Generic

class GEquatable f => GOrderable f where Source #

Methods

(<?#) :: f a -> f a -> Expr BoolSort Source #

(<=?#) :: f a -> f a -> Expr BoolSort Source #

Instances

Instances details
GOrderable (U1 :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<?#) :: forall (a :: k0). U1 a -> U1 a -> Expr 'BoolSort Source #

(<=?#) :: forall (a :: k0). U1 a -> U1 a -> Expr 'BoolSort Source #

GOrderable (V1 :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<?#) :: forall (a :: k0). V1 a -> V1 a -> Expr 'BoolSort Source #

(<=?#) :: forall (a :: k0). V1 a -> V1 a -> Expr 'BoolSort Source #

(GOrderable f, GOrderable g) => GOrderable (f :*: g :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<?#) :: forall (a :: k0). (f :*: g) a -> (f :*: g) a -> Expr 'BoolSort Source #

(<=?#) :: forall (a :: k0). (f :*: g) a -> (f :*: g) a -> Expr 'BoolSort Source #

(GOrderable f, GOrderable g) => GOrderable (f :+: g :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<?#) :: forall (a :: k0). (f :+: g) a -> (f :+: g) a -> Expr 'BoolSort Source #

(<=?#) :: forall (a :: k0). (f :+: g) a -> (f :+: g) a -> Expr 'BoolSort Source #

Orderable a => GOrderable (K1 i a :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<?#) :: forall (a0 :: k0). K1 i a a0 -> K1 i a a0 -> Expr 'BoolSort Source #

(<=?#) :: forall (a0 :: k0). K1 i a a0 -> K1 i a a0 -> Expr 'BoolSort Source #

GOrderable f => GOrderable (M1 i c f :: k -> Type) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

(<?#) :: forall (a :: k0). M1 i c f a -> M1 i c f a -> Expr 'BoolSort Source #

(<=?#) :: forall (a :: k0). M1 i c f a -> M1 i c f a -> Expr 'BoolSort Source #

Iteable

class Iteable b a where Source #

Class that allows branching on predicates of type b on branches of type a.

If predicate (p :: b) then (t :: a) else (f :: a).

There is a default implementation if your type is an Applicative.

Examples

Expand
>>> ite True "1" "2"
    "1"
>>> ite False 100 42
    42

Minimal complete definition

Nothing

Methods

ite :: b -> a -> a -> a Source #

default ite :: (Iteable b c, Applicative f, f c ~ a) => b -> a -> a -> a Source #

Instances

Instances details
Iteable Bool a Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Bool -> a -> a -> a Source #

Iteable (Expr 'BoolSort) () Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> () -> () -> () Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Identity a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Identity a -> Identity a -> Identity a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (First a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> First a -> First a -> First a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Last a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Last a -> Last a -> Last a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Dual a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Dual a -> Dual a -> Dual a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Product a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Product a -> Product a -> Product a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Sum a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Sum a -> Sum a -> Sum a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Seq a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Seq a -> Seq a -> Seq a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Tree a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Tree a -> Tree a -> Tree a Source #

Iteable (Expr 'BoolSort) (Expr t) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Expr t -> Expr t -> Expr t Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) (Maybe a) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> Maybe a -> Maybe a -> Maybe a Source #

Iteable (Expr 'BoolSort) a => Iteable (Expr 'BoolSort) [a] Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> [a] -> [a] -> [a] Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b) => Iteable (Expr 'BoolSort) (a, b) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b) -> (a, b) -> (a, b) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c) => Iteable (Expr 'BoolSort) (a, b, c) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c) -> (a, b, c) -> (a, b, c) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d) => Iteable (Expr 'BoolSort) (a, b, c, d) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d) -> (a, b, c, d) -> (a, b, c, d) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e) => Iteable (Expr 'BoolSort) (a, b, c, d, e) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e) -> (a, b, c, d, e) -> (a, b, c, d, e) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e, Iteable (Expr 'BoolSort) f) => Iteable (Expr 'BoolSort) (a, b, c, d, e, f) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) -> (a, b, c, d, e, f) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e, Iteable (Expr 'BoolSort) f, Iteable (Expr 'BoolSort) g) => Iteable (Expr 'BoolSort) (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) -> (a, b, c, d, e, f, g) Source #

(Iteable (Expr 'BoolSort) a, Iteable (Expr 'BoolSort) b, Iteable (Expr 'BoolSort) c, Iteable (Expr 'BoolSort) d, Iteable (Expr 'BoolSort) e, Iteable (Expr 'BoolSort) f, Iteable (Expr 'BoolSort) g, Iteable (Expr 'BoolSort) h) => Iteable (Expr 'BoolSort) (a, b, c, d, e, f, g, h) Source # 
Instance details

Defined in Language.Hasmtlib.Type.Expr

Methods

ite :: Expr 'BoolSort -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) -> (a, b, c, d, e, f, g, h) Source #

Non-class functions

Quantifier

for_all :: forall t. KnownSMTSort t => (Expr t -> Expr BoolSort) -> Expr BoolSort Source #

Universal quantification for any specific SMTSort.

Example

Expand
  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 #

Existential quantification for any specific SMTSort

Example

Expand
  assert $
     for_all @(BvSort Unsigned 8) $ x ->
         exists $ y ->
           x - y === 0
  

The lambdas y is existentially quantified here. It will only be scoped for the lambdas body.

BitVec

bvConcat :: (KnownBvEnc enc, KnownNat n, KnownNat m) => Expr (BvSort enc n) -> Expr (BvSort enc m) -> Expr (BvSort enc (n + m)) Source #

Concats two bitvectors.

Array

select :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k), Ord (HaskellType v)) => Expr (ArraySort k v) -> Expr k -> Expr v Source #

Select a value from an array.

store :: (KnownSMTSort k, KnownSMTSort v, Ord (HaskellType k)) => Expr (ArraySort k v) -> Expr k -> Expr v -> Expr (ArraySort k v) Source #

Store a value in an array.

String

strLength :: Expr StringSort -> Expr IntSort Source #

Length of a string.

strAt :: Expr StringSort -> Expr IntSort -> Expr StringSort Source #

Singleton string containing a character at given position or empty string when position is out of range. The leftmost position is 0.

strSubstring :: Expr StringSort -> Expr IntSort -> Expr IntSort -> Expr StringSort Source #

(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.

strPrefixOf :: Expr StringSort -> Expr StringSort -> Expr BoolSort Source #

First string is a prefix of second one. (strPrefixof s t) is true iff s is a prefix of t.

strSuffixOf :: Expr StringSort -> Expr StringSort -> Expr BoolSort Source #

First string is a suffix of second one. (strSuffixof s t) is true iff s is a suffix of t.

strContains :: Expr StringSort -> Expr StringSort -> Expr BoolSort Source #

First string contains second one (strContains s t) iff s contains t.

strIndexOf :: Expr StringSort -> Expr StringSort -> Expr IntSort -> Expr IntSort Source #

Index of first occurrence of second string in first one starting at the position specified by the third argument. (strIndexof 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.

strReplace :: Expr StringSort -> Expr StringSort -> Expr StringSort -> Expr StringSort Source #

(strReplace 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.

strReplaceAll :: Expr StringSort -> Expr StringSort -> Expr StringSort -> Expr StringSort Source #

(strReplaceAll 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.

Conversion

toRealSort :: Expr IntSort -> Expr RealSort Source #

Converts an expression of type IntSort to type RealSort.

toIntSort :: Expr RealSort -> Expr IntSort Source #

Converts an expression of type RealSort to type IntSort.

isIntSort :: Expr RealSort -> Expr BoolSort Source #

Checks whether an expression of type RealSort may be safely converted to type IntSort.