System Modelling and Design A Simple ATM Beyond Specification - - PowerPoint PPT Presentation

system modelling and design
SMART_READER_LITE
LIVE PREVIEW

System Modelling and Design A Simple ATM Beyond Specification - - PowerPoint PPT Presentation

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM System Modelling and Design A Simple ATM Beyond Specification Revision: 1.2, April 23, 2008 Ken Robinson School of Computer Science & Engineering The University of


slide-1
SLIDE 1

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

System Modelling and Design

A Simple ATM Beyond Specification

Revision: 1.2, April 23, 2008

Ken Robinson

School of Computer Science & Engineering The University of New South Wales, Sydney Australia

May 17, 2010

c Ken Robinson 2005-2010

mailto::k.robinson@unsw.edu.au

slide-2
SLIDE 2

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Outline I

Objectives of this Lecture ATM0: A Simplistic Model of an ATM ATM0 Improving the Model ATMR0 Password Encryption

slide-3
SLIDE 3

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Objectives of this Lecture

  • to demonstrate that nondeterminism can be closer to reality than

determinism.

  • to illustrate the above using a simple ATM example.
slide-4
SLIDE 4

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Objectives of this Lecture

  • to demonstrate that nondeterminism can be closer to reality than

determinism.

  • to illustrate the above using a simple ATM example.
slide-5
SLIDE 5

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Objectives of this Lecture

  • to demonstrate that nondeterminism can be closer to reality than

determinism.

  • to illustrate the above using a simple ATM example.
slide-6
SLIDE 6

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0: A Simplistic Model of an ATM

We want to produce a model of an ATM. The model will be kept reasonably simple, but also reasonably realistic. Required ATM operations:

  • an operation to insert the card and provide a password;
  • an operation to withdraw money;

The initial attempt might be as shown in the ATM0 machine. This is likely to be the type of specification produced by someone familiar

  • nly with machine level development.
slide-7
SLIDE 7

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0: A Simplistic Model of an ATM

We want to produce a model of an ATM. The model will be kept reasonably simple, but also reasonably realistic. Required ATM operations:

  • an operation to insert the card and provide a password;
  • an operation to withdraw money;

The initial attempt might be as shown in the ATM0 machine. This is likely to be the type of specification produced by someone familiar

  • nly with machine level development.
slide-8
SLIDE 8

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0: A Simplistic Model of an ATM

We want to produce a model of an ATM. The model will be kept reasonably simple, but also reasonably realistic. Required ATM operations:

  • an operation to insert the card and provide a password;
  • an operation to withdraw money;

The initial attempt might be as shown in the ATM0 machine. This is likely to be the type of specification produced by someone familiar

  • nly with machine level development.
slide-9
SLIDE 9

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0: A Simplistic Model of an ATM

We want to produce a model of an ATM. The model will be kept reasonably simple, but also reasonably realistic. Required ATM operations:

  • an operation to insert the card and provide a password;
  • an operation to withdraw money;

The initial attempt might be as shown in the ATM0 machine. This is likely to be the type of specification produced by someone familiar

  • nly with machine level development.
slide-10
SLIDE 10

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0: A Simplistic Model of an ATM

We want to produce a model of an ATM. The model will be kept reasonably simple, but also reasonably realistic. Required ATM operations:

  • an operation to insert the card and provide a password;
  • an operation to withdraw money;

The initial attempt might be as shown in the ATM0 machine. This is likely to be the type of specification produced by someone familiar

  • nly with machine level development.
slide-11
SLIDE 11

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM Context I

CONTEXT ATM ctx SETS ACCOUNT The set of account IDs RESPONSES Set of responses CONSTANTS OK REFUSED RESPONSE Possible responses

slide-12
SLIDE 12

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM Context II

AXIOMS axm1: finite(ACCOUNT) axm4: RESPONSES = {OK, REFUSED} axm5: OK = REFUSED axm6: RESPONSE = {{OK}, {REFUSED}, ∅} END

slide-13
SLIDE 13

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Password context I

CONTEXT Password SETS PASSWORD END

slide-14
SLIDE 14

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 I

MACHINE ATM0 SEES ATM ctx, Password VARIABLES accounts password balance customer response

slide-15
SLIDE 15

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 II

INVARIANTS inv1: accounts ⊆ ACCOUNT inv2: finite(accounts) inv3: password ∈ accounts → PASSWORD inv4: balance ∈ accounts → Z inv5: customer ⊆ accounts inv6: card(customer) ≤ 1 inv7: response ∈ RESPONSE

slide-16
SLIDE 16

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 III

EVENTS Initialisation begin act1: accounts := ∅ act2: password := ∅ act3: balance := ∅ act4: customer := ∅ act5: response := ∅ end

slide-17
SLIDE 17

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 IV

Event InsertCard = any account pass when grd1: account ∈ ACCOUNT grd2: pass ∈ PASSWORD grd3: customer = ∅ grd4: response = ∅

slide-18
SLIDE 18

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 V

then act1: response, customer : | (account ∈ accounts ∧ pass = password(account) ⇒ response′ = {OK} ∧ customer ′ = {account}) ∧ ((account / ∈ accounts ∨ pass = password(account)) ⇒ response′ = {REFUSED} ∧ customer ′ = ∅) end

slide-19
SLIDE 19

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 VI

Event WithDraw = any amount account when grd1: response = ∅ grd2: customer = ∅ grd3: amount ∈ N grd4: {account} = customer

slide-20
SLIDE 20

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 VII

then act1: response : | (balance(account) ≥ amount ⇒ response′ = {OK}) ∧ (balance(account) < amount ⇒ response′ = {REFUSED}) act2: balance : | (balance(account) ≥ amount ⇒ balance′ = balance ⊳ − {account → balance(account) − amount}) ∧ (balance(account) < amount ⇒ balance′ = balance) end

slide-21
SLIDE 21

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM0 VIII

Event ResetResponse = Resets response when grd1: response = ∅ then act1: response := ∅ end END

slide-22
SLIDE 22

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Improving the Model

This ATM0 model is seriously ill-conceived. It puts bank-like state inside the ATM. This is obviously wrong: ATMs have no banking knowledge, they are simply boxes in the wall that interact with a card user and communicate with a remote banking system. We will attempt to build a more realistic model that separates the ATM and the remote banking system. First, we need to specify the context information that is common to both the ATM and the remote banking system. This is shown in CardStatus and Password contexts. It’s split into two machines because the account, service card and response modelling “belongs” to the banking system, but the modelling of passwords is global.

slide-23
SLIDE 23

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Improving the Model

This ATM0 model is seriously ill-conceived. It puts bank-like state inside the ATM. This is obviously wrong: ATMs have no banking knowledge, they are simply boxes in the wall that interact with a card user and communicate with a remote banking system. We will attempt to build a more realistic model that separates the ATM and the remote banking system. First, we need to specify the context information that is common to both the ATM and the remote banking system. This is shown in CardStatus and Password contexts. It’s split into two machines because the account, service card and response modelling “belongs” to the banking system, but the modelling of passwords is global.

slide-24
SLIDE 24

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Improving the Model

This ATM0 model is seriously ill-conceived. It puts bank-like state inside the ATM. This is obviously wrong: ATMs have no banking knowledge, they are simply boxes in the wall that interact with a card user and communicate with a remote banking system. We will attempt to build a more realistic model that separates the ATM and the remote banking system. First, we need to specify the context information that is common to both the ATM and the remote banking system. This is shown in CardStatus and Password contexts. It’s split into two machines because the account, service card and response modelling “belongs” to the banking system, but the modelling of passwords is global.

slide-25
SLIDE 25

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Improving the Model

This ATM0 model is seriously ill-conceived. It puts bank-like state inside the ATM. This is obviously wrong: ATMs have no banking knowledge, they are simply boxes in the wall that interact with a card user and communicate with a remote banking system. We will attempt to build a more realistic model that separates the ATM and the remote banking system. First, we need to specify the context information that is common to both the ATM and the remote banking system. This is shown in CardStatus and Password contexts. It’s split into two machines because the account, service card and response modelling “belongs” to the banking system, but the modelling of passwords is global.

slide-26
SLIDE 26

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Improving the Model

This ATM0 model is seriously ill-conceived. It puts bank-like state inside the ATM. This is obviously wrong: ATMs have no banking knowledge, they are simply boxes in the wall that interact with a card user and communicate with a remote banking system. We will attempt to build a more realistic model that separates the ATM and the remote banking system. First, we need to specify the context information that is common to both the ATM and the remote banking system. This is shown in CardStatus and Password contexts. It’s split into two machines because the account, service card and response modelling “belongs” to the banking system, but the modelling of passwords is global.

slide-27
SLIDE 27

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine I

MACHINE ATM SEES ATM ctx, Password VARIABLES response The variables of this machine model customer what we may think of as a User Interface. balance Each variable is a set that may be either empty money

  • r contain a single value.
slide-28
SLIDE 28

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine II

INVARIANTS inv1: customer ⊆ ACCOUNT inv2: card(customer) ≤ 1 inv3: response ∈ RESPONSE inv4: balance ⊆ Z inv5: finite(balance) inv6: card(balance) ≤ 1 inv7: money ⊆ N inv8: finite(money) inv9: card(money) ≤ 1

slide-29
SLIDE 29

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine III

EVENTS Initialisation begin act1: customer := ∅ act2: response := ∅ act3: balance := ∅ act4: money := ∅ end

slide-30
SLIDE 30

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine IV

Event InsertCard = Insert service card into ATM any scard pass when grd1: customer = ∅ grd2: response = ∅ grd3: scard ∈ SCARD grd4: pass ∈ PASSWORD then act1: response, customer : | response′ ∈ {{OK}, {REFUSED}} ∧ customer ′ ∈ P(ACCOUNT) ∧ (response′ = {OK} ⇒ customer ′ = {GENSCARD−1(scard)}) ∧ (response′ = {REFUSED} ⇒ customer ′ = ∅) end

slide-31
SLIDE 31

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine V

Event Withdraw = Make withdrawal from ATM any amount when grd1: customer = ∅ grd2: amount ∈ N then act1: response, money, balance : | response′ ∈ {{OK}, {REFUSED}} ∧ balance′ ⊆ Z ∧ finite(balance′) ∧ (response′ = {OK} ⇒ money′ = {amount} ∧ balance′ ∈ P(Z) ∧ card(balance′) ≤ 1) ∧ (response′ = {REFUSED} ⇒ money′ = ∅ ∧ balance′ = ∅) end

slide-32
SLIDE 32

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine VI

Event RemoveCard = Customer terminates session when grd1: customer = ∅ then act1: response := {OK} act2: customer := ∅ end

slide-33
SLIDE 33

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine VII

Event ResetResponse = Reset response when no customer using ATM when grd1: customer = ∅ grd2: response = ∅ then act1: response := ∅ end

slide-34
SLIDE 34

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATM machine VIII

Event ResetUI = Reset User Interface when grd1: customer = ∅ ⇒ money = ∅ grd2: customer = ∅ ⇒ balance = ∅ grd3: customer = ∅ ⇒ response = ∅ then act1: money := ∅ act2: balance := ∅ act3: response := ∅ end END

slide-35
SLIDE 35

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

CardStatus context

CONTEXT CardStatus EXTENDS ServiceCards SETS CARDSTATUS CONSTANTS validaccounts currentbalance withdrawlimit password CARDOK CARDNOK AXIOMS axm1: validaccounts ⊆ ACCOUNT axm2: currentbalance ∈ validaccounts → Z axm3: withdrawlimit ∈ validaccounts → N axm4: CARDSTATUS = {CARDOK, CARDNOK} axm5: CARDOK = CARDNOK axm6: password ∈ validaccounts → PASSWORD END

slide-36
SLIDE 36

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ServicCard context

CONTEXT ServiceCards EXTENDS ATM ctx SETS SCARD The set of service cards CONSTANTS GENSCARD An injective function that maps service cards to accounts AXIOMS axm1: finite(SCARD) axm2: GENSCARD ∈ ACCOUNT ֌ ։ SCARD END

slide-37
SLIDE 37

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

We are now modelling a service card, distinct from the account. We assume that the service card can be represented by information that is generated from the account, and that the account can be extracted from the service card.

slide-38
SLIDE 38

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 I

We show two stages in refinement of the ATM. The first attempt, ATMR0, is nearly what we are aiming for, but it contains modelling of the login management that is really nothing to do with the pure interface view of an ATM. MACHINE ATMR0 REFINES ATM SEES CardStatus VARIABLES response The variables of this machine model customer what we may think of as a User Interface. balance Each variable is a set that may be either empty money

  • r contain a single value.
slide-39
SLIDE 39

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 II

INVARIANTS inv1: customer ∈ P(validaccounts)

slide-40
SLIDE 40

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 III

EVENTS Initialisation begin act1: customer := ∅ act2: response := ∅ act3: balance := ∅ act4: money := ∅ end

slide-41
SLIDE 41

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 IV

Event InsertCard ok = Insert service card into ATM refines InsertCard any scard pass account when grd1: customer = ∅ grd2: response = ∅ grd3: scard ∈ SCARD grd4: account = GENSCARD−1(scard) grd5: account ∈ validaccounts grd6: pass = password(account) then act1: response := {OK} act2: customer := {account} end

slide-42
SLIDE 42

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 V

Event InsertCard nok = refines InsertCard any scard pass account when grd1: customer = ∅ grd2: response = ∅ grd3: scard ∈ SCARD grd4: account = GENSCARD−1(scard) grd5: account ∈ validaccounts ⇒ pass = password(account) then act1: response := {REFUSED} end

slide-43
SLIDE 43

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 VI

Event Withdraw ok = Make withdrawal from ATM refines Withdraw any amount account when grd1: customer = ∅ grd2: amount ∈ N grd3: customer = {account} grd4: amount ≤ withdrawlimit(account) then act1: response := {OK} act2: balance :∈ {∅} ∪ {n·n ∈ Z|{n}} act3: money := {amount} end

slide-44
SLIDE 44

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 VII

Event Withdraw nok = refines Withdraw any amount account when grd1: customer = ∅ grd2: amount ∈ N grd3: customer = {account} grd4: amount > withdrawlimit(account) then act1: response := {REFUSED} act2: balance := ∅ act3: money := ∅ end

slide-45
SLIDE 45

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 VIII

Event RemoveCard = Customer terminates session refines RemoveCard when grd1: customer = ∅ then act1: response := {OK} act2: customer := ∅ end

slide-46
SLIDE 46

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 IX

Event ResetResponse = Reset response when no customer using ATM refines ResetResponse when grd1: customer = ∅ grd2: response = ∅ then act1: response := ∅ end

slide-47
SLIDE 47

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

ATMR0 X

Event ResetUI = Reset User Interface refines ResetUI when grd1: customer = ∅ ⇒ money = ∅ grd2: customer = ∅ ⇒ balance = ∅ grd3: customer = ∅ ⇒ response = ∅ then act1: money := ∅ act2: balance := ∅ act3: response := ∅ end END

slide-48
SLIDE 48

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Password Encryption

In ATMR0 we model the mapping from account to password with a function accounts → PASSWORD. Looking ahead to implementation, we recognise that it would be unwise to implement a mapping from account to a plaintext password. It would be more secure to encrypt the password. To provide facilities for this we introduce a new machine Encryption. We also specify the operation CheckPassword as comparing encrypted passwords, rather than comparing plain passwords. Notice that we need to “think ahead” on this issue: if we specified the

  • peration as comparing plain passwords, we could not later decide to

implement the operation using comparison of encrypted passwords as this is weaker than comparing plain passwords and is hence not a refinement.

slide-49
SLIDE 49

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Password Encryption

In ATMR0 we model the mapping from account to password with a function accounts → PASSWORD. Looking ahead to implementation, we recognise that it would be unwise to implement a mapping from account to a plaintext password. It would be more secure to encrypt the password. To provide facilities for this we introduce a new machine Encryption. We also specify the operation CheckPassword as comparing encrypted passwords, rather than comparing plain passwords. Notice that we need to “think ahead” on this issue: if we specified the

  • peration as comparing plain passwords, we could not later decide to

implement the operation using comparison of encrypted passwords as this is weaker than comparing plain passwords and is hence not a refinement.

slide-50
SLIDE 50

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Password Encryption

In ATMR0 we model the mapping from account to password with a function accounts → PASSWORD. Looking ahead to implementation, we recognise that it would be unwise to implement a mapping from account to a plaintext password. It would be more secure to encrypt the password. To provide facilities for this we introduce a new machine Encryption. We also specify the operation CheckPassword as comparing encrypted passwords, rather than comparing plain passwords. Notice that we need to “think ahead” on this issue: if we specified the

  • peration as comparing plain passwords, we could not later decide to

implement the operation using comparison of encrypted passwords as this is weaker than comparing plain passwords and is hence not a refinement.

slide-51
SLIDE 51

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Password Encryption

In ATMR0 we model the mapping from account to password with a function accounts → PASSWORD. Looking ahead to implementation, we recognise that it would be unwise to implement a mapping from account to a plaintext password. It would be more secure to encrypt the password. To provide facilities for this we introduce a new machine Encryption. We also specify the operation CheckPassword as comparing encrypted passwords, rather than comparing plain passwords. Notice that we need to “think ahead” on this issue: if we specified the

  • peration as comparing plain passwords, we could not later decide to

implement the operation using comparison of encrypted passwords as this is weaker than comparing plain passwords and is hence not a refinement.

slide-52
SLIDE 52

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

CONTEXT Encryption EXTENDS Password SETS CRYPT CONSTANTS ENCRYPT AXIOMS axm1: ENCRYPT ∈ PASSWORD → CRYPT END

slide-53
SLIDE 53

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

CONTEXT CardStatus1 Adds encrypted passwords EXTENDS CardStatus CONSTANTS cryptpass We will store encrypted passwords, not plain passwords AXIOMS axm1: cryptpass ∈ validaccounts → CRYPT axm2: ∀acc·acc ∈ validaccounts ⇒ cryptpass(acc) = ENCRYPT(pass THEOREMS thm1: ∀acc, pass·acc ∈ validaccounts ⇒ (pass = password(acc) ⇒ ENCRYPT(pass) = cryptpass(acc)) END

slide-54
SLIDE 54

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

MACHINE ATMR1 REFINES ATMR0 SEES CardStatus1 VARIABLES response The variables of this machine model customer what we may think of as a User Interface. balance Each variable is a set that may be either empty money

  • r contain a single value.
slide-55
SLIDE 55

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

EVENTS Initialisation begin act1 : customer := ∅ act2 : response := ∅ act3 : balance := ∅ act4 : money := ∅ end

slide-56
SLIDE 56

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event InsertCard ok = Insert service card into ATM refines InsertCard ok any scard pass account when grd1 : customer = ∅ grd2 : response = ∅ grd3 : scard ∈ SCARD grd4 : account = GENSCARD−1(scard) grd5 : account ∈ validaccounts grd6 : ENCRYPT(pass) = cryptpass(account) then act1 : response := {OK} act2 : customer := {account} end

slide-57
SLIDE 57

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event InsertCard nok = refines InsertCard nok any scard pass account when grd1 : customer = ∅ grd2 : response = ∅ grd3 : scard ∈ SCARD grd4 : account = GENSCARD−1(scard) grd5 : account ∈ validaccounts ⇒ ENCRYPT(pass) = cryptpass(account) then act1 : response := {REFUSED} end

slide-58
SLIDE 58

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event Withdraw ok = Make withdrawal from ATM refines Withdraw ok any amount account when grd1 : customer = ∅ grd2 : amount ∈ N grd3 : customer = {account} grd4 : amount ≤ withdrawlimit(account) then act1 : response := {OK} act2 : balance :∈ {∅} ∪ {n·n ∈ Z|{n}} act3 : money := {amount} end

slide-59
SLIDE 59

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event Withdraw nok = refines Withdraw nok any amount account when grd1 : customer = ∅ grd2 : amount ∈ N grd3 : customer = {account} grd4 : amount > withdrawlimit(account) then act1 : response := {REFUSED} act2 : balance := ∅ act3 : money := ∅ end

slide-60
SLIDE 60

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event RemoveCard = Customer terminates session refines RemoveCard when grd1 : customer = ∅ then act1 : response := {OK} act2 : customer := ∅ end

slide-61
SLIDE 61

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event ResetResponse = Reset response when no customer using ATM refines ResetResponse when grd1 : customer = ∅ grd2 : response = ∅ then act1 : response := ∅ end

slide-62
SLIDE 62

Outline Objectives of this Lecture ATM0: A Simplistic Model of an ATM

Event ResetUI = Reset User Interface refines ResetUI when grd1 : customer = ∅ ⇒ money = ∅ grd2 : customer = ∅ ⇒ balance = ∅ grd3 : customer = ∅ ⇒ response = ∅ then act1 : money := ∅ act2 : balance := ∅ act3 : response := ∅ end END