<!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>Operational Specification for FCA using Z</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Simon Andrews</string-name>
          <email>s.andrews@shu.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simon Polovina</string-name>
          <email>s.polovina@shu.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Faculty of Arts, Computing, Engineering and Sciences Sheffield Hallam University</institution>
          ,
          <addr-line>Sheffield</addr-line>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We present an outline of a process by which operational software requirements specifications can be written for Formal Concept Analysis (FCA). The Z notation is used to specify the FCA model and the formal operations on it. We posit a novel approach whereby key features of Z and FCA can be integrated and put to work in contemporary software development, thus promoting operational specification as a useful application of conceptual structures.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The Z notation is a method of formally specifying software systems [
        <xref ref-type="bibr" rid="ref1 ref2">1, 2</xref>
        ]. It is
a mature method with tool support [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] and an ISO standard1. Its strength is
in providing a rigorous approach to software development. Formal methods of
software engineering allow system requirements to be unambiguously specified.
The mathematical specifications produced can be formally verified and tools
exist to aid with proof and type checking. Being based on typed set theory and
first order predicate logic, Z is in a position to be exploited as a method of
specification of systems modeled using FCA.
      </p>
      <p>An issue with formal methods has been the amount of effort required to
produce a mathematical specification of the software system being developed.
Having a ’ready made’ mathematical model provided by FCA would allow formal
methods to have a new outlet. Whilst FCA can already be used to aid in the
understanding and implementation of software systems (see next Section), Z can
provide the method and structure by which FCA can be properly integrated into
a development life cycle.</p>
      <p>
        Work linking FCA and Z has been undertaken [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] that uses FCA as a means
by which Z specifications can be explored and visualised. However, it does not
appear that the link has been established in the other direction, i.e. that an FCA
model can be taken as a starting point for functional requirements specification
in Z. We are interested in specifying functional system requirements as
operations on the FCA data model, thus allowing the strengths of FCA and Z to be
combined. Work on algorithms based on FCA has been carried out, for example
by Carpineto and Romano [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ], but here we are suggesting a formal approach to
the abstract specification of system requirements that can assist in transforming
the conceptual model into an implementation.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>FCA in Software Development</title>
      <p>
        FCA has been used in a number of ways for software development; for modeling
the data structure of software applications, such as ICE [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], DVDSleuth [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and
HierMail [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], and as the basis for specialised application building environments
such as ToscanJ [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and Galicia [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. However there appears to be little work
concerning the use of FCA as part of a general software engineering life cycle.
      </p>
      <p>
        Tilley et al [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] have conducted a survey of FCA support for software
engineering activities which found that the majority of reported work was concerned
with object-oriented re-engineering of existing/legacy systems and class
identification tasks. They found little that related to a wider software engineering
context or to particular life cycle phases.
      </p>
      <p>One piece of work that does relate FCA directly to phases of the software life
cycle has been carried out by Hesse and Tilley [12]; They discuss how FCA
applies to requirements engineering and analysis. By taking a use-case approach,
relating information objects to functional processes, they show that a
hierarchical program structure can be produced. They suggest that FCA can play a
central role in the software engineering process as a form of concept-based
software development. The approach of this paper embodies their idea, with FCA
providing the information structure and Z providing the process specification
(Figure 1).
In FCA a formal context consists of a set of objects, G , a set of attributes, M ,
and a relation between G and M , I ⊆ G × M . A formal concept is a pair (A,
B ) where A ⊆ G and B ⊆ M . Every object in A has every attribute in B . For
every object in G that is not in A, there is an attribute in B that that object
does not have. For every attribute in M that is not in B there is an object in A
that does not have that attribute. A is called the extent of the concept and B is
called the intent of the concept. If g ∈ A and m ∈ B then (g , m) ∈ I , or gIm.</p>
      <p>In Z, information structures are declared based upon a typed set theory. To
apply this in FCA, G becomes such a type, namely the universal set of objects of
interest. Similarly, M becomes the universal set of attributes that the objects of
interest may have. The notation g : G declares an object g of type G and m : M
declares an attribute m of type M . Sets can be declared using the powerset
notation, P, and relations declared by placing an appropriate arrow between
related types.
3.1</p>
      <sec id="sec-2-1">
        <title>Formal Context as a System State</title>
        <p>Using the Z notation, the formal context and concepts can be specified as state
variables in a state schema (Figure 2), declaring the relation I , along with a
concept function, S , which maps extents to intents. S is declared as an injection;
an intent has one and only one extent, an extent has one and only one intent.The
lower section of the schema (the schema predicate) logically describes how I and
S are related. A : P G declares that A is a set of objects. B is the intent of A. |
ContextAndConcepts
I : G ↔ M
S : P G ֌7 P M
∀ A : P G; B : P M | (A, B ) ∈ S •
∀ g : G; m : M • g ∈ A ∧ m ∈ B ⇔ gIm ∧
∀ g : G | g ∈/ A • ∃ m : M | m ∈ B ∧ ¬ gIm ∧
∀ m : M | m ∈/ B • ∃ g : G | g ∈ A ∧ ¬ gIm
can be read as ’such that’ and • can be read as ’then’.</p>
        <p>Although a proof is not attempted here, the predicate appears, by inspection,
to satisfy Wille’s conditions for deriving concepts so that A = B I and B = AI
[13].
3.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Query Operations</title>
        <p>In Z, a query postfix, ?, is used to indicate an input to an operation and an
exclamation postfix, !, is used to indicate an output from an operation. The
symbol Ξ indicates that the operation does not change the value of the state
variables.</p>
        <p>In Z, if R is a binary relation between X and Y , then the domain of R
(dom R) is the set of all members of X which are related to at least one member
of Y by R. The range of R (ran R) is the set of all members of Y to which at
least one member of X is related by R.</p>
        <p>By making use of the concept function, S , and the fact that it is injective,
operations to output the intent of an extent and to output the extent of an
intent, are easily specified. Figure 3 specifies the latter in an operation schema
called FindExtent.</p>
        <p>A strength of the Z notation is its notion of preconditions and
postconditions. Preconditions are statements that must be true for the operation to be
successful and postconditions specify the result of the operation. In FindExtent,
the precondition B ? ∈ ran S states that the input set of attributes must be in
the range of S . The postcondition A! = S ∼(B ?) obtains the extent by inverting
S and supplying it with the intent.</p>
        <p>FindIntent is not specified here as it is, essentially, a mirror of FindExtent,
with the input being a set of objects and the output being the corresponding set
of attributes, B ! = S (A?).</p>
        <p>FindExtent
ΞContextAndConcepts
B ? : P M
A! : P G
B ? ∈ ran S
A! = S ∼(B ?)
FindAttributes
ΞContextAndConcepts
g? : G
B ! : P M
g? ∈ dom I
B ! = I (| {g?} |)</p>
        <p>A query operation that outputs an object’s attributes, called FindAttributes
is shown in Figure 4. The set of attributes is obtained by taking the relational
image of I through a set containing the object of interest. Again, the operation
FindObjects (for an attribute of interest) is similar and is not specified here.</p>
        <p>Operation schemas to find object concepts and attribute concepts can be
specified according to Wille’s definitions, γg := ({g }II , {g }I ) and γm := ({m}II , {m}I ),
by piping together the corresponding object/attribute, extent/intent queries
using a chevron notation, &gt;&gt;. The output from the schema preceding the chevrons
becomes the input for the schema that follows them:</p>
        <p>FindObjectConcept =b FindAttributes &gt;&gt; FindExtent ,</p>
        <p>FindAttributeConcept =b FindObjects &gt;&gt; FindIntent .</p>
        <p>In each case, we are interested in the outputs of both of the piped schemas, so
that γg = (A!, B !?) and γm = (A!?, B !). The postfix !? indicates that something
is first an output and then an input.
3.3</p>
      </sec>
      <sec id="sec-2-3">
        <title>Update Operations</title>
        <p>A strength of the Z notation is its notion of before and after states, i.e. a clear
distinction is made between the value of state variables before an operation is
carried out and their values after the operation is carried out. A state variable
decorated with an apostrophe indicates that is in the after state. The symbol Δ
indicates that an operation changes the state.</p>
        <p>An operation to add a new object to the context can be specified by declaring
the object and the object’s attributes as inputs. The operation schema AddObject
is shown in Figure 5. It is a precondition that the attributes currently exist in
the context.</p>
        <p>In Z, −⊲ subtracts elements from a range and ⊲ restricts a range. These are
used in the postcondition involving S to take into account the possibility that
the attributes of the new object are an existing intent. The relevant concept is
updated by adding the new object to the corresponding extent.</p>
        <p>AddObject
ΔContextAndConcepts
g? : G
B ? : P M
g? ∈/ dom I
B ! ⊆ ran I
I ′ = I ∪ { m : M | m ∈ B ! • g? 7→ m }
S ′ = (S ⊲− {B ?}) ∪ {S(dom S ⊲ {B ?}) ∪ {g?} 7→ B ?}</p>
        <p>A similar operation to add a new attribute can be specified, but is not given
here. Other useful operations that can be specified include those to remove an
object from the context, remove an attribute from the context, remove an
attribute from an object, remove an object from an attribute and to add an existing
attribute to an existing object. It also is possible that other notions in FCA, such
as the superconcept/subconcept relationship and attribute/object implications,
will lend themselves to operational specification in Z.
4</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>A User Profile Example</title>
      <p>Consider a user profile system where users belong to groups and groups are
associated with services. The contexts for this system are
usergroupContext : USER ↔ GROUP
groupserviceContext : GROUP ↔ SERVICE</p>
      <p>The complete state schema UserProfileSystem is not given for the sake of
brevity. The concept functions are also omitted (in practice, where concepts are
explicitly required, it may be more pragmatic to specify an axiom to obtain them
from the context, rather than include them explicitly in the system state).</p>
      <p>An operation is required to form a new group from all users who have access
to a particular set of services. The preconditions are that the group must not
already exist and that there must be at least one user who has access to the set
of services (this also ensures that the services exist). The requirement is specified
in Figure 6.</p>
      <p>FormGroup
ΔUserProfileSystem
newgroup? : GROUP
services? : P SERVICE
newgroup? ∈/ dom groupserviceContext
usergroupcontext 9o groupservicecontext ⊲ services? = ∅
∃ user : USER | services? ⊆</p>
      <p>ran({user } ⊳ usergroupContext 9o groupserviceContext)
usergroupContext′ = usergroupContext ∪ {user : USER | services? ⊆</p>
      <p>ran({user } ⊳ usergroupContext 9o groupserviceContext) • user 7→ newgroup?}
groupserviceContext′ = groupserviceContext ∪
{service : SERVICE | service ∈ services? • newgroup? 7→ service}</p>
      <p>Relational composition is carried out using 9o, here to form the relation
between users and services. ⊳ is domain restriction. Set comprehension is used in
the postconditions in the form {... • x 7→ y }. The mapping x 7→ y defines the
form of the elements of the comprehended set.</p>
      <p>The above example shows how formal contexts, arising from FCA, can be
used in the formal specification of system requirements. The operation schema
FormGroup is an unambiguous specification that can be translated into a
program design.</p>
    </sec>
    <sec id="sec-4">
      <title>Conclusion</title>
      <p>The work presented here paves a way by which an FCA model can be specified
as a Z state schema and that operations on the model (system requirements)
can then be specified as Z operation schemas. The strengths of the conceptual
model are thus combined with the strengths of structured formal methods. The
Z notation is well understood as part of the software life cycle; it has strengths
in the way functional system requirements are structured as schemas and in
its notions of pre and post conditions and before and after states. Z has an
industry standard and is supported by a variety of software engineering tools.
We therefore envisage FCA systems that are specified using Z as opening up FCA
to the comprehensive tools and support that are available for Z and vice versa,
thereby promoting operational requirements specification as a useful application
of conceptual structures.
12. W. Hesse and T. Tilley. Formal Concept Analysis Used for Software Analysis and
Modelling. In B. Ganter, G. Stumme and R. Wille, editors, Formal Concept
Analysis: Foundations and Applications, pages 288-303. Springer-Verlag, Germany, 2005.
13. R. Wille. Formal Concept Analysis as Mathematical Theory of Concepts and
Concept Hierarchies. In B. Ganter, G. Stumme and R. Wille, editors, Formal
Concept Analysis: Foundations and Applications, pages 1-33. Springer-Verlag, Germany,
2005.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>J. M.</given-names>
            <surname>Spivey. The Z Notation: A Reference Manual.</surname>
          </string-name>
          Prentice-Hall,
          <year>1989</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>J. B.</given-names>
            <surname>Wordsworth</surname>
          </string-name>
          .
          <article-title>Software Development with Z: A Practical Approach to Formal Methods in Software Engineering</article-title>
          . Addison-Wesley,
          <year>1992</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3. http://vl.zuser.org/#
          <source>tools (Accessed 21 April</source>
          <year>2008</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>T.</given-names>
            <surname>Tilley</surname>
          </string-name>
          .
          <article-title>Towards an FCA based tool for visualising formal specifications</article-title>
          . In B. Ganter and A. de Moor, editors,
          <source>Using Conceptual Structures: Contributions to ICCS</source>
          <year>2003</year>
          , pages
          <fpage>227</fpage>
          -
          <lpage>240</lpage>
          . Shaker-Verlag, Germay,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>C.</given-names>
            <surname>Carpineto</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Romano</surname>
          </string-name>
          .
          <source>Concept Data Analysis: Theory and Application</source>
          . Wiley,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Y.</given-names>
            <surname>Qian</surname>
          </string-name>
          and
          <string-name>
            <given-names>L.</given-names>
            <surname>Feijs</surname>
          </string-name>
          .
          <article-title>Step-wise Concept Lattice Navigation</article-title>
          . In B. Ganter and A. de Moor, editors,
          <source>Using Conceptual Structures: Contributions to ICCS</source>
          <year>2003</year>
          , pages
          <fpage>255</fpage>
          -
          <lpage>267</lpage>
          . Shaker-Verlag, Germay,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>J. Ducrou.</surname>
          </string-name>
          <article-title>DVDSleuth: A Case Study in Applied Formal Concept Analysis for Navigating Web Catalogs</article-title>
          . In U. Priss,
          <string-name>
            <given-names>S.</given-names>
            <surname>Polovina</surname>
          </string-name>
          and R. Hill, editors, Conceptual Structures:
          <article-title>Knowledge Architectures for Smart Applications</article-title>
          ,
          <article-title>ICCS 2007 proceedings</article-title>
          , pages
          <fpage>496</fpage>
          -
          <lpage>500</lpage>
          , Springer,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>R.</given-names>
            <surname>Cole</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Eklund</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Stumme</surname>
          </string-name>
          .
          <article-title>Document Retrieval for Email Search and Discovery using Formal Concept Analysis</article-title>
          .
          <source>Applied Artificial Intelligence</source>
          , Volume
          <volume>17</volume>
          ,
          <string-name>
            <surname>Number</surname>
            <given-names>3</given-names>
          </string-name>
          ,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>P.</given-names>
            <surname>Becker</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Correia</surname>
          </string-name>
          .
          <article-title>The ToscanaJ Suite for Implementing Conceptual Information Systems</article-title>
          . In B. Ganter,
          <string-name>
            <given-names>G.</given-names>
            <surname>Stumme</surname>
          </string-name>
          and R. Wille, editors,
          <source>Formal Concept Analysis: Foundations and Applications</source>
          , pages
          <fpage>324</fpage>
          -
          <lpage>348</lpage>
          . Springer-Verlag, Germany,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <given-names>P.</given-names>
            <surname>Valtchev</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Grosser</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Roume</surname>
          </string-name>
          and
          <string-name>
            <given-names>M.</given-names>
            <surname>Hacene</surname>
          </string-name>
          .
          <article-title>Galicia: an open platform for lattices</article-title>
          . In B. Ganter and A. de Moor, editors,
          <source>Using Conceptual Structures: Contributions to ICCS</source>
          <year>2003</year>
          , pages
          <fpage>241</fpage>
          -
          <lpage>254</lpage>
          . Shaker-Verlag, Germay,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. T. Tilley,
          <string-name>
            <given-names>R.</given-names>
            <surname>Cole</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Becker</surname>
          </string-name>
          and
          <string-name>
            <given-names>P.</given-names>
            <surname>Eklund</surname>
          </string-name>
          .
          <article-title>A Survey of Formal Concept Analysis Support for Software Engineering Activities</article-title>
          . In B. Ganter,
          <string-name>
            <given-names>G.</given-names>
            <surname>Stumme</surname>
          </string-name>
          and R. Wille, editors,
          <source>Formal Concept Analysis: Foundations and Applications</source>
          , pages
          <fpage>250</fpage>
          -
          <lpage>271</lpage>
          . Springer-Verlag, Germany,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>