
% The transaction parent(N) executes N non-interacting processes
% concurrently, where each process is a sequence of seven tasks.  The
% program seq(parent,fail) will force all possible interleavings to be
% generated.

trans(parent(N)) :- seq(N > 0,
                     seq(M is N-1,
                      conc(process(N),parent(M)))).

trans(parent(0)) :- state.

trans(process(I)) :- seq(task(I,a),
                      seq(task(I,b),
                       seq(task(I,c),
                        seq(task(I,d),
                         seq(task(I,e),
                          seq(task(I,f),
                               task(I,g))))))).

trans(task(I,J)) :- monitor(task(I,J)).



% These dummy rules let Prolog know that the predicates parent/1,
% process/1 and task/2 are defined.
%
parent(dummy) :- fail.
process(dummy) :- fail.
task(dummy,dummy) :- fail.
