8) Modeling procedure and recursion
procedures and recursions are modeled by processes, they thus
introduce
a problem
of concurrency running.
ex1: proctype fact(int n; chan p) {
chan child = [1] of
{ int }; int result;
if
:: (n <= 1) -> p!1
:: (n >= 2) -> run fact(n-1,
child);
child?result; // wait for the child to complete
p!n*result
fi
}