<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JSEA</journal-id><journal-title-group><journal-title>Journal of Software Engineering and Applications</journal-title></journal-title-group><issn pub-type="epub">1945-3116</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jsea.2015.810050</article-id><article-id pub-id-type="publisher-id">JSEA-60326</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Why Formal Methods Are Considered for Safety Critical Systems?
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>onika</surname><given-names>Singh</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Ashok</surname><given-names>Kumar Sharma</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Ruhi</surname><given-names>Saxena</given-names></name><xref ref-type="aff" rid="aff2"><sup>2</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Faculty of Engineering &amp;amp; Technology (FET), Mody University of Science &amp;amp; Technology, Sikar, India</addr-line></aff><aff id="aff2"><addr-line>Computer Science &amp;amp; Engineering, Thapar University, Patiala, India</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>Dhariwal.monika@gmail.com(OS)</email>;</corresp></author-notes><pub-date pub-type="epub"><day>12</day><month>10</month><year>2015</year></pub-date><volume>08</volume><issue>10</issue><fpage>531</fpage><lpage>538</lpage><history><date date-type="received"><day>20</day>	<month>March</month>	<year>2015</year></date><date date-type="rev-recd"><day>accepted</day>	<month>13</month>	<year>October</year>	</date><date date-type="accepted"><day>16</day>	<month>October</month>	<year>2015</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  Formal methods are the mathematically techniques and tools which are used at early stages of software development lifecycle processes. The utter need of using formal methods in safety critical system leads to accuracy, consistency and correctness in proposed system. In safety critical real time application, requirements should be unambiguous and very accurate which can be achieved by using mathematical theorems. There is utter need to focus on the requirement phase which is the most critical phase of SDLC. This paper focuses on the use of Z notation for incorporating the accuracy, consistency, and eliminates ambiguity in safety critical system: Road Traffic Management System as a case study. The syntax, semantics, type checking and domain checking are further verified by using Z/EVES: a Z notation type checker tool.
 
</p></abstract><kwd-group><kwd>Formal Methods</kwd><kwd> Safety Critical System</kwd><kwd> Z Notation</kwd><kwd> Z/EVES</kwd><kwd> Syntax &amp; Type Checking</kwd><kwd> Domain Checking</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Formal specification languages are mathematically based on languages which are adequately used for construction of accurate, consistent and unambiguous systems and software. As formal methods are equipped with tool, which can be used for both the prospective i.e. describing a system and later on for analyzing their functionalities. The major obstacles behind formal methods to be used in practices frequently are the time spent on specification [<xref ref-type="bibr" rid="scirp.60326-ref1">1</xref>] [<xref ref-type="bibr" rid="scirp.60326-ref2">2</xref>] . Nevertheless, formal methods do not guarantee correctness, but their use emphasize to increase the understanding of a system by divulging errors or facets of incompleteness that may be expensive to correct them at any later point of time. However, formal methods play a critical role in safety critical system as they focus on refinement of requirements in the early stage of development which consequently increase the system’s accuracy and consistency. Various formal languages are used for this purpose like VDM, B-Methods, Petri Net, and Z notation etc. Z notation is a model based on formal specification language which uses the set theory and first order predicates [<xref ref-type="bibr" rid="scirp.60326-ref3">3</xref>] .</p><p>A lot of work has been done in this area of formal analysis of UML diagrams with formal approaches [<xref ref-type="bibr" rid="scirp.60326-ref4">4</xref>] -[<xref ref-type="bibr" rid="scirp.60326-ref8">8</xref>] . In article 8, UML based framework is presented to develop web applications. [<xref ref-type="bibr" rid="scirp.60326-ref5">5</xref>] represents the verification properties by HOL theorem prover. A formalization approach is developed for UML class diagrams in [<xref ref-type="bibr" rid="scirp.60326-ref6">6</xref>] . The paper [<xref ref-type="bibr" rid="scirp.60326-ref7">7</xref>] advocates how the formal methods can be used for safety properties of real time critical application such as railways. [<xref ref-type="bibr" rid="scirp.60326-ref8">8</xref>] explains an integrated approach of Z notation and Pertinet for analysis of safety critical properties.</p><p>In this article, Z notation is used for formal analysis of safety critical system i.e. Road Traffic Management System which is further verified by using the Z/EVES tool.</p></sec><sec id="s2"><title>2. Proposed Approach &amp; Methodology</title><p>In the first part of this section, the proposed approach is discussed. Then the tool and methodology used are discussed in section.</p><sec id="s2_1"><title>2.1. Proposed Approach</title><p><xref ref-type="fig" rid="fig1">Figure 1</xref> defines the proposed approach for designing the safety critical system using the formal methods.</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> The proposed approach for formal analysis of safety critical application</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x5.png"/></fig></sec><sec id="s2_2"><title>2.2. Z/EVES</title><p>This tool is used for verifying the specification written in Z notation language. This verification includes syntax, semantics, type checking, and domain checking of the given system’s specification. Z/EVES present two type of interface: graphical user interface and the command line interface [<xref ref-type="bibr" rid="scirp.60326-ref3">3</xref>] [<xref ref-type="bibr" rid="scirp.60326-ref9">9</xref>] . In this paper, we used the graphical user interface for verifying and composing the specification which were written in Z notation language. Moreover, Z/EVES propose two mode of operations i.e. “Eager” and “Lazy”. In our article we use the “Eager” mode since in this mode a paragraph is checked if and only if all the previous ones are checked which is highly recommended for safety critical real time application. By using Z/EVES, following can be done:</p><p>・ syntax and type checking;</p><p>・ schema expansion;</p><p>・ precondition calculation;</p><p>・ domain checking;</p><p>・ general theorem proving.</p></sec><sec id="s2_3"><title>2.3. UML</title><p>Unified Modeling language is in fact the blue prints for the system to be developed. It provides a better way to understands the requirements of the propose system. UML consists of nine diagrams which are used for capturing the both aspects of the system i.e. static and dynamic [<xref ref-type="bibr" rid="scirp.60326-ref10">10</xref>] -[<xref ref-type="bibr" rid="scirp.60326-ref12">12</xref>] . This paper aims at the static behaviour by composing the use case diagram of RTMS system which is further verified by using Z/EVES type checker tool. The conceptual model of Road Traffic Management System (RTMS) is given in <xref ref-type="fig" rid="fig2">Figure 2</xref>.</p><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Use case diagrams of vehicle owner</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x6.png"/></fig></sec></sec><sec id="s3"><title>3. Formalization of Use Case Diagram Using Z/EVES</title><p>Z schema is the notion for structuring the specification including the pre, post condition and the list of invariant &amp; variables. Z schema has two parts i.e. declaration part and predicate part. The Z schema has both declaration as well as predicate part that is shown in <xref ref-type="fig" rid="fig3">Figure 3</xref>.</p><p>The above part of central line consists of variables declaration and the below part of line describes the relationship the variable’s various values. This paper emphasis on three main characteristics of formal analysis of safety critical system which are:</p><p>1) Syntax &amp; Type checking; 2) Schema Expansion; and 3) Domain checking.</p><p>1) Syntax &amp; Type Checking</p><p>The syntax and type checking facility is provided by the Z/EVES tool. The syntax &amp; type checking facility enables that the syntax used in Z specification is correct which is automatically done by Z/EVES tool. In case of road traffic management system, the schema of Vehicle Owner is considered for syntax &amp; type checking which is consists of two variables:</p><p>・ Vowner is the set of names with RTMS registered.</p><p>・ Regist Vowner is the function which when implemented on a particular Vehicle Owner name, provides the unique registration number associated with the person.</p><p>In <xref ref-type="fig" rid="fig4">Figure 4</xref>, the schema for Vehicle Owner with basic data type is given: [Name, Seqchar].</p><p>In Vehicle Owner schema, a partial function named “Regist Vowner” is defined which maps the corresponding vehicle owner with a registration number i.e.</p><p>Regist Vowner: Name→ Seqchar</p><p>Moreover, “Regist Vowner” is a one-to-one function which maps Vehicle Owner name with registration number. Since it is a one-to-one function, therefore every Vehicle Owner has a unique registration number and consequently, would be no ambiguity. The schema of Vehicle Owner is further verified by Z/EVES tool for syntax &amp; type checking in <xref ref-type="fig" rid="fig5">Figure 5</xref>. The left most columns’ value “Y” shows that the schema is implemented using correct syntax. If there would be any syntax error, it shows “N” instead of “Y” in syntax column [<xref ref-type="bibr" rid="scirp.60326-ref9">9</xref>] .</p><p>2) Schema Expansion</p><p>The schema expansion facility enables to extend the functionality of system and helps in understanding the complex schema structure in detail. Initially, the list of registered vehicle owner in RTMS is empty which is depicted by the “Init Vehicle Owner” schema in <xref ref-type="fig" rid="fig6">Figure 6</xref>.</p><p>Since the lower part of the schema explain the relation between the variables, the function Regist Vowner is assigned a value “f”, and means initially there is no registered vehicle owner in RTMS. <xref ref-type="fig" rid="fig7">Figure 7</xref> shows the Z/EVES result of “Init Vehicle Owner”.</p><p>Now, the Vehicle Owner may perform a list of tasks like: Login. If the Vehicle Owner is Login first time, he/she has to register him/her; otherwise he/she will sign in. In <xref ref-type="fig" rid="fig8">Figure 8</xref>, the schemas of Login operation is implemented.</p><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> State space of schema</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x7.png"/></fig><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Vehicle Owner schema with invariants</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x8.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> Syntax checking of Vehicle Owner schema by Z/EVES</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x9.png"/></fig><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Initial state space of schema Vehicle Owner</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x10.png"/></fig><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Initial Vehicle Owner schema</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x11.png"/></fig><fig id="fig8"  position="float"><label><xref ref-type="fig" rid="fig8">Figure 8</xref></label><caption><title> State space of schema Login</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x12.png"/></fig><p>In this schema:</p><p>Password: Vowner→Word</p><p>“Password” is a function which associates a username to password. Nevertheless, it is a one-to-one function which in turn provides accuracy and correctness to system. Now Signin set and registered set both is the member of power set of Vehicle Owner which is mathematically shown by using set theory as following.</p><p>Signin, Reg: ℙ Vowner</p><p>Also the Signin set is a subset of registered set and the registered set having the values which are there in domain of “password” function i.e.</p><p>Signin <inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/2-9302052x13.png" xlink:type="simple"/></inline-formula> Reg = Dom Password</p><p>Initially, Login schema is empty which is here explained by assigning a value “f” to both the set whether it’s a registers one or a new one i.e.</p><p>Reg = f; Signin = f</p><p>This is called schema expansion which is one of the key features of Z/EVES tool i.e. from “Init Login” schema to “Login” schema.</p><p>In <xref ref-type="fig" rid="fig9">Figure 9</xref>, the schema expansion is shown and verified by Z/EVES as follow.</p><p>3) Domain Checking</p><p>Domain checking feature of Z/EVES tool enables us to write the statements which are meaningful and in finding the domain errors. However, it has been found that as compared to syntax &amp; type checking, domain checking is more crucial because where syntax and type checking is done automatically, one needs to work together with theorem prover to accomplish the domain checking. We also observed that proof “by reduce” in the proof window of the tool was sufficient for our formal specifications for domain checking. Now if you are already registered, you will opt for the sigin option. By investigating <xref ref-type="fig" rid="fig1">Figure 1</xref>0, the value for syntax column is “Y”, means no error, but the value in proof column is “N”. This is related to domain checking. The proof can be initiated by selecting the theorem in the Specification window, right clicking, and selecting “Show proof” which is shown in <xref ref-type="fig" rid="fig9">Figure 9</xref>.</p><p>The proof can be done by various mean in Z/EVES by choosing “Action Point” by Reduction, Cases, Quantifiers, Normal Norms and Equality. In our case, we use the option “prove by reduction”. <xref ref-type="fig" rid="fig1">Figure 1</xref>1 describes the proof by reduce action point in case of “Signin” schema.</p><fig id="fig9"  position="float"><label><xref ref-type="fig" rid="fig9">Figure 9</xref></label><caption><title> Z/EVES Schema expansion of Initial Login to Login schema</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x14.png"/></fig><fig id="fig10"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>0</label><caption><title> Domain checking with Z/EVES</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x15.png"/></fig></sec><sec id="s4"><title>4. Result Analysis</title><p>Any proposed model is incomplete without tool support. Nevertheless, use of formal language adequately increases the accuracy and completeness but, the use of computer tool indeed increases the level of confidence significantly for the system to be developed by fingering out the potential errors in syntax and semantics of formal narration. <xref ref-type="table" rid="table1">Table 1</xref> depicts the result of formal analysis of proposed schemas of road traffic management system using Z/EVES. The attributes in the table are name of the schema followed by syntax &amp; type checking, domain checking, proof and reduction. The second row in table, having status Y for all columns indicating that the schema named “Vehicle Owner” is correct with respect to syntax &amp; type check errors, domain check and having correct proof by performing reduction on the set of predicates for making specification meaningful. The Y&#185; symbol shows that the action point in proof window is chosen as “prove by reduce”.</p></sec><sec id="s5"><title>5. Conclusion</title><p>The use of formal methods in safety critical application increases quality in terms of accuracy, consistency, and</p><fig id="fig11"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref>1</label><caption><title> Proof script by using action point “proof by reduce” for “Signin” schema</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/2-9302052x16.png"/></fig><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Result analysis by Z/EVES</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Schema Name</th><th align="center" valign="middle" >Syntax &amp; Type Checking</th><th align="center" valign="middle" >Domain Checking</th><th align="center" valign="middle" >Schema Expansion</th><th align="center" valign="middle" >Proof by Reduction</th></tr></thead><tr><td align="center" valign="middle" >Vehicle Owner</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y&#185;</td></tr><tr><td align="center" valign="middle" >Login</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y&#185;</td></tr><tr><td align="center" valign="middle" >Signin</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y</td><td align="center" valign="middle" >Y&#185;</td></tr></tbody></table></table-wrap><p>in completeness. This paper describes the use of Z notation, a formal methods for Vehicle Owner, an actor of Road Traffic Management System; which will be further verified by Z/EVES, a typechecker tool for Z notation specification. In Future, the schema of Traffic Police, Admin, and Traffic Manager will be implemented and verified by Z/EVES theorem prover.</p></sec><sec id="s6"><title>Acknowledgements</title><p>Authors are thankful to faculty of Engineering &amp; Technology (FET), Mody University of Science &amp; Technology for providing the facility to carry out the research work.</p></sec><sec id="s7"><title>Cite this paper</title><p>MonikaSingh,Ashok KumarSharma,RuhiSaxena, (2015) Why Formal Methods Are Considered for Safety Critical Systems?. Journal of Software Engineering and Applications,08,531-538. doi: 10.4236/jsea.2015.810050</p></sec></body><back><ref-list><title>References</title><ref id="scirp.60326-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Woodcock, J.C.P. (1989) Structuring Specifications in Z. IEE/BCS Software Engineering Journal, 4, 51-66.http://dx.doi.org/10.1049/sej.1989.0007</mixed-citation></ref><ref id="scirp.60326-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Hall, A. (2002) Correctness by Construction: Integrating Formality into a Commercial Development Process. Proceedings of International Symposium of Formal Methods Europe, 2391, 139-157.http://dx.doi.org/10.1007/3-540-45614-7_13</mixed-citation></ref><ref id="scirp.60326-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Spivey, J.M. (1989) The Z Notation: A Reference Manual. Prentice-Hall, Englewood Cliffs.</mixed-citation></ref><ref id="scirp.60326-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Hamdy, K.E., Elsoud, M.A. and El-Halawany, A.M. (2011) UML-Based Web Engineering Framework for Modeling Web Application. Journal of Software Engineering, 5, 49-63. http://dx.doi.org/10.3923/jse.2011.49.63</mixed-citation></ref><ref id="scirp.60326-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Hasan, O. and Tahar, S. (2007) Verification of Probabilistic Properties in the HOL Theorem Prover. Proceedings of the Integrated Formal Methods, 4591, 333-352. http://dx.doi.org/10.1007/978-3-540-73210-5_18</mixed-citation></ref><ref id="scirp.60326-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">He, X. (2000) Formalizing UML Class Diagrams: A Hierarchical Predicate Transition Net Approach. Proceedings of 24th Annual International Computer Software and Applications Conference, Taipei, 25-28 October 2000, 217-222.</mixed-citation></ref><ref id="scirp.60326-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Zafar, N.A., Khan, S.A. and Araki, K. (2012) Towards the Safety Properties of Moving Block Railway Interlocking System. International Journal of Innovative Computing, Information and Control (ICIC International), 5677-5690.</mixed-citation></ref><ref id="scirp.60326-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Heiner, M. and Heisel, M. (1999) Modeling Safety Critical Systems with Z and Petri-Nets. Proceedings of International Conference on Computer Safety, Reliability and Security, London, 26-28 October 1999, 361-374.http://dx.doi.org/10.1007/3-540-48249-0_31</mixed-citation></ref><ref id="scirp.60326-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">The Z/EVES 2.0 User’s Guide: Mark Saaltink. October 1999 ORA Canada.</mixed-citation></ref><ref id="scirp.60326-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Mostafa, A.M., Manal, A.I., Hatem, E.B. and Saad, E.M. (2007) Toward a Formalization of UML2.0 Meta-Model Using Z Specifications. Proceedings of 8th ACIS International Conference on Software Engineering, Artificial Intelligence, Networking and Parallel/Distributed Computing, 3, 694-701. http://dx.doi.org/10.1109/SNPD.2007.508</mixed-citation></ref><ref id="scirp.60326-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Jacobson, R.I. and Booch, G. (2006) The Unified Modeling Language Reference Manual. 2nd Edition.</mixed-citation></ref><ref id="scirp.60326-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Selic, B. and Rumbaugh, J. (1998) UML for Modeling Complex Real-Time Systems. Technical Report, Object Time.</mixed-citation></ref></ref-list></back></article>