You are on page 1of 8

Z Schema Operations

1) The following user defined types are used in the system.

NAME, NATIONALITY, ADDRESS, PHONE_NUMBER

1. NAME is an Abstract Type which can hold all the possible Names.
2. NATIONALITY is an Abstract Type which can hold all the possible Nationalities of the
Ship.
3. ADDRESS is an Abstract Type which can hold all the possible addresses of the Farmers.
4. PHONE_NUMBER is an Abstract Type which can hold all the possible phone number of
Farmers.

2) The following types are also used in the system for determining the status of Silo, Responses
for the operations taken by the Silos and also the operations performed by the silos.

STATUS :: Full  Available Busy

RESPONSE :: Success Failure

OPERATION :: Load  Unload

1|Page
1. Silo
 The Knownsilo is  NAME is a powerset that contains the names of all the silos which
are already entered into the system.
 Capacity is a function which returns the capacity of a given name of a silo.
 Quantity is a function which returns the quantity of a given name of a silo.
 Queue is a function which returns the queue of a given name of a silo.
 Status is a function which returns the status of a given name of a silo.

InitSilo

 Silo



 knownsilo = 



Silo

knownsilo :  NAME

siloCapacity : NAME  

 siloQuantity : NAME  

 siloQueue : NAME seq 

 siloStatus : NAME  STATUS



 knownsilo = dom siloCapacity

 knownsilo = dom siloQuantity

 knownsilo = dom siloQueue

 knownsilo = dom siloStatus

 x : siloQuantity(x) siloCapacity(x)siloQuantity(x) 0



 Enter_new_silo 

2|Page
 Silo

 name? : NAME

capacity? : CAPACITY

 quantity? : QUANTITY



 name? : Knownsilo

 Silo’ = Silo  { name?  capacity? }

 Silo’ = Silo  { name?  quantity? }



2. Ship.
 The Knownship NAME is a powerset that contains the names of all the ships which
are already entered into the system.
 shipCapacity is a function which returns the capacity of a given name of a ship.
 shipQuantity is a function which returns the quantity of a given name of a ship.
 shipNationality is a function which returns the Nationaltiy of a given name of a ship.

3|Page
InitShip

 Ship



 knownship = 



Ship

knownShip :  NAME

 shipQuantity : NAME  

shipCapacity : NAME  

 shipNationality : NAME  NATIONALITY



 knownship = dom shipQuantity

knownship = dom shipCapacity

knownship = dom shipNationality

 x : shipQuantity(x) shipCapacity(x) shipQuantity(x) 0



3. Truck.
 The KnownTruck  NAME is a power set that contains all the registration number of
trucks which is already registered in the system.
 truckEmptyWeight is a function which returns the weight of a given registration number
of a truck.

4|Page
 truckQuantity is a function which returns the quantity of a given registration number
truck.
 The truckQuantity must be greater than or equal to zero.

InitTruck

 Truck



 knownTruck = 



Truck

knownTruckRegoNo :  

truckEmptyWeight : Name  

truckQuantity : Name  



 knownTruck = dom truckEmptyWeight

knownTruck = dom truckQuantity

x : truckQuantity(x) 0



 Accept_delivery

 Truck

 regono? : REGONO

truckemptyweight? : TRUCKEMPTYWEIGHT

5|Page
 quantity? : QUANTITY

 farmer name? : KNOWNFARMER  NAME

 operation! : OPERATION



 regono? :  Known

OPERATION ! = truck(rego?)



4. Farmer
 The KnownFarmer NAME is a power set that contains all the names of the farmers
which are already entered in the system.
 farmerAddressis a function which returns the address of a given name of a farmer.
 farmerPhone is a function which returns the phone number of a given name of a farmer.

InitFarmer

 Farmer



 knownFarmer = 



Farmer

knownFarmer :  NAME

farmerAddress : NAME  ADDRESS

 farmerPhone : NAME  PHONE



 knownFarmer = dom farmerAddress

 knownFarmer = dom farmerPhone

6|Page


5. Farmers Account
 The globalOp is a powerset of numbers which represents the operation number.
 globalOpNo is a number which is the current operation number.
 siloName is a function which returns the name of a silo for the given operation number.
 opName is a function which returns the operation number.
 vehicleName is a function which returns the name of a vehicle for the given operation
number.
 quantiy is a function which returns the quantity of a silo for the given operation number.
 farmerName is a function which returns the name of the farmer for the given operation
number.

Farmers_account

globalOp:  

globalOpNo : 

siloName :   NAME

 opName :   OPERATION

 vehicleName :   NAME

 quantity :   

 farmerName :   NAME



globalOp = dom siloName

 globalOp = dom opName

 globalOp = dom vehicleName

 globalOp = dom quantity

 globalOp = dom farmerName



7|Page
6. References
The Z Notation. (2015). Retrieved 5 October 2015, from http://www.rose-
hulman.edu/class/cs/cs415/zrm.pdf

YouTube,. (2015). Introduction to Z Notation. Retrieved 5 October 2015, from


http://www.youtube.com/watch?v=qfEe9luJmVE

8|Page

You might also like