<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<org.eventb.core.machineFile org.eventb.core.configuration="org.eventb.core.fwd" org.eventb.texttools.text_lastmodified="1298295845626" org.eventb.texttools.text_representation="machine ATM_0 sees ATM_CO&#10;&#10;variables bal accBalOnAtm cardAcct cardInAtm validCard cardPin&#10;&#10;invariants&#10;  @inv1 bal ∈ ACCOUNT ⇸ ℕ&#10;  @inv2 accBalOnAtm ∈ ATM ⇸ ℕ&#10;  @inv3 cardAcct ∈ CARD ⇸ ACCOUNT&#10;  @inv4 cardInAtm ∈ ATM ⇸ CARD&#10;  @inv5 validCard ⊆  CARD&#10;  @inv6 cardPin ∈ CARD ⇸ ℕ&#10;&#10;events&#10;  event INITIALISATION&#10;    then&#10;      @act1 bal ≔ ∅&#10;      @act2 cardAcct ≔ ∅&#10;      @act3 accBalOnAtm ≔ ∅&#10;      @act4 cardInAtm ≔ ∅&#10;      @act5 validCard ≔ ∅&#10;      @act6 cardPin ≔ ∅&#10;  end&#10;&#10;  event transfer&#10;    any src_ac dest_ac am&#10;    where&#10;      @grd1 src_ac ∈ ACCOUNT&#10;      @grd2 dest_ac ∈ ACCOUNT&#10;      @grd3 am ∈ ℕ&#10;      @grd4 src_ac ∈ dom(bal)&#10;      @grd5 dest_ac ∈ dom(bal)&#10;      @grd6 src_ac ≠ dest_ac&#10;      @grd7 am &lt; bal(src_ac)&#10;    then&#10;      @act1 bal ≔  bal  {dest_ac ↦ (bal(dest_ac) + am), src_ac ↦(bal(src_ac) − am)}&#10;  end&#10;&#10;  event deposit&#10;    any acc am&#10;    where&#10;      @grd1 acc ∈ ACCOUNT&#10;      @grd2 acc ∈ dom(bal)&#10;      @grd3 am ∈ ℕ&#10;    then&#10;      @act1 bal(acc) ≔ bal(acc) + am&#10;  end&#10;&#10;  event withdraw&#10;    any acc am&#10;    where&#10;      @grd1 acc ∈ ACCOUNT&#10;      @grd2 am ∈ ℕ&#10;      @grd3 acc ∈ dom(bal)&#10;      @grd4 bal(acc) ≥ am&#10;    then&#10;      @act1 bal(acc) ≔ bal(acc) − am&#10;  end&#10;&#10;  event changePin&#10;    any old_pin new_pin c&#10;    where&#10;      @grd1 old_pin ∈ ℕ&#10;      @grd6 new_pin ∈ ℕ&#10;      @grd2 c ∈ CARD&#10;      @grd3 c∈dom(cardPin)&#10;      @grd4 old_pin ≠ new_pin&#10;      @grd5 cardPin(c) = old_pin&#10;    then&#10;      @act1 cardPin(c) ≔ new_pin&#10;  end&#10;&#10;  event validateCard&#10;    any a c p&#10;    where&#10;      @grd5 c  ∈ CARD&#10;      @grd6 a ∈ ATM&#10;      @grd0 a ↦c ∈ cardInAtm&#10;      @grd1 p ∈ ℕ&#10;      @grd7 c ∈ dom(cardPin)&#10;      @grd2 cardPin (c) = p&#10;      @grd3 cardInAtm(a) = c&#10;      @grd4 c ∉ validCard&#10;    then&#10;      @act1 validCard ≔ validCard ∪ {c}&#10;  end&#10;&#10;  event CheckBalance //displays account balance for the card in ATM&#10;    any c acc a&#10;    where&#10;      @grd1 c ∈ CARD&#10;      @grd2 acc ∈ ACCOUNT&#10;      @grd3 c ↦ acc ∈ cardAcct&#10;      @grd4 a ∈ dom(cardInAtm)&#10;      @grd5 acc∈dom(bal)&#10;      @grd6 cardInAtm(a) = c&#10;    then&#10;      @act1 accBalOnAtm(a) ≔  bal(acc)&#10;  end&#10;&#10;end&#10;" version="5">
<org.eventb.core.seesContext name="_RPZksD24EeCAYsu3bd3gpA" org.eventb.core.target="ATM_CO"/>
<org.eventb.core.variable name="__CNjITqkEeCEXI9UeGRwrw" org.eventb.core.identifier="bal"/>
<org.eventb.core.variable name="_RPZksj24EeCAYsu3bd3gpA" org.eventb.core.identifier="cardAcct"/>
<org.eventb.core.variable name="_RPZksz24EeCAYsu3bd3gpA" org.eventb.core.identifier="cardInAtm"/>
<org.eventb.core.variable name="_RPZktD24EeCAYsu3bd3gpA" org.eventb.core.identifier="validCard"/>
<org.eventb.core.invariant name="__COKMDqkEeCEXI9UeGRwrw" org.eventb.core.label="inv1" org.eventb.core.predicate="bal ∈ ACCOUNT ⇸ ℕ"/>
<org.eventb.core.invariant name="_RPaLwD24EeCAYsu3bd3gpA" org.eventb.core.label="inv2" org.eventb.core.predicate="cardAcct ∈ CARD ⇸ ACCOUNT"/>
<org.eventb.core.invariant name="_RPaLwT24EeCAYsu3bd3gpA" org.eventb.core.label="inv3" org.eventb.core.predicate="cardInAtm ∈ ATM ⇸ CARD"/>
<org.eventb.core.invariant name="_RPaLwj24EeCAYsu3bd3gpA" org.eventb.core.label="inv4" org.eventb.core.predicate="validCard ⊆  CARD"/>
<org.eventb.core.event name="'" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="INITIALISATION">
<org.eventb.core.action name="__COKMTqkEeCEXI9UeGRwrw" org.eventb.core.assignment="bal ≔ ∅" org.eventb.core.label="act1"/>
<org.eventb.core.action name="_RPaLxD24EeCAYsu3bd3gpA" org.eventb.core.assignment="cardAcct ≔ ∅" org.eventb.core.label="act2"/>
<org.eventb.core.action name="_RPay0T24EeCAYsu3bd3gpA" org.eventb.core.assignment="cardInAtm ≔ ∅" org.eventb.core.label="act3"/>
<org.eventb.core.action name="_RPay0j24EeCAYsu3bd3gpA" org.eventb.core.assignment="validCard ≔ ∅" org.eventb.core.label="act4"/>
</org.eventb.core.event>
<org.eventb.core.event name="__COKMjqkEeCEXI9UeGRwrw" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="Transfer">
<org.eventb.core.parameter name="__COKMzqkEeCEXI9UeGRwrw" org.eventb.core.identifier="src_ac"/>
<org.eventb.core.parameter name="__COKNDqkEeCEXI9UeGRwrw" org.eventb.core.identifier="dest_ac"/>
<org.eventb.core.parameter name="__COKNTqkEeCEXI9UeGRwrw" org.eventb.core.identifier="am"/>
<org.eventb.core.guard name="__COKNjqkEeCEXI9UeGRwrw" org.eventb.core.label="grd1" org.eventb.core.predicate="src_ac ∈ ACCOUNT"/>
<org.eventb.core.guard name="__COxQDqkEeCEXI9UeGRwrw" org.eventb.core.label="grd2" org.eventb.core.predicate="dest_ac ∈ ACCOUNT"/>
<org.eventb.core.action name="__COxRjqkEeCEXI9UeGRwrw" org.eventb.core.assignment="bal ≔  bal  {dest_ac ↦ (bal(dest_ac) + am), src_ac ↦(bal(src_ac) − am)}" org.eventb.core.label="act1"/>
<org.eventb.core.parameter name="__COxRjqkEeCEXI9UeGRwrx" org.eventb.core.identifier="c"/>
<org.eventb.core.guard name="__COxRjqkEeCEXI9UeGRwry" org.eventb.core.label="grd3" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="__COxRjqkEeCEXI9UeGRwrz" org.eventb.core.label="grd4" org.eventb.core.predicate="c ↦ src_ac ∈ cardAcct"/>
<org.eventb.core.guard name="__COxQTqkEeCEXI9UeGRwrw" org.eventb.core.label="grd5" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="__COxQjqkEeCEXI9UeGRwrw" org.eventb.core.label="grd6" org.eventb.core.predicate="src_ac ∈ dom(bal)"/>
<org.eventb.core.guard name="__COxQzqkEeCEXI9UeGRwrw" org.eventb.core.label="grd7" org.eventb.core.predicate="dest_ac ∈ dom(bal)"/>
<org.eventb.core.guard name="__COxRDqkEeCEXI9UeGRwrw" org.eventb.core.label="grd8" org.eventb.core.predicate="src_ac ≠ dest_ac"/>
<org.eventb.core.guard name="__COxRTqkEeCEXI9UeGRwrw" org.eventb.core.label="grd9" org.eventb.core.predicate="am ≤ bal(src_ac)"/>
</org.eventb.core.event>
<org.eventb.core.event name="__CPYUDqkEeCEXI9UeGRwrw" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="Deposit">
<org.eventb.core.parameter name="__CPYUTqkEeCEXI9UeGRwrw" org.eventb.core.identifier="acc"/>
<org.eventb.core.parameter name="__CPYUjqkEeCEXI9UeGRwrw" org.eventb.core.identifier="am"/>
<org.eventb.core.guard name="__CPYUzqkEeCEXI9UeGRwrw" org.eventb.core.label="grd1" org.eventb.core.predicate="acc ∈ ACCOUNT"/>
<org.eventb.core.guard name="__CPYVDqkEeCEXI9UeGRwrw" org.eventb.core.label="grd2" org.eventb.core.predicate="acc ∈ dom(bal)"/>
<org.eventb.core.guard name="__CPYVTqkEeCEXI9UeGRwrw" org.eventb.core.label="grd3" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.action name="__CPYVjqkEeCEXI9UeGRwrw" org.eventb.core.assignment="bal(acc) ≔ bal(acc) + am" org.eventb.core.label="act1"/>
<org.eventb.core.parameter name="__CPYVjqkEeCEXI9UeGRwrx" org.eventb.core.identifier="c"/>
<org.eventb.core.guard name="__CPYVjqkEeCEXI9UeGRwry" org.eventb.core.label="grd4" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="__CPYVjqkEeCEXI9UeGRwrz" org.eventb.core.label="grd5" org.eventb.core.predicate="c ↦ acc ∈ cardAcct"/>
</org.eventb.core.event>
<org.eventb.core.invariant name="__CQmeDqkEeCEXI9UeGRwry" org.eventb.core.comment="" org.eventb.core.label="inv5" org.eventb.core.predicate="∀ c · c ∈ validCard ⇒ c ∈ ran(cardInAtm) "/>
</org.eventb.core.machineFile>
