GAL peterson_4_dve { //arrays array[4] pos= (0, 0, 0, 0) ; array[4] step= (0, 0, 0, 0) ; //variables int P_0.state=0; int P_0.j=0; int P_0.k=0; int P_1.state=0; int P_1.j=0; int P_1.k=0; int P_2.state=0; int P_2.j=0; int P_2.k=0; int P_3.state=0; int P_3.j=0; int P_3.k=0; //transitions transition t0 [ ( P_0.state == 0 ) ] { P_0.state = 2; P_0.j = 1; } transition t1 [ ( P_0.state == 1 ) ] { P_0.state = 0; pos[0] = 0; } transition t2 [ ( ( P_0.j < 4 ) && ( P_0.state == 2 ) ) ] { P_0.state = 3; pos[0] = P_0.j; } transition t3 [ ( ( P_0.j == 4 ) && ( P_0.state == 2 ) ) ] { P_0.state = 1; } transition t4 [ ( P_0.state == 3 ) ] { P_0.state = 4; step[( P_0.j - 1 )] = 0; P_0.k = 0; } transition t5 [ ( ( P_0.state == 4 ) && ( P_0.k < 4 ) && ( ( pos[P_0.k] < P_0.j ) || ( P_0.k == 0 ) ) ) ] { P_0.state = 4; P_0.k = ( 1 + P_0.k ); } transition t6 [ ( ( P_0.state == 4 ) && ( ( P_0.k == 4 ) || ( step[( P_0.j - 1 )] != 0 ) ) ) ] { P_0.state = 2; P_0.j = ( P_0.j + 1 ); } transition t7 [ ( P_1.state == 0 ) ] { P_1.state = 2; P_1.j = 1; } transition t8 [ ( P_1.state == 1 ) ] { P_1.state = 0; pos[1] = 0; } transition t9 [ ( ( P_1.j < 4 ) && ( P_1.state == 2 ) ) ] { P_1.state = 3; pos[1] = P_1.j; } transition t10 [ ( ( P_1.j == 4 ) && ( P_1.state == 2 ) ) ] { P_1.state = 1; } transition t11 [ ( P_1.state == 3 ) ] { P_1.state = 4; step[( P_1.j - 1 )] = 1; P_1.k = 0; } transition t12 [ ( ( P_1.state == 4 ) && ( ( pos[P_1.k] < P_1.j ) || ( P_1.k == 1 ) ) && ( P_1.k < 4 ) ) ] { P_1.state = 4; P_1.k = ( 1 + P_1.k ); } transition t13 [ ( ( P_1.state == 4 ) && ( ( step[( P_1.j - 1 )] != 1 ) || ( P_1.k == 4 ) ) ) ] { P_1.state = 2; P_1.j = ( 1 + P_1.j ); } transition t14 [ ( P_2.state == 0 ) ] { P_2.state = 2; P_2.j = 1; } transition t15 [ ( P_2.state == 1 ) ] { P_2.state = 0; pos[2] = 0; } transition t16 [ ( ( P_2.j < 4 ) && ( P_2.state == 2 ) ) ] { P_2.state = 3; pos[2] = P_2.j; } transition t17 [ ( ( P_2.j == 4 ) && ( P_2.state == 2 ) ) ] { P_2.state = 1; } transition t18 [ ( P_2.state == 3 ) ] { P_2.state = 4; step[( P_2.j - 1 )] = 2; P_2.k = 0; } transition t19 [ ( ( P_2.state == 4 ) && ( P_2.k < 4 ) && ( ( pos[P_2.k] < P_2.j ) || ( P_2.k == 2 ) ) ) ] { P_2.state = 4; P_2.k = ( 1 + P_2.k ); } transition t20 [ ( ( P_2.state == 4 ) && ( ( step[( P_2.j - 1 )] != 2 ) || ( P_2.k == 4 ) ) ) ] { P_2.state = 2; P_2.j = ( 1 + P_2.j ); } transition t21 [ ( P_3.state == 0 ) ] { P_3.state = 2; P_3.j = 1; } transition t22 [ ( P_3.state == 1 ) ] { P_3.state = 0; pos[3] = 0; } transition t23 [ ( ( P_3.state == 2 ) && ( P_3.j < 4 ) ) ] { P_3.state = 3; pos[3] = P_3.j; } transition t24 [ ( ( P_3.state == 2 ) && ( P_3.j == 4 ) ) ] { P_3.state = 1; } transition t25 [ ( P_3.state == 3 ) ] { P_3.state = 4; step[( P_3.j - 1 )] = 3; P_3.k = 0; } transition t26 [ ( ( P_3.state == 4 ) && ( P_3.k < 4 ) && ( ( P_3.k == 3 ) || ( pos[P_3.k] < P_3.j ) ) ) ] { P_3.state = 4; P_3.k = ( 1 + P_3.k ); } transition t27 [ ( ( P_3.state == 4 ) && ( ( step[( P_3.j - 1 )] != 3 ) || ( P_3.k == 4 ) ) ) ] { P_3.state = 2; P_3.j = ( 1 + P_3.j ); } // transient predicate TRANSIENT = false; }