Safe Haskell | Safe-Infered |
---|
This module contains the data types, operations and serialization functions for representing Fixpoint's implication (i.e. subtyping) and well-formedness constraints in Haskell. The actual constraint solving is done by the `fixpoint.native` which is written in Ocaml.
- toFixpoint :: FInfo a -> SDoc
- class Fixpoint a where
- data Sort
- data FTycon
- type TCEmb a = HashMap a FTycon
- stringFTycon :: String -> FTycon
- intFTyCon :: FTycon
- boolFTyCon :: FTycon
- predFTyCon :: FTycon
- typeSort :: TCEmb TyCon -> Type -> Sort
- typeUniqueSymbol :: Type -> Symbol
- data Symbol = S !String
- anfPrefix :: [Char]
- tempPrefix :: [Char]
- vv :: Maybe Integer -> Symbol
- intKvar :: Integer -> Symbol
- symChars :: [Char]
- isNonSymbol :: Symbol -> Bool
- nonSymbol :: Symbol
- dummySymbol :: Symbol
- intSymbol :: Show a => [Char] -> a -> Symbol
- tempSymbol :: String -> Integer -> Symbol
- qualifySymbol :: [Char] -> Symbol -> Symbol
- stringSymbol :: String -> Symbol
- symbolString :: Symbol -> String
- stringSymbolRaw :: String -> Symbol
- isNontrivialVV :: Symbol -> Bool
- data Constant = I !Integer
- data Bop
- data Brel
- data Expr
- data Pred
- pAnd :: [Pred] -> Pred
- pOr :: [Pred] -> Pred
- pIte :: Pred -> Pred -> Pred -> Pred
- pApp :: Symbol -> [Expr] -> Pred
- isTautoPred :: Pred -> Bool
- data SubC a
- data WfC a
- subC :: IBindEnv -> Pred -> SortedReft -> SortedReft -> Maybe Integer -> Tag -> a -> SubC a
- wfC :: IBindEnv -> SortedReft -> Maybe Integer -> a -> WfC a
- type Tag = [Int]
- data FixResult a
- = Crash [a] String
- | Safe
- | Unsafe ![a]
- | UnknownError
- type FixSolution = HashMap Symbol Pred
- data FInfo a = FI {}
- addIds :: [SubC a] -> [(Integer, SubC a)]
- sinfo :: SubC a -> a
- data SEnv a
- emptySEnv :: SEnv a
- fromListSEnv :: [(Symbol, a)] -> SEnv a
- insertSEnv :: Symbol -> a -> SEnv a -> SEnv a
- deleteSEnv :: Symbol -> SEnv a -> SEnv a
- memberSEnv :: Symbol -> SEnv a -> Bool
- lookupSEnv :: Symbol -> SEnv v -> Maybe v
- type FEnv = SEnv SortedReft
- insertFEnv :: Symbol -> a -> SEnv a -> SEnv a
- data IBindEnv
- type BindId = Int
- insertsIBindEnv :: [BindId] -> IBindEnv -> IBindEnv
- deleteIBindEnv :: BindId -> IBindEnv -> IBindEnv
- emptyIBindEnv :: IBindEnv
- data BindEnv
- insertBindEnv :: Symbol -> SortedReft -> BindEnv -> (Int, BindEnv)
- emptyBindEnv :: BindEnv
- data Refa
- data SortedReft = RR {}
- newtype Reft = Reft (Symbol, [Refa])
- trueSortedReft :: Sort -> SortedReft
- trueRefa :: Refa
- exprReft :: Expr -> Reft
- notExprReft :: Expr -> Reft
- symbolReft :: Symbol -> Reft
- isFunctionSortedReft :: SortedReft -> Bool
- isNonTrivialSortedReft :: SortedReft -> Bool
- isTautoReft :: Reft -> Bool
- isSingletonReft :: Reft -> Maybe Expr
- isEVar :: Expr -> Bool
- flattenRefas :: [Refa] -> [Refa]
- shiftVV :: Reft -> Symbol -> Reft
- ppr_reft :: Reft -> SDoc -> SDoc
- ppr_reft_pred :: Reft -> SDoc
- data Subst
- class Subable a where
- emptySubst :: Subst
- mkSubst :: [(Symbol, Expr)] -> Subst
- catSubst :: Subst -> Subst -> Subst
- substExcept :: Subst -> [Symbol] -> Subst
- substfExcept :: (Symbol -> Expr) -> [Symbol] -> Symbol -> Expr
- subst1Except :: Subable a => [Symbol] -> a -> (Symbol, Expr) -> a
- reftKVars :: Reft -> [Symbol]
- colorResult :: FixResult t -> Moods
- newtype Kuts = KS (HashSet Symbol)
- ksEmpty :: Kuts
- ksUnion :: [Symbol] -> Kuts -> Kuts
- checkSortedReft :: SEnv SortedReft -> [Symbol] -> SortedReft -> Maybe SDoc
Top level serialization
toFixpoint :: FInfo a -> SDocSource
Fixpoint Int | |
Fixpoint Integer | |
Fixpoint Subst | |
Fixpoint BindEnv | |
Fixpoint IBindEnv | |
Fixpoint FEnv | |
Fixpoint SortedReft | |
Fixpoint Refa | |
Fixpoint Pred | |
Fixpoint Expr | |
Fixpoint Bop | |
Fixpoint Brel | |
Fixpoint Constant | |
Fixpoint Symbol | |
Fixpoint Sort | |
Fixpoint FTycon | |
Fixpoint Kuts | |
Fixpoint Qualifier | |
Fixpoint a => Fixpoint [a] | |
(Eq a, Hashable a, Fixpoint a) => Fixpoint (HashSet a) | |
Fixpoint (WfC a) | |
Fixpoint (SubC a) | |
(Fixpoint a, Fixpoint b) => Fixpoint (a, b) |
Embedding to Fixpoint Types
stringFTycon :: String -> FTyconSource
typeUniqueSymbol :: Type -> SymbolSource
Symbols
tempPrefix :: [Char]Source
isNonSymbol :: Symbol -> BoolSource
tempSymbol :: String -> Integer -> SymbolSource
qualifySymbol :: [Char] -> Symbol -> SymbolSource
stringSymbol :: String -> SymbolSource
symbolString :: Symbol -> StringSource
isNontrivialVV :: Symbol -> BoolSource
Expressions and Predicates
isTautoPred :: Pred -> BoolSource
Constraints and Solutions
Show (SubC a) | |
NFData a => NFData (SubC a) | |
(Ord a, Outputable a) => Outputable (FixResult (SubC a)) | |
Outputable (SubC a) | |
Fixpoint (SubC a) |
subC :: IBindEnv -> Pred -> SortedReft -> SortedReft -> Maybe Integer -> Tag -> a -> SubC aSource
Crash [a] String | |
Safe | |
Unsafe ![a] | |
UnknownError |
type FixSolution = HashMap Symbol PredSource
Environments
fromListSEnv :: [(Symbol, a)] -> SEnv aSource
insertSEnv :: Symbol -> a -> SEnv a -> SEnv aSource
deleteSEnv :: Symbol -> SEnv a -> SEnv aSource
memberSEnv :: Symbol -> SEnv a -> BoolSource
lookupSEnv :: Symbol -> SEnv v -> Maybe vSource
type FEnv = SEnv SortedReftSource
insertFEnv :: Symbol -> a -> SEnv a -> SEnv aSource
insertsIBindEnv :: [BindId] -> IBindEnv -> IBindEnvSource
deleteIBindEnv :: BindId -> IBindEnv -> IBindEnvSource
emptyIBindEnv :: IBindEnvSource
Functions for Indexed Bind Environment
insertBindEnv :: Symbol -> SortedReft -> BindEnv -> (Int, BindEnv)Source
Functions for Global Binder Environment
Refinements
data SortedReft Source
notExprReft :: Expr -> ReftSource
symbolReft :: Symbol -> ReftSource
isTautoReft :: Reft -> BoolSource
isSingletonReft :: Reft -> Maybe ExprSource
flattenRefas :: [Refa] -> [Refa]Source
ppr_reft_pred :: Reft -> SDocSource
Substitutions
substa :: (Symbol -> Symbol) -> a -> aSource
substf :: (Symbol -> Expr) -> a -> aSource
Subable () | |
Subable SortedReft | |
Subable Reft | |
Subable Refa | |
Subable Pred | |
Subable Expr | |
Subable Symbol | |
Subable FReft | |
Subable Predicate | |
Subable UsedPVar | |
Subable a => Subable [a] | |
Subable r => Subable (UReft r) | |
(Subable a, Subable b) => Subable (a, b) | |
Subable a => Subable (HashMap k a) | |
(Reftable r, RefTypable p c tv r) => Subable (Ref r (RType p c tv r)) | |
Subable (Ref Reft RefType) | |
(Subable r, RefTypable p c tv r) => Subable (RType p c tv r) |
substExcept :: Subst -> [Symbol] -> SubstSource
Visitors
Functions on Result
colorResult :: FixResult t -> MoodsSource
Cut KVars
Checking Well-Formedness
checkSortedReft :: SEnv SortedReft -> [Symbol] -> SortedReft -> Maybe SDocSource