nano-js-0.1.0.0: Small Language for Implementing Verification Algorithms

Safe HaskellNone

Language.Nano.Liquid.Types

Contents

Description

Module pertaining to Refinement Type descriptions and conversions Likely mergeable with Language.Nano.Typecheck.Types

Synopsis

Refinement Types and Environments

type RefType = RType ReftSource

Constraint Environments

data CGEnv Source

Constraint Generation Environment ---------------------------------------------

Constructors

CGE 

Fields

renv :: !(Env RefType)

bindings in scope

fenv :: IBindEnv

fixpoint bindings

guards :: ![Pred]

branch target conditions

Instances

PP CGEnv 

Constraint Information

newtype Cinfo Source

Constraint Information ------------------------------------------------

Constructors

Ci SourcePos 

Instances

ci :: IsLocated a => a -> CinfoSource

Constraints

data SubC Source

Constraints -----------------------------------------------------------

Subtyping Constraints

Constructors

Sub 

Fields

senv :: !CGEnv

Environment

sinfo :: !Cinfo

Source Information

slhs :: !RefType

Subtyping LHS

srhs :: !RefType

Subtyping RHS ... senv |- slhs <: srhs

Instances

data WfC Source

Wellformedness Constraints

Constructors

W 

Fields

wenv :: !CGEnv

Scope/Environment

winfo :: !Cinfo

Source Information

wtyp :: !RefType

Type to be Well-formed ... wenv |- wtyp

Instances

type FixSubC = SubC CinfoSource

Aliases for Fixpoint Constraints

type FixWfC = WfC CinfoSource

Conversions

class RefTypable a whereSource

Embedding Values as RefTypes --------------------------------------

Methods

rType :: a -> RefTypeSource

eSingleton :: Expression e => RefType -> e -> RefTypeSource

pSingleton :: Predicate p => RefType -> p -> RefTypeSource

Manipulating RefType

rTypeReft :: Reftable r => RType r -> ReftSource

rTypeSort :: Reftable r => RType r -> SortSource

rTypeSortedReft :: Reftable r => RType r -> SortedReftSource

Converting RType to Fixpoint --------------------------------------------

rTypeValueVar :: Reftable r => RType r -> SymbolSource

Predicates On RefType

Monadic map (TODO: Applicative/Traversable)

mapReftM :: (Reftable b, Monad m, Applicative m) => (a -> m b) -> RType a -> m (RType b)Source

Primitive Types

prefixOpRTy :: PrefixOp -> CGEnv -> RefTypeSource

infixOpRTy :: InfixOp -> CGEnv -> RefTypeSource