#skip // expected output #expect 1 #expect 2 #expect 2 #expect 1 #expect 1 #expect 2 #expect 2 #expect 1 #expect 1 #expect 2 #expect 2 #expect 1 #expect 1 #expect 2 #expect 1 #expect 2 #expect 2 #expect 1 #expect 2 #expect 1 #expect 2 #expect 1 #expect 1 #expect 2 #expect 2 #expect 1 #expect 1 #expect 2 #expect 1 #expect 2 #expect 1 #expect 2 #expect 2 #expect 1 #expect 2 #expect 1 // ships required in order to run this code #ship debug : Debug #ship choice : Choice #ship fifo : Fifo // alternate values from choice1+choice2 choice.out1: [*] wait, take, sendto debug.in; choice.out2: [*] wait, take, sendto debug.in; debug.in: [*] nop; (*) notify fifo.out; (*) notify choice.out1; (*) notify choice.out2; (*) take, deliver; (*) take, deliver; kill*; choice.in1: take; [*] deliver; choice.in2: take; [*] deliver; 1: sendto choice.in1; 2: sendto choice.in2; choice.in: [*] take, deliver; fifo.in: [*] take, deliver; -1: sendto fifo.in; 0: sendto fifo.in; 1: sendto fifo.in; -1: sendto fifo.in; 0: sendto fifo.in; 1: sendto fifo.in; -1: sendto fifo.in; 0: sendto fifo.in; 1: sendto fifo.in; -1: sendto fifo.in; 0: sendto fifo.in; 1: sendto fifo.in; -1: sendto fifo.in; 0: sendto fifo.in; 1: sendto fifo.in; -1: sendto fifo.in; 0: sendto fifo.in; 1: sendto fifo.in; fifo.out: [3] wait, take, sendto choice.in.swapIfZero; [3] wait, take, sendto choice.in.swapIfNonZero; [3] wait, take, sendto choice.in.swapIfPositive; [3] wait, take, sendto choice.in.swapIfNonPositive; [3] wait, take, sendto choice.in.swapIfNegative; [3] wait, take, sendto choice.in.swapIfNonNegative;