Safe Haskell | None |
---|---|
Language | Haskell98 |
This module contains the top-level SOLUTION data types, including various indices used for solving.
Synopsis
- type Solution = Sol () QBind
- type GSolution = Sol (((Symbol, Sort), Expr), GBind) QBind
- data Sol b a
- updateGMap :: Sol b a -> HashMap KVar b -> Sol b a
- updateGMapWithKey :: [(KVar, QBind)] -> GSolution -> GSolution
- sScp :: Sol b a -> HashMap KVar IBindEnv
- type CMap a = HashMap SubcId a
- type Hyp = ListNE Cube
- data Cube = Cube {}
- data QBind
- data GBind
- data EQual = EQL {}
- data EbindSol
- eQual :: Qualifier -> [Symbol] -> EQual
- trueEqual :: EQual
- qbToGb :: QBind -> GBind
- gbToQbs :: GBind -> [QBind]
- gbEquals :: GBind -> [[EQual]]
- equalsGb :: [[EQual]] -> GBind
- emptyGMap :: GSolution -> GSolution
- qbExprs :: QBind -> [Expr]
- type Cand a = [(Expr, a)]
- fromList :: SymEnv -> [(KVar, a)] -> [(KVar, b)] -> [(KVar, Hyp)] -> HashMap KVar IBindEnv -> [(BindId, EbindSol)] -> SEnv (BindId, Sort) -> Sol a b
- update :: Sol a QBind -> [KVar] -> [(KVar, EQual)] -> (Bool, Sol a QBind)
- updateEbind :: Sol a b -> BindId -> Pred -> Sol a b
- lookupQBind :: Sol a QBind -> KVar -> QBind
- lookup :: Sol a QBind -> KVar -> Either Hyp QBind
- glookup :: GSolution -> KVar -> Either Hyp (Either QBind (((Symbol, Sort), Expr), GBind))
- qb :: [EQual] -> QBind
- qbPreds :: String -> Sol a QBind -> Subst -> QBind -> [(Pred, EQual)]
- qbFilter :: (EQual -> Bool) -> QBind -> QBind
- gbFilterM :: Monad m => ([EQual] -> m Bool) -> GBind -> m GBind
- result :: Sol a QBind -> HashMap KVar Expr
- resultGradual :: GSolution -> HashMap KVar (Expr, [Expr])
- data Index = FastIdx {}
- data KIndex = KIndex {}
- data BindPred = BP {}
- data BIndex
Solution tables
type Solution = Sol () QBind Source #
The Solution
data type --------------------------------------------------
A Sol
contains the various indices needed to compute a solution,
in particular, to compute lhsPred
for any given constraint.
Instances
Solution elements
type Hyp = ListNE Cube Source #
A Cube
is a single constraint defining a KVar ---------------------------
Instances
Show Cube Source # | |
Generic Cube Source # | |
NFData Cube Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
PPrint Cube Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
type Rep Cube Source # | |
Defined in Language.Fixpoint.Types.Solutions type Rep Cube = D1 (MetaData "Cube" "Language.Fixpoint.Types.Solutions" "liquid-fixpoint-0.8.0.2-EGSzGwrlcJrCaUaEYLNzOY" False) (C1 (MetaCons "Cube" PrefixI True) ((S1 (MetaSel (Just "cuBinds") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 IBindEnv) :*: S1 (MetaSel (Just "cuSubst") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Subst)) :*: (S1 (MetaSel (Just "cuId") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 SubcId) :*: S1 (MetaSel (Just "cuTag") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Tag)))) |
Instances
Eq QBind Source # | |
Data QBind Source # | |
Defined in Language.Fixpoint.Types.Solutions gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> QBind -> c QBind # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c QBind # dataTypeOf :: QBind -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c QBind) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c QBind) # gmapT :: (forall b. Data b => b -> b) -> QBind -> QBind # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> QBind -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> QBind -> r # gmapQ :: (forall d. Data d => d -> u) -> QBind -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> QBind -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> QBind -> m QBind # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> QBind -> m QBind # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> QBind -> m QBind # | |
Show QBind Source # | |
Generic QBind Source # | |
NFData QBind Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
PPrint QBind Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
type Rep QBind Source # | |
Defined in Language.Fixpoint.Types.Solutions |
Instances
Data GBind Source # | |
Defined in Language.Fixpoint.Types.Solutions gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> GBind -> c GBind # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c GBind # dataTypeOf :: GBind -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c GBind) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c GBind) # gmapT :: (forall b. Data b => b -> b) -> GBind -> GBind # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GBind -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GBind -> r # gmapQ :: (forall d. Data d => d -> u) -> GBind -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> GBind -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GBind -> m GBind # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GBind -> m GBind # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GBind -> m GBind # | |
Show GBind Source # | |
Generic GBind Source # | |
NFData GBind Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
type Rep GBind Source # | |
Defined in Language.Fixpoint.Types.Solutions |
Instantiated Qualifiers ---------------------------------------------------
Instances
Eq EQual Source # | |
Data EQual Source # | |
Defined in Language.Fixpoint.Types.Solutions gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> EQual -> c EQual # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c EQual # dataTypeOf :: EQual -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c EQual) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c EQual) # gmapT :: (forall b. Data b => b -> b) -> EQual -> EQual # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> EQual -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> EQual -> r # gmapQ :: (forall d. Data d => d -> u) -> EQual -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> EQual -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> EQual -> m EQual # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> EQual -> m EQual # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> EQual -> m EQual # | |
Show EQual Source # | |
Generic EQual Source # | |
NFData EQual Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
PPrint EQual Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
Loc EQual Source # | |
type Rep EQual Source # | |
Defined in Language.Fixpoint.Types.Solutions type Rep EQual = D1 (MetaData "EQual" "Language.Fixpoint.Types.Solutions" "liquid-fixpoint-0.8.0.2-EGSzGwrlcJrCaUaEYLNzOY" False) (C1 (MetaCons "EQL" PrefixI True) (S1 (MetaSel (Just "eqQual") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Qualifier) :*: (S1 (MetaSel (Just "eqPred") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Expr) :*: S1 (MetaSel (Just "_eqArgs") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 [Expr])))) |
An EbindSol
contains the relevant information for an existential-binder;
(See testsposebind-*.fq for examples.) This is either
1. the constraint whose HEAD is a singleton that defines the binder, OR
2. the solved out TERM that we should use in place of the ebind at USES.
EbDef [SimpC ()] Symbol | The constraint whose HEAD "defines" the Ebind
and the |
EbSol Expr | The solved out term that should be used at USES. |
EbIncr | EBinds not to be solved for (because they're currently being solved for) |
Instances
Show EbindSol Source # | |
Generic EbindSol Source # | |
NFData EbindSol Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
PPrint EbindSol Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
type Rep EbindSol Source # | |
Defined in Language.Fixpoint.Types.Solutions type Rep EbindSol = D1 (MetaData "EbindSol" "Language.Fixpoint.Types.Solutions" "liquid-fixpoint-0.8.0.2-EGSzGwrlcJrCaUaEYLNzOY" False) (C1 (MetaCons "EbDef" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 [SimpC ()]) :*: S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Symbol)) :+: (C1 (MetaCons "EbSol" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Expr)) :+: C1 (MetaCons "EbIncr" PrefixI False) (U1 :: Type -> Type))) |
Equal elements
Gradual Solution elements
Solution Candidates (move to SolverMonad?)
Constructor
fromList :: SymEnv -> [(KVar, a)] -> [(KVar, b)] -> [(KVar, Hyp)] -> HashMap KVar IBindEnv -> [(BindId, EbindSol)] -> SEnv (BindId, Sort) -> Sol a b Source #
Create a Solution ---------------------------------------------------------
Update
update :: Sol a QBind -> [KVar] -> [(KVar, EQual)] -> (Bool, Sol a QBind) Source #
Update Solution -----------------------------------------------------------
Lookup
lookupQBind :: Sol a QBind -> KVar -> QBind Source #
Read / Write Solution at KVar ---------------------------------------------
Manipulating QBind
Conversion for client
Fast Solver (DEPRECATED as unsound)
A Index is a suitably indexed version of the cosntraints that lets us 1. CREATE a monolithic "background formula" representing all constraints, 2. ASSERT each lhs via bits for the subc-id and formulas for dependent cut KVars
FastIdx | |
|
A KIndex uniquely identifies each *use* of a KVar in an (LHS) binder
Instances
Eq KIndex Source # | |
Ord KIndex Source # | |
Show KIndex Source # | |
Generic KIndex Source # | |
Hashable KIndex Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
PPrint KIndex Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
type Rep KIndex Source # | |
Defined in Language.Fixpoint.Types.Solutions type Rep KIndex = D1 (MetaData "KIndex" "Language.Fixpoint.Types.Solutions" "liquid-fixpoint-0.8.0.2-EGSzGwrlcJrCaUaEYLNzOY" False) (C1 (MetaCons "KIndex" PrefixI True) (S1 (MetaSel (Just "kiBIndex") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 BindId) :*: (S1 (MetaSel (Just "kiPos") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "kiKVar") NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 KVar)))) |
A BIndex is created for each LHS Bind or RHS constraint
Instances
Eq BIndex Source # | |
Ord BIndex Source # | |
Show BIndex Source # | |
Generic BIndex Source # | |
Hashable BIndex Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
PPrint BIndex Source # | |
Defined in Language.Fixpoint.Types.Solutions | |
type Rep BIndex Source # | |
Defined in Language.Fixpoint.Types.Solutions type Rep BIndex = D1 (MetaData "BIndex" "Language.Fixpoint.Types.Solutions" "liquid-fixpoint-0.8.0.2-EGSzGwrlcJrCaUaEYLNzOY" False) (C1 (MetaCons "Root" PrefixI False) (U1 :: Type -> Type) :+: (C1 (MetaCons "Bind" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 BindId)) :+: C1 (MetaCons "Cstr" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness SourceStrict DecidedStrict) (Rec0 SubcId)))) |