<?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>// Place global declarations here.

urgent chan get_hammer, get_mallet;
chan put_hammer, put_mallet;
urgent chan jobE, jobA, jobH;

clock now;</declaration><template><name x="5" y="5">Jobber</name><declaration>// Place local declarations here.
clock x;</declaration><location id="id0" x="128" y="96"><name x="144" y="72">work_hard</name><label kind="invariant" x="96" y="104">x&lt;=22</label></location><location id="id1" x="128" y="32"><name x="120" y="0">work_av_hammer</name><label kind="invariant" x="96" y="40">x&lt;=12</label></location><location id="id2" x="128" y="-96"><name x="144" y="-120">work_av_mallet</name><label kind="invariant" x="96" y="-128">x&lt;=17</label></location><location id="id3" x="128" y="-160"><name x="144" y="-176">work_easy</name><label kind="invariant" x="88" y="-184">x&lt;=7</label></location><location id="id4" x="0" y="96"><name x="-24" y="112">hard</name></location><location id="id5" x="0" y="-160"><name x="-24" y="-200">easy</name><urgent/></location><location id="id6" x="0" y="-32"><name x="-40" y="-72">average</name></location><location id="id7" x="-128" y="-32"><name x="-184" y="-48">begin</name></location><init ref="id7"/><transition><source ref="id1"/><target ref="id7"/><label kind="guard" x="144" y="48">x&gt;=10</label><label kind="synchronisation" x="144" y="32">put_hammer!</label><nail x="256" y="32"/><nail x="256" y="-224"/><nail x="-128" y="-224"/></transition><transition><source ref="id0"/><target ref="id7"/><label kind="guard" x="144" y="112">x&gt;=20</label><label kind="synchronisation" x="144" y="96">put_hammer!</label><nail x="256" y="96"/><nail x="256" y="-224"/><nail x="-128" y="-224"/></transition><transition><source ref="id3"/><target ref="id7"/><label kind="guard" x="136" y="-208">x&gt;=5</label><nail x="128" y="-224"/><nail x="-128" y="-224"/></transition><transition><source ref="id2"/><target ref="id7"/><label kind="guard" x="144" y="-80">x&gt;=15</label><label kind="synchronisation" x="144" y="-96">put_mallet!</label><nail x="256" y="-96"/><nail x="256" y="-224"/><nail x="-128" y="-224"/></transition><transition><source ref="id5"/><target ref="id3"/><label kind="assignment" x="64" y="-160">x:=0</label></transition><transition><source ref="id4"/><target ref="id0"/><label kind="synchronisation" x="16" y="96">get_hammer!</label><label kind="assignment" x="64" y="72">x:=0</label></transition><transition><source ref="id6"/><target ref="id1"/><label kind="synchronisation" x="-8" y="16">get_hammer!</label><label kind="assignment" x="64" y="-16">x:=0</label></transition><transition><source ref="id6"/><target ref="id2"/><label kind="synchronisation" x="0" y="-88">get_mallet!</label><label kind="assignment" x="64" y="-64">x:=0</label></transition><transition><source ref="id7"/><target ref="id4"/><label kind="synchronisation" x="-96" y="32">jobH?</label></transition><transition><source ref="id7"/><target ref="id6"/><label kind="synchronisation" x="-96" y="-56">jobA?</label></transition><transition><source ref="id7"/><target ref="id5"/><label kind="synchronisation" x="-96" y="-120">jobE?</label></transition></template><template><name>Tool</name><parameter>urgent chan &amp;get, chan &amp;put</parameter><location id="id8" x="-192" y="-224"><name x="-208" y="-256">taken</name></location><location id="id9" x="-320" y="-224"><name x="-336" y="-256">free</name></location><init ref="id9"/><transition><source ref="id8"/><target ref="id9"/><label kind="synchronisation" x="-296" y="-184">put?</label><nail x="-192" y="-160"/><nail x="-320" y="-160"/></transition><transition><source ref="id9"/><target ref="id8"/><label kind="synchronisation" x="-296" y="-248">get?</label></transition></template><template><name>Belt</name><declaration>const int E=0;
const int A=1;
const int H=2;

const int J=10;
const int[0,2] jobs[J] = {H,A,H,H,H,E,E,A,A,A};

int[0,J] i;</declaration><location id="id10" x="-128" y="-64"></location><init ref="id10"/><transition><source ref="id10"/><target ref="id10"/><label kind="guard" x="-96" y="-48">i&lt;J &amp;&amp; jobs[i]==A</label><label kind="synchronisation" x="-96" y="-32">jobA!</label><label kind="assignment" x="-96" y="-16">i++</label><nail x="-128" y="0"/><nail x="-96" y="0"/></transition><transition><source ref="id10"/><target ref="id10"/><label kind="guard" x="-264" y="-88">i&lt;J &amp;&amp; jobs[i]==H</label><label kind="synchronisation" x="-264" y="-72">jobH!</label><label kind="assignment" x="-264" y="-56">i++</label><nail x="-192" y="-64"/><nail x="-192" y="-32"/></transition><transition><source ref="id10"/><target ref="id10"/><label kind="guard" x="-96" y="-128">i&lt;J &amp;&amp; jobs[i]==E</label><label kind="synchronisation" x="-96" y="-112">jobE!</label><label kind="assignment" x="-96" y="-96">i++</label><nail x="-128" y="-128"/><nail x="-96" y="-128"/></transition></template><system>// Place template instantiations here.
Jobber1 = Jobber();
Jobber2 = Jobber();
Hammer = Tool(get_hammer,put_hammer);
Mallet = Tool(get_mallet,put_mallet);

// List one or more processes to be composed into a system.
system Belt, Jobber1, Jobber2, Hammer, Mallet;</system></nta>