                            HINet-0.1
      A simple parallel implementation of interaction nets

Copyright © 2015  Wolfram Kahl


The standard way to install Haskell packages also works for HINet:

  ghc --make Setup
  ./Setup configure --help
  ./Setup configure --prefix=/usr/local
  ./Setup build -v

The executables should now be at the following locations:

  dist/build/RunInets/RunInets
  dist/build/ackND/ackND
  dist/build/fibND/fibND

For installing them into your chosen prefix (/usr/local above), just:

  ./Setup install -v


Alternatively, ``cabal install'' should work, too;
be aware of the intricacies though:
  http://www.vex.net/~trebla/haskell/sicp.xhtml


Currently, HINet has no haddock documentation,
but is written as (somewhat) literate code;
the result of typesetting the complete source code is included as:

  doc/HINet.pdf

Modified examples from the Inets project (http://gna.org/svn/?group=inets)
are included in:

  data/Inets/*.inet

A few additional examples are in:

  data/Nat/*.inet

For example, after ``./Setup build'', you can:

  Calculate the 20th Fibonacci number on 1 core, with 1G fixed heap:

    time dist/build/fibND/fibND +RTS -N1 -H1G -M1G -RTS 20

  Try again with 4 cores:
  
    time dist/build/fibND/fibND +RTS -N4 -H1G -M1G -RTS 20

  Don't be disappointed that the speed-up is far from 4 --- HINet only
  implements extremely fine-grained concurrency without any attempt
  to achieve larger granularity for parallelisation.

  Get more information from the GHC run-time system:
  
    time dist/build/fibND/fibND +RTS -N4 -H1G -M1G -s -RTS 20

  Calculate Ackerman(3,6):

    time dist/build/ackND/ackND +RTS -N1 -H7M -M7M -RTS 3 6
    time dist/build/ackND/ackND +RTS -N4 -H7M -M7M -RTS 3 6

  Give larger arguments according to the time you have ---
  you will see slightly better speed-ups.
  Consider running htop (http://hisham.hm/htop/) to see what is
  happening on your machine...


  Calculate fib(20) again, but using a .inet specification --- like the
  above, this works with unary numbers internally, but now also produces a
  unary number as output:
  
    time dist/build/RunInets/RunInets +RTS -N1 -H1G -M1G -RTS data/Nat/fib20.inet 
    time dist/build/RunInets/RunInets +RTS -N4 -H1G -M1G -RTS data/Nat/fib20.inet 

  The conversion can be done in the Inets language, by using ``int'' attributes:
  
    time dist/build/RunInets/RunInets +RTS -N1 -H1G -M1G -RTS data/Nat/fibN20.inet 
    time dist/build/RunInets/RunInets +RTS -N4 -H1G -M1G -RTS data/Nat/fibN20.inet 

  Calculate fib(20) again, but now using an .inet specification that does all
  the additions on ``int'' attributes:
  
    time dist/build/RunInets/RunInets +RTS -N1 -H1G -M1G -RTS data/Inets/fibonacci20.inet
    time dist/build/RunInets/RunInets +RTS -N4 -H1G -M1G -RTS data/Inets/fibonacci20.inet

  Sort a (fixed) randomly-generated list (which you can inspect in the
  argument file):

    time dist/build/RunInets/RunInets +RTS -N1 -H1G -M1G -RTS data/Inets/sort100.inet 
    time dist/build/RunInets/RunInets +RTS -N4 -H1G -M1G -RTS data/Inets/sort100.inet 

