182 lines
5.3 KiB
XML
182 lines
5.3 KiB
XML
|
<?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_2.dtd'>
|
||
|
<nta>
|
||
|
<declaration>clock time;
|
||
|
|
||
|
urgent chan ML;
|
||
|
urgent chan LM;
|
||
|
urgent chan LR;
|
||
|
urgent chan RL;</declaration>
|
||
|
<template>
|
||
|
<name>Receiver</name>
|
||
|
<declaration>clock rc;</declaration>
|
||
|
<location id="id0" x="-229" y="-144">
|
||
|
<name x="-340" y="-170">wait</name>
|
||
|
</location>
|
||
|
<location id="id1" x="-229" y="17">
|
||
|
<name x="-306" y="17">send_ack</name>
|
||
|
</location>
|
||
|
<location id="id2" x="-55" y="14">
|
||
|
<name x="-38" y="-12">done_pkg</name>
|
||
|
<label kind="invariant" x="-65" y="31">rc <= 4</label>
|
||
|
</location>
|
||
|
<location id="id3" x="-55" y="-148">
|
||
|
<name x="-65" y="-182">recv_pkg</name>
|
||
|
<label kind="invariant" x="-25" y="-153">rc <=4</label>
|
||
|
</location>
|
||
|
<init ref="id0"/>
|
||
|
<transition>
|
||
|
<source ref="id1"/>
|
||
|
<target ref="id0"/>
|
||
|
<label kind="synchronisation" x="-221" y="-85">RL!</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id0"/>
|
||
|
<target ref="id3"/>
|
||
|
<label kind="synchronisation" x="-170" y="-170">LR!</label>
|
||
|
<label kind="assignment" x="-170" y="-144">rc := 0</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id2"/>
|
||
|
<target ref="id1"/>
|
||
|
<label kind="guard" x="-170" y="-8">rc >= 2</label>
|
||
|
<label kind="assignment" x="-170" y="17">rc := 0</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id3"/>
|
||
|
<target ref="id2"/>
|
||
|
<label kind="guard" x="-34" y="-102">rc >= 2</label>
|
||
|
<label kind="assignment" x="-34" y="-68">rc := 0</label>
|
||
|
</transition>
|
||
|
</template>
|
||
|
<template>
|
||
|
<name>Link</name>
|
||
|
<declaration>clock lc;</declaration>
|
||
|
<location id="id4" x="-178" y="-68">
|
||
|
<name x="-188" y="-102">received_pkg</name>
|
||
|
<label kind="invariant" x="-237" y="-94">lc < 4</label>
|
||
|
</location>
|
||
|
<location id="id5" x="204" y="153">
|
||
|
<name x="238" y="136">received_ack</name>
|
||
|
<label kind="invariant" x="212" y="161">lc < 4</label>
|
||
|
</location>
|
||
|
<location id="id6" x="204" y="-68">
|
||
|
<name x="194" y="-102">resend_ack</name>
|
||
|
</location>
|
||
|
<location id="id7" x="-178" y="127">
|
||
|
<name x="-238" y="144">resend_pkg</name>
|
||
|
</location>
|
||
|
<location id="id8" x="0" y="25">
|
||
|
<name x="-10" y="-9">idle</name>
|
||
|
</location>
|
||
|
<init ref="id8"/>
|
||
|
<transition>
|
||
|
<source ref="id5"/>
|
||
|
<target ref="id6"/>
|
||
|
<label kind="guard" x="246" y="-8">lc >= 2</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id8"/>
|
||
|
<target ref="id5"/>
|
||
|
<label kind="synchronisation" x="93" y="68">RL?</label>
|
||
|
<label kind="assignment" x="68" y="102">lc := 0</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id6"/>
|
||
|
<target ref="id8"/>
|
||
|
<label kind="synchronisation" x="68" y="-51">LM?</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id4"/>
|
||
|
<target ref="id7"/>
|
||
|
<label kind="guard" x="-255" y="-8">lc >= 2</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id7"/>
|
||
|
<target ref="id8"/>
|
||
|
<label kind="synchronisation" x="-102" y="51">LR?</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id8"/>
|
||
|
<target ref="id4"/>
|
||
|
<label kind="synchronisation" x="-119" y="-25">ML?</label>
|
||
|
<label kind="assignment" x="-110" y="-59">lc := 0</label>
|
||
|
<nail x="-144" y="-59"/>
|
||
|
</transition>
|
||
|
</template>
|
||
|
<template>
|
||
|
<name x="5" y="5">Sender</name>
|
||
|
<declaration>clock sc;
|
||
|
clock attesa;</declaration>
|
||
|
<location id="id9" x="-578" y="-229">
|
||
|
<name x="-663" y="-204">received_ack</name>
|
||
|
<label kind="invariant" x="-655" y="-229">sc <= 4</label>
|
||
|
</location>
|
||
|
<location id="id10" x="-408" y="-229">
|
||
|
<name x="-391" y="-255">wait_ack</name>
|
||
|
</location>
|
||
|
<location id="id11" x="-408" y="-391">
|
||
|
<name x="-418" y="-425">send_pkg</name>
|
||
|
</location>
|
||
|
<location id="id12" x="-578" y="-391">
|
||
|
<name x="-629" y="-433">wait</name>
|
||
|
<label kind="invariant" x="-654" y="-399">sc <= 2</label>
|
||
|
</location>
|
||
|
<init ref="id12"/>
|
||
|
<transition>
|
||
|
<source ref="id9"/>
|
||
|
<target ref="id12"/>
|
||
|
<label kind="guard" x="-637" y="-331">sc >= 2</label>
|
||
|
<label kind="assignment" x="-629" y="-306">sc := 0</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id10"/>
|
||
|
<target ref="id9"/>
|
||
|
<label kind="synchronisation" x="-510" y="-221">LM!</label>
|
||
|
<label kind="assignment" x="-510" y="-246">sc := 0</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id11"/>
|
||
|
<target ref="id10"/>
|
||
|
<label kind="synchronisation" x="-408" y="-327">ML!</label>
|
||
|
<label kind="assignment" x="-399" y="-314">attesa := 0</label>
|
||
|
</transition>
|
||
|
<transition>
|
||
|
<source ref="id12"/>
|
||
|
<target ref="id11"/>
|
||
|
<label kind="guard" x="-518" y="-408">sc >= 1</label>
|
||
|
</transition>
|
||
|
</template>
|
||
|
<system>sender = Sender();
|
||
|
receiver = Receiver();
|
||
|
link = Link();
|
||
|
|
||
|
system sender, receiver, link;</system>
|
||
|
<queries>
|
||
|
<query>
|
||
|
<formula>A<> receiver.recv_pkg
|
||
|
</formula>
|
||
|
<comment>
|
||
|
</comment>
|
||
|
</query>
|
||
|
<query>
|
||
|
<formula>sender.wait_ack --> (sender.received_ack)
|
||
|
</formula>
|
||
|
<comment>
|
||
|
</comment>
|
||
|
</query>
|
||
|
<query>
|
||
|
<formula>A<> sender.received_ack
|
||
|
</formula>
|
||
|
<comment>
|
||
|
</comment>
|
||
|
</query>
|
||
|
<query>
|
||
|
<formula>A[] (not deadlock)
|
||
|
</formula>
|
||
|
<comment>
|
||
|
</comment>
|
||
|
</query>
|
||
|
</queries>
|
||
|
</nta>
|