The hermit package
HERMIT uses Haskell to express semi-formal models, efficient implementations, and provide a bridging DSL to describe via stepwise refinement the connection between these models and implementations. The key transformation in the bridging DSL is the worker/wrapper transformation.
This is a pre-alpha `please give feedback' release. Shortcomings/gotchas include:
Command line completion is ad hoc at the moment.
log command prints linearly, even if command history is a tree.
The fold rewrite can only fold syntactically alpha-equivalent (up to parameters of the function you are folding) expressions.
RULES have issues with forall types.
Different core comes out depending on whether you ascribe explicit type signatures.
A number of rewrites don't enforce preconditions. ex: cast elimination always works, even if the cast is necessary
Examples can be found in the examples sub-directory.
$ cd examples/reverse
Example of running a script.
$ hermit Reverse.hs Reverse.hss resume [starting HERMIT v0.1.8.0 on Reverse.hs] % ghc Reverse.hs -fforce-recomp -O2 -dcore-lint -fexpose-all-unfoldings -fsimple-list-literals -fplugin=HERMIT -fplugin-opt=HERMIT:Main:Reverse.hss -fplugin-opt=HERMIT:Main:resume [1 of 2] Compiling HList ( HList.hs, HList.o ) Loading package ghc-prim ... linking ... done. ... Loading package hermit-0.1.8.0 ... linking ... done. [2 of 2] Compiling Main ( Reverse.hs, Reverse.o ) Linking Reverse ... $ ./Reverse ....
Example of interactive use.
$ hermit Reverse.hs [starting HERMIT v0.1.8.0 on Reverse.hs] % ghc Reverse.hs -fforce-recomp -O2 -dcore-lint -fexpose-all-unfoldings -fsimple-list-literals -fplugin=HERMIT -fplugin-opt=HERMIT:Main: [1 of 2] Compiling HList ( HList.hs, HList.o ) Loading package ghc-prim ... linking ... done. ... Loading package hermit-0.1.8.0 ... linking ... done. [2 of 2] Compiling Main ( Reverse.hs, Reverse.o ) module main:Main where rev ∷ ∀ a . [a] -> [a] unwrap ∷ ∀ a . ([a] -> [a]) -> [a] -> H a wrap ∷ ∀ a . ([a] -> H a) -> [a] -> [a] main ∷ IO () main ∷ IO () hermit<0> ...
To resume compilation, use resume.
... hermit<0> resume hermit<0> Linking Reverse ... $
Properties
| Versions | 0.0, 0.1.1.0, 0.1.1.1, 0.1.2.0, 0.1.4.0, 0.1.6.0, 0.1.8.0 |
|---|---|
| Dependencies | ansi-terminal (≥0.5.5), array, base (4.*), containers (≥0.5.0.0), data-default (≥0.5.0), directory (≥1.2.0.0), ghc (≥7.6), haskeline (≥0.7.0.3), kure (≥2.6.22), marked-pretty (≥0.1), mtl (≥2.1.2), operational (≥0.2.2.1), process, stm (≥2.4), template-haskell (≥2.8.0.0), transformers |
| License | BSD3 |
| Author | Andrew Farmer, Andy Gill, Ed Komp, Neil Sculthorpe |
| Maintainer | Andy Gill <andygill@ku.edu> |
| Stability | pre-alpha |
| Category | Language, Formal Methods, Optimization, Transformation, Refactoring, Reflection |
| Source repository | git clone git://github.com/ku-fpg/hermit.git |
| Executables | hermit |
| Upload date | Thu May 16 05:06:04 UTC 2013 |
| Uploaded by | AndrewFarmer |
| Built on | ghc-7.6 |
Modules
- HERMIT
- Language
- HERMIT
- Language.HERMIT.Context
- Language.HERMIT.Core
- Language.HERMIT.Dictionary
- Language.HERMIT.External
- Language.HERMIT.GHC
- Language.HERMIT.Interp
- Language.HERMIT.Kernel
- Language.HERMIT.Kure
- Language.HERMIT.Monad
- Language.HERMIT.Optimize
- Language.HERMIT.Parser
- Language.HERMIT.ParserCore
- Language.HERMIT.Plugin
- PrettyPrinter
- Primitive
- Language.HERMIT.Primitive.AlphaConversion
- Language.HERMIT.Primitive.Common
- Language.HERMIT.Primitive.Debug
- Language.HERMIT.Primitive.FixPoint
- Language.HERMIT.Primitive.Fold
- Language.HERMIT.Primitive.GHC
- Language.HERMIT.Primitive.Inline
- Language.HERMIT.Primitive.Kure
- Language.HERMIT.Primitive.Local
- Language.HERMIT.Primitive.Navigation
- Language.HERMIT.Primitive.New
- Language.HERMIT.Primitive.Unfold
- Shell
- HERMIT
Downloads
- hermit-0.1.8.0.tar.gz (Cabal source package)
- package description (included in the package)