Safe Haskell | None |
---|---|
Language | Haskell98 |
Language.Haskell.Liquid.Measure
Synopsis
- data Spec lname ty = Spec {
- measures :: ![MeasureV lname (Located ty) (Located LHName)]
- expSigs :: ![(lname, Sort)]
- asmSigs :: ![(Located LHName, Located ty)]
- asmReflectSigs :: ![(Located LHName, Located LHName)]
- sigs :: ![(Located LHName, Located (BareTypeV lname))]
- invariants :: ![(Maybe LocSymbol, Located ty)]
- ialiases :: ![(Located ty, Located ty)]
- dataDecls :: ![DataDeclP lname ty]
- newtyDecls :: ![DataDeclP lname ty]
- aliases :: ![Located (RTAlias Symbol (BareTypeV lname))]
- ealiases :: ![Located (RTAlias Symbol (ExprV lname))]
- embeds :: !(TCEmb (Located LHName))
- qualifiers :: ![QualifierV lname]
- lvars :: !(HashSet (Located LHName))
- lazy :: !(HashSet (Located LHName))
- rewrites :: !(HashSet (Located LHName))
- rewriteWith :: !(HashMap (Located LHName) [Located LHName])
- fails :: !(HashSet (Located LHName))
- reflects :: !(HashSet (Located LHName))
- privateReflects :: !(HashSet LocSymbol)
- opaqueReflects :: !(HashSet (Located LHName))
- autois :: !(HashSet (Located LHName))
- hmeas :: !(HashSet (Located LHName))
- inlines :: !(HashSet (Located LHName))
- ignores :: !(HashSet (Located LHName))
- autosize :: !(HashSet (Located LHName))
- pragmas :: ![Located String]
- cmeasures :: ![MeasureV lname (Located ty) ()]
- imeasures :: ![MeasureV lname (Located ty) (Located LHName)]
- omeasures :: ![MeasureV lname (Located ty) (Located LHName)]
- classes :: ![RClass (Located ty)]
- relational :: ![(Located LHName, Located LHName, Located (BareTypeV lname), Located (BareTypeV lname), RelExprV lname, RelExprV lname)]
- asmRel :: ![(Located LHName, Located LHName, Located (BareTypeV lname), Located (BareTypeV lname), RelExprV lname, RelExprV lname)]
- termexprs :: ![(Located LHName, [Located (ExprV lname)])]
- rinstance :: ![RInstance (Located ty)]
- dvariance :: ![(Located LHName, [Variance])]
- dsize :: ![([Located ty], lname)]
- bounds :: !(RRBEnvV lname (Located ty))
- axeqs :: ![EquationV lname]
- defines :: ![(Located LHName, LMapV lname)]
- usedDataCons :: HashSet LHName
- data MSpec ty ctor = MSpec {}
- type BareSpec = Spec Symbol BareType
- type BareMeasure = Measure LocBareType (Located LHName)
- type SpecMeasure = Measure LocSpecType DataCon
- mkM :: HasCallStack => Located LHName -> ty -> [DefV v ty bndr] -> MeasureKind -> UnSortedExprs -> MeasureV v ty bndr
- mkMSpec :: [Measure t (Located LHName)] -> [Measure t ()] -> [Measure t (Located LHName)] -> [Measure t (Located LHName)] -> MSpec t (Located LHName)
- mkMSpec' :: [Measure ty DataCon] -> MSpec ty DataCon
- dataConTypes :: Bool -> MSpec (RRType Reft) DataCon -> ([(Var, RRType Reft)], [(Located LHName, RRType Reft)])
- defRefType :: Bool -> Type -> Def (RRType Reft) DataCon -> RRType Reft
- bodyPred :: Expr -> Body -> Expr
Specifications
A generic Spec
type, polymorphic over the inner choice of type and binders.
lname
corresponds to the names used for entities only known to LH like
non-interpreted functions and type aliases.
Constructors
Spec | |
Fields
|
Instances
Constructors
MSpec | |
Instances
Bifunctor MSpec Source # | |||||
Functor (MSpec ty) Source # | |||||
Eq ctor => Monoid (MSpec ty ctor) Source # | |||||
Eq ctor => Semigroup (MSpec ty ctor) Source # | |||||
(Data ty, Data ctor) => Data (MSpec ty ctor) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Types Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> MSpec ty ctor -> c (MSpec ty ctor) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (MSpec ty ctor) # toConstr :: MSpec ty ctor -> Constr # dataTypeOf :: MSpec ty ctor -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (MSpec ty ctor)) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (MSpec ty ctor)) # gmapT :: (forall b. Data b => b -> b) -> MSpec ty ctor -> MSpec ty ctor # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> MSpec ty ctor -> r # gmapQ :: (forall d. Data d => d -> u) -> MSpec ty ctor -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> MSpec ty ctor -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> MSpec ty ctor -> m (MSpec ty ctor) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> MSpec ty ctor -> m (MSpec ty ctor) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> MSpec ty ctor -> m (MSpec ty ctor) # | |||||
Generic (MSpec ty ctor) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Types Associated Types
| |||||
(Show ty, Show ctor, PPrint ctor, PPrint ty) => Show (MSpec ty ctor) Source # | |||||
(PPrint t, PPrint a) => PPrint (MSpec t a) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Types | |||||
type Rep (MSpec ty ctor) Source # | |||||
Defined in Language.Haskell.Liquid.Types.Types type Rep (MSpec ty ctor) = D1 ('MetaData "MSpec" "Language.Haskell.Liquid.Types.Types" "liquidhaskell-boot-0.9.10.1.2-inplace" 'False) (C1 ('MetaCons "MSpec" 'PrefixI 'True) ((S1 ('MetaSel ('Just "ctorMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap LHName [Def ty ctor])) :*: S1 ('MetaSel ('Just "measMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap (Located LHName) (Measure ty ctor)))) :*: (S1 ('MetaSel ('Just "cmeasMap") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap (Located LHName) (Measure ty ()))) :*: S1 ('MetaSel ('Just "imeas") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 [Measure ty ctor])))) |
Type Aliases
type BareSpec = Spec Symbol BareType Source #
A BareSpec
is the spec we derive by parsing the Liquid Haskell annotations of a single file. As
such, it contains things which are relevant for validation and lifting; it contains things like
the pragmas the user defined, the termination condition (if termination-checking is enabled) and so
on and so forth. Crucially, as a BareSpec
is still subject to "preflight checks", it may contain
duplicates (e.g. duplicate measures, duplicate type declarations etc.) and therefore most of the fields
for a BareSpec
are lists, so that we can report these errors to the end user: it would be an error
to silently ignore the duplication and leave the duplicate resolution to whichever Eq
instance is
implemented for the relevant field.
Also, a BareSpec
has not yet been subject to name resolution, so it may refer
to undefined or out-of-scope entities.
type BareMeasure = Measure LocBareType (Located LHName) Source #
type SpecMeasure = Measure LocSpecType DataCon Source #
Constructors
mkM :: HasCallStack => Located LHName -> ty -> [DefV v ty bndr] -> MeasureKind -> UnSortedExprs -> MeasureV v ty bndr Source #
mkMSpec :: [Measure t (Located LHName)] -> [Measure t ()] -> [Measure t (Located LHName)] -> [Measure t (Located LHName)] -> MSpec t (Located LHName) Source #