<?xml version="1.0" encoding="utf-8"?><!DOCTYPE nta PUBLIC '-//Uppaal Team//DTD Flat System 1.1//EN' 'http://www.it.uu.se/research/group/darts/uppaal/flat-1_1.dtd'><nta><declaration>typedef int[0,4] Buffer_Implementation;
const Buffer_Implementation SET = 0;
const Buffer_Implementation BAG = 1;
const Buffer_Implementation STUTT_FIFO = 2;
const Buffer_Implementation FIFO = 3;
const Buffer_Implementation LOSSY_FIFO = 4;
// ****************************
// PROTOCOL CONFIGURATION START
// ****************************

// First choose a communication policy, possible values are: SET, BAG, STUTT_FIFO, FIFO, LOSSY_FIFO
Buffer_Implementation buffer_Implementation = STUTT_FIFO;

// Then set the maximum buffer capacity
const int BUFFER_CAPACITY = 4;

// Finally set the minimum delay and tire-outs for the retransmission of messages 
// This is relevant only for the termination property and MIN_DELAY should be 
// smaller or eqaul than TIRE_OUT
// For boundedness and correctness checks, the constants should be both set to 0
const int MIN_DELAY = 0;
const int TIRE_OUT = 0;

// **************************
// PROTOCOL CONFIGURATION END
// **************************

bool overflow = false;

typedef int[0,BUFFER_CAPACITY-1] BufferTc;
int [0,BUFFER_CAPACITY] bufferSizeTc;

typedef int[0,BUFFER_CAPACITY-1] BufferP;
int [0,BUFFER_CAPACITY] bufferSizeP;

/**Coordinator states*/
typedef int[0,11] StateTC;
const StateTC TC_ACTIVE = 0;
const StateTC TC_CANCELING_ACTIVE = 1;
const StateTC TC_CANCELING_COMPLETING = 2;
const StateTC TC_COMPLETING = 3;
const StateTC TC_COMPLETED = 4;
const StateTC TC_CLOSING = 5;
const StateTC TC_COMPENSATING = 6;
const StateTC TC_FAILING_ACC = 7; //failing Active/Canceling/Completing
const StateTC TC_FAILING_C = 8; //failing Compensating
const StateTC TC_NOT_COMPLETING = 9;
const StateTC TC_EXITING = 10;
const StateTC TC_ENDED = 11;

StateTC stTC = TC_ACTIVE;

/**States of the Participant.*/
typedef int[0,10] StateP;
const StateP P_ACTIVE = 0;
const StateP P_CANCELING = 1;
const StateP P_COMPLETING = 2;
const StateP P_COMPLETED = 3;
const StateP P_CLOSING = 4;
const StateP P_COMPENSATING = 5;
const StateP P_FAILING_ACC = 6; //failing Active/Canceling
const StateP P_FAILING_C = 7; //failing Compensating
const StateP P_NOT_COMPLETING = 8;
const StateP P_EXITING = 9;
const StateP P_ENDED = 10;

StateP stP = P_ACTIVE;

//Messages sent from TC to Participant.
typedef int[0,7] MsgsTC;
const MsgsTC CANCEL_TC = 0;
const MsgsTC COMPLETE_TC = 1;
const MsgsTC CLOSE_TC = 2;
const MsgsTC COMPENSATE_TC =3;
const MsgsTC FAILED_TC = 4;
const MsgsTC EXITED_TC = 5;
const MsgsTC NOT_COMPLETED_TC = 6;
const MsgsTC FAILED_EXITED_NOT_COMPLETED_TC = 7;

int msgTC_SET_BAG[MsgsTC];

MsgsTC msgTC_FIFO[BufferTc];

//Messages sent from Participant to TC.
typedef int[0,7] MsgsP;
const MsgsP EXIT_P = 0;
const MsgsP COMPLETED_P = 1;
const MsgsP FAIL_P = 2;
const MsgsP CANNOT_COMPLETE_P = 3;
const MsgsP CANCELED_P = 4;
const MsgsP CLOSED_P = 5;
const MsgsP COMPENSATED_P = 6;
const MsgsP CANCELED_CLOSED_COMPENSATED_P = 7;

int msgP_SET_BAG[MsgsP];

MsgsP msgP_FIFO[BufferP];</declaration><template><name>Coordinator</name><declaration>clock x,y;

void Send_Msg(MsgsTC s) {
int i;
//SET construct
if (buffer_Implementation == SET) msgTC_SET_BAG[s] = true;
//BAG construct
if (buffer_Implementation == BAG) {
	if (msgTC_SET_BAG[s] == BUFFER_CAPACITY) overflow = true;
		else msgTC_SET_BAG[s]++; }
//STUTT_FIFO construct
if (buffer_Implementation == STUTT_FIFO)	{
	if (bufferSizeTc == BUFFER_CAPACITY) overflow = true;
		else
  		{	if (msgTC_FIFO[0] != s and bufferSizeTc&gt;0)	{
                		for (i=bufferSizeTc-1; i&gt;=0; i--) msgTC_FIFO[i+1] = msgTC_FIFO[i];
				        bufferSizeTc++; msgTC_FIFO[0] = s; 
                        }
            if (bufferSizeTc==0) { bufferSizeTc++; msgTC_FIFO[0] = s; }
   		}		
				}
//FIFO and LOSSY_FIFO construct
if (buffer_Implementation == FIFO || buffer_Implementation == LOSSY_FIFO) {
	if (bufferSizeTc == BUFFER_CAPACITY) overflow = true;
		else	
  			{ for (i=bufferSizeTc-1; i&gt;=0; i--) msgTC_FIFO[i+1] = msgTC_FIFO[i];
				bufferSizeTc++; 
  				msgTC_FIFO[0] = s;}
		}
}

bool Receive_Msg(MsgsP r) {
int i;
//SET construct
if (buffer_Implementation == SET) return msgP_SET_BAG[r];
//BAG construct
if (buffer_Implementation == BAG) return(msgP_SET_BAG[r] &gt;= 1);
//STUTT_FIFO construct
if (buffer_Implementation == STUTT_FIFO) {
	for (i=bufferSizeP-1; i&gt;=0; i--) 
		if (msgP_FIFO[i] == r) return true;
			return false;}
//FIFO and LOSSY_FIFO construct
if (buffer_Implementation == FIFO || buffer_Implementation == LOSSY_FIFO) {
    if (bufferSizeP==0) return false;
    return (msgP_FIFO[bufferSizeP-1]==r);	}
return false;
}

void Received_Msg(MsgsP r) {
int i;
//SET construct
//if (buffer_Implementation == SET) return ;
//BAG construct
if (buffer_Implementation == BAG) msgP_SET_BAG[r]--;
//STUTT_FIFO construct
if (buffer_Implementation == STUTT_FIFO) {
        i = 0; 
	while (msgP_FIFO[i] != r) i++; // msgP_SEQ[0,i-1] != r
                  bufferSizeP--; }
//FIFO and LOSSY_FIFO construct
if (buffer_Implementation == FIFO || buffer_Implementation == LOSSY_FIFO) {
	bufferSizeP--; }
}
//Messages transmitted by the TC

bool guard1() {
return stTC == TC_ACTIVE;
}
void action1() {
Send_Msg(CANCEL_TC);
stTC = TC_CANCELING_ACTIVE;
}

bool guard2() {
return stTC == TC_CANCELING_ACTIVE;
}
void action2() {
Send_Msg(CANCEL_TC);
}

bool guard3() {
return stTC == TC_CANCELING_COMPLETING;
}
void action3() {
Send_Msg(CANCEL_TC);
}

bool guard4() {
return stTC == TC_COMPLETING;
}
void action4() {
Send_Msg(CANCEL_TC);
stTC = TC_CANCELING_COMPLETING;
}

bool guard5() {
return stTC == TC_ACTIVE;
}
void action5() {
Send_Msg(COMPLETE_TC);
stTC = TC_COMPLETING;
}

bool guard6() {
return stTC == TC_COMPLETING;
}
void action6() {
Send_Msg(COMPLETE_TC);
}

bool guard7() {
return stTC == TC_COMPLETED;
}
void action7() {
Send_Msg(CLOSE_TC);
stTC = TC_CLOSING;
}

bool guard8() {
return stTC == TC_CLOSING;
}
void action8() {
Send_Msg(CLOSE_TC);
}

bool guard9() {
return stTC == TC_COMPLETED;
}
void action9() {
Send_Msg(COMPENSATE_TC);
stTC = TC_COMPENSATING;
}

bool guard10() {
return stTC == TC_COMPENSATING;
}
void action10() {
Send_Msg(COMPENSATE_TC);
}

bool guard11() {
return stTC == TC_FAILING_ACC || stTC == TC_FAILING_C;
}
void action11() {
Send_Msg(FAILED_TC);
stTC = TC_ENDED;
}

bool guard12() {
//return (msgTC_SET_BAG[FAILED_TC] || msgTC_SEQ[FAILED_TC]) &amp;&amp; stTC == TC_ENDED;
return stTC == TC_ENDED;
}
void action12() {
Send_Msg(FAILED_TC);
}

bool guard13() {
return stTC == TC_EXITING;
}
void action13() {
Send_Msg(EXITED_TC);
stTC = TC_ENDED;
}

bool guard14() {
//return (msgTC_SET_BAG[EXITED_TC] || msgTC_SEQ[EXITED_TC]) &amp;&amp; stTC == TC_ENDED;
return stTC == TC_ENDED;
}
void action14() {
Send_Msg(EXITED_TC);
}

bool guard15() {
return stTC == TC_NOT_COMPLETING;
}
void action15() {
Send_Msg(NOT_COMPLETED_TC);
stTC = TC_ENDED;
}

bool guard16() {
//return (msgTC_SET_BAG[NOT_COMPLETED_TC] || msgTC_SEQ[NOT_COMPLETED_TC]) &amp;&amp; stTC == TC_ENDED;
return stTC == TC_ENDED;
}
void action16() {
Send_Msg(NOT_COMPLETED_TC);
}

//Messages received by the TC

bool guard17() {
return Receive_Msg(EXIT_P) &amp;&amp; (stTC == TC_ACTIVE || stTC == TC_CANCELING_ACTIVE || stTC == TC_CANCELING_COMPLETING || stTC == TC_COMPLETING);
} 
void action17() {
stTC = TC_EXITING;
Received_Msg(EXIT_P);
}

bool guard18() {
return Receive_Msg(EXIT_P) &amp;&amp; stTC == TC_EXITING;
} 
void action18() {
Received_Msg(EXIT_P);
}

bool guard19() {
return Receive_Msg(EXIT_P) &amp;&amp; stTC == TC_ENDED;
} 
void action19() {
Send_Msg(EXITED_TC);
Received_Msg(EXIT_P);
}

bool guard20() {
return Receive_Msg(COMPLETED_P) &amp;&amp; (stTC == TC_CANCELING_COMPLETING || stTC == TC_COMPLETING);
}
void action20() {
stTC = TC_COMPLETED;
Received_Msg(COMPLETED_P);
}

bool guard21() {
return Receive_Msg(COMPLETED_P) &amp;&amp; stTC == TC_COMPLETED;
}
void action21() {
Received_Msg(COMPLETED_P);
}

bool guard22() {
return Receive_Msg(COMPLETED_P) &amp;&amp; stTC == TC_CLOSING;
}
void action22() {
Send_Msg(CLOSE_TC);
Received_Msg(COMPLETED_P);
}

bool guard23() {
return Receive_Msg(COMPLETED_P) &amp;&amp; stTC == TC_COMPENSATING;
}
void action23() {
Send_Msg(COMPENSATE_TC);
Received_Msg(COMPLETED_P);
}

bool guard24() {
return Receive_Msg(COMPLETED_P) &amp;&amp; stTC == TC_FAILING_C;
}
void action24() {
Received_Msg(COMPLETED_P);
}

bool guard25() {
return Receive_Msg(COMPLETED_P) &amp;&amp; stTC == TC_ENDED;
}
void action25() {
Received_Msg(COMPLETED_P);
}

bool guard26() {
return Receive_Msg(FAIL_P) &amp;&amp; 
		(stTC == TC_ACTIVE || stTC == TC_CANCELING_ACTIVE || stTC == TC_CANCELING_COMPLETING || stTC == TC_COMPLETING);
}
void action26() {
stTC = TC_FAILING_ACC;
Received_Msg(FAIL_P);
}

bool guard27() {
return Receive_Msg(FAIL_P) &amp;&amp; stTC == TC_COMPENSATING;
}
void action27() {
stTC = TC_FAILING_C;
Received_Msg(FAIL_P);
}

bool guard28() {
return Receive_Msg(FAIL_P) &amp;&amp; stTC == TC_FAILING_ACC;
}
void action28() {
Received_Msg(FAIL_P);
}

bool guard29() {
return Receive_Msg(FAIL_P) &amp;&amp; stTC == TC_FAILING_C;
}
void action29() {
Received_Msg(FAIL_P);
}

bool guard30() {
return Receive_Msg(FAIL_P) &amp;&amp; stTC == TC_ENDED;
}
void action30() {
Send_Msg(FAILED_TC);
Received_Msg(FAIL_P);
}

bool guard31() {
return Receive_Msg(CANNOT_COMPLETE_P) &amp;&amp; 
		(stTC == TC_ACTIVE || stTC == TC_CANCELING_ACTIVE || stTC == TC_CANCELING_COMPLETING || stTC == TC_COMPLETING);
}
void action31() {
stTC = TC_NOT_COMPLETING;
Received_Msg(CANNOT_COMPLETE_P);
}

bool guard32() {
return Receive_Msg(CANNOT_COMPLETE_P) &amp;&amp; stTC == TC_NOT_COMPLETING;
}
void action32() {
Received_Msg(CANNOT_COMPLETE_P);
}

bool guard33() {
return Receive_Msg(CANNOT_COMPLETE_P) &amp;&amp; stTC == TC_ENDED;
}
void action33() {
Send_Msg(NOT_COMPLETED_TC);
Received_Msg(CANNOT_COMPLETE_P);
}

bool guard34() {
return Receive_Msg(CANCELED_P) &amp;&amp; (stTC == TC_CANCELING_ACTIVE || stTC == TC_CANCELING_COMPLETING);
}
void action34() {
stTC = TC_ENDED;
Received_Msg(CANCELED_P);
}

bool guard35() {
return Receive_Msg(CANCELED_P) &amp;&amp; stTC == TC_ENDED;
}
void action35() {
Received_Msg(CANCELED_P);
}

bool guard36() {
return Receive_Msg(CLOSED_P) &amp;&amp; stTC == TC_CLOSING;
}
void action36() {
stTC = TC_ENDED;
Received_Msg(CLOSED_P);
}

bool guard37() {
return Receive_Msg(CLOSED_P) &amp;&amp; stTC == TC_ENDED;
}
void action37() {
Received_Msg(CLOSED_P);
}

bool guard38() {
return Receive_Msg(COMPENSATED_P) &amp;&amp; stTC == TC_COMPENSATING;
}
void action38() {
stTC = TC_ENDED;
Received_Msg(COMPENSATED_P);
}

bool guard39() {
return Receive_Msg(CANCELED_P) &amp;&amp; stTC == TC_ENDED;
}
void action39() {
Received_Msg(CANCELED_P);
}

bool receive_msg_exit_In_456789() {
return (Receive_Msg(EXIT_P) &amp;&amp; (stTC == TC_COMPLETED || stTC == TC_CLOSING || stTC == TC_COMPENSATING || stTC == TC_FAILING_ACC || stTC == TC_FAILING_C || stTC == TC_NOT_COMPLETING));
}

bool receive_msg_Completed_In_017910() {
return (Receive_Msg(COMPLETED_P) &amp;&amp; (stTC == TC_ACTIVE || stTC == TC_CANCELING_ACTIVE || stTC == TC_FAILING_ACC || stTC == TC_NOT_COMPLETING || stTC == TC_EXITING));
}

bool receive_msg_fail_In_45910() {
return (Receive_Msg(FAIL_P) &amp;&amp; (stTC == TC_COMPLETED || stTC == TC_CLOSING || stTC == TC_NOT_COMPLETING || stTC == TC_EXITING));
}

bool receive_msg_cannot_complete_In_4567810() {
return (Receive_Msg(CANNOT_COMPLETE_P) &amp;&amp; (stTC == TC_COMPLETED || stTC == TC_CLOSING || stTC == TC_COMPENSATING || stTC == TC_FAILING_ACC || stTC == TC_FAILING_C || stTC == TC_EXITING));
}

bool receive_msg_canceled_In_0345678910() {
return (Receive_Msg(CANCELED_P) &amp;&amp; (stTC == TC_ACTIVE || stTC == TC_COMPLETING || stTC == TC_COMPLETED || stTC == TC_CLOSING || stTC == TC_COMPENSATING || 
										stTC == TC_FAILING_ACC || stTC == TC_FAILING_C || stTC == TC_NOT_COMPLETING || stTC == TC_EXITING));
}

bool receive_msg_closed_In_01234678910() {
return (Receive_Msg(CLOSED_P) &amp;&amp; (stTC == TC_ACTIVE || stTC == TC_CANCELING_ACTIVE || stTC == TC_CANCELING_COMPLETING || stTC == TC_COMPLETING || stTC == TC_COMPLETED || 
					stTC == TC_COMPENSATING || stTC == TC_FAILING_ACC || stTC == TC_FAILING_C || stTC == TC_NOT_COMPLETING || stTC == TC_EXITING));
}

bool receive_msg_compensated_In_01234578910() {
return (Receive_Msg(COMPENSATED_P) &amp;&amp; (stTC == TC_ACTIVE || stTC == TC_CANCELING_ACTIVE || stTC == TC_CANCELING_COMPLETING || stTC == TC_COMPLETING || stTC == TC_COMPLETED || 
				stTC == TC_CLOSING || stTC == TC_FAILING_ACC || stTC == TC_FAILING_C || stTC == TC_NOT_COMPLETING || stTC == TC_EXITING));
}</declaration><location id="id0" x="-872" y="-1040"><name x="-936" y="-1064">INVALID</name></location><location id="id1" x="96" y="-472"><name x="112" y="-480">START</name><committed/></location><location id="id2" x="96" y="-1040"><label kind="invariant" x="86" y="-1025">x&lt;=TIRE_OUT+1</label></location><init ref="id1"/><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="360" y="-1352">bufferSizeTc&gt;0 &amp;&amp; buffer_Implementation==LOSSY_FIFO</label><label kind="assignment" x="316" y="-1240">bufferSizeTc--</label><nail x="632" y="-1400"/><nail x="688" y="-1304"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="112" y="-584">guard39()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="112" y="-544">action39(),
y=0</label><nail x="176" y="-592"/><nail x="112" y="-584"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="216" y="-608">guard38()</label><label kind="assignment" x="216" y="-592">action38(),
x=0</label><nail x="256" y="-624"/><nail x="192" y="-600"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="288" y="-648">guard37()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="288" y="-608">action37(),
y=0</label><nail x="320" y="-664"/><nail x="264" y="-632"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="360" y="-696">guard36()</label><label kind="assignment" x="360" y="-680">action36(),
x=0</label><nail x="384" y="-712"/><nail x="328" y="-672"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-496" y="-1232">guard12()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-496" y="-1192">action12(),
y=0</label><nail x="-392" y="-1160"/><nail x="-376" y="-1224"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-192" y="-1528">guard17()</label><label kind="assignment" x="-192" y="-1512">action17(),
x=0</label><nail x="-160" y="-1472"/><nail x="-104" y="-1504"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-408" y="-1376">guard14()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-408" y="-1336">action14(),
y=0</label><nail x="-328" y="-1304"/><nail x="-288" y="-1360"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="344" y="-1520">guard24()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="344" y="-1480">action24(),
y=0</label><nail x="312" y="-1464"/><nail x="360" y="-1432"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="272" y="-1560">guard23()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="272" y="-1520">action23(),
y=0</label><nail x="248" y="-1496"/><nail x="304" y="-1472"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="200" y="-1592">guard22()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="200" y="-1544">action22(),
y=0</label><nail x="184" y="-1520"/><nail x="240" y="-1504"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-72" y="-592">guard2()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-72" y="-544">action2(),
y=0</label><nail x="8" y="-592"/><nail x="-56" y="-608"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="424" y="-768">guard35()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="424" y="-728">action35(),
y=0</label><nail x="432" y="-768"/><nail x="392" y="-720"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="464" y="-816">guard34()</label><label kind="assignment" x="464" y="-800">action34(),
x=0</label><nail x="472" y="-824"/><nail x="440" y="-776"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="536" y="-1040">guard31()</label><label kind="assignment" x="536" y="-1024">action31(),
x=0</label><nail x="536" y="-1040"/><nail x="528" y="-984"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="544" y="-1120">guard30()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="544" y="-1080">action30(),
y=0</label><nail x="536" y="-1112"/><nail x="536" y="-1056"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="536" y="-1200">guard29()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="536" y="-1160">action29(),
y=0</label><nail x="528" y="-1184"/><nail x="536" y="-1128"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="528" y="-976">guard32()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="528" y="-936">action32(),
y=0</label><nail x="528" y="-968"/><nail x="512" y="-912"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="504" y="-896">guard33()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="504" y="-856">action33(),
y=0</label><nail x="504" y="-896"/><nail x="480" y="-840"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="528" y="-1280">guard28()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="528" y="-1240">action28(),
y=0</label><nail x="512" y="-1256"/><nail x="528" y="-1200"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="496" y="-1328">guard27()</label><label kind="assignment" x="496" y="-1312">action27(),
x=0</label><nail x="472" y="-1320"/><nail x="504" y="-1264"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="448" y="-1392">guard26()</label><label kind="assignment" x="448" y="-1376">action26(),
x=0</label><nail x="424" y="-1376"/><nail x="464" y="-1328"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-848" y="-928">receive_msg_compensated_In_01234578910()</label><nail x="-528" y="-1040"/><nail x="-528" y="-904"/><nail x="-872" y="-904"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-824" y="-976">receive_msg_closed_In_01234678910()</label><nail x="-528" y="-1040"/><nail x="-528" y="-952"/><nail x="-872" y="-952"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-824" y="-1016">receive_msg_canceled_In_0345678910()</label><nail x="-528" y="-1040"/><nail x="-528" y="-992"/><nail x="-872" y="-992"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-832" y="-1064">receive_msg_cannot_complete_In_4567810()</label><nail x="-528" y="-1040"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-792" y="-1120">receive_msg_fail_In_45910()</label><nail x="-528" y="-1040"/><nail x="-528" y="-1096"/><nail x="-872" y="-1096"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-816" y="-1160">receive_msg_Completed_In_017910()</label><nail x="-528" y="-1040"/><nail x="-528" y="-1136"/><nail x="-872" y="-1136"/></transition><transition><source ref="id2"/><target ref="id0"/><label kind="guard" x="-800" y="-1208">receive_msg_exit_In_456789()</label><nail x="-528" y="-1040"/><nail x="-528" y="-1184"/><nail x="-872" y="-1184"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-424" y="-1296">guard13()</label><label kind="assignment" x="-424" y="-1280">action13(),
x=0</label><nail x="-368" y="-1240"/><nail x="-336" y="-1296"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-280" y="-1496">guard16()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-280" y="-1456">action16(),
y=0</label><nail x="-168" y="-1464"/><nail x="-224" y="-1424"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-112" y="-1576">guard18()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-112" y="-1536">action18(),
y=0</label><nail x="-96" y="-1504"/><nail x="-40" y="-1520"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-320" y="-1424">guard15()</label><label kind="assignment" x="-320" y="-1408">action15(),
x=0</label><nail x="-232" y="-1416"/><nail x="-280" y="-1368"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-512" y="-1064">guard10()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-512" y="-1016">action10(),
y=0</label><nail x="-408" y="-1064"/><nail x="-400" y="-1000"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-472" y="-896">guard8()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-472" y="-856">action8(),
y=0</label><nail x="-376" y="-904"/><nail x="-352" y="-848"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="400" y="-1472">guard25()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="400" y="-1432">action25(),
y=0</label><nail x="368" y="-1424"/><nail x="416" y="-1384"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-32" y="-1592">guard19()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-32" y="-1552">action19(),
y=0</label><nail x="-32" y="-1520"/><nail x="32" y="-1528"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="112" y="-1600">guard21()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="112" y="-1560">action21(),
y=0</label><nail x="112" y="-1528"/><nail x="176" y="-1520"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="40" y="-1568">guard20()</label><label kind="assignment" x="40" y="-1552">action20(),
x=0</label><nail x="40" y="-1528"/><nail x="104" y="-1528"/></transition><transition><source ref="id1"/><target ref="id2"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-448" y="-968">guard9()</label><label kind="assignment" x="-448" y="-952">action9(),
x=0</label><label kind="comments">P-46, 2nd Prepared message</label><nail x="-384" y="-920"/><nail x="-400" y="-984"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-472" y="-1136">guard11()</label><label kind="assignment" x="-472" y="-1120">action11(),
x=0</label><label kind="comments">P-45, 1st Prepared message</label><nail x="-408" y="-1080"/><nail x="-400" y="-1144"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-288" y="-712">guard5()</label><label kind="assignment" x="-288" y="-696">action5(),
x=0</label><label kind="comments">p-45, 3rd Register message</label><nail x="-208" y="-688"/><nail x="-248" y="-728"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-384" y="-824">guard7()</label><label kind="assignment" x="-384" y="-808">action7(),
x=0</label><label kind="comments">p-45, 4th Register message</label><nail x="-344" y="-840"/><nail x="-312" y="-792"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-392" y="-768">guard6()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-392" y="-720">action6(),
y=0</label><label kind="comments">p-44, 5th TLA code module</label><nail x="-264" y="-736"/><nail x="-304" y="-784"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-224" y="-664">guard4()</label><label kind="assignment" x="-224" y="-648">action4(),
x=0</label><label kind="comments">p-43, 4th TLA code module</label><nail x="-144" y="-648"/><nail x="-200" y="-680"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="-176" y="-632">guard3()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-176" y="-592">action3(),
y=0</label><label kind="comments">p-43, erd TLA code module</label><nail x="-72" y="-616"/><nail x="-136" y="-640"/></transition><transition><source ref="id2"/><target ref="id2"/><label kind="guard" x="32" y="-584">guard1()</label><label kind="assignment" x="32" y="-568">action1(),
x=0</label><label kind="comments">p-43, 2nd TLA code module</label><nail x="80" y="-584"/><nail x="16" y="-592"/></transition></template><template><name>par</name><declaration>clock x,y;

void Send_Msg(MsgsP s) {
int i;
//SET construct
if (buffer_Implementation == SET) msgP_SET_BAG[s] = true;
//BAG construct
if (buffer_Implementation == BAG) {
	if (msgP_SET_BAG[s] == BUFFER_CAPACITY) overflow = true;
		else msgP_SET_BAG[s]++; }
//STUTT_FIFO construct
if (buffer_Implementation == STUTT_FIFO) {
	if (bufferSizeP == BUFFER_CAPACITY) overflow = true;
		else
   		{
			if (msgP_FIFO[0] != s and bufferSizeP&gt;0) {
				for (i = bufferSizeP-1; i&gt;=0; i--) msgP_FIFO[i+1] = msgP_FIFO[i];
					bufferSizeP++; msgP_FIFO[0] = s;
                }
            if (bufferSizeP==0) { bufferSizeP++; msgP_FIFO[0] = s;}
   		}
				}
//FIFO and LOSSY_FIFO construct
if (buffer_Implementation == FIFO || buffer_Implementation == LOSSY_FIFO) {
	if (bufferSizeP == BUFFER_CAPACITY) overflow = true;
		else   		
			{ for (i = bufferSizeP-1; i&gt;=0; i--) msgP_FIFO[i+1] = msgP_FIFO[i];
				bufferSizeP++;
				msgP_FIFO[0] = s; }
		}
}

bool Receive_Msg(MsgsTC r) {
int i;
//SET construct
if (buffer_Implementation == SET) return msgTC_SET_BAG[r];
//BAG construct
if (buffer_Implementation == BAG) return (msgTC_SET_BAG[r] &gt;= 1);
//STUTT_FIFO construct
if (buffer_Implementation == STUTT_FIFO) {
	for (i=bufferSizeTc-1; i&gt;=0; i--)
		if (msgTC_FIFO[i] == r) return true;
			return false; }
//FIFO and LOSSY_FIFO construct
if (buffer_Implementation == FIFO || buffer_Implementation == LOSSY_FIFO) {
    if (bufferSizeTc==0) return false;
    return (msgTC_FIFO[bufferSizeTc-1] == r);
}
return false;
}

void Received_Msg(MsgsTC r) {
int i;
//SET construct
//if (buffer_Implementation == SET) return ;
//BAG construct
if (buffer_Implementation == BAG) msgTC_SET_BAG[r]--;
//STUTT_FIFO construct
if (buffer_Implementation == STUTT_FIFO) {
        i = 0; 
	while (msgTC_FIFO[i] != r) i++; // msgTC_SEQ[0,i-1] != r
                 bufferSizeTc--; }
//FIFO and LOSSY_FIFO construct
if (buffer_Implementation == FIFO || buffer_Implementation == LOSSY_FIFO) {
	bufferSizeTc--; }
}

//Messages transmitted by the Participant

bool guard40() {
return stP == P_ACTIVE || stP == P_COMPLETING;
}
void action40() {
Send_Msg(EXIT_P);
stP = P_EXITING;
}

bool guard41() {
return stP == P_EXITING;
}
void action41() {
Send_Msg(EXIT_P);
}

bool guard42() {
return stP == P_COMPLETING;
}
void action42() {
Send_Msg(COMPLETED_P);
stP = P_COMPLETED;
}

bool guard43() {
return stP == P_COMPLETED;
}
void action43() {
Send_Msg(COMPLETED_P);
}

bool guard44() {
return stP == P_ACTIVE || stP == P_CANCELING || stP == P_COMPLETING;
}
void action44() {
Send_Msg(FAIL_P);
stP = P_FAILING_ACC;
}

bool guard45() {
return stP == P_COMPENSATING;
}
void action45() {
Send_Msg(FAIL_P);
stP = P_FAILING_C;
}

bool guard46() {
return stP == P_FAILING_ACC || stP == P_FAILING_C;
}
void action46() {
Send_Msg(FAIL_P);
}

bool guard47() {
return stP == P_ACTIVE || stP == P_COMPLETING;
}
void action47() {
Send_Msg(CANNOT_COMPLETE_P);
stP = P_NOT_COMPLETING;
}

bool guard48() {
return stP == P_NOT_COMPLETING;
}
void action48() {
Send_Msg(CANNOT_COMPLETE_P);
}

bool guard49() {
return stP == P_CANCELING;
}
void action49() {
Send_Msg(CANCELED_P);
stP = P_ENDED;
}

bool guard50() {
return stP == P_ENDED;
}
void action50() {
Send_Msg(CANCELED_P);
}

bool guard51() {
return stP == P_CLOSING;
}
void action51() {
Send_Msg(CLOSED_P);
stP = P_ENDED;
}

bool guard52() {
return stP == P_ENDED;
}
void action52() {
Send_Msg(CLOSED_P);
}

bool guard53() {
return stP == P_COMPENSATING;
}
void action53() {
Send_Msg(COMPENSATED_P);
stP = P_ENDED;
}

bool guard54() {
return stP == P_ENDED;
}
void action54() {
Send_Msg(COMPENSATED_P);
}
//Messages received by the Participant

bool guard55() {
return Receive_Msg(CANCEL_TC) &amp;&amp; (stP == P_ACTIVE || stP == P_COMPLETING);
}
void action55() {
stP = P_CANCELING;
Received_Msg(CANCEL_TC);
}

bool guard56() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_CANCELING;
}
void action56() {
Received_Msg(CANCEL_TC);
}

bool guard57() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_COMPLETED;
}
void action57() {
Send_Msg(COMPLETED_P);
Received_Msg(CANCEL_TC);
}

bool guard58() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_CLOSING;
}
void action58() {
Received_Msg(CANCEL_TC);
}

bool guard59() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_COMPENSATING;
}
void action59() {
Received_Msg(CANCEL_TC);
}

bool guard60() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_FAILING_ACC;
}
void action60() {
Send_Msg(FAIL_P);
Received_Msg(CANCEL_TC);
}

bool guard61() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_FAILING_C;
}
void action61() {
Received_Msg(CANCEL_TC);
}

bool guard62() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_NOT_COMPLETING;
}
void action62() {
Send_Msg(CANNOT_COMPLETE_P);
Received_Msg(CANCEL_TC);
}

bool guard63() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_EXITING;
}
void action63() {
Send_Msg(EXIT_P);
Received_Msg(CANCEL_TC);
}

bool guard64() {
return Receive_Msg(CANCEL_TC) &amp;&amp; stP == P_ENDED;
}
void action64() {
Send_Msg(CANCELED_P);
Received_Msg(CANCEL_TC);
}

bool guard65() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_ACTIVE;
}
void action65() {
stP = P_COMPLETING;
Received_Msg(COMPLETE_TC);
}

bool guard66() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_CANCELING;
}
void action66() {
Received_Msg(COMPLETE_TC);
}

bool guard67() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_COMPLETING;
}
void action67() {
Received_Msg(COMPLETE_TC);
}

bool guard68() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_COMPLETED;
}
void action68() {
Send_Msg(COMPLETED_P);
Received_Msg(COMPLETE_TC);
}

bool guard69() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_CLOSING;
}
void action69() {
Received_Msg(COMPLETE_TC);
}

bool guard70() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_COMPENSATING;
}
void action70() {
Received_Msg(COMPLETE_TC);
}

bool guard71() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_FAILING_ACC;
}
void action71() {
Send_Msg(FAIL_P);
Received_Msg(COMPLETE_TC);
}

bool guard72() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_FAILING_C;
}
void action72() {
Received_Msg(COMPLETE_TC);
}

bool guard73() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_NOT_COMPLETING;
}
void action73() {
Send_Msg(CANNOT_COMPLETE_P);
Received_Msg(COMPLETE_TC);
}

bool guard74() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_EXITING;
}
void action74() {
Send_Msg(EXIT_P);
Received_Msg(COMPLETE_TC);
}

bool guard75() {
return Receive_Msg(COMPLETE_TC) &amp;&amp; stP == P_ENDED;
}
void action75() {
Send_Msg(FAIL_P);
Received_Msg(COMPLETE_TC);
}

bool guard76() {
return Receive_Msg(CLOSE_TC) &amp;&amp; stP == P_COMPLETED;
}
void action76() {
stP = P_CLOSING;
Received_Msg(CLOSE_TC);
}

bool guard77() {
return Receive_Msg(CLOSE_TC) &amp;&amp; stP == P_CLOSING;
}
void action77() {
Received_Msg(CLOSE_TC);
}

bool guard78() {
return Receive_Msg(CLOSE_TC) &amp;&amp; stP == P_ENDED;
}
void action78() {
Send_Msg(CLOSED_P);
Received_Msg(CLOSE_TC);
}

bool guard79() {
return Receive_Msg(COMPENSATE_TC) &amp;&amp; stP == P_COMPLETED;
}
void action79() {
stP = P_COMPENSATING;
Received_Msg(COMPENSATE_TC);
}

bool guard80() {
return Receive_Msg(COMPENSATE_TC) &amp;&amp; stP == P_COMPENSATING;
}
void action80() {
Received_Msg(COMPENSATE_TC);
}

bool guard81() {
return Receive_Msg(COMPENSATE_TC) &amp;&amp; stP == P_FAILING_C;
}
void action81() {
Send_Msg(FAIL_P);
Received_Msg(COMPENSATE_TC);
}

bool guard82() {
return Receive_Msg(COMPENSATE_TC) &amp;&amp; stP == P_ENDED;
}
void action82() {
Send_Msg(COMPENSATED_P);
Received_Msg(COMPENSATE_TC);
}

bool guard83() {
return Receive_Msg(FAILED_TC) &amp;&amp; (stP == P_FAILING_ACC || stP == P_FAILING_C);
}
void action83() {
stP = P_ENDED;
Received_Msg(FAILED_TC);
}

bool guard84() {
return Receive_Msg(FAILED_TC) &amp;&amp; stP == P_ENDED;
}
void action84() {
Received_Msg(FAILED_TC);
}

bool guard85() {
return Receive_Msg(EXITED_TC) &amp;&amp; stP == P_EXITING;
}
void action85() {
stP = P_ENDED;
Received_Msg(EXITED_TC);
}

bool guard86() {
return Receive_Msg(EXITED_TC) &amp;&amp; stP == P_ENDED;
}
void action86() {
Received_Msg(EXITED_TC);
}

bool guard87() {
return Receive_Msg(NOT_COMPLETED_TC) &amp;&amp; stP == P_NOT_COMPLETING;
}
void action87() {
stP = P_ENDED;
Received_Msg(NOT_COMPLETED_TC);
}

bool guard88() {
return Receive_Msg(NOT_COMPLETED_TC) &amp;&amp; stP == P_ENDED;
}
void action88() {
Received_Msg(NOT_COMPLETED_TC);
}

bool receive_close_In_01256789() {
return Receive_Msg(CLOSE_TC) &amp;&amp; (stP == P_ACTIVE || stP == P_CANCELING || stP == P_COMPLETING || stP == P_COMPENSATING || stP == P_FAILING_ACC || stP == P_FAILING_C || stP == P_NOT_COMPLETING || stP == P_EXITING);
}

bool receive_compensate_In_0124689() {
return Receive_Msg(COMPENSATE_TC) &amp;&amp; (stP == P_ACTIVE || stP == P_CANCELING || stP == P_COMPLETING || stP == P_CLOSING || stP == P_FAILING_ACC || stP == P_NOT_COMPLETING || stP == P_EXITING);
}

bool receive_failed_In_01234589() {
return Receive_Msg(FAILED_TC) &amp;&amp; (stP == P_ACTIVE || stP == P_CANCELING || stP == P_COMPLETING || stP == P_COMPLETED || stP == P_CLOSING || stP == P_COMPENSATING || stP == P_NOT_COMPLETING || stP == P_EXITING);
}

bool receive_exited_In_012345678() {
return Receive_Msg(EXITED_TC) &amp;&amp; (stP == P_ACTIVE || stP == P_CANCELING || stP == P_COMPLETING || stP == P_COMPLETED || stP == P_CLOSING || stP == P_COMPENSATING || 
												stP == P_FAILING_ACC || stP == P_FAILING_C || stP == P_NOT_COMPLETING);
}

bool receive_NotCompleted_In_012345679() {
return Receive_Msg(NOT_COMPLETED_TC) &amp;&amp; (stP == P_ACTIVE || stP == P_CANCELING || stP == P_COMPLETING || stP == P_COMPLETED || stP == P_CLOSING || stP == P_COMPENSATING || 
												stP == P_FAILING_ACC || stP == P_FAILING_C || stP == P_EXITING);
}</declaration><location id="id3" x="-1032" y="-1040"><name x="-1096" y="-1064">INVALID</name></location><location id="id4" x="96" y="-352"><name x="112" y="-360">START</name><committed/></location><location id="id5" x="96" y="-1040"><label kind="invariant" x="86" y="-1025">x&lt;=TIRE_OUT+1</label></location><init ref="id4"/><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="456" y="-1536">bufferSizeP&gt;0 &amp;&amp; buffer_Implementation==LOSSY_FIFO</label><label kind="assignment" x="336" y="-1368">bufferSizeP--</label><nail x="728" y="-1616"/><nail x="808" y="-1512"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="112" y="-440">guard88()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="112" y="-400">action88(),
y=0</label><nail x="176" y="-448"/><nail x="112" y="-440"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="368" y="-1680">guard67()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="368" y="-1640">action67(),
y=0</label><nail x="344" y="-1616"/><nail x="408" y="-1584"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="288" y="-1712">guard66()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="288" y="-1672">action66(),
y=0</label><nail x="272" y="-1640"/><nail x="336" y="-1616"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="136" y="-1736">guard64()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="136" y="-1696">action64(),
y=0</label><nail x="128" y="-1664"/><nail x="192" y="-1656"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="272" y="-472">guard86()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="272" y="-432">action86(),
y=0</label><nail x="320" y="-488"/><nail x="264" y="-472"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="424" y="-544">guard84()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="424" y="-504">action84(),
y=0</label><nail x="440" y="-560"/><nail x="392" y="-528"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="632" y="-792">guard80()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="632" y="-752">action80(),
y=0</label><nail x="632" y="-784"/><nail x="600" y="-728"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="680" y="-928">guard78()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="680" y="-888">action78(),
y=0</label><nail x="680" y="-928"/><nail x="664" y="-864"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="696" y="-1072">guard76()</label><label kind="assignment" x="696" y="-1056">action76(),
x=0</label><nail x="688" y="-1080"/><nail x="688" y="-1016"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="688" y="-1232">guard74()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="688" y="-1192">action74(),
y=0</label><nail x="680" y="-1224"/><nail x="688" y="-1160"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="352" y="-512">guard85()</label><label kind="assignment" x="352" y="-496">action85(),
x=0</label><nail x="384" y="-520"/><nail x="328" y="-496"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="472" y="-592">guard83()</label><label kind="assignment" x="472" y="-576">action83(),
x=0</label><nail x="496" y="-608"/><nail x="448" y="-568"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="200" y="-456">guard87()</label><label kind="assignment" x="200" y="-440">action87(),
x=0</label><nail x="256" y="-464"/><nail x="192" y="-448"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="536" y="-656">guard82()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="536" y="-616">action82(),
y=0</label><nail x="552" y="-664"/><nail x="504" y="-616"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="656" y="-1376">guard72()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="656" y="-1336">action72(),
y=0</label><nail x="632" y="-1352"/><nail x="656" y="-1296"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="592" y="-720">guard81()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="592" y="-680">action81(),
y=0</label><nail x="592" y="-720"/><nail x="560" y="-672"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="656" y="-848">guard79()</label><label kind="assignment" x="656" y="-832">action79(),
x=0</label><nail x="664" y="-856"/><nail x="640" y="-792"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="688" y="-1016">guard77()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="688" y="-976">action77(),
y=0</label><nail x="688" y="-1008"/><nail x="680" y="-944"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="696" y="-1160">guard75()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="696" y="-1120">action75(),
y=0</label><nail x="688" y="-1152"/><nail x="688" y="-1088"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="680" y="-1304">guard73()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="680" y="-1264">action73(),
y=0</label><nail x="664" y="-1288"/><nail x="680" y="-1232"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="616" y="-1440">guard71()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="616" y="-1400">action71(),
y=0</label><nail x="592" y="-1416"/><nail x="624" y="-1360"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="576" y="-1504">guard70()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="576" y="-1464">action70(),
y=0</label><nail x="544" y="-1472"/><nail x="584" y="-1424"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="216" y="-1704">guard65()</label><label kind="assignment" x="216" y="-1688">action65(),
x=0</label><nail x="200" y="-1656"/><nail x="264" y="-1640"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="512" y="-1576">guard69()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="512" y="-1536">action69(),
y=0</label><nail x="480" y="-1528"/><nail x="536" y="-1480"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="440" y="-1632">guard68()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="440" y="-1592">action68(),
y=0</label><nail x="416" y="-1576"/><nail x="472" y="-1536"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="56" y="-1736">guard63()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="56" y="-1696">action63(),
y=0</label><nail x="48" y="-1664"/><nail x="120" y="-1664"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-16" y="-1736">guard62()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-16" y="-1696">action62(),
y=0</label><nail x="-32" y="-1656"/><nail x="40" y="-1664"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-96" y="-1720">guard61()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-96" y="-1680">action61(),
y=0</label><nail x="-104" y="-1640"/><nail x="-40" y="-1656"/></transition><transition><source ref="id5"/><target ref="id3"/><label kind="guard" x="-976" y="-976">receive_NotCompleted_In_012345679()</label><nail x="-688" y="-1040"/><nail x="-688" y="-952"/><nail x="-1032" y="-952"/></transition><transition><source ref="id5"/><target ref="id3"/><label kind="guard" x="-960" y="-1016">receive_exited_In_012345678()</label><nail x="-688" y="-1040"/><nail x="-688" y="-992"/><nail x="-1032" y="-992"/></transition><transition><source ref="id5"/><target ref="id3"/><label kind="guard" x="-952" y="-1064">receive_failed_In_01234589()</label><nail x="-688" y="-1040"/></transition><transition><source ref="id5"/><target ref="id3"/><label kind="guard" x="-968" y="-1120">receive_compensate_In_0124689()</label><nail x="-688" y="-1040"/><nail x="-688" y="-1096"/><nail x="-1032" y="-1096"/></transition><transition><source ref="id5"/><target ref="id3"/><label kind="guard" x="-952" y="-1160">receive_close_In_01256789()</label><nail x="-688" y="-1040"/><nail x="-688" y="-1136"/><nail x="-1032" y="-1136"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-584" y="-1272">guard53()</label><label kind="assignment" x="-584" y="-1256">action53(),
x=0</label><nail x="-528" y="-1208"/><nail x="-504" y="-1280"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-504" y="-1424">guard55()</label><label kind="assignment" x="-504" y="-1408">action55(),
x=0</label><nail x="-416" y="-1416"/><nail x="-456" y="-1360"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-488" y="-1496">guard56()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-488" y="-1456">action56(),
y=0</label><nail x="-408" y="-1424"/><nail x="-368" y="-1472"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-584" y="-1360">guard54()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-584" y="-1320">action54(),
y=0</label><nail x="-464" y="-1352"/><nail x="-496" y="-1288"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-616" y="-1088">guard51()</label><label kind="assignment" x="-616" y="-1072">action51(),
x=0</label><nail x="-552" y="-1104"/><nail x="-552" y="-1032"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-592" y="-904">guard49()</label><label kind="assignment" x="-592" y="-888">action49(),
x=0</label><nail x="-536" y="-920"/><nail x="-512" y="-848"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-184" y="-1696">guard60()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-184" y="-1656">action60(),
y=0</label><nail x="-176" y="-1616"/><nail x="-112" y="-1640"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-424" y="-1560">guard57()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-424" y="-1520">action57(),
y=0</label><nail x="-360" y="-1480"/><nail x="-312" y="-1528"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-264" y="-1672">guard59()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-264" y="-1632">action59(),
y=0</label><nail x="-240" y="-1584"/><nail x="-184" y="-1616"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-344" y="-1624">guard58()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-344" y="-1576">action58(),
y=0</label><nail x="-304" y="-1536"/><nail x="-248" y="-1576"/></transition><transition><source ref="id4"/><target ref="id5"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-160" y="-472">guard42()</label><label kind="assignment" x="-160" y="-456">action42(),
x=0</label><label kind="comments">p-48, 1st Committed message</label><nail x="-88" y="-464"/><nail x="-152" y="-488"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="16" y="-440">guard40()</label><label kind="assignment" x="16" y="-424">action40(),
x=0</label><label kind="comments">p-47, 1st Aborted message</label><nail x="8" y="-448"/><nail x="72" y="-440"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-656" y="-1000">guard50()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-656" y="-960">action50(),
y=0</label><label kind="comments">P-46, 2nd Prepared message</label><nail x="-544" y="-936"/><nail x="-552" y="-1016"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-656" y="-1192">guard52()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-656" y="-1152">action52(),
y=0</label><label kind="comments">P-45, 1st Prepared message</label><nail x="-552" y="-1120"/><nail x="-536" y="-1192"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-504" y="-680">guard46()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-504" y="-632">action46(),
y=0</label><label kind="comments">p-45, 3rd Register message</label><nail x="-376" y="-640"/><nail x="-424" y="-696"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-600" y="-824">guard48()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-600" y="-784">action48(),
y=0</label><label kind="comments">p-45, 4th Register message</label><nail x="-504" y="-832"/><nail x="-480" y="-776"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-520" y="-744">guard47()</label><label kind="assignment" x="-520" y="-728">action47(),
x=0</label><label kind="comments">p-44, 5th TLA code module</label><nail x="-432" y="-704"/><nail x="-472" y="-760"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-400" y="-608">guard45()</label><label kind="assignment" x="-400" y="-592">action45(),
x=0</label><label kind="comments">p-43, 4th TLA code module</label><nail x="-312" y="-584"/><nail x="-360" y="-632"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-320" y="-552">guard44()</label><label kind="assignment" x="-320" y="-536">action44(),
x=0</label><label kind="comments">p-43, erd TLA code module</label><nail x="-240" y="-536"/><nail x="-296" y="-576"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-264" y="-512">guard43()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-264" y="-464">action43(),
y=0</label><label kind="comments">p-43, 2nd TLA code module</label><nail x="-160" y="-496"/><nail x="-224" y="-528"/></transition><transition><source ref="id5"/><target ref="id5"/><label kind="guard" x="-96" y="-448">guard41()&amp;&amp;
x&lt;=TIRE_OUT&amp;&amp;
y&gt;=MIN_DELAY</label><label kind="assignment" x="-96" y="-400">action41(),
y=0</label><label kind="comments">p-43, 1st TLA code module</label><nail x="-8" y="-448"/><nail x="-72" y="-464"/></transition></template><system>tc = Coordinator();
//p = Participant_T();
system tc, par;</system></nta>