hermit-0.7.1.0: Haskell Equational Reasoning Model-to-Implementation Tunnel

Safe HaskellNone
LanguageHaskell2010

HERMIT.Kernel

Contents

Synopsis

The HERMIT Kernel

data AST Source

A handle for a specific version of the ModGuts.

Instances

data Kernel Source

A Kernel is a repository for complete Core syntax trees (ModGuts) and Lemmas.

data KernelEnv Source

Constructors

KernelEnv 

Fields

kEnvChan :: DebugMessage -> HermitM ()
 

hermitKernel Source

Arguments

:: IORef (Maybe (AST, ASTMap))

Global (across passes) AST store.

-> String

Last GHC pass name

-> (Kernel -> AST -> IO ())

Callback

-> ModGuts 
-> CoreM ModGuts 

Start a HERMIT client by providing an IO callback that takes the initial Kernel and inital AST handle. The callback is only ever called once. The 'Modguts -> CoreM Modguts' function required by GHC Plugins is returned.

Kernel Interface

resumeK :: Kernel -> MonadIO m => AST -> m () Source

Halt the Kernel and return control to GHC, which compiles the specified AST.

abortK :: Kernel -> MonadIO m => m () Source

Halt the Kernel and abort GHC without compiling.

applyK :: Kernel -> (MonadIO m, MonadCatch m) => RewriteH ModGuts -> CommitMsg -> KernelEnv -> AST -> m AST Source

Apply a Rewrite to the specified AST and return a handle to the resulting AST.

queryK :: Kernel -> (MonadIO m, MonadCatch m) => TransformH ModGuts a -> CommitMsg -> KernelEnv -> AST -> m (AST, a) Source

Apply a TransformH to the AST, return the resulting value, and potentially a new AST.

deleteK :: Kernel -> MonadIO m => AST -> m () Source

Delete the internal record of the specified AST.

listK :: Kernel -> MonadIO m => m [(AST, Maybe String, Maybe AST)] Source

List all the ASTs tracked by the Kernel, including version data.

tellK :: Kernel -> (MonadIO m, MonadCatch m) => String -> AST -> m AST Source

Log a new AST with same Lemmas/ModGuts as given AST.