<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<org.eventb.core.machineFile org.eventb.core.comment="introduce atm, atmCash, atm acct bal , withdrawal successful or fails" org.eventb.core.configuration="org.eventb.core.fwd" org.eventb.texttools.text_lastmodified="1307057691366" org.eventb.texttools.text_representation="machine Withdraw_1 // introduce atm, atmCash, atm acct bal , withdrawal successful or fails&#10; refines Withdraw_0  sees Withdraw_CO1&#10;&#10;variables bal // Shared variable, DO NOT REFINE&#10;          atmCash atm withdrawOkA withdrawFailA&#10;&#10;invariants&#10;  @inv1 atm ⊆ ATM&#10;  @inv3 atmCash ∈ atm → ℕ&#10;  @inv4 withdrawOkA ⊆ atm&#10;  @inv5 withdrawFailA ⊆  atm&#10;&#10;events&#10;  event INITIALISATION&#10;    then&#10;      @act1 bal ≔ ∅&#10;      @act2 atm ≔ ∅&#10;      @act4 atmCash ≔ ∅&#10;      @act5 withdrawOkA ≔ ∅&#10;      @act6 withdrawFailA ≔ ∅&#10;&#10;  end&#10;&#10;  event withdrawOK refines withdraw&#10;    any a am acc&#10;    where&#10;      @grd1 acc ∈ ACCOUNT&#10;      @grd2 am ∈ ℕ&#10;      @grd3 acc ∈ dom(bal)&#10;      @grd4 bal(acc) ≥ am&#10;      @grd5 a ∈ atm&#10;      @grd6 atmCash(a) ≥ am&#10;    then&#10;      @act1 bal(acc) ≔ bal(acc) − am&#10;      @act2 atmCash(a) ≔ atmCash(a) − am&#10;      @act3 withdrawOkA ≔  withdrawOkA ∪ {a}&#10;&#10;  end&#10;&#10;  event withdrawFail&#10;    any acc am a&#10;    where&#10;      @grd1 acc ∈ ACCOUNT&#10;      @grd2 am ∈ ℕ&#10;      @grd3 acc ∈ dom(bal)&#10;      @grd4 bal(acc) &lt; am&#10;      @grd5 a ∈ atm&#10;    then&#10;      @act2 withdrawFailA ≔  withdrawFailA ∪ {a}&#10;  end&#10;&#10;  event deposit // External event, DO NOT REFINE&#10;  extends deposit&#10;  end&#10;&#10;  event transfer // External event, DO NOT REFINE&#10;  extends transfer&#10;  end&#10;end&#10;" version="5">
<org.eventb.core.refinesMachine name="_h_cgsI1oEeCql_Cw8lZNHQ" org.eventb.core.target="Withdraw_0"/>
<org.eventb.core.seesContext name="_h_dHwI1oEeCql_Cw8lZNHQ" org.eventb.core.target="Withdraw_CO1"/>
<org.eventb.core.variable ch.ethz.eventb.decomposition.nature="1" name="_T_koQVObEeCu5ZBiYa8OYg" org.eventb.core.comment="Shared variable, DO NOT REFINE" org.eventb.core.identifier="bal"/>
<org.eventb.core.variable ch.ethz.eventb.decomposition.nature="1" name="_r7vYsYfsEeCsjdVPpjFWxi" org.eventb.core.comment="Shared variable, DO NOT REFINE" org.eventb.core.identifier="validCard"/>
<org.eventb.core.variable ch.ethz.eventb.decomposition.nature="1" name="_r7vYsYfsEeCsjdVPpjFWxh" org.eventb.core.comment="Shared variable, DO NOT REFINE" org.eventb.core.identifier="cardAcct"/>
<org.eventb.core.variable name="_Oi2EY1OcEeCu5ZBiYa8OYg" org.eventb.core.identifier="atmCash"/>
<org.eventb.core.variable name="_r7vYsIfsEeCsjdVPpjFWxg" org.eventb.core.identifier="withdrawOkA"/>
<org.eventb.core.variable name="_r7vYsYfsEeCsjdVPpjFWxg" org.eventb.core.identifier="withdrawFailA"/>
<org.eventb.core.invariant name="_Oi3SglOcEeCu5ZBiYa8OYg" org.eventb.core.label="inv3" org.eventb.core.predicate="atmCash ∈ ATM → ℕ"/>
<org.eventb.core.invariant name="_Oi2rdFOcEeCu5ZBiYa8OYg" org.eventb.core.label="inv4" org.eventb.core.predicate="withdrawOkA ∈ ℙ(ATM)"/>
<org.eventb.core.invariant name="_Oi3SgVOcEeCu5ZBiYa8OYg" org.eventb.core.label="inv5" org.eventb.core.predicate="withdrawFailA ∈ ℙ(ATM)"/>
<org.eventb.core.event name="'" org.eventb.core.convergence="0" org.eventb.core.extended="true" org.eventb.core.label="INITIALISATION">
<org.eventb.core.action name="_I5IX8FOeEeCu5ZBiYa8OYg" org.eventb.core.assignment="atmCash ≔ ATM × {0}" org.eventb.core.label="act7"/>
<org.eventb.core.action name="_I5Hw4lOeEeCu5ZBiYa8OYg" org.eventb.core.assignment="withdrawOkA ≔ ∅" org.eventb.core.label="act5"/>
<org.eventb.core.action name="_I5Hw41OeEeCu5ZBiYa8OYg" org.eventb.core.assignment="withdrawFailA ≔ ∅" org.eventb.core.label="act6"/>
</org.eventb.core.event>
<org.eventb.core.event name="_Oi35kVOcEeCu5ZBiYa8OYg" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="withdrawOK">
<org.eventb.core.refinesEvent name="_h_eV4I1oEeCql_Cw8lZNHQ" org.eventb.core.target="withdraw"/>
<org.eventb.core.parameter name="_Oi35k1OcEeCu5ZBiYa8OYg" org.eventb.core.identifier="a"/>
<org.eventb.core.parameter name="_Oi4goVOcEeCu5ZBiYa8OYg" org.eventb.core.comment="" org.eventb.core.identifier="am"/>
<org.eventb.core.parameter name="_Oi4golOcEeCu5ZBiYa8OYg" org.eventb.core.identifier="acc"/>
<org.eventb.core.guard name="_Oi4go1OcEeCu5ZBiYa8OYg" org.eventb.core.label="grd1" org.eventb.core.predicate="acc ∈ ACCOUNT"/>
<org.eventb.core.guard name="_Oi4gpFOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd2" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="_Oi4gpVOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd3" org.eventb.core.predicate="acc ∈ dom(bal)"/>
<org.eventb.core.guard name="_Oi5HsFOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd4" org.eventb.core.predicate="am ≤ bal(acc)"/>
<org.eventb.core.guard name="_h_eV4I1oEeCql_Cw8lZNHT" org.eventb.core.label="grd5" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="_h_eV4I1oEeCql_Cw8lZNHS" org.eventb.core.label="grd6" org.eventb.core.predicate="c ↦ acc ∈ cardAcct"/>
<org.eventb.core.guard name="_Oi5HsVOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd7" org.eventb.core.predicate="a ∈ ATM"/>
<org.eventb.core.guard name="_antvAFOdEeCu5ZBiYa8OYg" org.eventb.core.label="grd8" org.eventb.core.predicate="am ≤ atmCash(a)"/>
<org.eventb.core.action name="_Oi6V0VOcEeCu5ZBiYa8OYg" org.eventb.core.assignment="bal(acc) ≔ bal(acc) − am" org.eventb.core.label="act1"/>
<org.eventb.core.action name="_Oi6V0lOcEeCu5ZBiYa8OYg" org.eventb.core.assignment="atmCash(a) ≔ atmCash(a) − am" org.eventb.core.label="act2"/>
<org.eventb.core.action name="_Oi6V01OcEeCu5ZBiYa8OYg" org.eventb.core.assignment="withdrawOkA ≔  withdrawOkA ∪ {a}" org.eventb.core.label="act3"/>
<org.eventb.core.parameter name="_h_eV4I1oEeCql_Cw8lZNHR" org.eventb.core.identifier="c"/>
</org.eventb.core.event>
<org.eventb.core.event name="_Oi684FOcEeCu5ZBiYa8OYg" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="withdrawFail">
<org.eventb.core.parameter name="_Oi685FOcEeCu5ZBiYa8OYg" org.eventb.core.identifier="acc"/>
<org.eventb.core.parameter name="_Oi6841OcEeCu5ZBiYa8OYg" org.eventb.core.identifier="am"/>
<org.eventb.core.parameter name="_Oi684VOcEeCu5ZBiYa8OYg" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="_Oi7j8VOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd1" org.eventb.core.predicate="acc ∈ ACCOUNT"/>
<org.eventb.core.guard name="_Oi7j8FOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd2" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="_anvkMlOdEeCu5ZBiYa8OYg" org.eventb.core.label="grd3" org.eventb.core.predicate="acc ∈ dom(bal)"/>
<org.eventb.core.guard name="_anvkM1OdEeCu5ZBiYa8OYg" org.eventb.core.label="grd4" org.eventb.core.predicate="am &gt; bal(acc)"/>
<org.eventb.core.guard name="_anvkNFOdEeCu5ZBiYa8OYj" org.eventb.core.label="grd5" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="_anvkNFOdEeCu5ZBiYa8OYi" org.eventb.core.label="grd6" org.eventb.core.predicate="c ↦ acc ∈ cardAcct"/>
<org.eventb.core.guard name="_Oi7j8lOcEeCu5ZBiYa8OYg" org.eventb.core.label="grd7" org.eventb.core.predicate="a ∈ ATM"/>
<org.eventb.core.action name="_anvkNFOdEeCu5ZBiYa8OYg" org.eventb.core.assignment="withdrawFailA ≔  withdrawFailA ∪ {a}" org.eventb.core.label="act2"/>
<org.eventb.core.guard name="_anvkNFOdEeCu5ZBiYa8OYh" org.eventb.core.label="grd8" org.eventb.core.predicate="am ≤ atmCash(a)"/>
<org.eventb.core.parameter name="_anvkNFOdEeCu5ZBiYa8OYk" org.eventb.core.comment="" org.eventb.core.identifier="c"/>
</org.eventb.core.event>
<org.eventb.core.event name="_T_mdc1ObEeCu5ZBiYa8OYg" org.eventb.core.comment="External event, DO NOT REFINE" org.eventb.core.convergence="0" org.eventb.core.extended="true" org.eventb.core.label="Deposit">
<org.eventb.core.refinesEvent name="_h_fkAI1oEeCql_Cw8lZNHQ" org.eventb.core.target="Deposit"/>
</org.eventb.core.event>
<org.eventb.core.event name="_T_nrklObEeCu5ZBiYa8OYg" org.eventb.core.comment="External event, DO NOT REFINE" org.eventb.core.convergence="0" org.eventb.core.extended="true" org.eventb.core.label="Transfer">
<org.eventb.core.refinesEvent name="_h_gLEI1oEeCql_Cw8lZNHQ" org.eventb.core.target="Transfer"/>
</org.eventb.core.event>
</org.eventb.core.machineFile>
