| Safe Haskell | None |
|---|---|
| Language | Haskell98 |
Language.Fixpoint.Types.Theories
Description
This module contains the types defining an SMTLIB2 interface.
Synopsis
- type Raw = Text
- data TheorySymbol = Thy {}
- data Sem
- data SmtSort
- type FuncSort = (SmtSort, SmtSort)
- sortSmtSort :: Bool -> SEnv DataDecl -> Sort -> SmtSort
- isIntSmtSort :: SEnv DataDecl -> Sort -> Bool
- mergeTopAppls :: HashMap FuncSort Int -> Appls -> Appls
- pushAppls :: Appls -> Appls
- popAppls :: Appls -> Appls
- peekAppls :: Appls -> Maybe (HashMap FuncSort Int)
- data SymEnv = SymEnv {}
- type SymM a = State SymEnv a
- symEnv :: SEnv Sort -> SEnv TheorySymbol -> [DataDecl] -> SEnv Sort -> [Sort] -> SymEnv
- symEnvSort :: Symbol -> SymEnv -> Maybe Sort
- symEnvTheory :: Symbol -> SymEnv -> Maybe TheorySymbol
- insertSymEnv :: Symbol -> Sort -> SymEnv -> SymEnv
- deleteSymEnv :: Symbol -> SymEnv -> SymEnv
- insertsSymEnv :: SymEnv -> [(Symbol, Sort)] -> SymEnv
- symbolAtName :: Symbol -> Sort -> SymM Text
- symbolAtSortIndex :: Symbol -> Int -> Text
- coerceSort :: ElabFlags -> Sort -> Sort
- coerceEnv :: ElabFlags -> SymEnv -> SymEnv
- coerceSortEnv :: ElabFlags -> SEnv Sort -> SEnv Sort
- class TheorySymbols a where
- theorySymbols :: a -> SEnv TheorySymbol
Serialized Representation
Theory Symbol
data TheorySymbol Source #
TheorySymbol represents the information about each interpreted Symbol
Constructors
| Thy | |
Instances
Sem describes the SMT semantics for a given symbol
Constructors
| Uninterp | for UDF: |
| Ctor | for ADT constructor and tests: |
| Test | for ADT tests : `is$cons` |
| Field | for ADT field: |
| Theory | for theory ops: mem, cup, select |
| Defined | for user-defined `define-fun` |
Instances
| Data Sem Source # | |||||
Defined in Language.Fixpoint.Types.Theories Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sem -> c Sem # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Sem # dataTypeOf :: Sem -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Sem) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Sem) # gmapT :: (forall b. Data b => b -> b) -> Sem -> Sem # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sem -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sem -> r # gmapQ :: (forall d. Data d => d -> u) -> Sem -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sem -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sem -> m Sem # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sem -> m Sem # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sem -> m Sem # | |||||
| Generic Sem Source # | |||||
Defined in Language.Fixpoint.Types.Theories Associated Types
| |||||
| Show Sem Source # | |||||
| NFData Sem Source # | |||||
Defined in Language.Fixpoint.Types.Theories | |||||
| Eq Sem Source # | |||||
| Ord Sem Source # | |||||
| PPrint Sem Source # | |||||
Defined in Language.Fixpoint.Types.Theories | |||||
| Store Sem Source # | |||||
| type Rep Sem Source # | |||||
Defined in Language.Fixpoint.Types.Theories type Rep Sem = D1 ('MetaData "Sem" "Language.Fixpoint.Types.Theories" "liquid-fixpoint-0.9.6.3.4-CmH5CYTDh7gFBJNG3w2uNw" 'False) ((C1 ('MetaCons "Uninterp" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Ctor" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Test" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "Field" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Theory" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Defined" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||
Theory Sorts
A Refinement of Sort that describes SMTLIB Sorts
Constructors
| SInt | |
| SBool | |
| SReal | |
| SString | |
| SSet !SmtSort | |
| SBag !SmtSort | |
| SFFld !Integer | |
| SArray !SmtSort !SmtSort | |
| SBitVec !Int | |
| SVar !Int | |
| SData !FTycon ![SmtSort] |
Instances
| Data SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SmtSort -> c SmtSort # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SmtSort # toConstr :: SmtSort -> Constr # dataTypeOf :: SmtSort -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SmtSort) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SmtSort) # gmapT :: (forall b. Data b => b -> b) -> SmtSort -> SmtSort # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SmtSort -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SmtSort -> r # gmapQ :: (forall d. Data d => d -> u) -> SmtSort -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SmtSort -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SmtSort -> m SmtSort # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SmtSort -> m SmtSort # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SmtSort -> m SmtSort # | |||||
| Generic SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories Associated Types
| |||||
| Show SmtSort Source # | |||||
| NFData SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories | |||||
| Eq SmtSort Source # | |||||
| Ord SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories | |||||
| Hashable SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories | |||||
| SMTLIB2 SmtSort Source # | |||||
| PPrint SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories | |||||
| Store SmtSort Source # | |||||
| type Rep SmtSort Source # | |||||
Defined in Language.Fixpoint.Types.Theories type Rep SmtSort = D1 ('MetaData "SmtSort" "Language.Fixpoint.Types.Theories" "liquid-fixpoint-0.9.6.3.4-CmH5CYTDh7gFBJNG3w2uNw" 'False) (((C1 ('MetaCons "SInt" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SBool" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "SReal" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "SString" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "SSet" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SmtSort))))) :+: ((C1 ('MetaCons "SBag" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SmtSort)) :+: (C1 ('MetaCons "SFFld" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Integer)) :+: C1 ('MetaCons "SArray" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SmtSort) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SmtSort)))) :+: (C1 ('MetaCons "SBitVec" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "SVar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "SData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 FTycon) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [SmtSort])))))) | |||||
sortSmtSort :: Bool -> SEnv DataDecl -> Sort -> SmtSort Source #
The poly parameter is True when we are *declaring* sorts,
and so we need to leave the top type variables be; it is False when
we are declaring variables etc., and there, we serialize them
using Int (though really, there SHOULD BE NO floating tyVars...
'smtSort True msg t' serializes a sort t using type variables,
'smtSort False msg t' serializes a sort t using Int instead of tyvars.
Symbol Environments
Constructors
| SymEnv | |
Fields
| |
Instances
| Data SymEnv Source # | |
Defined in Language.Fixpoint.Types.Theories Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SymEnv -> c SymEnv # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SymEnv # toConstr :: SymEnv -> Constr # dataTypeOf :: SymEnv -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SymEnv) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SymEnv) # gmapT :: (forall b. Data b => b -> b) -> SymEnv -> SymEnv # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SymEnv -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SymEnv -> r # gmapQ :: (forall d. Data d => d -> u) -> SymEnv -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SymEnv -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SymEnv -> m SymEnv # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SymEnv -> m SymEnv # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SymEnv -> m SymEnv # | |
| Monoid SymEnv Source # | |
| Semigroup SymEnv Source # | |
| Generic SymEnv Source # | |
| Show SymEnv Source # | |
| NFData SymEnv Source # | |
Defined in Language.Fixpoint.Types.Theories | |
| Eq SymEnv Source # | |
| Store SymEnv Source # | |
| type Rep SymEnv Source # | |
Defined in Language.Fixpoint.Types.Theories | |
type SymM a = State SymEnv a Source #
Generating SMT expressions is a stateful process because new symbols (apply, coerce,
smt_lambda and lam_arg) need to be emitted with unique ids for each newly encountered
function sort. The SymM monad carries the SymEnv state required to track the ids.
The state updates are performed in Serialize (functions smt2App, smt2Coerc,
smt2Lam and smtLamArg, correspondingly).
symEnvTheory :: Symbol -> SymEnv -> Maybe TheorySymbol Source #
Coercing sorts in environments
coerceSortEnv :: ElabFlags -> SEnv Sort -> SEnv Sort Source #
Coercing sorts inside environments for SMT theory encoding
class TheorySymbols a where Source #
Methods
theorySymbols :: a -> SEnv TheorySymbol Source #
Instances
| TheorySymbols SMTSolver Source # | Theory Symbols : |
Defined in Language.Fixpoint.Smt.Theories Methods | |
| TheorySymbols DefinedFuns Source # | |
Defined in Language.Fixpoint.Smt.Theories Methods | |
| TheorySymbols [Equation] Source # | |
Defined in Language.Fixpoint.Smt.Theories Methods theorySymbols :: [Equation] -> SEnv TheorySymbol Source # | |
| TheorySymbols [DataDecl] Source # | |
Defined in Language.Fixpoint.Smt.Theories Methods theorySymbols :: [DataDecl] -> SEnv TheorySymbol Source # | |