Safe Haskell | None |
---|
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.
- class Fixpoint a where
- toFixpoint :: FInfo a -> Doc
- data FInfo a = FI {}
- showFix :: Fixpoint a => a -> String
- traceFix :: Fixpoint a => String -> a -> a
- resultDoc :: (Ord a, Fixpoint a) => FixResult a -> Doc
- data Sort
- data FTycon
- type TCEmb a = HashMap a FTycon
- intFTyCon :: FTycon
- boolFTyCon :: FTycon
- strFTyCon :: FTycon
- propFTyCon :: FTycon
- stringFTycon :: String -> FTycon
- fTyconString :: FTycon -> String
- data Symbol = S !String
- anfPrefix :: [Char]
- tempPrefix :: [Char]
- vv :: Maybe Integer -> Symbol
- intKvar :: Integer -> Symbol
- symChars :: [Char]
- isNonSymbol :: Symbol -> Bool
- nonSymbol :: Symbol
- isNontrivialVV :: Symbol -> Bool
- stringSymbol :: String -> Symbol
- symbolString :: Symbol -> String
- dummySymbol :: Symbol
- intSymbol :: Show a => [Char] -> a -> Symbol
- tempSymbol :: String -> Integer -> Symbol
- qualifySymbol :: [Char] -> Symbol -> Symbol
- stringSymbolRaw :: String -> Symbol
- suffixSymbol :: Symbol -> [Char] -> Symbol
- data SymConst = SL !String
- data Constant = I !Integer
- data Bop
- data Brel
- data Expr
- data Pred
- eVar :: Symbolic a => a -> Expr
- eProp :: Symbolic a => a -> Pred
- pAnd :: [Pred] -> Pred
- pOr :: [Pred] -> Pred
- pIte :: Pred -> Pred -> Pred -> Pred
- isTautoPred :: Pred -> Bool
- class Symbolic a where
- class Expression a where
- class Predicate a where
- data SubC a
- data WfC a
- subC :: IBindEnv -> Pred -> SortedReft -> SortedReft -> Maybe Integer -> Tag -> a -> SubC a
- lhsCs :: SubC a -> Reft
- rhsCs :: SubC a -> Reft
- wfC :: IBindEnv -> SortedReft -> Maybe Integer -> a -> WfC a
- type Tag = [Int]
- data FixResult a
- type FixSolution = HashMap Symbol Pred
- addIds :: [SubC a] -> [(Integer, SubC a)]
- sinfo :: SubC a -> a
- trueSubCKvar :: Symbol -> a -> SubC a
- removeLhsKvars :: SubC a -> [Symbol] -> SubC a
- data SEnv a
- data SESearch a
- emptySEnv :: SEnv a
- toListSEnv :: SEnv a -> [(Symbol, a)]
- fromListSEnv :: [(Symbol, a)] -> SEnv a
- mapSEnv :: (a1 -> a) -> SEnv a1 -> 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
- intersectWithSEnv :: (v1 -> v2 -> a) -> SEnv v1 -> SEnv v2 -> SEnv a
- filterSEnv :: (a -> Bool) -> SEnv a -> SEnv a
- lookupSEnvWithDistance :: Symbol -> SEnv a -> SESearch a
- 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 -> (BindId, BindEnv)
- emptyBindEnv :: BindEnv
- data Refa
- data SortedReft = RR {}
- newtype Reft = Reft (Symbol, [Refa])
- class (Monoid r, Subable r) => Reftable r where
- trueSortedReft :: Sort -> SortedReft
- trueRefa :: Refa
- exprReft :: Expression a => a -> Reft
- notExprReft :: Expression a => a -> Reft
- symbolReft :: Symbolic a => a -> Reft
- propReft :: Predicate a => a -> Reft
- predReft :: Predicate a => a -> Reft
- isFunctionSortedReft :: SortedReft -> Bool
- isNonTrivialSortedReft :: SortedReft -> Bool
- isTautoReft :: Reft -> Bool
- isSingletonReft :: Reft -> Maybe Expr
- isEVar :: Expr -> Bool
- isFalse :: Falseable a => a -> Bool
- flattenRefas :: [Refa] -> [Refa]
- squishRefas :: [Refa] -> [Refa]
- shiftVV :: Reft -> Symbol -> Reft
- 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
- sortSubst :: HashMap Symbol Sort -> Sort -> Sort
- reftKVars :: Reft -> [Symbol]
- colorResult :: FixResult t -> Moods
- newtype Kuts = KS (HashSet Symbol)
- ksEmpty :: Kuts
- ksUnion :: [Symbol] -> Kuts -> Kuts
- data Qualifier = Q {}
Top level serialization
Fixpoint Int | |
Fixpoint Integer | |
Fixpoint Qualifier | |
Fixpoint Subst | |
Fixpoint BindEnv | |
Fixpoint IBindEnv | |
Fixpoint FEnv | |
Fixpoint SortedReft | |
Fixpoint Reft | |
Fixpoint Refa | |
Fixpoint Pred | |
Fixpoint Expr | |
Fixpoint Bop | |
Fixpoint Brel | |
Fixpoint Constant | |
Fixpoint SymConst | |
Fixpoint Symbol | |
Fixpoint Sort | |
Fixpoint FTycon | |
Fixpoint Kuts | |
Fixpoint a => Fixpoint [a] | |
Fixpoint a => Fixpoint (Maybe a) | |
(Eq a, Hashable a, Fixpoint a) => Fixpoint (HashSet a) | |
(Ord a, Fixpoint a) => Fixpoint (FixResult (SubC a)) | |
Fixpoint (WfC a) | |
Fixpoint (SubC a) | |
Fixpoint a => Fixpoint (SEnv a) | |
(Fixpoint a, Fixpoint b) => Fixpoint (a, b) |
toFixpoint :: FInfo a -> DocSource
Rendering
Embedding to Fixpoint Types
stringFTycon :: String -> FTyconSource
fTyconString :: FTycon -> StringSource
Symbols
tempPrefix :: [Char]Source
isNonSymbol :: Symbol -> BoolSource
isNontrivialVV :: Symbol -> BoolSource
stringSymbol :: String -> SymbolSource
symbolString :: Symbol -> StringSource
Creating Symbols
tempSymbol :: String -> Integer -> SymbolSource
qualifySymbol :: [Char] -> Symbol -> SymbolSource
suffixSymbol :: Symbol -> [Char] -> SymbolSource
Expressions and Predicates
Uninterpreted constants that are embedded as constant symbol : Str
isTautoPred :: Pred -> BoolSource
Generalizing Embedding with Typeclasses
Generalizing Symbol, Expression, Predicate into Classes -----------
Values that can be viewed as Symbols
class Expression a whereSource
Values that can be viewed as Expressions
Expression Int | |
Expression Integer | |
Expression String | |
Expression Expr | |
Expression Symbol | The symbol may be an encoding of a SymConst. |
Values that can be viewed as Predicates
Constraints and Solutions
subC :: IBindEnv -> Pred -> SortedReft -> SortedReft -> Maybe Integer -> Tag -> a -> SubC aSource
type FixSolution = HashMap Symbol PredSource
trueSubCKvar :: Symbol -> a -> SubC aSource
removeLhsKvars :: SubC a -> [Symbol] -> SubC aSource
Environments
toListSEnv :: SEnv a -> [(Symbol, a)]Source
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
intersectWithSEnv :: (v1 -> v2 -> a) -> SEnv v1 -> SEnv v2 -> SEnv aSource
filterSEnv :: (a -> Bool) -> SEnv a -> SEnv aSource
lookupSEnvWithDistance :: Symbol -> SEnv a -> SESearch aSource
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 -> (BindId, BindEnv)Source
Functions for Global Binder Environment
Refinements
data SortedReft Source
class (Monoid r, Subable r) => Reftable r whereSource
A Class Predicates for Valid Refinements Types ---------------------
Constructing Refinements
exprReft :: Expression a => a -> ReftSource
notExprReft :: Expression a => a -> ReftSource
symbolReft :: Symbolic a => a -> ReftSource
isTautoReft :: Reft -> BoolSource
isSingletonReft :: Reft -> Maybe ExprSource
flattenRefas :: [Refa] -> [Refa]Source
squishRefas :: [Refa] -> [Refa]Source
Substitutions
substExcept :: Subst -> [Symbol] -> SubstSource
Visitors
Functions on Result
colorResult :: FixResult t -> MoodsSource