<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<org.eventb.core.machineFile org.eventb.core.comment="intro atm, card and transfer failure" org.eventb.core.configuration="org.eventb.core.fwd" org.eventb.texttools.text_lastmodified="1293644462750" org.eventb.texttools.text_representation="machine BalTransfer_1 // intro atm, cardValidation, account balance on atm and transfer failure&#10; refines BalTransfer_0  sees BalTransfer_CO1&#10;&#10;variables account bal&#10;                atm  transferOkA transferFailA&#10;&#10;invariants&#10;  @inv7 atm ∈ ℙ(ATM)&#10;  @inv9 transferOkA ∈ ℙ(atm)&#10;  @in10 transferFailA ∈ ℙ(atm)&#10;&#10;events&#10;  event INITIALISATION&#10;    then&#10;      @act1 account ≔ ∅&#10;      @act4 bal ≔ ∅&#10;      @act8 atm ≔ ∅&#10;      @act5 transferOkA ≔ ∅&#10;      @act6 transferFailA ≔ ∅&#10;  end&#10;&#10;  event transferOK refines transfer&#10;    any src_ac dest_ac am a&#10;    where&#10;      @grd1 src_ac ∈ account&#10;      @grd2 dest_ac ∈ account&#10;      @grd3 am ∈ ℕ1&#10;      @grd4 am &lt; bal(src_ac)&#10;      @grd5 src_ac ≠ dest_ac&#10;      @grd7 a ∈ atm&#10;    then&#10;      @act1 bal ≔  bal  {dest_ac ↦ (bal(dest_ac) + am), src_ac ↦(bal(src_ac) − am)}&#10;      @act2 transferOkA ≔  transferOkA ∪ {a}&#10;  end&#10;&#10;  event transferFails&#10;    any src_ac dest_ac am a&#10;    where&#10;      @grd1 src_ac ∈ account&#10;      @grd2 dest_ac ∈ account&#10;      @grd3 am ∈ ℕ1&#10;      @grd4 am &gt; bal(src_ac)&#10;      @grd5 src_ac ≠ dest_ac&#10;      @grd7 a ∈ atm&#10;    then&#10;      @act2 transferFailA ≔  transferFailA ∪ {a}&#10;  end&#10;end&#10;" version="5">
<org.eventb.core.refinesMachine name="_bLwPQBNqEeCky5OpqeHuBQ" org.eventb.core.target="BalTransfer_0"/>
<org.eventb.core.seesContext name="_bLwPQRNqEeCky5OpqeHuBQ" org.eventb.core.target="BalTransfer_CO1"/>
<org.eventb.core.variable ch.ethz.eventb.decomposition.nature="1" name="'" 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="(" 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=")" org.eventb.core.comment="Shared variable, DO NOT REFINE" org.eventb.core.identifier="cardAcct"/>
<org.eventb.core.variable name="_FREeUAY9EeC9GJs-VyssYw" org.eventb.core.identifier="transferOkA"/>
<org.eventb.core.variable name="_btYp4g0NEeCDh_sKUTn4vw" org.eventb.core.identifier="transferFailA"/>
<org.eventb.core.invariant name="_FRFscAY9EeC9GJs-VyssYw" org.eventb.core.comment="" org.eventb.core.label="inv9" org.eventb.core.predicate="transferOkA ∈ ℙ(ATM)"/>
<org.eventb.core.invariant name="_btYp4w0NEeCDh_sKUTn4vw" org.eventb.core.label="inv10" org.eventb.core.predicate="transferFailA ∈ ℙ(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="_FRIvwAY9EeC9GJs-VyssYw" org.eventb.core.assignment="transferOkA ≔ ∅" org.eventb.core.label="act5"/>
<org.eventb.core.action name="_ZZUNYRFeEeCibs8Q1rasEA" org.eventb.core.assignment="transferFailA ≔ ∅" org.eventb.core.label="act6"/>
<org.eventb.core.action name="_ZZUNYRFeEeCibs8Q1rasEB" org.eventb.core.assignment="cardInAtm ≔ ∅" org.eventb.core.label="act7"/>
</org.eventb.core.event>
<org.eventb.core.event name="_-x4foYUfEd-Yw_1iUmuWTQ" org.eventb.core.convergence="0" org.eventb.core.extended="true" org.eventb.core.label="TransferOK">
<org.eventb.core.refinesEvent name="_bLxdYBNqEeCky5OpqeHuBQ" org.eventb.core.target="Transfer"/>
<org.eventb.core.parameter name="_s57vlOwKEd-V6twkc9HfSw" org.eventb.core.identifier="a"/>
<org.eventb.core.action name="_eHjV0OwJEd-V6twkc9HfSw" org.eventb.core.assignment="transferOkA ≔  transferOkA ∪ {a}" org.eventb.core.label="act2"/>
<org.eventb.core.guard name="_s6E5gOwKEd-V6twkc9HfSx" org.eventb.core.comment="" org.eventb.core.label="grd10" org.eventb.core.predicate="a ∈ dom(cardInAtm)"/>
<org.eventb.core.guard name="_s6E5gOwKEd-V6twkc9HfSy" org.eventb.core.label="grd11" org.eventb.core.predicate="c = cardInAtm(a)"/>
<org.eventb.core.guard name="_s6E5gOwKEd-V6twkc9HfSz" org.eventb.core.label="grd12" org.eventb.core.predicate="a ∉ (transferOkA ∪ transferFailA)"/>
</org.eventb.core.event>
<org.eventb.core.event name="_eHjV0uwJEd-V6twkc9HfSw" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="TransferFails">
<org.eventb.core.parameter name="_eHjV1OwJEd-V6twkc9HfSw" org.eventb.core.identifier="src_ac"/>
<org.eventb.core.parameter name="_eHjV1ewJEd-V6twkc9HfSw" org.eventb.core.identifier="dest_ac"/>
<org.eventb.core.parameter name="_eHjV1uwJEd-V6twkc9HfSw" org.eventb.core.identifier="am"/>
<org.eventb.core.guard name="_eHjV2OwJEd-V6twkc9HfSw" org.eventb.core.label="grd1" org.eventb.core.predicate="src_ac ∈ ACCOUNT"/>
<org.eventb.core.guard name="_eHjV2ewJEd-V6twkc9HfSw" org.eventb.core.label="grd2" org.eventb.core.predicate="dest_ac ∈ ACCOUNT"/>
<org.eventb.core.guard name="_s6E5guwKEd-V6twkc9HfSy" org.eventb.core.label="grd3" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="_eHjV2uwJEd-V6twkc9HfSw" org.eventb.core.label="grd5" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="_s6E5guwKEd-V6twkc9HfS{" org.eventb.core.label="grd6" org.eventb.core.predicate="src_ac ∈ dom(bal)"/>
<org.eventb.core.guard name="_s6E5guwKEd-V6twkc9HfS|" org.eventb.core.label="grd7" org.eventb.core.predicate="dest_ac ∈ dom(bal)"/>
<org.eventb.core.guard name="_eHjV3OwJEd-V6twkc9HfSw" org.eventb.core.label="grd8" org.eventb.core.predicate="src_ac ≠ dest_ac"/>
<org.eventb.core.guard name="_eHjV2-wJEd-V6twkc9HfSw" org.eventb.core.label="grd9" org.eventb.core.predicate="am &gt; bal(src_ac) ∨ c ↦ src_ac ∉ cardAcct "/>
<org.eventb.core.action name="_btrk0A0NEeCDh_sKUTn4vw" org.eventb.core.assignment="transferFailA ≔  transferFailA ∪ {a}" org.eventb.core.label="act2"/>
<org.eventb.core.parameter name="_s6E5guwKEd-V6twkc9HfSx" org.eventb.core.identifier="c"/>
<org.eventb.core.parameter name="_s6E5gewKEd-V6twkc9HfSw" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="_s6E5guwKEd-V6twkc9HfS}" org.eventb.core.label="grd10" org.eventb.core.predicate="a ∈ dom(cardInAtm)"/>
<org.eventb.core.guard name="_s6E5guwKEd-V6twkc9HfS~" org.eventb.core.comment="" org.eventb.core.label="grd11" org.eventb.core.predicate="c = cardInAtm(a)"/>
<org.eventb.core.guard name="_s6E5guwKEd-V6twkc9HfT'" org.eventb.core.label="grd12" org.eventb.core.predicate="a ∉ (transferOkA ∪ transferFailA)"/>
</org.eventb.core.event>
<org.eventb.core.event ch.ethz.eventb.decomposition.external="true" name="2" org.eventb.core.comment="External event, DO NOT REFINE" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="Deposit">
<org.eventb.core.refinesEvent name="0" org.eventb.core.target="Deposit"/>
<org.eventb.core.parameter name="1" org.eventb.core.identifier="acc"/>
<org.eventb.core.parameter name="2" org.eventb.core.comment="" org.eventb.core.identifier="am"/>
<org.eventb.core.parameter name="3" org.eventb.core.identifier="c"/>
<org.eventb.core.guard name="4" org.eventb.core.label="grd1" org.eventb.core.predicate="acc ∈ ACCOUNT"/>
<org.eventb.core.guard name="5" org.eventb.core.label="grd2" org.eventb.core.predicate="acc ∈ dom(bal)"/>
<org.eventb.core.guard name="6" org.eventb.core.label="grd3" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="7" org.eventb.core.label="grd4" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="8" org.eventb.core.label="grd5" org.eventb.core.predicate="c ↦ acc ∈ cardAcct"/>
<org.eventb.core.action name="9" org.eventb.core.assignment="bal(acc) ≔ bal(acc) + am" org.eventb.core.label="act1"/>
</org.eventb.core.event>
<org.eventb.core.variable name="_eHjV0uwJEd-V6twkc9HfSx" org.eventb.core.identifier="cardInAtm"/>
<org.eventb.core.invariant name="_eHjV0uwJEd-V6twkc9HfSy" org.eventb.core.comment="" org.eventb.core.label="inv11" org.eventb.core.predicate="cardInAtm ∈  ATM ⇸ CARD"/>
<org.eventb.core.invariant name="_eHjV0uwJEd-V6twkc9HfSz" org.eventb.core.label="inv12" org.eventb.core.predicate="transferOkA ∩ transferFailA = ∅"/>
<org.eventb.core.event name="_eHjV0uwJEd-V6twkc9HfS{" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="FinishTransfer">
<org.eventb.core.parameter name="'" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="(" org.eventb.core.label="grd1" org.eventb.core.predicate="a ∈ ATM"/>
<org.eventb.core.guard name=")" org.eventb.core.label="grd2" org.eventb.core.predicate="a ∈ (transferOkA ∪ transferFailA)"/>
<org.eventb.core.action name="*" org.eventb.core.assignment="transferOkA ≔ transferOkA ∖ {a}" org.eventb.core.label="act1"/>
<org.eventb.core.action name="+" org.eventb.core.assignment="transferFailA ≔ transferFailA ∖ {a}" org.eventb.core.label="act2"/>
</org.eventb.core.event>
</org.eventb.core.machineFile>
