Formal specifications are used to describe systems in a clear and precise manner using mathematical notations borrowed from formal logic and the set theory (Somerville, 2013). They provide an abstraction of the system from a high level point of view (Partsch, 2012). This means that the users and developers know what the system is going to do before they go into the specific details of how that will be achieved. The specification acts as a kind of central repository because analysts, developers, testers and users all refer to it at one point or another in the system development lifecycle.
In general formal specifications reduce the overall cost of system development and reduces ambiguity and therefore errors as the system keeps getting developed (Sommerville et al., 2012).
The Z notation is a formal specification method which models the behavior of the proposed system in decomposed, small units known as schemas. Schemas are depicted using mathematical notations from the set theory and predicate logic (Klein, Sawicki, Roos-Frantz & Frantz, 2014).
Schemas represent the dynamic and static aspects of the system. The dynamic aspects include the operations that can be carried out, relationships between inputs and outputs and changes of state. The static aspects include the possible states the system can be in (state space) and the relationships between them.
The structure of a schema consists of the title of the schema, the declaration part, where variables are declared, and the predicate section, where conditions and relationship between variables and functions are specified. The figure below illustrates.
Figure 1: Structure of a schema
The predicate part can be optional and is assumed to be true when absent.
Variables are declared in the form x:T, where x is the variable and T is the data type. Predicates use mathematical symbols from the set theory and logic to represent an expression. Z notation particularly employs the Zermelo-Fraenkel set theory and the typed first order predicate logic for these expressions. An example of a predicate could be x∈S, where x is an element which exists in the set S.
The Z notations used for the library system schema include:-
? – Declares a variable x to be a subset of Y. Its syntax is x: ?Y
? – Indicates partial dependence of a variable y on a variable x. The syntax is of the form x?y
Δ – It is known as a delta and shows that the current function causes a change in system state, for example when a new item is added.
Ξ – It is known as Xi and indicates that the current function does not alter system state
∪- Indicates a union between set A and B. Technically it represents an addition of an element to a set X in a schema
∈- Indicates that an element x is a member of a set Y. Its syntax is x∈Y
∉ – Indicates that an element x is not a member of a set Y. Its syntax is x∉ Y
? -Indicates a difference between two sets A and B, with A being the larger set which contains all the elements present in set B. The syntax is A?B
? –Is used to indicate input variable x. Syntax is of the form x?:TYPE
! – Is used to indicate output variable x. Syntax is of the form x!:TYPE
This is the main schema for the entire system on which changes will be effected as depicted in the function schemas.
Library
known: ?BOOK
name: ?NAME
lending: NAME?BOOK
reservation: NAME?BOOK
AddBook
ΔLibrary
bookID?:BOOK
ISBN?:BOOK
title?: BOOK
bookID? ∉ known
ISBN? ∉ known
title? ∉ known
known′ = known ∪{bookID?ISBN? ?title?}
DeleteBook
ΔLibrary
bookID? : BOOK
ISBN?:BOOK
bookID? ∈ known
ISBN?: ∈ known
known′ = known ?{bookID??ISBN? ?title}
AddBorrower
ΔLibrary
name? : NAME
name? ∉ name
name′ = name∪ {name?}
DeleteBorrower
ΔLibrary
name? : NAME
name? ∈ name
name′ = name ? {name?}
LendBook
ΔLibrary
name? : NAME
title?: BOOK
bookID:BOOK
ISBN:BOOK
name? ∈ name
title? ∈ known
lending′ = lending ∪ {name? ?bookID?ISBN?title?}
ReturnBook
ΔLibrary
name?: NAME
title: BOOK
bookID?:BOOK
ISBN:BOOK
name? ∈ lending
lending′ = lending? {name??bookID??title?ISBN
EnquireBook
Ξ Library
title?: BOOK
book!: BOOK
bookID:BOOK
ISBN:BOOK
book! = known(title? ?bookID?ISBN)
Reserve book schema
ReserveBook
ΔLibrary
title?: BOOK
name?: NAME
bookID:BOOK
ISBN:BOO
name? ∉ reservation
reservation′ = reservation ∪ {name??title? ?bookID?ISBN}
EnquireReservation
ΞLibrary
name?: NAME ISBN:BOOK
title: BOOK result!:reservation
bookID:BOOK
result!= reservation(name??title?bookID?ISBN)
CancelReservation
ΔLibrary
name?: NAME
title:BOOK
bookID:BOOK
ISBN:BOOK
name? ∈ reservation
reservation′ = reservation? {name??title?bookID?ISBN}
In this predicate, the title of a book is output automatically when a borrower’s name is keyed into the system. Hence there is no direct relation between the known function and the title.
Object Z is a new object oriented formal specification technique based on the earlier developed Z notation. It is therefore, in essence, an extension of Z (Smith, 2012). The view of the system is that of objects communicating with one another. It is necessary, therefore, that all the object oriented principles are followed including encapsulation, polymorphism, inheritance and persistence.
Singh, Sharma, and Saxena (2016) have proposed a new approach of integrating UML and Z notation. This comes about as a result of rigorous use of mathematics in formal methods. Therefore, they suggested that a bridge is required between UML and formal methods to overcome the insufficiencies. Research and development continues.
Conclusion
Formal specification techniques have been seen to be useful in large scale system development as they reduce ambiguity and therefore errors in the final deliverable. This makes them invaluable tools both in the software and industrial engineering fields. As can be seen in the previous sections, these techniques keep being improved through research and development
References
Klein, M. J., Sawicki, S., Roos-Frantz, F., & Frantz, R. Z. (2014). On the Formalisation of an
Application Integration Language Using Z Notation. In ICEIS (1) (pp. 314-319).
Partsch, H. A. (2012). Specification and transformation of programs: a formal approach to
software development. Springer Science & Business Media.
Singh, M., Sharma, A. K., & Saxena, R. (2016). Formal Transformation of UML Diagram: Use
Case, Class, Sequence Diagram with Z Notation for Representing the Static and Dynamic Perspectives of System. In Proceedings of International Conference on ICT for Sustainable Development(pp. 25-38). Springer, Singapore.
Smith, G. (2012). The Object-Z specification language (Vol. 1). Springer Science & Business
Media.
Sommerville, I. (2013). Software Engineering: Pearson New International Edition. Pearson
Education Limited.
Sommerville, I., Cliff, D., Calinescu, R., Keen, J., Kelly, T., Kwiatkowska, M., … & Paige, R.
(2012). Large-scale complex IT systems. Communications of the ACM, 55(7), 71-77.
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Contact Essay is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Essay Writing Service Works
First, you will need to complete an order form. It's not difficult but, in case there is anything you find not to be clear, you may always call us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download