Presentation is loading. Please wait.

Presentation is loading. Please wait.

Schemas. Nature of a schema: scope of names in a Z specification Names that are not confined inside schemas. Need to declare and called as global declaration.

Similar presentations


Presentation on theme: "Schemas. Nature of a schema: scope of names in a Z specification Names that are not confined inside schemas. Need to declare and called as global declaration."— Presentation transcript:

1 Schemas

2 Nature of a schema: scope of names in a Z specification Names that are not confined inside schemas. Need to declare and called as global declaration Names introduced are called global variables - names of given sets - names introduced by syntactic equivalence - names introduced by axiomatic description - names introduced by generic definition - names of data types - names of schemas

3

4 A schema contains a declaration part and a predicate part Declaration part declares some local declarations Predicate part expresses some requirements about values of the variables The name of a schema will be used elsewhere in the document to refer to the mathematical text

5

6

7

8

9

10

11

12

13

14

15 example If userid and Password are given sets Time_sharing password: Userid ↛ Password logged_on : ℙ Userid logged_on  dom password Res ≙ [ w: Title ↛ seq Person |  sp : ran w sp ≠ ‹›]

16 Declaration part Introduces some names and establishes their types To establish the type of the names we can use any names of sets that are globally declared These sets can be used in any of the constructions that yield set values such as - power set - union, intersection etc - cartesian product - relation, function etc - domain, range, etc

17 example Library on_loan, on-shelves, books : ℙ Book borrowers : ℙ Person lent_to : Book ↛ Person on_loan, on_shelves, books, and borrowers are declared to be set values, but they are not known in the declaration part of this schema, and cannot be used here.

18 example The notions that - the books that are associated with borrowers in lent_to are exactly the books in on_loan, and - the persons associated with the books in lent_to must all be members of borrowers cannot be formalized by declaring lent_to : on_loan  borrowers but must be formalized in the predicate part

19 Predicate part Defines conditions that constrain the values declared in the declaration part The names used in the construction of predicates must be either: - globally declared, or - declared in the declaration part of the schema

20 example Library on_loan, on-shelves, books : ℙ Book borrowers : ℙ Person lent_to : Book ↛ Person on_loan = dom lent_to ran lent_to  borrowers on_loan  on-shelves = books on_loan  on-shelves = 

21 Example : informal explanation The books on loan are exactly those for which we have a record of a borrower Books can only be recorded as having been lent to known borrowers Every book belonging to the library is either on loan or on the shelves No book can be recorded as being on loan and on the shelves

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56


Download ppt "Schemas. Nature of a schema: scope of names in a Z specification Names that are not confined inside schemas. Need to declare and called as global declaration."

Similar presentations


Ads by Google