Beruflich Dokumente
Kultur Dokumente
86
Overview of Z
Scheme:
• name
87
Example: Bank Application in Z
Bank ΞBank
Bank0 InitBank
ˆ Bank ∧ Bank0
∆Bank =
88
State Transformations
∆Bank
amount?: IN
from?, to?: Account
from? 6= to?
bal0 = bal ⊕ {from? 7→ bal(from?) − amount?,
to? 7→ bal(to?) + amount?}
bal(from?)≥amount?
89
Error Treatment
Ok Insufficient
90
Proving System Properties
Theorem
after transfer: bal’(from?) + bal’(to?) = bal(from?) + bal(to?)
92
Soundness Proof
Theorem
bal0 = {accountNo0 (i) 7→ balance0 (i) | i:0..quantity0 -1}
Abs
RBank Bank
RTransfer1 Transfer1
Abs
RBank’ Bank’
Proof.