Introduction to the Z Example Two

1 / 11

# Introduction to the Z Example Two - PowerPoint PPT Presentation

##### Introduction to the Z Example Two

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. Introduction to the ZExample Two

2. Write Z specifications for the Birthday Book Problem • The Birthday Book system keeps track of people’s birthdays. It allows you to add and search for birthdays. Also, it issues reminders.

3. The Z specification should include: • Given Sets • State Schema • Initial State • Operations

4. The Birthday Book Z Specification 1. Given Sets [NAME,DATE]

5. The Birthday Book Z Specification • State definition • BirthDayBook • known: ℙ NAME • Birthday: NAME ⇸DATE • known = dombirthday • Notation: D⇸ R • ⇸ ↦ Ξ ∀  × → Δ ≠ ∧ ∨ ∉ ∈ ∅ ∃ ℤ ℕ ℙ ℝ ≙ • 

6. Birthday Function: Example • known = {Ahmed, Zaid, Qais} • birthday = {Ahmed ↦ 17-Ram, Zaid↦ 27-Sha, Qais↦ 10-Raj} • The notation x ↦ y

7. The Birthday Book Z Specification 3. Initial State BirthDayInit BirthdayBook known = Ø

8. The Birthday Book Z Specification Operations Add birthday Find birthday Remind

9. The Birthday Book Z Specification Operations (AddBirthday) AddBirthday  BirthdayBook name? : NAME date?: DATE name? known known’= known {name?} birthday’ = birthday {name? ↦ date?}

10. The Birthday Book Z Specification Operations (FindBirthday) FindBirthday BirthdayBook name? : NAME date!: DATE name?  known date! = birthday(name?) X

11. The Birthday Book Z Specification Operations (Remind) Remind BirthdayBook cards! : ℙ NAME today?: DATE cards!= {n: known | birthday (n) = today!} X