110 likes | 223 Vues
The Birthday Book system effectively manages and tracks individuals' birth dates by allowing users to add, search for, and receive reminders about birthdays. This document outlines the Z specification necessary for the system's development. Key components include Given Sets, State Schema, Initial State, and Operations, which encompass adding birthdays, finding specific birthdays, and issuing reminders. The specification captures the necessary formal definitions and examples for each operation, ensuring clarity and functionality for users managing their birthday information.
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