Safe Haskell | None |
---|---|
Language | Haskell98 |
- data Type
- type family Lifted tps idx :: [Type]
- class Unlift tps idx where
- type family Fst a :: p
- type family Snd a :: q
- class (Typeable t, Typeable (DatatypeSig t), Show t, Ord t) => IsDatatype t where
- type DatatypeSig t :: [[Type]]
- type TypeCollectionSig t :: [([[Type]], *)]
- getDatatype :: e t -> Datatype `(DatatypeSig t, t)`
- getTypeCollection :: e t -> TypeCollection (TypeCollectionSig t)
- getConstructor :: t -> Constrs con (DatatypeSig t) t -> (forall arg. con `(arg, t)` -> List ConcreteValue arg -> a) -> a
- type TypeCollection sigs = Datatypes Datatype sigs
- data Datatype sig = Datatype {
- datatypeName :: String
- constructors :: Constrs Constr (Fst sig) (Snd sig)
- data Constr sig = Constr {}
- data Field a t = Field {}
- data Value con a where
- data ConcreteValue a where
- BoolValueC :: Bool -> ConcreteValue BoolType
- IntValueC :: Integer -> ConcreteValue IntType
- RealValueC :: Rational -> ConcreteValue RealType
- BitVecValueC :: Integer -> Natural n -> ConcreteValue (BitVecType n)
- ConstrValueC :: IsDatatype t => t -> ConcreteValue (DataType t)
- data AnyValue con = forall t . AnyValue (Value con t)
- data Repr t where
- data NumRepr t where
- data Constrs con a t where
- data Datatypes dts sigs where
- NoDts :: Datatypes dts `[]`
- ConsDts :: IsDatatype dt => dts `(DatatypeSig dt, dt)` -> Datatypes dts sigs -> Datatypes dts (`(DatatypeSig dt, dt)` : sigs)
- data FunRepr sig where
- class GetType v where
- class GetFunType fun where
- getFunType :: fun `(arg, res)` -> (List Repr arg, Repr res)
- class GetConType con where
- getConType :: IsDatatype dt => con `(arg, dt)` -> (List Repr arg, Datatype `(DatatypeSig dt, dt)`)
- class GetFieldType field where
- getFieldType :: IsDatatype dt => field `(dt, tp)` -> (Datatype `(DatatypeSig dt, dt)`, Repr tp)
- bool :: Repr BoolType
- int :: Repr IntType
- real :: Repr RealType
- bitvec :: Natural bw -> Repr (BitVecType bw)
- array :: List Repr idx -> Repr el -> Repr (ArrayType idx el)
- reifyType :: Type -> (forall tp. Repr tp -> a) -> a
- mapValue :: (Monad m, Typeable con2) => (forall arg dt. con1 `(arg, dt)` -> m (con2 `(arg, dt)`)) -> Value con1 a -> m (Value con2 a)
- findConstrByName :: String -> Datatype `(cons, dt)` -> (forall arg. Constr `(arg, dt)` -> a) -> a
- valueToConcrete :: Monad m => (forall arg tp. IsDatatype tp => con `(arg, tp)` -> List ConcreteValue arg -> m tp) -> Value con t -> m (ConcreteValue t)
- valueFromConcrete :: (Monad m, Typeable con) => (forall tp a. IsDatatype tp => tp -> (forall arg. con `(arg, tp)` -> List ConcreteValue arg -> m a) -> m a) -> ConcreteValue t -> m (Value con t)
- valueType :: Value con tp -> Repr tp
- valueTypeC :: ConcreteValue tp -> Repr tp
- liftType :: List Repr tps -> List Repr idx -> List Repr (Lifted tps idx)
- numRepr :: NumRepr tp -> Repr tp
- asNumRepr :: Repr tp -> Maybe (NumRepr tp)
- getTypes :: GetType e => List e tps -> List Repr tps
Documentation
Describes the kind of all SMT types.
It is only used in promoted form, for a concrete representation see Repr
.
class (Typeable t, Typeable (DatatypeSig t), Show t, Ord t) => IsDatatype t where Source
type DatatypeSig t :: [[Type]] Source
type TypeCollectionSig t :: [([[Type]], *)] Source
getDatatype :: e t -> Datatype `(DatatypeSig t, t)` Source
getTypeCollection :: e t -> TypeCollection (TypeCollectionSig t) Source
getConstructor :: t -> Constrs con (DatatypeSig t) t -> (forall arg. con `(arg, t)` -> List ConcreteValue arg -> a) -> a Source
type TypeCollection sigs = Datatypes Datatype sigs Source
Datatype | |
|
BoolValue :: Bool -> Value con BoolType | |
IntValue :: Integer -> Value con IntType | |
RealValue :: Rational -> Value con RealType | |
BitVecValue :: Integer -> Natural n -> Value con (BitVecType n) | |
ConstrValue :: (Typeable con, IsDatatype t) => con `(arg, t)` -> List (Value con) arg -> Value con (DataType t) |
GCompare ((,) [Type] *) con => GCompare Type (Value con) Source | |
GEq ((,) [Type] *) con => GEq Type (Value con) Source | |
GShow ((,) [Type] *) con => GShow Type (Value con) Source | |
GetType (Value con) Source | |
GEq ((,) [Type] *) con => Eq (Value con t) Source | |
GShow ((,) [Type] *) con => Show (Value con tp) Source |
data ConcreteValue a where Source
BoolValueC :: Bool -> ConcreteValue BoolType | |
IntValueC :: Integer -> ConcreteValue IntType | |
RealValueC :: Rational -> ConcreteValue RealType | |
BitVecValueC :: Integer -> Natural n -> ConcreteValue (BitVecType n) | |
ConstrValueC :: IsDatatype t => t -> ConcreteValue (DataType t) |
A concrete representation of an SMT type.
For aesthetic reasons, it's recommended to use the functions bool
, int
, real
, bitvec
or array
.
data Datatypes dts sigs where Source
NoDts :: Datatypes dts `[]` | |
ConsDts :: IsDatatype dt => dts `(DatatypeSig dt, dt)` -> Datatypes dts sigs -> Datatypes dts (`(DatatypeSig dt, dt)` : sigs) |
GetType Repr Source | |
GetType ConcreteValue Source | |
GetType NoVar Source | |
GetType (Value con) Source | |
GetType (UntypedVar v) Source | |
(GetType var, GetType qvar, GetFunType fun, GetConType con, GetFieldType field, GetType farg, GetType lvar) => GetType (SMTExpr var qvar fun con field farg lvar) Source | |
(GetType v, GetType qv, GetFunType fun, GetConType con, GetFieldType field, GetType fv, GetType lv, GetType e) => GetType (Expression v qv fun con field fv lv e) Source |
class GetFunType fun where Source
getFunType :: fun `(arg, res)` -> (List Repr arg, Repr res) Source
GetFunType NoFun Source | |
GetFunType (UntypedFun v) Source | |
(GetFunType fun, GetConType con, GetFieldType field) => GetFunType (Function fun con field) Source |
class GetConType con where Source
getConType :: IsDatatype dt => con `(arg, dt)` -> (List Repr arg, Datatype `(DatatypeSig dt, dt)`) Source
class GetFieldType field where Source
getFieldType :: IsDatatype dt => field `(dt, tp)` -> (Datatype `(DatatypeSig dt, dt)`, Repr tp) Source
bitvec :: Natural bw -> Repr (BitVecType bw) Source
mapValue :: (Monad m, Typeable con2) => (forall arg dt. con1 `(arg, dt)` -> m (con2 `(arg, dt)`)) -> Value con1 a -> m (Value con2 a) Source
findConstrByName :: String -> Datatype `(cons, dt)` -> (forall arg. Constr `(arg, dt)` -> a) -> a Source
valueToConcrete :: Monad m => (forall arg tp. IsDatatype tp => con `(arg, tp)` -> List ConcreteValue arg -> m tp) -> Value con t -> m (ConcreteValue t) Source
valueFromConcrete :: (Monad m, Typeable con) => (forall tp a. IsDatatype tp => tp -> (forall arg. con `(arg, tp)` -> List ConcreteValue arg -> m a) -> m a) -> ConcreteValue t -> m (Value con t) Source
valueTypeC :: ConcreteValue tp -> Repr tp Source