88 Views

Download Presentation
##### Introduction to the Z Example Two

**An Image/Link below is provided (as is) to download presentation**

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 - - - - - - - - - - - - - - - - - - - - - - - - - - -

**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.**The Z specification should include:**• Given Sets • State Schema • Initial State • Operations**The Birthday Book Z Specification**1. Given Sets [NAME,DATE]**The Birthday Book Z Specification**• State definition • BirthDayBook • known: ℙ NAME • Birthday: NAME ⇸DATE • known = dombirthday • Notation: D⇸ R • ⇸ ↦ Ξ ∀ × → Δ ≠ ∧ ∨ ∉ ∈ ∅ ∃ ℤ ℕ ℙ ℝ ≙ • **Birthday Function: Example**• known = {Ahmed, Zaid, Qais} • birthday = {Ahmed ↦ 17-Ram, Zaid↦ 27-Sha, Qais↦ 10-Raj} • The notation x ↦ y**The Birthday Book Z Specification**3. Initial State BirthDayInit BirthdayBook known = Ø**The Birthday Book Z Specification**Operations Add birthday Find birthday Remind**The Birthday Book Z Specification**Operations (AddBirthday) AddBirthday BirthdayBook name? : NAME date?: DATE name? known known’= known {name?} birthday’ = birthday {name? ↦ date?}**The Birthday Book Z Specification**Operations (FindBirthday) FindBirthday BirthdayBook name? : NAME date!: DATE name? known date! = birthday(name?) X**The Birthday Book Z Specification**Operations (Remind) Remind BirthdayBook cards! : ℙ NAME today?: DATE cards!= {n: known | birthday (n) = today!} X