<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<org.eventb.core.machineFile org.eventb.core.comment="introduce transaction, diff ATM and Bank" org.eventb.core.configuration="ch.ethz.eventb.decomposition.mchBase" org.eventb.texttools.text_lastmodified="1292940641977" org.eventb.texttools.text_representation="machine Deposit_2 // introduce transaction, diff ATM and Bank&#10; refines Deposit_1  sees Deposit_CO1&#10;&#10;variables account atm bal atmCash atmCard validCard cardInAtm cardAccount&#10;&#9;&#9;&#9;AccBalOnAtm trans reqDep respDep processedDep atmDepAm atmCashA AccBalOnAtmA&#10;&#10;invariants&#10;  @inv4 trans ∈ ℙ(atm)&#10;  @inv5 reqDep ∈ ℙ(trans)&#10;  @inv6 respDep ∈ ℙ(trans)&#10;  @inv7 processedDep ∈ ℙ(trans)&#10;  @inv8 atmDepAm ∈ atm ⇸ ℕ&#10;  @inv9 partition(trans, reqDep, processedDep,respDep)&#10;  @inv10 atmCashA ∈ atm → ℕ&#10;  @inv11 AccBalOnAtmA ∈ account ⇸ ℕ&#10;&#10;events&#10;  event INITIALISATION&#10;    then&#10;      @act1 account ≔ ∅&#10;      @act2 atm ≔ ∅&#10;      @act3 bal ≔ ∅&#10;      @act4 atmCash ≔ ∅&#10;      @act5 atmCard ≔ ∅&#10;      @act6 validCard ≔ ∅&#10;      @act7 cardInAtm ≔ ∅&#10;      @act8 cardAccount ≔ ∅&#10;      @act11 AccBalOnAtm ≔ ∅&#10;      @act12 trans ≔  ∅&#10;      @act13 reqDep ≔  ∅&#10;      @act14 atmDepAm ≔ ∅&#10;      @act15 processedDep ≔ ∅&#10;      @act16 respDep ≔ ∅&#10;      @act17 atmCashA ≔ ∅&#10;      @act18 AccBalOnAtmA ≔ ∅&#10;  end&#10;&#10;  event reqDeposit&#10;    any c am a&#10;    where&#10;      @grd2 am ∈ ℕ&#10;      @grd3 c ∈ ran(cardInAtm)&#10;      @grd4 a ∈ dom(cardInAtm)&#10;      @grd5 cardInAtm(a) = c&#10;      @grd6 c ∈ validCard&#10;      @grd9 a ∉ trans&#10;    then&#10;      @act1 reqDep ≔ reqDep ∪ {a}&#10;      @act2 trans ≔ trans ∪ {a}&#10;      @act3 atmDepAm(a) ≔ am&#10;  end&#10;&#10;  event depositB refines deposit&#10;    any c am acc a&#10;    where&#10;      @grd1 acc ∈ account&#10;      @grd2 am ∈ ℕ&#10;      @grd3 c ∈ validCard&#10;      @grd4 a ∈ dom(cardInAtm)&#10;      @grd5 cardInAtm(a) = c&#10;      @grd6 c ↦ acc ∈ cardAccount&#10;      @grd7 a ∈ reqDep&#10;      @grd8 a ∈ dom(atmDepAm)&#10;      @grd9 atmDepAm(a) = am&#10;    then&#10;      @act1 bal(acc) ≔ bal(acc) + am&#10;      @act2 atmCash(a) ≔ atmCash(a) + am&#10;      @act3 AccBalOnAtm(acc) ≔  bal(acc) + am&#10;      @act4 reqDep ≔ reqDep ∖ {a}&#10;      @act5 processedDep ≔ processedDep ∪ {a}&#10;  end&#10;&#10;  event respDeposit&#10;    any a&#10;    where&#10;      @grd1 a ∈ processedDep&#10;    then&#10;      @act1 respDep ≔ respDep ∪ {a}&#10;      @act3 processedDep ≔ processedDep ∖ {a}&#10;  end&#10;&#10;  event depositATM&#10;    any c am acc a&#10;    where&#10;      @grd1 acc ∈ account&#10;      @grd2 am ∈ ℕ&#10;      @grd3 c ∈ atmCard&#10;      @grd4 a ∈ dom(cardInAtm)&#10;      @grd5 cardInAtm(a) = c&#10;      @grd6 c ∈ validCard&#10;      @grd7 c ↦ acc ∈ cardAccount&#10;      @grd8 a ∈ respDep&#10;      @grd9 a ∈ dom (atmDepAm)&#10;      @grd10 atmDepAm(a) = am&#10;      @grd11 acc ∈ dom(AccBalOnAtmA)&#10;    then&#10;      @act2 atmCashA(a) ≔ atmCashA(a) + am&#10;      @act3 AccBalOnAtmA(acc) ≔  AccBalOnAtmA(acc) + am&#10;      @act4 respDep ≔ respDep ∖ {a}&#10;      @act5 trans ≔ trans ∖ {a}&#10;  end&#10;end&#10;" version="5">
<org.eventb.core.refinesMachine name="_txMZIA0DEeCDh_sKUTn4vw" org.eventb.core.target="Deposit_1"/>
<org.eventb.core.seesContext name="_txMZIQ0DEeCDh_sKUTn4vw" org.eventb.core.target="Deposit_CO1"/>
<org.eventb.core.variable ch.ethz.eventb.decomposition.nature="1" name="org.eventb.core.variable.bal.106" 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="_b0H3wOgxEd-Lbc8PVuKdog" 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="_opL2sOtHEd-kIOCd7y5zgw" org.eventb.core.comment="Shared variable, DO NOT REFINE" org.eventb.core.identifier="cardAcct"/>
<org.eventb.core.variable name="org.eventb.core.variable.atm_cash.108" org.eventb.core.identifier="atmCash"/>
<org.eventb.core.variable name="org.eventb.core.event.INITIALISATION.11:" org.eventb.core.identifier="cardInAtm"/>
<org.eventb.core.variable name="_lSkcgPZFEd-O8eDjmTF4AA" org.eventb.core.identifier="trans"/>
<org.eventb.core.variable name="_lSkcgfZFEd-O8eDjmTF4AA" org.eventb.core.identifier="reqDep"/>
<org.eventb.core.variable name="_MsmdQPZOEd-O8eDjmTF4AA" org.eventb.core.identifier="respDep"/>
<org.eventb.core.variable name="_MsmdQfZOEd-O8eDjmTF4AA" org.eventb.core.identifier="processedDep"/>
<org.eventb.core.variable name="_lSlDkPZFEd-O8eDjmTF4AA" org.eventb.core.identifier="atmDepAm"/>
<org.eventb.core.variable name="_7rJHUPcREd-VE9yXNFfzhQ" org.eventb.core.identifier="atmCashA"/>
<org.eventb.core.variable name="_7rJHUfcREd-VE9yXNFfzhQ" org.eventb.core.identifier="accBalOnAtm"/>
<org.eventb.core.invariant name="_lSm4wPZFEd-O8eDjmTF4AA" org.eventb.core.label="inv4" org.eventb.core.predicate="trans ∈ ℙ(ATM)"/>
<org.eventb.core.invariant name="_lSnf0PZFEd-O8eDjmTF4AA" org.eventb.core.label="inv5" org.eventb.core.predicate="reqDep ∈ ℙ(trans)"/>
<org.eventb.core.invariant name="_MsnrYPZOEd-O8eDjmTF4AA" org.eventb.core.label="inv6" org.eventb.core.predicate="respDep ∈ ℙ(trans)"/>
<org.eventb.core.invariant name="_MsoScPZOEd-O8eDjmTF4AA" org.eventb.core.label="inv7" org.eventb.core.predicate="processedDep ∈ ℙ(ATM)"/>
<org.eventb.core.invariant name="_lSoG4PZFEd-O8eDjmTF4AA" org.eventb.core.label="inv8" org.eventb.core.predicate="atmDepAm ∈ ATM ⇸ ℕ"/>
<org.eventb.core.invariant name="_Mso5gPZOEd-O8eDjmTF4AA" org.eventb.core.label="inv9" org.eventb.core.predicate="partition(trans, reqDep, respDep)"/>
<org.eventb.core.invariant name="_7rNYwPcREd-VE9yXNFfzhQ" org.eventb.core.label="inv10" org.eventb.core.predicate="atmCashA ∈ ATM → ℕ"/>
<org.eventb.core.invariant name="_7rN_0PcREd-VE9yXNFfzhQ" org.eventb.core.comment="" org.eventb.core.label="inv11" org.eventb.core.predicate="accBalOnAtm ∈ ACCOUNT ⇸ ℕ"/>
<org.eventb.core.event name="org.eventb.core.event.INITIALISATION.119" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="INITIALISATION">
<org.eventb.core.action name="org.eventb.core.action.atm_cash.init.127" org.eventb.core.assignment="bal ≔ ∅" org.eventb.core.label="act3"/>
<org.eventb.core.action name="_PSCWkOXIEd-el7FusQO1eQ" org.eventb.core.assignment="atmCash ≔ ATM × {0}" org.eventb.core.label="act4"/>
<org.eventb.core.action name="_PSC9oOXIEd-el7FusQO1eQ" org.eventb.core.assignment="validCard ≔ ∅" org.eventb.core.label="act6"/>
<org.eventb.core.action name="_PSC9oeXIEd-el7FusQO1eQ" org.eventb.core.assignment="cardInAtm ≔ ∅" org.eventb.core.label="act7"/>
<org.eventb.core.action name="_PSDksOXIEd-el7FusQO1eQ" org.eventb.core.assignment="cardAcct ≔ ∅" org.eventb.core.label="act8"/>
<org.eventb.core.action name="_lStmcPZFEd-O8eDjmTF4AA" org.eventb.core.assignment="trans ≔  ∅" org.eventb.core.label="act12"/>
<org.eventb.core.action name="_lStmcfZFEd-O8eDjmTF4AA" org.eventb.core.assignment="reqDep ≔  ∅" org.eventb.core.label="act13"/>
<org.eventb.core.action name="_lSuNgPZFEd-O8eDjmTF4AA" org.eventb.core.assignment="atmDepAm ≔ ∅" org.eventb.core.label="act14"/>
<org.eventb.core.action name="_MsuZEPZOEd-O8eDjmTF4AA" org.eventb.core.assignment="processedDep ≔ ∅" org.eventb.core.label="act15"/>
<org.eventb.core.action name="_MsvAIPZOEd-O8eDjmTF4AA" org.eventb.core.assignment="respDep ≔ ∅" org.eventb.core.label="act16"/>
<org.eventb.core.action name="_7rUGcPcREd-VE9yXNFfzhQ" org.eventb.core.assignment="atmCashA ≔ ATM × {0}" org.eventb.core.label="act17"/>
<org.eventb.core.action name="_7rUGcfcREd-VE9yXNFfzhQ" org.eventb.core.assignment="accBalOnAtm ≔ ∅" org.eventb.core.label="act18"/>
</org.eventb.core.event>
<org.eventb.core.event name="_lTBvgPZFEd-O8eDjmTF4AA" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="reqDeposit">
<org.eventb.core.parameter name="_lTCWkPZFEd-O8eDjmTF4AA" org.eventb.core.identifier="c"/>
<org.eventb.core.parameter name="_lTC9oPZFEd-O8eDjmTF4AA" org.eventb.core.identifier="am"/>
<org.eventb.core.parameter name="_lTC9ofZFEd-O8eDjmTF4AA" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="_lTDksfZFEd-O8eDjmTF4AA" org.eventb.core.label="grd2" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="_lTELwPZFEd-O8eDjmTF4AA" org.eventb.core.label="grd3" org.eventb.core.predicate="c ∈ ran(cardInAtm)"/>
<org.eventb.core.guard name="_lTEy0PZFEd-O8eDjmTF4AA" org.eventb.core.label="grd4" org.eventb.core.predicate="a ∈ dom(cardInAtm)"/>
<org.eventb.core.guard name="_lTGA8PZFEd-O8eDjmTF4AA" org.eventb.core.label="grd5" org.eventb.core.predicate="cardInAtm(a) = c"/>
<org.eventb.core.guard name="_lTGA8fZFEd-O8eDjmTF4AA" org.eventb.core.label="grd6" org.eventb.core.predicate="c ∈ validCard"/>
<org.eventb.core.guard name="_lTH2IfZFEd-O8eDjmTF4AA" org.eventb.core.label="grd9" org.eventb.core.predicate="a ∉ trans"/>
<org.eventb.core.action name="_lTIdMPZFEd-O8eDjmTF4AA" org.eventb.core.assignment="reqDep ≔ reqDep ∪ {a}" org.eventb.core.label="act1"/>
<org.eventb.core.action name="_lTJEQPZFEd-O8eDjmTF4AA" org.eventb.core.assignment="trans ≔ trans ∪ {a}" org.eventb.core.label="act2"/>
<org.eventb.core.action name="_lTJrUPZFEd-O8eDjmTF4AA" org.eventb.core.assignment="atmDepAm(a) ≔ am" org.eventb.core.label="act3"/>
</org.eventb.core.event>
<org.eventb.core.event name="_MX3VcYXWEd-IWucizL2C3A" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="depositB">
<org.eventb.core.refinesEvent name="_txfUEA0DEeCDh_sKUTn4vw" org.eventb.core.target="Deposit"/>
<org.eventb.core.parameter name="'" org.eventb.core.identifier="acc"/>
<org.eventb.core.parameter name="(" org.eventb.core.identifier="am"/>
<org.eventb.core.parameter name=")" org.eventb.core.identifier="c"/>
<org.eventb.core.guard name="*" org.eventb.core.label="grd1" org.eventb.core.predicate="acc ∈ ACCOUNT"/>
<org.eventb.core.guard name="+" org.eventb.core.label="grd2" org.eventb.core.predicate="acc ∈ dom(bal)"/>
<org.eventb.core.guard name="," org.eventb.core.label="grd3" org.eventb.core.predicate="am ∈ ℕ1"/>
<org.eventb.core.guard name="." org.eventb.core.label="grd5" org.eventb.core.predicate="c ↦ acc ∈ cardAcct"/>
<org.eventb.core.action name="/" org.eventb.core.assignment="bal(acc) ≔ bal(acc) + am" org.eventb.core.label="act1"/>
<org.eventb.core.action name="(" org.eventb.core.assignment="atmCash(a) ≔ atmCash(a) + am" org.eventb.core.label="act2"/>
<org.eventb.core.guard name=")" org.eventb.core.label="grd6" org.eventb.core.predicate="a ∈ ATM"/>
<org.eventb.core.guard name="internal1" org.eventb.core.label="grd7" org.eventb.core.predicate="a ∈ dom(atmCash)"/>
<org.eventb.core.parameter name="*" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="-" org.eventb.core.label="grd8" org.eventb.core.predicate="a ∈ dom(cardInAtm)"/>
<org.eventb.core.guard name="internal2" org.eventb.core.label="grd9" org.eventb.core.predicate="cardInAtm(a) = c"/>
<org.eventb.core.guard name="_opdjgOtHEd-kIOCd7y5zgw" org.eventb.core.label="grd10" org.eventb.core.predicate="a ∈ reqDep"/>
<org.eventb.core.guard name="_Ms6mUPZOEd-O8eDjmTF4AA" org.eventb.core.label="grd11" org.eventb.core.predicate="a ∈ dom(atmDepAm)"/>
<org.eventb.core.guard name="_Ms5_QPZOEd-O8eDjmTF4AA" org.eventb.core.label="grd12" org.eventb.core.predicate="atmDepAm(a) = am"/>
<org.eventb.core.action name="_p0Lo8evxEd-V6twkc9HfSw" org.eventb.core.assignment="processedDep ≔ processedDep ∪ {a}" org.eventb.core.label="act5"/>
</org.eventb.core.event>
<org.eventb.core.event name="_Ms9CkPZOEd-O8eDjmTF4AA" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="respDeposit">
<org.eventb.core.parameter name="_Ms-QsfZOEd-O8eDjmTF4AA" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="_Ms-QsvZOEd-O8eDjmTF4AA" org.eventb.core.label="grd1" org.eventb.core.predicate="a ∈ processedDep"/>
<org.eventb.core.action name="_MtB7EfZOEd-O8eDjmTF4AA" org.eventb.core.assignment="respDep ≔ respDep ∪ {a}" org.eventb.core.label="act1"/>
<org.eventb.core.action name="_MtCiIPZOEd-O8eDjmTF4AA" org.eventb.core.assignment="processedDep ≔ processedDep ∖ {a}" org.eventb.core.label="act3"/>
<org.eventb.core.action name="_MtCiIPZOEd-O8eDjmTF4AB" org.eventb.core.assignment="reqDep ≔ reqDep ∖ {a}" org.eventb.core.label="act4"/>
<org.eventb.core.guard name="_MtCiIPZOEd-O8eDjmTF4AC" org.eventb.core.label="grd2" org.eventb.core.predicate="a ∈ reqDep"/>
</org.eventb.core.event>
<org.eventb.core.event name="_MtDJMPZOEd-O8eDjmTF4AA" org.eventb.core.convergence="0" org.eventb.core.extended="false" org.eventb.core.label="depositATM">
<org.eventb.core.parameter name="_MtDwQPZOEd-O8eDjmTF4AA" org.eventb.core.identifier="am"/>
<org.eventb.core.parameter name="_MtDwQvZOEd-O8eDjmTF4AA" org.eventb.core.identifier="a"/>
<org.eventb.core.guard name="_MtHaoPZOEd-O8eDjmTF4AA" org.eventb.core.label="grd8" org.eventb.core.predicate="a ∈ respDep"/>
<org.eventb.core.guard name="_MtHaofZOEd-O8eDjmTF4AA" org.eventb.core.label="grd9" org.eventb.core.predicate="a ∈ dom (atmDepAm)"/>
<org.eventb.core.guard name="_MtIBsPZOEd-O8eDjmTF4AA" org.eventb.core.label="grd10" org.eventb.core.predicate="atmDepAm(a) = am"/>
<org.eventb.core.action name="_7rtvEPcREd-VE9yXNFfzhQ" org.eventb.core.assignment="atmCashA(a) ≔ atmCashA(a) + am" org.eventb.core.label="act2"/>
<org.eventb.core.action name="_MtIowfZOEd-O8eDjmTF4AA" org.eventb.core.assignment="respDep ≔ respDep ∖ {a}" org.eventb.core.label="act4"/>
<org.eventb.core.action name="_MtJP0PZOEd-O8eDjmTF4AA" org.eventb.core.assignment="trans ≔ trans ∖ {a}" org.eventb.core.label="act5"/>
</org.eventb.core.event>
<org.eventb.core.event ch.ethz.eventb.decomposition.external="true" name="1" 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="'" org.eventb.core.target="Transfer"/>
</org.eventb.core.event>
<org.eventb.core.invariant name="org.eventb.core.event.INITIALISATION.11;" org.eventb.core.label="inv12" org.eventb.core.predicate="∀c· c ∈ ran(cardInAtm) ⇒ c ∈ validCard "/>
</org.eventb.core.machineFile>
