<?xml version="1.0"?>
<!DOCTYPE nta PUBLIC "-//Uppaal Team//DTD Flat System 1.0//EN" "http://www.docs.uu.se/docs/rtmv/uppaal/xml/flat-1_0.dtd">
<nta>
  <declaration>// 971204, Arne, Fredrik, Kim &amp; Paul.
// Fairmont Hotel, San Francisco.

// Test Data from Feb. 18, 2003 by Aglais Co. http://aglaia.cc/profile.html 
const LEAKY_NUM 108, WORK1_ACC_NUM 60, WORK2_ACC_NUM 84, WORK3_ACC_NUM 65, W1_ACC_NUM 88, W2_ACC_NUM 95, W3_ACC_NUM 101, W4_ACC_NUM 108;

int[0,150] accNo1, accNo2, accNo3, detected, checked, detectedNo;
urgent chan check, w0, w1, w2, w3, w4;</declaration>
  
  <template>
    <name x="32" y="16">UserAcc</name>
    <parameter x="168" y="16"> int[0,150] accNo, checked, detected, detectedNo; const workAccNum; urgent chan check, w0, w1, w2, w3, w4</parameter>
    <declaration/>
    <location id="id7" x="48" y="48">
    <name x="56" y="8">idle</name></location>
    <location id="id6" x="176" y="-16">
      <name x="120" y="-32">Logon</name>
    </location>
    <location id="id8" x="48" y="-16"><name x="-16" y="-24">Access</name></location><location id="id9" x="48" y="208"><name x="48" y="224">Detection</name><committed/></location><location id="id10" x="-80" y="208"><name x="-96" y="168">MngReview</name></location><location id="id11" x="176" y="208"><name x="128" y="224">StopWork</name></location><location id="id12" x="176" y="48"><name x="128" y="48">Leak</name></location><location id="id15" x="176" y="112"><name x="120" y="120">FinishWork</name></location><location id="id0" x="48" y="112"/><location id="id1" x="-80" y="144"><name x="-96" y="112">warnMessage</name></location><location id="id2" x="-80" y="272"><name x="-96" y="240">Logoff</name></location><location id="id3" x="176" y="272"><name x="120" y="240">MngInspect</name></location><init ref="id6"/>
    <transition>
      <source ref="id6"/>
      <target ref="id7"/>
      
      
      <nail x="112" y="16"/>
    </transition>
    
  <transition><source ref="id9"/><target ref="id11"/><label kind="guard" x="80" y="160">accNo &lt; workAccNum,
detected &gt; 0</label></transition><transition><source ref="id9"/><target ref="id0"/><label kind="synchronisation" x="0" y="144">w0?</label><nail x="24" y="168"/></transition><transition><source ref="id7"/><target ref="id0"/><label kind="assignment" x="-96" y="80">detectedNo:=accNo</label></transition><transition><source ref="id8"/><target ref="id7"/><nail x="48" y="0"/></transition><transition><source ref="id7"/><target ref="id12"/><label kind="guard" x="80" y="24">accNo &gt; LEAKY_NUM</label></transition><transition><source ref="id7"/><target ref="id15"/><label kind="guard" x="80" y="72">accNo == workAccNum</label></transition><transition><source ref="id0"/><target ref="id9"/><label kind="synchronisation" x="56" y="120">check?</label><label kind="guard" x="56" y="136">checked == 0</label></transition><transition><source ref="id0"/><target ref="id8"/><label kind="assignment" x="-96" y="0">detectedNo:=0,
detected:=0,
checked:=0,
accNo++</label><label kind="guard" x="-96" y="-16">checked == 1</label><nail x="-40" y="48"/></transition><transition><source ref="id9"/><target ref="id1"/><label kind="synchronisation" x="-32" y="160">w1?</label></transition><transition><source ref="id2"/><target ref="id3"/></transition><transition><source ref="id9"/><target ref="id2"/><label kind="synchronisation" x="-32" y="248">w4?</label></transition><transition><source ref="id9"/><target ref="id10"/><label kind="synchronisation" x="-32" y="184">w2?</label><nail x="-24" y="208"/></transition><transition><source ref="id9"/><target ref="id10"/><label kind="synchronisation" x="-32" y="224">w3?</label><nail x="-16" y="224"/></transition><transition><source ref="id1"/><target ref="id0"/></transition><transition><source ref="id10"/><target ref="id0"/></transition></template>
  <template><name x="5" y="5">DynamicPolicy1</name><parameter x="5" y="20"> int[0,150] checked, detected, detectedNo; urgent chan w0, w1, w2, w3, w4</parameter><declaration/><location id="id13" x="176" y="144"><name x="160" y="112">idle</name></location><location id="id14" x="272" y="144"><committed/></location><location id="id4" x="368" y="112"><committed/></location><location id="id5" x="368" y="176"><committed/></location><location id="id16" x="368" y="240"><committed/></location><location id="id17" x="368" y="48"><committed/></location><init ref="id13"/><transition><source ref="id13"/><target ref="id14"/><label kind="synchronisation" x="208" y="120">check!</label><label kind="assignment" x="192" y="104">checked:=1</label></transition><transition><source ref="id14"/><target ref="id17"/><label kind="assignment" x="260" y="96">detected:=1</label><label kind="guard" x="208" y="0">detectedNo&gt;=W1_ACC_NUM,
detectedNo&lt;W2_ACC_NUM</label><label kind="synchronisation" x="304" y="72">w1!</label></transition><transition><source ref="id14"/><target ref="id4"/><label kind="guard" x="336" y="72">detectedNo&gt;=W2_ACC_NUM,
detectedNo&lt;W3_ACC_NUM</label><label kind="assignment" x="360" y="120">detected:=1</label><label kind="synchronisation" x="304" y="112">w2!</label></transition><transition><source ref="id14"/><target ref="id5"/><label kind="guard" x="336" y="136">detectedNo&gt;=W3_ACC_NUM,
detectedNo&lt;W4_ACC_NUM</label><label kind="assignment" x="352" y="192">detected:=1</label><label kind="synchronisation" x="304" y="136">w3!</label></transition><transition><source ref="id14"/><target ref="id16"/><label kind="guard" x="208" y="208">detectedNo&gt;=W4_ACC_NUM</label><label kind="assignment" x="384" y="232">detected:=1</label><label kind="synchronisation" x="304" y="160">w4!</label></transition><transition><source ref="id14"/><target ref="id13"/><label kind="guard" x="160" y="176">detectedNo&lt;W1_ACC_NUM</label><label kind="synchronisation" x="200" y="160">w0!</label><nail x="224" y="168"/></transition><transition><source ref="id17"/><target ref="id13"/></transition><transition><source ref="id4"/><target ref="id13"/></transition><transition><source ref="id5"/><target ref="id13"/></transition><transition><source ref="id16"/><target ref="id13"/></transition></template><instantiation>User1 := UserAcc(accNo1, checked, detected, detectedNo, WORK1_ACC_NUM, check, w0, w1, w2, w3, w4);
User2 := UserAcc(accNo2, checked, detected, detectedNo, WORK2_ACC_NUM, check, w0, w1, w2, w3, w4);
User3 := UserAcc(accNo3, checked, detected, detectedNo, WORK3_ACC_NUM, check, w0, w1, w2, w3, w4);
DynamicPolicy1 := DynamicPolicy1(checked, detected, detectedNo, w0, w1, w2, w3, w4);</instantiation>
  <system>system User1, User2, User3, DynamicPolicy1;</system>
</nta>