Introduction to the Z Example One

12
Introduction to the Z Example One

description

Introduction to the Z Example One. Write Z specifications for the Exam Schedule Problem. The Exam Schedule system keeps track of all final exams. It allows you to add, delete, update, and search exams of all courses in the college. Every exam has a specific date. - PowerPoint PPT Presentation

Transcript of Introduction to the Z Example One

Page 1: Introduction to the Z Example One

Introduction to the ZExample One

Page 2: Introduction to the Z Example One

2

Write Z specifications for the Exam Schedule Problem

The Exam Schedule system keeps track of all final exams. It allows you to add, delete, update, and search exams of all courses in the college. Every exam has a specific date.

Page 3: Introduction to the Z Example One

3

The Z specification should include:

Given Sets State Schema Initial State Operations

Page 4: Introduction to the Z Example One

4

The Exam Schedule Z Specification

1. Given Sets [COURSE,DATE]

Page 5: Introduction to the Z Example One

5

The Exam Schedule Z Specification

2. State definition

ExamSchedulecourses: P COURSE

exam: COURSE ⇸ DATE

courses = dom exam

Page 6: Introduction to the Z Example One

6

The Exam Schedule Z Specification

3. Initial State ExamScheduleInit

ExamSchedule

courses = Ø

Page 7: Introduction to the Z Example One

7

The Exam Schedule Z Specification

Operations

1. Add exam2. Delete exam3. Find exam4. Change date

Page 8: Introduction to the Z Example One

8

The Exam Schedule Z Specification

4. Operations (AddExam) AddExam ExamSchedule

course? : COURSEdate?: DATE

course? coursescourses’= courses {course?}exam’ = exam {course? ↦ date?}

Page 9: Introduction to the Z Example One

9

The Exam Schedule Z Specification

4. Operations (DeleteExam) DeleteExam ExamSchedule

course? : COURSE

course? courses

courses’= courses\{course?}

Page 10: Introduction to the Z Example One

10

The Exam Schedule Z Specification

4. Operations (FindExam) FindExam ExamSchedule

course? : COURSEdate!: DATE

course? courses

date! = exam(course?)

X

Page 11: Introduction to the Z Example One

11

The Exam Schedule Z Specification

4. Operations (ChangeDate) ChangeDate ExamSchedule

course? : COURSEdate?: DATE

course? courses

exam’ = exam {course? ↦ date?}

Page 12: Introduction to the Z Example One

12

The Exam Schedule Z Specification

4. Operations (ChangeDate) ChangeDate ExamSchedule

course? : COURSEdate?: DATE

course? courses

exam’ = exam {course? ↦ date?}