UniTO/anno2/YearI/SecondSem/VPC/labs/uppaal/Modello-B.xml
Francesco Mecca 5e286062f8 MCAD 2019
2018-11-22 13:09:11 +01:00

194 lines
5.4 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>// Place global declarations here.
clock time;
urgent chan ML;
urgent chan LM;
urgent chan LR;
urgent chan RL;</declaration>
<template>
<name x="5" y="5">Sender</name>
<declaration>clock sc;
clock fc;</declaration>
<location id="id0" x="170" y="127">
<name x="68" y="119">receivedACK</name>
<label kind="invariant" x="153" y="144">sc&lt;=4</label>
</location>
<location id="id1" x="323" y="127">
<name x="340" y="119">waitACK</name>
</location>
<location id="id2" x="323" y="-8">
<name x="340" y="-17">canSend</name>
</location>
<location id="id3" x="170" y="-8">
<name x="76" y="-17">waitPacket</name>
<label kind="invariant" x="153" y="-42">sc&lt;=4</label>
</location>
<init ref="id3"/>
<transition>
<source ref="id0"/>
<target ref="id3"/>
<label kind="guard" x="127" y="42">sc&gt;=2</label>
<label kind="assignment" x="127" y="59">sc:=0</label>
</transition>
<transition>
<source ref="id1"/>
<target ref="id0"/>
<label kind="synchronisation" x="238" y="110">LM!</label>
<label kind="assignment" x="238" y="127">sc:=0</label>
</transition>
<transition>
<source ref="id2"/>
<target ref="id1"/>
<label kind="synchronisation" x="331" y="42">ML!</label>
<label kind="assignment" x="331" y="59">fc:=0</label>
</transition>
<transition>
<source ref="id3"/>
<target ref="id2"/>
<label kind="guard" x="229" y="-25">sc&gt;=1</label>
</transition>
</template>
<template>
<name>Receiver</name>
<declaration>clock rc;</declaration>
<location id="id4" x="-93" y="-68">
<name x="-161" y="-76">canACK</name>
</location>
<location id="id5" x="-93" y="93">
<name x="-187" y="85">donePacket</name>
<label kind="invariant" x="-110" y="110">rc&lt;=3</label>
</location>
<location id="id6" x="68" y="93">
<name x="85" y="85">receivedPacket</name>
<label kind="invariant" x="51" y="110">rc&lt;=4</label>
</location>
<location id="id7" x="68" y="-68">
<name x="85" y="-76">waitPacket</name>
</location>
<init ref="id7"/>
<transition>
<source ref="id4"/>
<target ref="id7"/>
<label kind="synchronisation" x="-34" y="-85">RL!</label>
</transition>
<transition>
<source ref="id5"/>
<target ref="id4"/>
<label kind="guard" x="-136" y="0">rc&gt;=2</label>
</transition>
<transition>
<source ref="id7"/>
<target ref="id6"/>
<label kind="synchronisation" x="76" y="0">LR!</label>
<label kind="assignment" x="76" y="17">rc:=0</label>
</transition>
<transition>
<source ref="id6"/>
<target ref="id5"/>
<label kind="guard" x="-42" y="93">rc&gt;=2</label>
<label kind="assignment" x="-42" y="76">rc:=0</label>
</transition>
</template>
<template>
<name>Link</name>
<declaration>clock lc;</declaration>
<location id="id8" x="-34" y="-238">
<name x="-44" y="-272">lostPacket</name>
</location>
<location id="id9" x="-161" y="-8">
<name x="-238" y="-17">canSend</name>
</location>
<location id="id10" x="-161" y="-178">
<name x="-280" y="-187">receivedPacket</name>
<label kind="invariant" x="-178" y="-212">lc&lt;8</label>
</location>
<location id="id11" x="93" y="-8">
<name x="110" y="-17">canACK</name>
</location>
<location id="id12" x="93" y="-178">
<name x="110" y="-187">receivedACK</name>
<label kind="invariant" x="76" y="-212">lc&lt;8</label>
</location>
<location id="id13" x="-34" y="-93">
</location>
<init ref="id13"/>
<transition>
<source ref="id8"/>
<target ref="id13"/>
</transition>
<transition>
<source ref="id12"/>
<target ref="id8"/>
</transition>
<transition>
<source ref="id10"/>
<target ref="id8"/>
</transition>
<transition>
<source ref="id9"/>
<target ref="id13"/>
<label kind="synchronisation" x="-102" y="-51">LR?</label>
</transition>
<transition>
<source ref="id10"/>
<target ref="id9"/>
<label kind="guard" x="-204" y="-110">lc&gt;=6</label>
</transition>
<transition>
<source ref="id13"/>
<target ref="id10"/>
<label kind="synchronisation" x="-102" y="-153">ML?</label>
<label kind="assignment" x="-110" y="-119">lc:=0</label>
</transition>
<transition>
<source ref="id11"/>
<target ref="id13"/>
<label kind="synchronisation" x="0" y="-51">LM?</label>
</transition>
<transition>
<source ref="id12"/>
<target ref="id11"/>
<label kind="guard" x="102" y="-102">lc&gt;=6</label>
</transition>
<transition>
<source ref="id13"/>
<target ref="id12"/>
<label kind="synchronisation" x="8" y="-153">RL?</label>
<label kind="assignment" x="8" y="-119">lc:=0</label>
</transition>
</template>
<system>sender = Sender();
receiver = Receiver();
link = Link();
system sender, receiver, link;</system>
<queries>
<query>
<formula>A[] (not deadlock)
</formula>
<comment>
</comment>
</query>
<query>
<formula>A&lt;&gt; sender.receivedACK
</formula>
<comment>
</comment>
</query>
<query>
<formula>sender.waitACK --&gt; (sender.receivedACK)
</formula>
<comment>
</comment>
</query>
<query>
<formula>E&lt;&gt; receiver.receivedPacket
</formula>
<comment>
</comment>
</query>
</queries>
</nta>