You are on page 1of 8

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

Defining web services and data through mathematical expressions in


Z-language
Festim HALILI1, Burhan RAHMANI2, Merita KASA3
Departament of Informatics - State University of Tetova, Macedonia
2
Departament of Informatics - State University of Tetova, Macedonia
3
Departament of Informatics - State University of Tetova, Macedonia
festim.halili@unite.edu.mk, burhanrahmani90@gmail.com, merita.kasa@gmail.com
1

Abstract
During the last few years, the field of software engineering has witnessed an increased interest in formal
methods and software reuse. Web services often are interconnected with databases with intention to
exchange data, and they represent a real solution for the reuse of the software components and the
reduction of costs. The Z notation is formal language used for describing and modelling computing
systems. It is targeted at the clear specification of computer programs and computer-based systems in
general. Based on the title of this paper, our intention is to define Web services and data through
mathematical expression in Z-language, because Z is based on the standard mathematical notation used
in axiomatic set theory.
After analysing and reading this paper, the readers should be familiar with the concept of Z-language and
also absorb the methods for defining the structure of the web services and data by using formal
specifications.
Keywords: web service, Z-language, XML, SOAP, WSDL, Formal Specification

1. Introduction
A new software technology was introduced in 1999, with intention to deal with obstacles in the
field of software; this new technology is called Web Services and they share three models of
computer programming: XML (Extensible Markup Language), WSDL (Web Services Definition
Language) and SOAP (Simple Object Standard Protocol) [1]. The main strength of web services
is the interoperability between heterogeneous platforms, meaning that they can be used in
different operating systems or different programming languages. As the complexity and cost of
software or applications have continually increased, researchers have attempted to alleviate the
software crisis.
The problems of producing reliable software quickly and economically have been widely
discussed in recent years, and initial experience has indicated that the use of mathematical
methods of specifying and designing software can contribute towards a solution.
Support tools have been implemented to help eliminate human error. Programming paradigms
other than the conventional, imperative model have been advocated. The style of software
specification and design known as Z has had a long period of development, which has for the
most part been characterized not by stability of notation but by its very opposite. In this paper,
we will model web services and data by using the Z logic to describe the operators involved for
solving the problems of programming the web services.
Z offers no such methodology allowing specifications in many different styles [2]. Zed Formal
specifications use mathematical notation to describe in a precise way the properties which an
information system must have, without unduly con-straining the way in which these properties
are achieved. They describe what the system must do without saying how it is to be done [3].
This abstraction makes formal specifications useful in the process of developing a web service or
designing databases consisting of data, because they allow questions about what the system does
to be answered confidently, without the need to disentangle the information from a mass of de

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

tailed program code, or to speculate about the meaning of phrases in an imprecisely-worded


prose description.
We can use the Zed language to describe the state of a system, and operations upon it. The Z
notation for specifying and designing software has evolved over the best part of a decade, and it
is now possible to identify a standard set of notations which, although simple, capture the
essential features of the method. According to the principle of using mathematics to document
specifications and designs, this means that we should try to describe the Z-notation itself in a
mathematical way [3].
The process of invoking Web services is very important; therefore the SOAP protocol is
established as the main function to exchange envelopes of messages between the service
provider and service requester [4]. By the time of writing this paper there are two versions of
SOAP: SOAP version 1.1 and SOAP version 1.2 which has brought some new benefits like: It is
cleaner, faster, better Web integration, more versatile.
There are three main types of SOAP Nodes, as described in the figure 1:
SOAP Sender: Generates and transmits a SOAP message
SOAP Receiver: Receives and processes the SOAP message and it also may generate
SOAP response, message or fault as a result.
SOAP Intermediary (Forwarding or active): it is both, a SOAP receiver and a SOAP
sender. It receives and processes the SOAP header blocks targeted at it and resends the
SOAP message toward an SOAP receiver.

SOAP
Sender

SOAP
Intermedi
ary

SOAP
Receiver

Fig. 1. SOAP Nodes


To summarize, SOAP is a method of accessing remote objects by sending XML messages, which
provides platform and language independence. It operates over different low-level
communications protocols, but the most typical protocol is HTTP [5].
Using the Z notation, we will model the content of Web services and the SOAP messages used
for transmission.
2. The mathematical expression
While modelling Web services, we have to indicate an important part of the Z method, which is a
standard library or tool-kit of mathematical definitions. This tool-kit allows many structure in
information systems to be described very compactly, and because the data type it contains are
oriented towards mathematical simplicity rather than computer implementation, reasoning about
properties of the systems is made easier.
The tool-kit begins with the basic operations of set algebra. In the table below are presented
already mentioned algebraic operations [6].

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

Table 1. Algebric Operations [6]

Symbol

Details

,
, , , P
, ,

Inequality, non-membership
Empty set, subset, non-empty sets
Set algebra

Next, the idea of relational as a set of ordered pairs is introduced, together with various
operations on relations. Again, the subset ordering plays a special part, in that many relations.
Functions are introduced as a special kind of relation, and injections, surjection and bijections
are introduced as special kind of function. Because functions are really relations, the operations
on relations may be used on functions too.
Table 2. Set of ordered pairs, functions and Natural numbers in Z-language schema

Symbol

Details

,
dom, ran
Id ; .
, , ,
N ,Z ,
+,-,*, div
min , max

Binary relations, maplet


Domain and range of a relation
Identity relational, composition
Injections, surjections, bijections
Natural numbers
Integers
Minimum and maximum numbers

Natural numbers are also introduced in Z-language schema, together with the ideas of iteration of
a relation and of finite sets and functions.
In addition, we will present a generalized example using some of these operations:
- Set union
- Set intersaction
\ - Set difference
Definition in Z-Schema:

Fig. 2. Z Schema using the given operations


The above table expresses the ordinary operations of set algebra. These members of the set S
T are those objects which are members of S or T or both. The members of S T are
those objects which are members of both S and T. The members of S/T are those objects which
are members of S but not T.
Before starting to use Z language for defining a specific type of Web services, firstly we have to
consider the laws applicable in this language:
= S S= S \ =S
S S=S

S
=S\S=
\ S=

International Journal of Science, Innovation and New Technology

S T= T S
S (T V) = (S T) V
T) V
S (T V) = (S T) V
T) V

vol. 1, no. 2/2011

S T= T S
S (T V) = (S
S (T V) = (S

S (T V) = (S V) (S V)
V) (S V)
(S T) (S \ T) = S
(S \ T) T =
S \ (T \ V) = (S \ T)

(S V)

(S \ T )\ V = S \ (T V)

(T V) = (S

S (T \ V) = (S T) \ (V \ S)
S (T \ V) = (S T) \ V

T
(S T) \ V = (S \ V)
V)

S \ (T V) = (S \ T) (S \ V)

3. Complicated systems of Z-language


Even the most complex Z specification is, from one point of view, nothing more than a
mathematical theory with a certain structure. Specification are built from components called
schemas [6]. Schemas are used to introduce state variables and to define constraints and
operations on the state. The Z schema presentation has been designed so that it stands out from
surrounding text, as shown in the figure below:

S chema name Schema s igna


ture

Schema pr
edicate

Container
contents :
capacity:
contents capacity
Fig. 3. The Structure of Z-Schema
An abstract data type consist of a set of states, called the state space, a non-empty set of initial
states, and a number of operations. The Z Specification can be seen as a collection of schemas,
which presents entities and invariant values, which is very important in modelling web services,
whilst the schema signature defines each name of the entity and type. The predicate indicates the
relations among entities which must appear.
A guide principle of the Z approach to specification has been the use of the ordinary structures of
mathematics in the writing of software specifications. There are several advantages in this: the
familiar language of sets and relations proves to be sufficient to describe the abstract structures
needed in programming [7].
To make it more convenient to declare these variables, there is a convention that whenever a schema
State is implicitly
State is introduced as the state space of an abstract data type, the schema
defined as the combination of State and State, unless a different definition is made explicitly. Many

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

data types have operations which access information in the state with-out changing the state at all. This
fact can be recorded by including the equation State = State in the post-condition of the
operation, but it is convenient to have a special schema State on which these access operations
can be built. Like State, the schema State is implicitly defined whenever a schema State is
introduced as the state space of a datatype:

Fig. 4. The Structure of Z-Schema


4. Modeling Web services and data in Z-language A case study
Web services and data can be created in different programming language and in different syntax,
but before doing that, the coder needs to have a structure or in some cases UML diagrams to
better understand the requirements of the clients. In our case, we will use the Z-language to
define the main issues and requirements for a specific case study; in addition we will model
schemas for managing a restaurant.
To explain the Z language and the impact of Web services, by using schema and different
operations, we will take as a case study the management of a restaurant through schemes. In the
phase of modelling we will express the operations for: addition, deletion and verification of
whether or not there is an article in a restaurant.

Fig. 5. Statement in the catalogue of items

Fig. 6. Adding in catalogue of items

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

The above Z-language schemas have defined the structure of listing the catalogue items Web
service and the schema for adding an item into the WSDL format of the web service. The
architecture of Web services uses the XML (extensible markup language) as a standardized way
for representing information in a structured and machine readable way, this means that the tags
of the XML are flexible and they adopt to the information that need to be stored or delivered to
the requester. It is designed to describe data and improve the functionality of the Web by
providing more creative and adaptable ways of information representation. The term extensible
means that its format is not fixed like HTML [8].

Fig. 7. Deleting an item in the catalogue of items

Fig. 8. Verify that article exist

Fig. 9. Verify that article doesnt exist:


The above three Z-language schemas, have defined the web methods of a Web service and the
activities which would be needed for a software managing a restaurant. In the figure 7, we can
percept the modelling of a web method for deleting an item from the catalogue of items, which

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

can be done by the invoking process in Web services and data, whilst the figure 8 and 9 are set to
verify if an article exists in the catalogue of items.
The modelling of data and Web services using the Z-language schemas is a very important step
for the communication between the service provider and service requestor, because it reduces
errors and the cost for the later maintenance of the system.
5. Conclusions
The emerging technology of Web services to exchange messages and data between different
enterprises or individuals encouraged many researchers to think for different types of modeling
Web services and data. In this paper we brought a prototype of mixture between Z-language and
Web services, with intention to establish the theoretical architecture of Web services for later
implementation and coding by the programmers. To evaluate our method, we consider two types:
quality of understanding a specification and a time needed for specification comprehension. Web
services are surprisingly complicated and their benefits are not always obvious, although the
basic ideas behind them are great, furthermore they are still under development and studies.
References
[1] T. Takase and M. Tatsubori, Efficient Web services response caching by selecting optimal
data representation, in Proc. The 24th International Conference on Distributed Computting
Systems, Tokyo, Japan, 2004, pp. 188-197.
[2] G. Smith, The object Z-Specification Language, Norwell, Massachusetts USA: Kluwer
Academic Publishers, 1999, pp. 2-3.
[3] L.B. Sherrell, D.L. Carver, FunZ Designs A Bridge between Z Specifications and Haskell
Implementations, in Proc. The 19th annual International Conference on Computer Software
and Applications (COMPSAC95), Dallas, Texas, 1995.
[4] J. Tekli, E. Diamanti and R. Chbeir, Differential SOAP Multicasting, in Proc. The IEEE
International conference on Web Services (ICWS), Crema, Italy, 2011, pp. 1-8.
[5] Tutorial : XML messaging with SOAP. developerWorks, IBM. [Online] Available:
http://www.digilife.be/quickreferences/PT/XML%20messaging%20with%20SOAP.pdf
Accessed [15.12.2011].
[6] I. Somerville, Model based Specification 11 Z-Schemas version 2.0, 2000. [Online]
Available:http://www.comp.lancs.ac.uk/computing/resources/IanS/SE6/IG/Z.pdf
Accessed
[21.01.2012]
[7] J.M.Spivey, Understanding Z: a specification language and its formal semantics Cambrige
Tracts in Theoretical Computer Science, Press Sindicate of the University of Cambridge,
New York, USA, 1992, pp.25-30.
[8] Festim Halili, Merita Kasa. Analysis and comparison of web service architectural styles,
and business benefits of their use. In Information Systems and Technologies and their
importance in the Economic Development. , pp. 701-707. University of Tirana, Republic of
Albania, 6 / 2011. ISBN: 978-99956-59-13-4.

International Journal of Science, Innovation and New Technology

vol. 1, no. 2/2011

Festim HALILI has graduated the Faculty of Contemporary Sciences and Technology in 2007.
He holds an MSc diploma in Computer Sciences from 2011 and till now he has been involved in
many projects and papers. Currently he is Assistant of Informatics within the Faculty of Natural
and Math Sciences in the State University of Tetovo. His work focuses on the field of Web
services, Artificial Intelligence and Data Modelling.
Burhan RAHMANI is an excellent student of the department of Informatics in the State
University of Tetovo, he holds a scholarship from the Ministry of Education in Rep. Of
Macedonia. His work focuses on the field of Software Engineering and Programming.
Merita KASA is an excellent student of the department of Informatics in the State University of
Tetovo, she holds a scholarship from the Ministry of Education in Rep. Of Macedonia. Her work
focuses on the field of Web services, Software Engineering and Programming.

You might also like