L2CA Exemples : List Reversal, Expanded Version
This Version show how two nodes of the initial heap will have there position on the list reversed.
Program Source
pointer i,j,k;
while !(i == null) do
k = i.next ;
i.next = j;
j = i;
i = k;
od
Initial Heap
3 // nb of vertices
O x 1 (i); // id counterName nextVertice RootList
1 y 2 (first);
2 z null (second);
DOT Output
This is what L2CA generates when used on those program and heap. You can see the shape of the heap through the program execution.
The doted boxes are the automaton states and
small ones the heap vertices, in which the first line is for the roots and the second for the counter.
[This is a guard] this is an action ;