Control flow analysis for a lambda calculus like language with integers, booleans and explicit recursion operator. It is based on the language presented in chapter 5 of Principles of program analysis.
However, the implementation differs from the one in the book as the subeffecting of control-flow annotations is presented as a separate rule which prevents to some extent poisoning.
-
Download and install the Haskell platform for your operating system. The Haskell platform can be found in https://www.haskell.org/platform/. The three main platforms, Window, Mac OS X and Linux are supported.
-
Install the Stack tool from the hackage repository with the next steps. This need to be done from a terminal with the Haskell platform available in the path.
cabal update
cabal install stack
- Clone this repository or extract the source code.
git clone https://github.com/carlostome/FunFlow.git
- Change directory into the project and build the project with: .
stack build
- To install it just type:
stack install
this will copy it to stack binaries folder.
The easiest way to play with this library is to use it in a live ghci session.
In order to do so, just type stack repl
in the project folder. The examples
are contained in the src/Examples.hs file
The function runExpr
defined in src/FunFlow.hs performs parsing and analysis
on a string containing the program.
Also src/FunFlow.hs exports the function runFile
which reads, parses and
executes the analysis of a given file.
Once installed, run funflow FILE. File examples can be found under examples/. However is more recomendable the previous methods as all interesting examples are coded as strings in the file src/Examples.hs.