hermit

Haskell Equational Reasoning Model-to-Implementation Tunnel

Latest on Hackage:1.0.1@rev:1

This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.

BSD-3-Clause licensed by Andrew Farmer, Andy Gill, Ed Komp, Neil Sculthorpe
Maintained by Andrew Farmer

HERMIT is a Haskell-specific toolkit designed to mechanize equational reasoning and program transformation during compilation in GHC.

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 v1.0.1 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-1.0.1 ... linking ... done.
[2 of 2] Compiling Main             ( Reverse.hs, Reverse.o )
Linking Reverse ...
$ ./Reverse
....

Example of interactive use.

$ hermit Reverse.hs
[starting HERMIT v1.0.1 on Reverse.hs]
% ghc Reverse.hs -fforce-recomp -O2 -dcore-lint -fexpose-all-unfoldings -fsimple-list-literals -fplugin=HERMIT -fplugin-opt=HERMIT:*:
[1 of 2] Compiling HList            ( HList.hs, HList.o )
Loading package ghc-prim ... linking ... done.
...
Loading package hermit-1.0.1 ... linking ... done.
[2 of 2] Compiling Main             ( Reverse.hs, Reverse.o )
===================== Welcome to HERMIT =====================
HERMIT is a toolkit for the interactive transformation of GHC
core language programs. Documentation on HERMIT can be found
on the HERMIT web page at:
http://www.ittc.ku.edu/csdl/fpg/software/hermit.html

You have just loaded the interactive shell. To exit, type
"abort" or "resume" to abort or resume GHC compilation.

Type "help" for instructions on how to list or search the
available HERMIT commands.

To get started, you could try the following:
  - type "binding-of 'foo", where "foo" is a function
    defined in the module;
  - type "set-pp-type Show" to switch on typing information;
  - use natural numbers such as "0" and "1" to descend into
    the definition, and "up" to ascend;
  - type "info" for more information about the current node;
  - type "log" to display an activity log.
=============================================================
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 ...
$