Safe Haskell | None |
---|
Turn CoreHW terms into normalized CoreHW Terms
- runNormalization :: DebugLevel -> Supply -> HashMap TmName (Type, Term) -> (Type -> Maybe (Either String HWType)) -> NormalizeSession a -> a
- normalize :: [TmName] -> NormalizeSession [(TmName, (Type, Term))]
- rewriteExpr :: (String, NormRewrite) -> (String, Term) -> NormalizeSession Term
- cleanupGraph :: [TmName] -> [(TmName, (Type, Term))] -> NormalizeSession [(TmName, (Type, Term))]
- checkNonRecursive :: TmName -> [(TmName, (Type, Term))] -> [(TmName, (Type, Term))]
Documentation
:: DebugLevel | Level of debug messages to print |
-> Supply | UniqueSupply |
-> HashMap TmName (Type, Term) | Global Binders |
-> (Type -> Maybe (Either String HWType)) | Hardcoded Type -> HWType translator |
-> NormalizeSession a | NormalizeSession to run |
-> a |
Run a NormalizeSession in a given environment
normalize :: [TmName] -> NormalizeSession [(TmName, (Type, Term))]Source
Normalize a list of global binders
:: (String, NormRewrite) | Transformation to apply |
-> (String, Term) | Term to transform |
-> NormalizeSession Term |
Rewrite a term according to the provided transformation
:: [TmName] | Names of the functions to clean up |
-> [(TmName, (Type, Term))] | Global binders |
-> NormalizeSession [(TmName, (Type, Term))] |
Perform general "clean up" of the normalized (non-recursive) function hierarchy. This includes:
- Inlining functions that simply "wrap" another function
Check if the call graph (second argument), starting at the topEnity
(first argument) is non-recursive. Returns the list of normalized terms if
call graph is indeed non-recursive, errors otherwise.