Reading ADP Source Code

All the examples are shown in ADP source code -- it this code (though in compiled form) which is executed when you run an example. We do not allow you to change it.
The code is structured along the basic concepts of ADP: Signature, several algebras, tree grammar. Each piece of code can be sticked to the screen in an extra window.

ADP Notation

Function Notation

Functions are written in prefix notation, without parentheses. For example,

f(x,y,z)

is written as

f x y z

Rules of the tree grammar

Rules in the tree grammar, with trees in their
righthand side, must be distinguished from other formulas. They are written like this;

u = f <<< x ~~~ y~~~ z ||| g <<< u ~~~ x ... h

which means:

- There are two alternative rules how to construct candidates of type u.
- The first has root operator f and three subtrees (of type x,y,z).
- The second has root operator g and two subtrees (of type u and x).
- When candidates of both kinds have been constructed, a choice via h is to be made. This is explicitly indicated by "... h", as it is not necessary done with all the rules.
- Some examples use variants of the "~~~" symbol, like "-~~" or "~~-". They mean the same as "~~~", the are just implemented a little more efficiently. Don't worry about this here.

Trees in the tree grammar may have any height, involving several operators. Then we use parentheses as in;

u = f <<< x ~~~ (g <<< u ~~~ x) ~~~ (g <<< y ~~~ z)

Layout

Text layout is important. Indentation means nesting od definitions. Just get
used to our layout and adhere to it when you start to write your own code.

That's all.