ProductsLogo
LogoStudy Documents
LogoAI Grader
LogoAI Answer
LogoAI Code Checker
LogoPlagiarism Checker
LogoAI Paraphraser
LogoAI Quiz
LogoAI Detector
PricingBlogAbout Us
logo

Formal Specification with Z Notation

Verified

Added on  2020/03/23

|20
|4444
|171
AI Summary
This assignment delves into the Z notation, a formal specification language used to describe software systems precisely. It provides an overview of Z's principles, syntax, and various schemas. Students are expected to understand how Z is used to define system behavior and relationships, analyze its benefits for software development, and explore practical examples demonstrating its application in specifying access control systems. Resources like lecture notes, papers, and online tools are provided to guide learning.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Software Engineering
Methodologies

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Table of Contents
1. Introduction.......................................................................................................................................1
2. Z- Language specification.................................................................................................................2
3. Z- Schema...........................................................................................................................................2
4. WTC...................................................................................................................................................6
5. Z Schema Procedures........................................................................................................................7
6. Z-Schema Conventions:....................................................................................................................8
7. Structural Modeling Constructs of Z schema..................................................................................9
8. Z-scheme for WTC system..............................................................................................................10
9. Z schema WTC Coding...................................................................................................................13
10. Conclusion....................................................................................................................................14
References................................................................................................................................................15
1
Document Page
1. Introduction
The project relates in evolving z schema formal specifications for the Wheat Truck
control System. The accounts of wheat farmers & Truck Deliveries to and from Portland Wheat
Board silos will be handled by an automated system. The basics of Z schema, its operations, and
state spaces of WTC system will clearly be defined. Z-language specification will be described
and explained clearly. Features of z schema, WTC refinement and its conventions will be clearly
defined. The z schema operations for Wheat Truck Control System and its initialization
operations will be clearly mentioned. The structural modeling constructs for Z-schema based on
WTC system will be described. The Z schema will be used as per the material provided as per
the information. Z-schema for WTC system will be investigated and provided. The Z-schema for
WTC coding will be provided as a separate section.
2. Z- Language specification
The formal specification language based on Z-notation which is used for recitation and
representing the computing based systems. Z language is labeled as a Software where
Mathematical Function carried out. It defines a software by using functions and the relation in
between. This formal language pressures that the,
It mainly helps in removing the Ambiguity in the requirement and avoid the
reasoning errors, mistakes and proving the executing description correct allowing to
the requirement.
It helps to achieve methodical deduction of programs grounded on the predicate
language.
It automates QA techniques and also performs computing systems and Automated Testing
the models .The concept used for reasoning and specifications ("Software Engineering Mike
Wooldridge", n.d.). Data: Sets, Relations and Functions, bag, sequences.
Logic: Predicated Language and Propositional Language ("The Z Specification Language",
2017)
2
Document Page
3. Z- Schema
Z-Schema:
Z is recognized description language for the computer systems that is based on the set theory and
the predicate logic.
The Z schema is a 2-dimensional (2D) graphical symbolization for describing:
a. state spaces and
b. Operations.
Z-schema Language
The Z-schema is also known as a formal language which is based on the z-notation. Basically z-
schema can explain as well as modeling the computing based systems. It also referred as the
structure of the system; it is a 2-Dimensional graphical notation for describing the following,
i. State Spaces
ii. Operations (Butler, 2001)
This language is full and fully based on the typed set theory. It is built upon schemas. It contains
Basic building blocks
Permit modularity
Simple to understand via the graphical presentation ("Z lecture notes: Schemas and
Schema Calculus", 2017)
Z-Schema
i. Schema predicates at all times true (Spivey, n.d.)
ii. Predicates can pass on only to component is in the signature.
Types
Types are mainly used to differentiate the multiple of data which is present in a particular
specification by using this type, there are many advantages that is,
It helps in the specifications of structure that is differentiating by the objects.
It can also prevent the errors by not permit the meaningless sentence, which is checked
by the computer.
3

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Data Dictionary Specification
Data dictionary is one of the most important parts of the CASE system. It is mostly used to keep
track the each and every system names. The data dictionary structure contains the item name,
description and the data of creation (Stepney & Lord, n.d.).
A system requirement in Z consists of some state variables, an initialization, and it also contains
set of actions on state variables. The state variables is also having some invariants that is
associated with them demonstrating “healthiness conditions” which must always be well
satisfied. Usually all of these are quantified using schemas (Saiedian, 2007).
For example, the state variables of a counter system may be specified using the following
schema:
• Definition of schemas symbolization:
A vertical-form schema is either of the form the following
The above shows how schema should represent. It can also be written as the follwing
• Once presented that the Schema Name will be related with WTC schema proper, which is the
contents
The statements part of the schema will contain: –
I. A brief list of variable declarations
II. References to other schematics. this is also called schematic inclusion.
• Variable statements have the usual form:
x1, x2, . . . , xn. It has n values.
The predicate part of a schema includes a list of predicates, detached either by semi-colons or
new lines. This is the format of schema.
In Z, schemas are
4
Document Page
It is mainly used to define both the static and dynamic aspects of a scheme.
The static aspects include the following. They are
The conditions it can take
The invariant relationships that are preserved as the scheme to state.
The active aspects include:
the actions that are conceivable
the association between their inputs and the relevant outputs
The variations in the state that happen.
The formal model commonly used for an access manage system which can permits the
users and services from various administrations in order to communicate with each other, while
still permitting the administrators to maintain the control of their individual elements of the
network. The formal model, written by using the Z specification Language, has been developed
as the accesses manage system.
Formal methods can able to assist in order to achieving the most of the important properties; in
particular:
i. Un Ambiguity
ii. Verifiability
iii. Reliability
iv. Succinctness and neatness
v. Annotation
Advantages
Unambiguous descriptions that is one unique understanding of a model which is
specified in a formal notation.
Analyze the product. That the property contains both the completeness and
reliability that can be checked by using the mechanisms.
Disadvantages
Mathematical skills, interest are essential
The improvement and confirmation process is very costly and effort-intensive
Complexity may blow up with the dimension of the difficulty and it can become
uncontrollable
5
Document Page
While the Formal Methods can be useful during the variety of stages of the overall software
improvement, their maximum impact would be done during the in the early stages, that is the
modeling and requirement stages
Program confirmation can be well thought-out in a secondary concern.
Z-notation Features:
Decomposition of specification into many small pieces (Schemas) that helps in
describing both static and dynamic aspects in the field of system (Groves, 2017).
Data Refinement:
It helps in representing the abstract data in the specification. Direct Refinement: Go directly
from specification to design.
4. WTC
In the project, WTC has to implement in Z-schema. Some basic descriptions regarding WTC
is explained below. Wheat and other breakfast cereal grain making is a land concentrated, an
effective and energetic transportation system is spirited to the capability of these farmers to
participate in international market place. The participation between and volume of those modes
have provided well-organized and market place approachable service in region (Parziale,
Gunreben, Miranda, W Novak & Werner, 2015).
The Wheat produce happens throughout late seasonal as the crop develops ready. Due to
harvest, more amount of wheat is passed by farm truck to initial storage. Till current periods,
such activities are directed by the smaller trucks, though these trucks are constantly replaced by
the larger trucks passed up to 26 tons of wheat production at a time.
6

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
A single load of wheat evaluates approximately a 60 pounds, production the whole mass of
the 2012 crop approximately 4.23 millions of tons. This harvest can produces an appraised
162,716 trucks of trips among the grain and farm silo.
5. Z Schema Procedures
First generate a Z schema that sufficiently defines the Wheat Truck Control system. It must
include single state space in WTC. The basic operations of the Z schema is given below,
An initialization procedure named Init. (Liapis, 2008)
The process enter new silo that a worker customs to come up with the truths of a fresh
silo into the structure system. The silo is presently empty (Concrete stave silos, brooks
patent, 2010).
7
Document Page
The process Accept delivery that a worker customs to signal the system to begin off-
loading x tons of materials from the truck. The entire system need do a verification
process in Wheat truck Control system. If that loading or storing capacity is obtainable in
silo container, if not then a fault or error message must be production output and no
automobile or truck unloading done. Extra data desired through routine is the truck
recording, registering as well as farmer’s address and name (Coutts, n.d.).
The procedure and process stores total essential particulars into the system organization
for that distribution delivery (Commission, 2010).
If an automobile is previously drop, after that new automobile will be located in a line
and to come for turn to drop.
The process Leave queue performed. The process is in track through the scheme operator
every period there is a line for a silo and driver of an identified automobile selects the
expected waiting period is extended and they leave (Shagaida, 2016).
The process results to the worker the number of automobiles in the queue after the
indicated truck is eliminated. The sensible faults will be shown when nobody or none in
the line.
The action Silo account in WTC provides the overall amount of wheat in tons and it’s
supplied to a specific silo via ALL farmers in a quantified time period. It provides the
global operation number in simplified systems (O’Keeffe & Neave, 2017).
For instance, global operations between 10000 and 10500 in WTC ("Glossary of Z
notation", 2017).
The process Ships_total_account delivers the total number of wheat and amount of wheat
in certain ship and it has taken from entire silos in the whole history of the system.
The process framers_account in Wheat truck control system provides the wheat amount
and it’s supplied to all silos in between two specified global operation numbers. The
global operation number is 10000 and 10500 ("z-schema", 2017).
6. Z-Schema Conventions:
Place the name of the schema in declaration part. It is done by using-‘includes’, by using
variables in it.
Input variable name is terminated by question mark (?).
8
Document Page
Only input will be variable name.
The output variable is terminated by an exclamation mark (!).
The ≡ (Xi) symbol means that schema is not changed.
If we write ▲ (delta) instead of ≡ then it means that Schema will change.
The post condition is defined by using ‘tel’ .The pre- condition is defined by using
‘Known’ and it is under variable name.
7. Structural Modeling Constructs of Z schema
Based on previous discussion, this paper means to formalize the features of a component in a
model with few showing elements of component in z schema. There are many modeling
elements the following describes and helps in designing few of those elements.
Service
Class
Interfaces:
a. Service:
A service can be well-defined as a small part of requirement. It specifies that the thing user
is doing. A service comprises an Eid for itself, a Cid for a class, and the explanation where it
defines the service it delivers which has declared generally at the time of type inspection. A
service can be graphically noted as a triangular box ("FpML Coding Schemes (Master
View)", 2017).
b. Class:
A class can be well-defined as a collection of facilities i.e., the overall description of the related
services. It apparatuses one or more border also. A class covers and Cid for itself, and an Eid
where Eid are taken from the area of services (GmbH, 2017).
Another condition is that Eid must have a limit which means it specifies that how many facilities
can be occupied by the class. A class can be graphically noted ascircle. Figure 1(b)shows the Z
specification of class.
c. Interfaces:
It defines the physical nature of a system and is only used for examination syntactic needs and
compositionality. They are represented in terms of signatures of service operations.
9

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
There are many user interfaces.
Cid has the area of the class. It must have a boundary which specifies many classes may use or
implement this interface. An interface can be realistically noted as pipe.
Component:
It is a group of classes and boundaries by which the small sections of specification can be
combined into single unit. A module contains a Coid for itself.
Cid and Iid where Cid & Iid are taken from the area of class and interface correspondingly and
they have bounds which helps in specifying that how many modules or border maybe collected
in the components. A module can be realistically noted as a rectangular box. The limit is a
worldwide variable.
8. Z-scheme for WTC system
[Truck] set of distinct trucks ("Sample:The Formal Specification Language Z", 2017)
[Silos] set of silos
[Queue] the set of all Queue at this silo
[Ships] The set of all Ships that have been registered
[Farmers] the set of all farmers that supply wheat to Silos
Initialization Operation
The below operation is done.
Operation Init;
Start
1. Login to Wheat Control system
2. Select operation to perform
3. Execute the operation
4. Accept result
End
As a first step login into WTC. Then select the operation which is needed to perform. Further,
execute the operation which needs to be done. The results generate as the final results are the
outcome.
The name of the operation is Entering new silo account.
10
Document Page
Operation Enter_new_Silo;
Start
1. Open new account for Silo.
2. Enter name , Name should be unique from the stored list.
3. Enter Storage Capacity.
4. Display-Silo is currently empty.
End
A new sil account is created. After creating enter the name. the name provided
Operation Accept Delivery
Start
1. Select Operation Accept Delivery.
2. Verify Truck Registration No.
3. Verify Farmer Name
4. Check load in Truck (XIA & GENG, 2013)
5. Check if Silo has capacity to store this load(Silo Capacity> current Silo Load+
Truck Load)
6. If Silo can store load then
7. Check loaded status of Truck (Unloaded or Not Unloaded)
8. If not unloaded then unload wheat from Truck
9. Else bring next Truck from the Queue
10.Perform Operation Accept Delivery.
End
Operation Leave_Queue
Start
1. Select Operation Leave_Queue .
2. Check Truck Queue
3. If no truck in queue then display message “ No Truck in the queue”
11
Document Page
4. If trucks in the queue then update Queue status(No of Trucks in queue, Truck R. No,
Driver Info, Farmer info, sequence no of Truck in queue)
5. Check if any driver wants to leave as the queue is too long and it will take more time in
queue
6. Then update status of the Queue
End
Operation Silo_Account:
1. Start
2. Select operation Silo_Account
3. Display List of Delivered Truck on the Silo
4. Perform sum of amount of wheat delivered (Sum=weight(truck1+truck2+………….truck
n)
5. Display Sum (Stepney, Barden & Cooper, 1992)
End
Operation Ships_Total_ Account:
Start
1. Select Operation Ships_Total_Account
2. Display List of Silos from where the Wheat is loaded on the Ship.
3. Perform Sum of amount of wheat delivered (Sum=weight(Silo1+Silo2+…………Silo n)
4. Display Sum
End
Operation Farmer_Account
Start
1. Select Operation Farmer Account
2. Display list of Farmers that delivered weight on silos
3. Accept Farmer no
4. Display Farmer details
End
Z-Schema for Wheat control Truck-
12

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Wheat control truck System
Operation Init (Jacky, 2010)
Z SCHEMA
STATUS ::= disabled | off |on | error
CURRENT == -200.00..800.00 |silo amount
More description for the z schema in Wheat truck control system
WTC
Mainnfid : STATUS
Mainfid_init, enter silo acc, accept delivery, leave query, silo acc, ships total acc, farmers acc :
CURRENT
Rf : Status
Wtc : WTC
TurnonMain fid
Wheat truck control
Mainfd =! Disabled
Mainfid_init = mainfd_enter silo acc
Turnonsilo
Wheat truck control
13
Document Page
Rf =! Disabled
Rf1 € {on, error}
NAME: Silo Storage Capacity
Not valid Entry}
Display Status→ Silo Presently Empty
S:Silo detail part Updated and Simplified
The status is displayed and the silo is presented as empty.
Operation Accept Delivery
WTC (Wheat Cntrol Truck System)
Farmer→ Wheat Truck→ Silo
Name ? Receive Delivery
The operation for the delivering of WTC is provided above
Operation Leave_Queue
Wheat Control Truck System
Wheat Truck→Queue→Silo
Name ? Leave_Queue
Result! Status of the Queue
The final results is provided above with the needed variables.
The silo storage capacity in wheat truck control system contains the silo format and
queue format. It performs the operation by queue and produce the result.
Farmers in WTC system
14
Document Page
It maintain a record of separate farmer providing wheat to the silo. Detail parts of the WTC
(Wheat Truck Control System) contain the farmer’s phone number, address and name details.
9. Z schema WTC Coding
A Z specification consists of combination of a formal mathematics and an informal English text.
The Formal mathematical part provides the precise, explicit definition of the WTS System. The
informal text is considered as a commentary on the formal part. It can be referred to find out on
what aspects of the WTS system are being done (Derrick & Boiten, 2014).
The state of the WTS system is being explained by the Z schema and the loading and
unloading process are being carried out with the use of Z schema. A schema box has two parts
namely signature and predicate, here the signature is considered as Silos where the wheat is to be
stored and predicate holds the condition of which Silos is to be filled with which ship, truck and
farmer. The term ‘after’ are primed variables and ‘before’ give the state of the unprimed
variables.
Name
Silos
//
Operation accept delivery
Enter (S, CS, T) =
//The operation name is entered and the process is started.
if Horsham_1 (S, CS ) then S exception (Wheat already in Silos)
//if the provided condition doesnot suits, the process is proceeded with else account by loading
the value of S and T
elsif Loaded (S, T) then S exception (Conflict)
//if the elseif condition fails, then the values added are S, CS, and T
else Put (S, CS, T)
Leave (Create, CS) = Create exception (Wheat not in Silos)
Leave (Put (S, CS1, T1), CS) =
if CS = CS1 then S else Put (Load (S, CS), CS1, T1)
15

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
//Changing the position of S,CS and T is performed below
Move (S, CS, T) =
if S = Create then Create exception (No wheat in silos)
the alternate condition is provided below.
elsif not Melbourne (S, CS) then S exception (Wheat not in Silos)
elsif Loaded (S, T) then S exception (Conflict)
else Put (Load (S, CS), CS, T)
// -NO-WHEAT is a constant indicating that a wheat must be loaded
Lookup (Create, CS) = NO-WHEAT exception (Wheat not in Silos)
Lookup (Put (S, CS1, T1), CS) =
if CS = CS1 then T1 else Lookup (S, CS)
Loaded (Create, T) = false
Loaded (Put (S, CS1, H1), H) =
if (T1 > Tand T1 - T ) 300) or (T> T1 and T - T1 ) 300) then true
//if the condition fails when subtracting and computation happens, the the else condition
proceeds be loading S and T
else Loaded (S, T)
Horsham_1 (Create, CS) = false
//The condition fails and proceeded to the next step which is final
Horsham_1 (Put (S, CS1, T1), CS ) =
//Finally it ends by added values of S,CS1, T1 in CS
End
10.Conclusion
The project describes in the formal conditions in Z schema for the Wheat Truck control
System. The accounts of wheat farmers & Truck Deliveries to and from Portland Wheat Board
silos is handled by an automated system. The Z schema used as per the material provided as per
the information. The basics of Z schema, its operations, and state spaces of WTC system is
clearly defined. Z-language specification is described and explained clearly. Features of z
schema, WTC refinement and its conventions is clearly defined. The z schema operations for
16
Document Page
Wheat Truck Control System and its initialization operations is clearly mentioned and is
provided. The structural modeling constructs for Z-schema based on WTC system is described.
The Z schema is used as per the material provided as per the information. Z-schema for WTC
system is investigated and provided. The Z-schema for WTC coding is provided as a separate
section.
References
Butler, M. (2001). Introductory Notes on Specification with Z. Retrieved from
http://www.bowdoin.edu/~allen/courses/cs260/readings/ztutorial.pdf
Commission, P. (2010). Wheat Export Marketing Arrangements. SSRN Electronic Journal.
http://dx.doi.org/10.2139/ssrn.1724996
Concrete stave silos, brooks patent. (2010). [Place of publication not identified].
Coutts, M. Stepping away from the silos.
Derrick, J., & Boiten, E. (2014). Refinement in Z and Object-Z. London [u.a.]: Springer.
FpML Coding Schemes (Master View). (2017). Fpml.org. Retrieved 26 September 2017, from
http://www.fpml.org/spec/coding-scheme/
Glossary of Z notation. (2017). Staff.washington.edu. Retrieved 26 September 2017, from
https://staff.washington.edu/jon/z/glossary.html
GmbH, a. (2017). Daxner Bulk Solids technology - Mills. Daxner.com. Retrieved 26 September
2017, from http://www.daxner.com/en/Solutions/Food-and-beverages/Milling-systems/15-
Truck-loading-silo-system-boosts-efficiency
Groves, L. (2017). Refinement and the Z Schema Calculus. Retrieved 26 September 2017, from
Jacky, J. (2010). Way of Z. Cambridge, GBR: Cambridge University Press.
Liapis, P. (2008). Causality of EC Wheat Export Subsidies and U.S. Wheat Export
Prices. Canadian Journal Of Agricultural Economics/Revue Canadienne
D'agroeconomie, 37(4), 1155-1164. http://dx.doi.org/10.1111/j.1744-7976.1989.tb00826.x
17
Document Page
O’Keeffe, P., & Neave, M. (2017). Experiences of wheat growers in Australia’s western
Wimmera following deregulation of the export wheat market. Rural Society, 26(1), 1-17.
http://dx.doi.org/10.1080/10371656.2017.1283736
Parziale, L., Gunreben, B., Miranda, F., W Novak, P., & Werner, K. (2015). The Virtualization
Cookbook for IBM z Systems Volume 3: SUSE Linux Enterprise Server 12. Retrieved from
http://www.redbooks.ibm.com/redbooks/pdfs/sg248890.pdf
Saiedian, H. (2007). Developing Formal Specifications in Z. Retrieved from
https://people.eecs.ku.edu/~hossein/Teaching/Fa09/814/Lectures/z.pdf
Sample:The Formal Specification Language Z. (2017). Csci.csusb.edu. Retrieved 25 September
2017, from http://www.csci.csusb.edu/dick/samples/z.html
Shagaida, N. (2016). Russiaas Wheat Export. SSRN Electronic Journal.
http://dx.doi.org/10.2139/ssrn.2874810
Software Engineering Mike Wooldridge. Retrieved from
http://www.cs.ox.ac.uk/people/michael.wooldridge/teaching/soft-eng/lect11.pdf
Spivey, J. The Z Notation. Retrieved from
http://teaching.csse.uwa.edu.au/units/CITS2220/readings/zrm.pdf
Stepney, S., & Lord, S. Formal Specification of an Access Control System. Retrieved from
https://www-users.cs.york.ac.uk/susan/bib/ss/z/acs.pdf
Stepney, S., Barden, R., & Cooper, D. (1992). Object orientation in Z. London: Springer-Verlag.
The Z Specification Language. (2017). Rbjones.com. Retrieved 25 September 2017, from
http://www.rbjones.com/rbjpub/cs/csfm03.htm
XIA, L., & GENG, W. (2013). Personal Self-Support, Self-Schema, and Other-Schema. Acta
Psychologica Sinica, 44(4), 478-488. http://dx.doi.org/10.3724/sp.j.1041.2012.00478
Z lecture notes: Schemas and Schema Calculus. (2017). Staff.washington.edu. Retrieved 26
September 2017, from https://staff.washington.edu/jon/z-lectures/schema.html
z-schema. (2017). npm. Retrieved 26 September 2017, from https://www.npmjs.com/package/z-
schema
18

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
19
1 out of 20
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]