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

Safe HaskellNone

Language.Nano.Liquid.CGMonad

Contents

Description

Operations pertaining to Constraint Generation

Synopsis

Constraint Generation Monad

type CGM = ErrorT String (State CGState)Source

Execute Action and Get FInfo

Get Defined Function Type Signature

getDefType :: (PP a, Symbolic a, IsLocated a) => a -> ErrorT String (State CGState) RefTypeSource

Throw Errors

cgError :: IsLocated l => l -> String -> CGM aSource

Fresh Templates for Unknown Refinement Types

freshTyFun :: IsLocated l => CGEnv -> l -> RefType -> CGM RefTypeSource

Fresh Templates ------------------------------------------------------------------

Instantiate Fresh Type (at Function-site)

freshTyInst :: IsLocated l => l -> CGEnv -> [TVar] -> [Type] -> RefType -> CGM RefTypeSource

Instantiate Fresh Type (at Call-site)

freshTyPhis :: IsLocated l => l -> CGEnv -> [Id l] -> [Type] -> CGM (CGEnv, [RefType])Source

Instantiate Fresh Type (at Phi-site)

Environment API

envAddFresh :: IsLocated l => l -> RefType -> CGEnv -> CGM (Id l, CGEnv)Source

Environment API ------------------------------------------------------------------

envAdds :: (Symbolic x, IsLocated x) => [(x, RefType)] -> CGEnv -> CGM CGEnvSource

envAddGuard :: (Symbolic x, IsLocated x) => x -> Bool -> CGEnv -> CGEnvSource

envFindTy :: (IsLocated x, Symbolic x, Expression x) => x -> CGEnv -> RefTypeSource

A helper that returns the actual RefType of the expression by looking up the environment with the name, strengthening with singleton for base-types.

Add Subtyping Constraints

subTypes :: (IsLocated l, IsLocated x, Expression x, Symbolic x) => l -> CGEnv -> [x] -> [RefType] -> CGM ()Source

Adding Subtyping Constraints -----------------------------------------------------

subType :: IsLocated l => l -> CGEnv -> RefType -> RefType -> CGM ()Source