<?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.

// Channels between the customer Eric and the ATM 
chan bank_card,      
     request, // request for 10 euro by Eric to the ATM
     cash;

// Channels between the ATM and the bank 
chan ask_permission, // request to pay out 10 euro 
     OK, 
     not_OK;</declaration><template><name x="5" y="5">Eric</name><declaration>
int cash_in_pocket=0;  // cash in Eric's pocket</declaration><location id="id0" x="-216" y="-48"></location><location id="id1" x="88" y="-48"></location><location id="id2" x="88" y="-104"></location><location id="id3" x="88" y="-168"><name x="56" y="-208">IS_AT_ATM</name></location><location id="id4" x="-216" y="-168"><name x="-240" y="-208">READY</name></location><init ref="id4"/><transition><source ref="id0"/><target ref="id4"/><label kind="synchronisation" x="-208" y="-120">bank_card?</label></transition><transition><source ref="id1"/><target ref="id0"/><label kind="synchronisation" x="-96" y="-72">cash?</label><label kind="assignment" x="-192" y="-48">cash_in_pocket=cash_in_pocket+10</label></transition><transition><source ref="id2"/><target ref="id1"/><label kind="synchronisation" x="96" y="-88">request!</label></transition><transition><source ref="id3"/><target ref="id2"/><label kind="synchronisation" x="96" y="-144">bank_card!</label></transition><transition><source ref="id4"/><target ref="id3"/></transition></template><template><name>ATM</name><declaration>
int in_till = 200; // amount of cash in the ATM's till</declaration><location id="id5" x="-184" y="64"><name x="-240" y="80">ALMOST_READY</name></location><location id="id6" x="-8" y="24"></location><location id="id7" x="264" y="24"></location><location id="id8" x="264" y="-96"></location><location id="id9" x="120" y="136"><name x="120" y="152">READY_TO_PAY_OUT</name></location><location id="id10" x="-72" y="136"></location><location id="id11" x="48" y="-96"></location><location id="id12" x="-184" y="-96"><name x="-194" y="-126">READY</name></location><init ref="id12"/><transition><source ref="id10"/><target ref="id5"/></transition><transition><source ref="id6"/><target ref="id5"/></transition><transition><source ref="id5"/><target ref="id12"/><label kind="synchronisation" x="-176" y="-32">bank_card!</label></transition><transition><source ref="id7"/><target ref="id6"/><label kind="synchronisation" x="64" y="0">not_OK?</label></transition><transition><source ref="id9"/><target ref="id10"/><label kind="synchronisation" x="16" y="112">cash!</label><label kind="assignment" x="-40" y="136">in_till := in_till -10</label></transition><transition><source ref="id7"/><target ref="id9"/><label kind="synchronisation" x="192" y="88">OK?</label></transition><transition><source ref="id8"/><target ref="id7"/><label kind="synchronisation" x="144" y="-48">ask_permission!</label></transition><transition><source ref="id11"/><target ref="id8"/><label kind="synchronisation" x="112" y="-120">request?</label></transition><transition><source ref="id12"/><target ref="id11"/><label kind="synchronisation" x="-104" y="-120">bank_card?</label></transition></template><template><name>Bank</name><declaration>
int balance=80; // balance of Eric's bank account </declaration><location id="id13" x="-144" y="64"></location><location id="id14" x="-216" y="200"></location><location id="id15" x="56" y="200"></location><location id="id16" x="-224" y="-64"><name x="-234" y="-94">READY</name></location><location id="id17" x="64" y="-64"></location><location id="id18" x="0" y="64"></location><init ref="id16"/><transition><source ref="id13"/><target ref="id16"/></transition><transition><source ref="id14"/><target ref="id16"/><label kind="assignment" x="-368" y="56">balance := balance - 1</label></transition><transition><source ref="id18"/><target ref="id13"/><label kind="synchronisation" x="-112" y="40">not_OK!</label></transition><transition><source ref="id15"/><target ref="id14"/><label kind="synchronisation" x="-112" y="176">OK!</label></transition><transition><source ref="id17"/><target ref="id15"/><label kind="guard" x="64" y="80">balance &gt;= 10</label></transition><transition><source ref="id17"/><target ref="id18"/><label kind="guard" x="-56" y="-32">balance &lt; 10</label></transition><transition><source ref="id16"/><target ref="id17"/><label kind="synchronisation" x="-144" y="-88">ask_permission?</label></transition></template><system>

// The system consists of Eric, an ATM, and a Back.

// There is only interaction between Eric and the ATM 
// and between the ATM and the Bank. 

system Eric, Bank, ATM;

</system></nta>