<?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.
const int N = 3; 
int[0,3] count = 0; // count keeps track of how many guys have arrived at the barrier
int[-3,3] barrier = 0; // &lt;=0 until all guys arrive, and &gt;0 when it should be unlocked</declaration><template><name x="5" y="5">Guy</name><parameter>int i</parameter><declaration>// Place local declarations here.
</declaration><location id="id0" x="-248" y="-88"><name x="-258" y="-118">InDisco</name></location><location id="id1" x="-64" y="-88"></location><location id="id2" x="144" y="-96"><name x="120" y="-80">AtBarrier</name></location><location id="id3" x="128" y="-240"><name x="118" y="-270">CountInc</name></location><location id="id4" x="-88" y="-240"><name x="-112" y="-280">Rendezvous</name></location><location id="id5" x="-264" y="-248"><name x="-280" y="-288">Start</name></location><init ref="id5"/><transition><source ref="id1"/><target ref="id0"/><label kind="assignment" x="-176" y="-88">barrier++</label></transition><transition><source ref="id3"/><target ref="id2"/><label kind="guard" x="208" y="-208">count != N</label><nail x="152" y="-240"/><nail x="248" y="-152"/></transition><transition><source ref="id2"/><target ref="id1"/><label kind="guard" x="-20" y="-122">barrier &gt; 0</label><label kind="assignment" x="-20" y="-92">barrier--</label></transition><transition><source ref="id3"/><target ref="id2"/><label kind="guard" x="64" y="-200">count == N</label><label kind="assignment" x="72" y="-184">barrier++</label></transition><transition><source ref="id4"/><target ref="id3"/><label kind="assignment" x="0" y="-240">count++</label></transition><transition><source ref="id5"/><target ref="id4"/></transition></template><system>// Place template instantiations here.
John = Guy(1);
Frank = Guy(2);
Ole = Guy(3);

// List one or more processes to be composed into a system.
system John, Frank, Ole;</system></nta>
