Installation instructions:

1. Get the BDD library from http://www-2.cs.cmu.edu/~modelcheck/bdd.html and
install it. You should obtain the libraries called "mem" and "bdd". You do
not need the contents of directories "boole" and "trlib".

2. Get the graph visualiser aiSee from http://www.aisee.com and install it.

3. Check the variables in the Makefile to make sure that they point to right
places:
  *. BDDINCLUDE must point to the directory where the include files of the
     BDD library were put.
  *. BDDLIB must point to the directory where the libraries "mem" and "bdd"
     were put.
  *. GCC and LEX must point to the incarnations of gcc and lex.

4. make. This produces an executable called iflowprog.




Running:

Invoke iflowprog with the name of a file containing a program in
WHILE-language as the command-line parameter. The subdirecrory "examples"
contains some simple programs. As the result of the execution, two files,
named _filename_.1.gdl and _filename_.2.gdl, where _filename_ was the
command-line parameter of iflowprog, are created. These files contain
descriptions of graphs in the input language of aiSee. The first file
contains just the control flow graph of the program. The second, however,
contains the control flow graph together with the analysis result.




The WHILE-language:

The program consists of three parts, first two of which may be missing: the
listing of secret variables, the listing of keys in the beginning of the
program and the program text itself.

The syntax of the listing of secret variables is the following:

secrets
  <comma-separated list of variables>
end secrets

A variable (name) is an identifier. An identifier is a sequence of
alphanumeric characters and underscores, beginning with a letter.

The syntax of the initial keys is the following:

keys
  <comma-separated list of variables>
end keys

The program text itself is a statement. A statement is either an
assignment, a sequence of statements, an if-statement or a while-statement.
An assignment has either the shape of

<variable> = <variable>

or

<variable> = <function name>(<comma-separated list of variables and constants>)

The variable at the left hand side may not be a secret variable. A constant
is a sequence of digits. A function name can have one of the following three
shapes:

enc
key_gen
`<identifier>

Here enc denotes the encryption operator, it takes two arguments --- the key
and the plaintext. key_gen denotes the key generation operator, it takes
zero arguments. The third possibility denotes other functions which are not
treated separately. The contents of <identifier> plays no role for the
analysis.

A sequence of statements is a list of statements, separated by whitespace.
An if-statement has one of the following shapes:

if <variable> then
  <statement>
end if

or

if <variable> then
  <statement>
else
  <statement>
end if

A while-statement has the following shape:

while <variable> do
  <statement>
end while
