\documentclass[10pt,a4paper]{report}
\usepackage[top=3cm, bottom=2.5cm, left=3cm, right=2.5cm] {geometry}
\usepackage {bsymb,b2latex}
\usepackage{fancyhdr,lastpage,color}
\lhead{\rm An Event-B Specification of mMW\_T}
\rhead {\rm Page \thepage~of \pageref{LastPage}}
\lfoot{}\cfoot{}\rfoot{}
\pagestyle{fancy}
%---------------------------------------------------------
\begin{document}
\thispagestyle{empty}
\begin{description}
\BTitle{mMW\_T}{23 Apr 2012}{03:56:06 PM}
\MACHINE{mMW\_T}
\SEES{Context\_mMW\_T}
\VARIABLES
	\begin{description}
		\Item{ trAmountM }
		\Item{ cardInAtmM }
		\Item{ srcAccM }
		\Item{ destAccM }
		\Item{ sendReqTransfer }
		\Item{ sendRespTransferOk }
		\Item{ sendRespTransferFail }
	\end{description}
\INVARIANTS
	\begin{description}
		\nItemX{ typing\_sendRespTransferFail }{ sendRespTransferFail \in  \pow(ATM) }
		\nItemX{ typing\_sendRespTransferOk }{ sendRespTransferOk \in  \pow(ATM) }
		\nItemX{ typing\_cardInAtmM }{ cardInAtmM \in  \pow(ATM \cprod  CARD) }
		\nItemX{ typing\_destAccM }{ destAccM \in  \pow(ATM \cprod  ACCOUNT) }
		\nItemX{ typing\_sendReqTransfer }{ sendReqTransfer \in  \pow(ATM) }
		\nItemX{ typing\_trAmountM }{ trAmountM \in  \pow(ATM \cprod  \intg ) }
		\nItemX{ typing\_srcAccM }{ srcAccM \in  \pow(ATM \cprod  ACCOUNT) }
		\nItemX{ BalTransfer\_4\_inv2 }{ cardInAtmM \in  ATM \pfun  CARD }
		\nItemX{ BalTransfer\_4\_inv3 }{ trAmountM \in  ATM \pfun  \nat_1 }
		\nItemX{ BalTransfer\_4\_inv21 }{ srcAccM \in  ATM \pfun  ACCOUNT }
		\nItemX{ BalTransfer\_4\_inv22 }{ destAccM \in  ATM \pfun  ACCOUNT }
	\end{description}
\EVENTS
	\INITIALISATION
		\begin{description}
		\BeginAct
			\begin{description}
			\nItemX{ act27 }{ sendReqTransfer :=   \emptyset  }
			\nItemX{ act29 }{ sendRespTransferOk :=   \emptyset  }
			\nItemX{ act25 }{ sendRespTransferFail :=   \emptyset  }
			\nItemX{ act36 }{ cardInAtmM :=  \emptyset  }
			\nItemX{ act38 }{ trAmountM :=  \emptyset  }
			\nItemX{ act40 }{ srcAccM :=  \emptyset  }
			\nItemX{ act41 }{ destAccM:=  \emptyset  }
			\end{description}
		\EndAct
		\end{description}
	\EVT {SendReqTransfer}
		\begin{description}
		\AnyPrm
			\begin{description}
			\ItemX{ c }
			\ItemX{ src\_ac }
			\ItemX{ dest\_ac }
			\ItemX{ am }
			\ItemX{ a }
			\end{description}
		\WhereGrd
			\begin{description}
			\nItemX{ typing\_c }{ c \in  CARD }
			\nItemX{ typing\_am }{ am \in  \intg  }
			\nItemX{ grd1 }{ src\_ac \in  ACCOUNT }
			\nItemX{ grd2 }{ dest\_ac \in  ACCOUNT }
			\nItemX{ grd3 }{ am \in  \nat_1 }
			\nItemX{ grd5 }{ src\_ac \neq  dest\_ac }
			\nItemX{ grd8 }{ a \in  ATM }
			\end{description}
		\ThenAct
			\begin{description}
			\nItemX{ act1 }{ sendReqTransfer :=  sendReqTransfer \bunion  \{ a\}  }
			\nItemX{ act6 }{ trAmountM(a) :=  am }
			\nItemX{ act7 }{ srcAccM(a) :=  src\_ac }
			\nItemX{ act8 }{ destAccM(a) :=  dest\_ac }
			\nItemX{ act10 }{ cardInAtmM(a) :=  c }
			\end{description}
		\EndAct
		\end{description}
	\EVT {RecvReqTransfer}
		\begin{description}
		\AnyPrm
			\begin{description}
			\ItemX{ a }
			\ItemX{ am }
			\ItemX{ c }
			\ItemX{ src\_ac }
			\ItemX{ dest\_ac }
			\end{description}
		\WhereGrd
			\begin{description}
			\nItemX{ typing\_c }{ c \in  CARD }
			\nItemX{ typing\_am }{ am \in  \intg  }
			\nItemX{ typing\_src\_ac }{ src\_ac \in  ACCOUNT }
			\nItemX{ typing\_a }{ a \in  ATM }
			\nItemX{ typing\_dest\_ac }{ dest\_ac \in  ACCOUNT }
			\nItemX{ grd1 }{ a \in  sendReqTransfer }
			\nItemX{ grd2 }{ a \in  dom(trAmountM) }
			\nItemX{ grd3 }{ am = trAmountM(a) }
			\nItemX{ grd5 }{ a \mapsto  c \in  cardInAtmM }
			\nItemX{ grd8 }{ a \in  dom(srcAccM) }
			\nItemX{ grd9 }{ a \in  dom(destAccM) }
			\nItemX{ grd6 }{ srcAccM(a) = src\_ac }
			\nItemX{ grd7 }{ destAccM(a) = dest\_ac }
			\end{description}
		\ThenAct
			\begin{description}
			\nItemX{ act5 }{ sendReqTransfer :=  sendReqTransfer \setminus  \{ a\}  }
			\end{description}
		\EndAct
		\end{description}
	\EVT {SendRespTransferOk}
		\begin{description}
		\AnyPrm
			\begin{description}
			\ItemX{ a }
			\end{description}
		\WhereGrd
			\begin{description}
			\nItemX{ typing\_a }{ a \in  ATM }
			\end{description}
		\ThenAct
			\begin{description}
			\nItemX{ act3 }{ sendRespTransferOk :=   sendRespTransferOk \bunion  \{ a\}  }
			\end{description}
		\EndAct
		\end{description}
	\EVT {RecvRespTransferOk}
		\begin{description}
		\AnyPrm
			\begin{description}
			\ItemX{ a }
			\end{description}
		\WhereGrd
			\begin{description}
			\nItemX{ typing\_a }{ a \in  ATM }
			\nItemX{ grd1 }{ a \in  sendRespTransferOk }
			\end{description}
		\ThenAct
			\begin{description}
			\nItemX{ act2 }{ sendRespTransferOk :=   sendRespTransferOk \setminus  \{ a\}  }
			\nItemX{ act9 }{ trAmountM :=  \{ a\}  \domsub  trAmountM }
			\nItemX{ act11 }{ cardInAtmM :=  \{ a\}  \domsub  cardInAtmM }
			\nItemX{ act12 }{ srcAccM :=   \{ a\}  \domsub  srcAccM }
			\nItemX{ act13 }{ destAccM :=   \{ a\}  \domsub  destAccM }
			\end{description}
		\EndAct
		\end{description}
	\EVT {SendRespTransferFail}
		\begin{description}
		\AnyPrm
			\begin{description}
			\ItemX{ a }
			\end{description}
		\WhereGrd
			\begin{description}
			\nItemX{ typing\_a }{ a \in  ATM }
			\end{description}
		\ThenAct
			\begin{description}
			\nItemX{ act3 }{ sendRespTransferFail :=   sendRespTransferFail \bunion  \{ a\}  }
			\end{description}
		\EndAct
		\end{description}
	\EVT {RecvRespTransferFail}
		\begin{description}
		\AnyPrm
			\begin{description}
			\ItemX{ a }
			\end{description}
		\WhereGrd
			\begin{description}
			\nItemX{ typing\_a }{ a \in  ATM }
			\nItemX{ grd1 }{ a \in  sendRespTransferFail }
			\end{description}
		\ThenAct
			\begin{description}
			\nItemX{ act2 }{ sendRespTransferFail :=   sendRespTransferFail \setminus  \{ a\}  }
			\nItemX{ act9 }{ trAmountM :=  \{ a\}  \domsub  trAmountM }
			\nItemX{ act11 }{ cardInAtmM :=  \{ a\}  \domsub  cardInAtmM }
			\nItemX{ act12 }{ srcAccM :=   \{ a\}  \domsub  srcAccM }
			\nItemX{ act13 }{ destAccM :=   \{ a\}  \domsub  destAccM }
			\end{description}
		\EndAct
		\end{description}
\END
\end{description}
\end{document}
