<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>From Requirements Models to Formal Specifications in B</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Christophe Ponsard</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emmanuel Dieul</string-name>
          <email>emmanuel.dieul@ts.siemens.fr</email>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>CETIC Research Center</institution>
          ,
          <addr-line>Charleroi (Belgium) -</addr-line>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Siemens Transportation Systems (France) -</institution>
        </aff>
      </contrib-group>
      <fpage>845</fpage>
      <lpage>849</lpage>
      <abstract>
        <p>The development of critical systems requires a high assurance process from requirements to the running code. Formal methods, such as B, now provide industry-strength tools to develop abstract models, refine them in more concrete models and finally turn them into code. A major remaining weakness in the development chain is the gap between textual or semi-formal requirements and formal models. In this paper, we explore how to cope with this problem using a goal-oriented approach to elaborate a pertinent model, including regulation modelling, and turn it into a high quality abstract formal specification.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Several fields such as transportation, health care, finance are increasingly
relying on complex systems mixing hardware and software, interacting tightly with
human users and constrained by a number of national/international regulations
and standards. Achieving high assurance is difficult but critical as failure can
lead to catastrophic consequences ranging from loss of profit to human lives.</p>
      <p>
        Formal methods (FM) are based on rigorous mathematical reasoning. They
have shown their ability to produce such systems for large industrial problems
(such as Paris metro line 14 using B). The deployment of such methods are
far from trivial for a number of reasons such as the mathematical expertise
required, the poor communicability with the customer, the lack of indirect ”return
on investment” of increased time spend earlier in the project. As the formal
development chain matures, the major problem is now at the ”gap” between
the requirements documents and the initial formal specification [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. In current
practice, the formal specification is elaborated based on informal or semi-formal
requirements, the validation of the specification is then difficult due to the
inability for the customer to understand the formal model, to link them with initial
requirements and to bring regulations into the picture.
      </p>
      <p>
        Some practical solutions have been explored such as the extraction of UML
views [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] or the inclusion of traceability links [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. Although interesting, those are
going ”backward” to the requirements level. In this paper, we develop an
approach where formal methods can be introduced during requirements engineering
(RE) to build a model combining semi-formal and formal notations from which
a specification can then be derived in a more constructive, ”forward way” [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
In the present context of regulation modelling, this design process is interesting
because it can be guided to comply with given regulations and can produce a
rich set of traceable properties (called goals hereafter) the system has to
ensure within its environment. Those can be explicit regulation constraints on the
system under design, organisational constraints on agents in the environment,
technical requirements in a specific design, etc.
      </p>
      <p>
        The rest of this paper is structured as follows. In section 2, the KAOS
goaloriented framework will be used to show how system goals can be captured,
refined and analyzed formally while preserving communicability and taking
regulations into account. The B method [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] which is which clearly evolving towards
system level [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], will be used as formal specification language. Section 3 will show
how a set of initial B machines can be derived from the requirements model.
Section 4 will summarize benefits, current limits and future work.
      </p>
      <p>
        To illustrate our purpose, we choose the train domain which is very rich
in regulations (e.g. new office of rail regulation in UK, ministerial service of
rail regulation in Belgium) and standards (e.g. Cenelec 50126/128/129). The
excerpt used as running example is related to the operation of platform screen
doors (borrowed from [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]).
1.1
      </p>
      <p>Requirements Modelling and Analysis
A KAOS requirements model is composed of four sub-models: (i) the central
model is the goal model which captures and structures the assumed and required
properties (including regulations); (ii) the object model captures the relevant
vocabulary to express the goals; (iii) the agent model takes care of assigning goal
to agent in a realizable way; (iv) the operation model details, at state transitions
level, the work an agent has to perform to reach the goals he is responsible for.</p>
      <p>Model elaboration usually starts from key properties of the system to-be.
Those are expressed using goals which are statements of intent about some
system (existing or to-be) whose satisfaction in general requires the cooperation of
some of the agents forming that system. Figure 1 shows the goals related to the
operation of the platform screen doors. High level goals are related to progress
properties and passenger safety. Safety issues are refined (AND-refinement)
considering the avoidance of dangers such as people falling off the train or on the
tracks. For the latter, two alternatives are considered (OR-refinement): in a
manual system, the driver can be responsible for this by monitoring/anticipating such
events and triggering an emergency stop when needed. In the automated design
considered here, this is not possible: the selected alternative is to achieve track
isolation and access through screen doors. The design choice can be made with
respect to the satisfaction of higher level (generally non functional) goals but can
also be prescribed by a regulation authority (e.g. decision to generalise screen
doors in the French metro).</p>
      <p>
        Those goals are described informally in natural language and are optionally
formalized in a real-time temporal logic [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. Keywords such as Achieve, Avoid,
M aintain are used to name goals according to the temporal behaviour pattern
they prescribe. For example the goal M aintain[DoorsClosedW hileM oving] can
be formalized as follows:
Goal Avoid[PeopleFallingOnTracks]
(∀pf : P latf orm) (¬(∃tr : T rain) docked(tr, pf )) ⇒ pf.doors = CLOSED
In the formalization process, pertinent entities/relationships/attributes (eg.
Train, docked, doors,...) are identified and result in the constructive
elaboration of an object model. Due to a lack of space, this model is not illustrated
graphically here.
      </p>
      <p>To enforce the system behaviours, goals are under the responsibility of a
number of agents which are active components, such as humans, devices, legacy
software or software-to-be components, that play some role towards goal
satisfaction. Some agents are part of the system to design whereas others define its
environment. Some may also be prescribed by regulation authorities. Those agents
control the operation through a number of operations which are strengthened in
order to satisfy the goals. For example, the Achieve[F astP assengerT ransf er]
goal results in a trigger on the door opening, while the Avoid[P eopleF allingOn
T racks] goal results in an additional precondition to open the doors. This can
be formalized as follows (where @P ⇔ •¬P ∧ P , • being the previous state)).
Operation OpenPlatformDoors</p>
      <p>Input pf : P latf orm
Output pf : P latf orm/doors
DomPre pf.doors = CLOSED
DomPost pf.doors = OP EN
ReqTrig for F astP assengerT ransf er : @∃(tr : T rain) docked(tr, pf )
ReqPre for P eopleF allingOnT racks : ∃(tr : T rain) docked(tr, pf )
2</p>
    </sec>
    <sec id="sec-2">
      <title>Deriving Formal Specifications</title>
      <p>In order to derive initial B machines from the requirements model, we propose
here a basic algorithm focusing on safety properties.</p>
      <p>As agents are the active entities able to perform operations, a B MACHINE
is associated with each KAOS agent. Of course, this initial design can be refined
later in B to develop or map to a finer grained system, reuse existing components,
etc. Each machine is composed of the following elements:
– necessary SETS, VARIABLES, CONSTRAINT to model the agent attributes
and the operations arguments
– INITIALISATION information, also present in goal refinements
– INVARIANTS for all maintain goals under the agent responsibility
– OPERATIONS the agent has to perform. Domain and strengthened pre- and
postconditions are merged. Trigger conditions are not considered but can be
safely ignored as they should imply the precondition.</p>
      <p>The resulting machine for the P latf ormController is the following:</p>
    </sec>
    <sec id="sec-3">
      <title>Benefits, current limitations and future work</title>
      <p>
        So far, our current experiments confirmed a number of benefits:
– early validation. The operational requirement model can be animated through
the generation of finite state machines [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]. The system behaviour can directly
be checked by a domain expert, possibly using domain specific display and
controls (note this component can be reused from the application domain,
avoiding the cost of development and validation). Relevant goals can also be
automatically monitored (see figure 2).
– better initial models. Although proof obligations are not discharged (the
mapping is still partial and unproved), the effort spent in early modelling and
validation results in easier proofs (i.e. managed by the automated prover).
– communication. Formal language can always be hidden behind semi-formal
notations. Useful diagrams such as the object model or the agent interactions
are easier to generate at this step than from B models.
– better traceability. The goal model provides a rich set of properties which
can be traced throughout the project life. A look at the above untagged B
machine shows how difficult it is to discover the related requirements.
– natural complementarities. Both KAOS and B have a notion of refinement
and are based on a constructive approach. KAOS at the property level and
B at the machine level.
      </p>
      <p>
        The current mapping is still partial and we are actively working on its
improvement. Future work will move to Event B [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] which is more appropriate to
reason at system level and for liveness properties. This work is done in
connection with RODIN project [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. At tool level, we plan to develop a B connector
between the Objectiver/FAUST[
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] toolset and the RODIN open platform.
      </p>
      <p>Regarding regulations, method support for regulation modelling should be
further elaborated. Interesting issues to cover is the verification of regulation
enforcement and the analysis of possibly conflicting regulations in order to merge
them (from national regulation to European regulations such as in the
EuroInterlocking group in the railway domain).</p>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgement</title>
      <p>This work is financially supported by the European Union (ERDF and ESF)
and the Walloon Region (DGTRE).</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J. R.</given-names>
            <surname>Abrial</surname>
          </string-name>
          ,
          <string-name>
            <surname>The B-Book</surname>
          </string-name>
          :
          <article-title>Assigning programs to meanings</article-title>
          , Cambridge University Press,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>J.R.</given-names>
            <surname>Abrial</surname>
          </string-name>
          , B: past, present,
          <source>future (in French)</source>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Jeremy</given-names>
            <surname>Dick</surname>
          </string-name>
          ,
          <article-title>Formalising the informal: Linking formal methods to informal requirements</article-title>
          ,
          <source>Proc. FMICS'04</source>
          ,
          <string-name>
            <surname>Linz</surname>
          </string-name>
          (Austria),
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>Akram</given-names>
            <surname>Idani</surname>
          </string-name>
          and
          <string-name>
            <given-names>Yves</given-names>
            <surname>Ledru</surname>
          </string-name>
          ,
          <article-title>Object Oriented Concepts Identification from Formal B Specifications</article-title>
          ,
          <source>Proc. FMICS'04</source>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5. IST-1999-11435, Matisse:
          <article-title>Methodologies and technologies for industrial strength systems engineering</article-title>
          - practitioners handbook,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6. Objectiver/FAUST, http://www.objectiver.com + http://faust.cetic.be,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>The</surname>
            <given-names>RODIN</given-names>
          </string-name>
          project, http://rodin-b-sharp.
          <source>sourceforge.net/</source>
          ,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>H.</given-names>
            <surname>Tran Van</surname>
          </string-name>
          ,
          <string-name>
            <surname>A. van Lamsweerde</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Massonet</surname>
          </string-name>
          , and
          <string-name>
            <given-names>C.</given-names>
            <surname>Ponsard</surname>
          </string-name>
          ,
          <article-title>Goal-oriented requirements animation</article-title>
          ,
          <source>12th IEEE Int.Req.Eng.Conf</source>
          .,
          <string-name>
            <surname>Kyoto</surname>
          </string-name>
          ,
          <year>September 2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>A. van Lamsweerde</surname>
          </string-name>
          ,
          <article-title>Goal-oriented requirements engineering: A guided tour</article-title>
          ,
          <source>Proc. RE'01 - 5th IEEE International Symposium on Requirements Engineering</source>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>