0

I'm trying to use CSP-like synchronization mechanism and I don't understand why the initial state of the following model is a deadlock:

const int N = 2;
chan a;

process Processes(int [1,N] pid) {
    state A, B;
    init A;
    trans A -> B { sync a; };
}

system Processes;

In my opinion the 2 processes are synchronized on channel 'a' and should make at least one step, no ?

1 Answers1

1

The system declaration needs to include the IO declaration:

P1=Processes(1);
P2=Processes(2);

system P1, P2;

IO P1 {a}
IO P2 {a}

Unfortunately the IO declaration does not understand the template parameters, thus I used complete instantiation with concrete names.

There is also "Modest" option to enable the different update semantics, like:

x=y+z

uses the the old value of y and z (before the synchronization) in case y and z are modified concurrently.

mariusm
  • 1,483
  • 1
  • 11
  • 26
  • Thanks Marius. I have a doubt about what happens when an event isn't in an IO declaration. In my example if we add a transition, say B -> A, labeled with 'b'. If 'b' is not added to IO declarations then transitions labeled 'b' are allowed to occur asynchronously. However if there is no IO declaration no event can occur. Does it mean that as soon as a process occurs in an IO declaration, its events are allowed to occur asynchronously ? – user2083098 Jun 11 '19 at 08:12