// expected output #expect 2 #expect 1 #expect 1 #expect 2 #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 // alternate values from choice1+choice2 choice.out1: [*] wait, take, sendto debug.in; choice.out2: [*] wait, take, sendto debug.in; debug.in: [*] nop; (*) notify choice.out1; (*) take, deliver; (*) notify choice.out2; (*) take, deliver; kill*; choice.in1: take; [*] deliver; choice.in2: take; [*] deliver; 1: sendto choice.in1; 2: sendto choice.in2; choice.in: [*] take, deliver; 0: sendto choice.in.swapIfZero; 1: sendto choice.in.swapIfZero; 0: sendto choice.in.swapIfNonZero; 1: sendto choice.in.swapIfNonZero; -1: sendto choice.in.swapIfPositive; 0: sendto choice.in.swapIfPositive; 1: sendto choice.in.swapIfPositive; -1: sendto choice.in.swapIfNonPositive; 0: sendto choice.in.swapIfNonPositive; 1: sendto choice.in.swapIfNonPositive; -1: sendto choice.in.swapIfNegative; 0: sendto choice.in.swapIfNegative; 1: sendto choice.in.swapIfNegative; -1: sendto choice.in.swapIfNonNegative; 0: sendto choice.in.swapIfNonNegative; 1: sendto choice.in.swapIfNonNegative;