<!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>An Architecture for Developing Context-aware Systems</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Kaiyu Wan</string-name>
          <email>wan@cse.concordia.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Vasu Alagar</string-name>
          <email>alagar@cse.concordia.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Joey Paquet</string-name>
          <email>paquet@cse.concordia.ca</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Concordia University</institution>
          ,
          <addr-line>Montreal</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
      </contrib-group>
      <fpage>119</fpage>
      <lpage>123</lpage>
      <abstract>
        <p>architecture of the context-aware systems. We conclude the paper in Section 5 with a review of our ongoing work.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Context-aware systems are notoriously heterogeneous in terms of device types,
context interpretations, and adaptation requirements. We introduce a three-tiered formalism
as a solution to this heterogeneity problem. Perception involves the objects perceived,
the devices used for observing the objects, and the observational measurements. The
objects and the devices are low level abstractions belonging to one tier. The
observations of the device signals are converted to symbolic forms. We formally describe
the structures composed from elementary symbolic representations using mathematical
concepts. This description belongs to one tier, which links the low level abstraction to
the high-level adaptation abstraction. Thus we end up with a three-tiered formalism.
The architecture that we propose encapsulates the three tiers into two components, one
of which deals with context construction and the other deals with context adaptation.</p>
      <p>Tier 1 formalism is a description of “see, gather, control, and modify” features of
perception abstractions. It describes the assembled symbolic representations of the
observations and notifies Tier 2. Tier 2 receives the notification from Tier 1, and constructs
contexts that reflect the current awareness. The formal basis of Tier 2 functionality is
the context theory explained in [6]. Tier 2 uses the context calculus toolkit provided by
the theory to construct general contexts, deconstruct and modify them. Tier 2 notifies
current context information to Tier 3. Tier 3 receives current context from Tier 2 and
determines the corrections to be made to the current awareness. The modified context
information is given to Tier 1 through Tier 2. Figure 1(a) shows the three tiers and their
formalisms. Below we give an overview of the formal notation used in the three tiers.</p>
      <sec id="sec-1-1">
        <title>Tier3: ESM</title>
        <p>Tier2:
Context Calculus</p>
      </sec>
      <sec id="sec-1-2">
        <title>Tier1:Codesign</title>
        <p>Context Adapter
aware(context)</p>
        <p>report_change(context)</p>
        <p>Context Toolkit
Symbolic
information</p>
        <p>Symbolic
information
Transformation</p>
        <p>Sensing
digitalinformation
digitalinformation</p>
        <p>Verifier3:</p>
        <p>Verifier for</p>
        <p>Adaptation
Verifier2:
Reasoning with</p>
        <p>Context
Verifier1:
Verifier for Codesign</p>
        <p>CC</p>
        <p>E D
Codesign</p>
        <p>D2</p>
        <p>D3</p>
        <p>D1
sbuibnsduinmge CA
delegate
notifies
receives T3</p>
        <p>Context</p>
        <p>S
U</p>
        <p>T2</p>
        <p>T
(a) Three-tier Formalism</p>
        <p>(b) Architecture of Context-aware System</p>
        <p>Tier 1 formalism is a description of “see, gather, control, and modify” features of
perception abstractions. It describes the assembled symbolic representations of the
observations and notifies Tier 2. In describing Tier 1, we consider the environment, sensing
mechanism, and functional transformation of the observed raw data. The entities in the
environment seen by Tier 1 include users, programmable parts, sensors, and actuators.
We filter away the heterogeneity in the set of entities by encapsulating the behaviour
of each entity separately as a Codesign Finite State Machine(CFSM) [1]. The CFSMs
communicate asynchronously through message (event) passing. To ensure quality of
service, the entire design will be optimally partitioned for software and hardware
implementations. In this paper we do not discuss hardware/software partitioning issues.</p>
        <p>Tier 2 discusses formalism based on set theory and relations for contexts. The
context information is in general multidimensional, where in each dimension there exists
several choices to be considered. As an example, a physical context for a braking
device includes certain values (rotation per minute for wheels), situation (wheels locked
or not), environmental conditions (friction on the road, gradient of road surface), and
user characteristics (applying brakes or not). Here we have enumerated four
dimensions. In each dimension, there are several possible ways to represent information. We
say information in each dimension is tagged, and given the set of dimensions
(dimension names), and a tag set for each dimension, then it is easy to see why the context
should be defined as a of a finite union of relations. We define contexts as subsets of
a union of relations which in turn characterize the possible worlds [6]. The rationale
for the choice of formalism is that relational semantics provides a formal basis for
supporting the representation and manipulation of different types of contexts that arise in
context-aware applications. Contexts arising in both discrete and continuous interaction
of entities can be casted as relations. Both descriptive and prescriptive context
information can be modelled as relations. Although finiteness is not insisted, in our discussions
we deal with contexts having a finite number of dimensions. Hence, both an
enumeration syntax and a presentation syntax are used for context presentation. The context
toolkit includes the mathematical definition and representation of contexts, context
operators, and context expressions.</p>
        <p>The adaptive control mechanism in Tier 3 is modelled by an Extended State Machine
(ESM) model, which has been used to model real-time reactive systems [5]. At each
state, the ESM may receive context information composed by T2, query the context
database and/or compute a mathematical function, and output the results to CC. The
state transition semantics is
si ∧ e ∈ E(si) ∧ varg(si) ∧ cong(si) ∧ tc(t)</p>
        <p>
          si −→e sj ∧ vara(sj) ∧ rtc(t)
where (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ) varg is a predicate formula, in which each atomic predicate expresses a
constraint on one variable in state si; (
          <xref ref-type="bibr" rid="ref2">2</xref>
          ) cong is also a predicate formula, in which
each atomic predicate expresses a constraint on context information in state si; and (
          <xref ref-type="bibr" rid="ref3">3</xref>
          )
tc is a conjunction of linear time predicates of the form Lower ≤ t ≤ U pper, where
t is the valuation of a local clock. An execution in the ESM is a sequence of transitions
starting from an initial state. The behaviour of the ESM is the set of executions.
3
        </p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Architecture of the System</title>
      <p>
        In this section we give a component model of the three tiers, following the terminology
and notation in [4]. A component type T = F, A defines a black-box view, called
frame F, and a grey-box view, called architecture A. The type T may include more
than one grey-box view. The black-box defines the interface types, and the particular
grey-box view A as a structured implemented version of F. An interface of a
component is an instance of either notifies-interface type or receives-interface type. The four
kinds of ties between the interfaces of two component instances A and B are as follows:
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ). binding(−b−i−n→d) of a receives-interface to a notifies-interface between two
components at the same level of nesting, (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ). delegating (−d−el→g) from a receives-interface of a
component A to a receives-interface of a subcomponent B of A on the adjacent level,
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ). subsuming (−s−u−b→s) from a notifies-interface of a component B to a notifies-interface
of a component A, where B is a subcomponent of A on its adjacent level, and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
exempting (−e−x−em→) an interface of a component from participating in the architectural
connection.
      </p>
      <p>Following the above conventions we describe the architecture construction of a
context-aware system. We encapsulate Tier 1 as a component CC, which constructs
contexts out of the observables. Component CC is a composition of two components:
component E modelling the environment and the primitive component T modelling the
transformation unit that constructs elementary contexts from the observables in the
environment. Component E is composed from component D modelling the collection of
devices, the primitive component U modelling the user, and the primitive component S
modelling the sensing mechanism, which is a central unit sensing all the information the
system needs. The component D is composed from subcomponents Di, i = 1, . . . , k,
where each component modelling one device is primitive. We compose the primitive
component T2 corresponding to Tier 2 and the primitive component T3 corresponding
to Tier 3. The resulting component CA is the context adapter. A context-aware system
is a composition of CC and CA, as shown in Figure 1(b).
4</p>
      <p>Case Study - Antilock Braking System (ABS)
ABS is a typical example of a context-aware system, in which both situated and
environmental information should become part of a context. Our design is more general and
formal than the one suggested in [3].</p>
      <p>CC</p>
      <p>E
Codesign</p>
      <p>D DW1h.e14l</p>
      <p>D21.24</p>
      <p>Brake
ABS has two types of devices, wheels and braking units. For simplicity, we only
consider one wheel (D11) and one brake unit (D21) in the architecture. Environmental
contexts such as the road friction and the current wheel speed are sensed by the Sensing
mechanism S. They are converted into symbolic form by the transformer and passed as
atomic contexts to T2. Applying the operations given by the context calculus toolkit,
the atomic contexts are aggregated to a simple context c and passed as a parameter to
T3 [6]. The architecture of ABS is shown in Figure 2[a]. The formal behavior model of
context adaptation is shown in Figure 2[b].
5</p>
    </sec>
    <sec id="sec-3">
      <title>Conclusion</title>
      <p>
        The main contribution of this paper is a formal approach for developing context-aware
systems. The significant aspects of the architecture are: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) modularity: each
component is fully encapsulated, and their relative independence promotes easy refinements
and maximal reuse; (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) codesign: the sensing components in CC require hardware
implementation, and the transformer T requires a software implementation, and the
tight coupling between them can be optimized through appropriate hardware/software
partitioning; (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) context toolkit: component T2 implements context operators and
provides precedence rules, and their implementation is quite independent of the nature of
contexts (supplied by CC) and adaptation (at T3); and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) knowledge-base: T3 may
be given the knowledge-base that is specific to an application, and hence the
adaptation/controller can be reused for different applications by simply rebooting a new
knowledge-base for every new application.
      </p>
      <p>Sensory devices produce signals that are converted to symbolic forms. Necessarily,
this process is error-prone, and consequently not all context information will be
accurately quantified. In order to guarantee that the design satisfies a desired property, the
design methodology should be verification-driven. This aspect of verification-driven
design and implementation of context-aware systems is an integral part of our ongoing
research.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>F.</given-names>
            <surname>Balarin</surname>
          </string-name>
          , E. Sentovich,
          <string-name>
            <given-names>M.</given-names>
            <surname>Chiodo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Giusto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>H.</given-names>
            <surname>Hsieh</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Tabbara</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Jurecska</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Lavagno</surname>
          </string-name>
          ,
          <string-name>
            <given-names>C.</given-names>
            <surname>Passerone</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Suzuki</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Sangiovanni-Vincentelli</surname>
          </string-name>
          .
          <article-title>Hardware-Software Co-design of Embedded Systems - The POLIS approach</article-title>
          . Kluwer Academic Publishers,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>A.K. Dey</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Salber</surname>
            ,
            <given-names>G.D.</given-names>
          </string-name>
          <string-name>
            <surname>Abowd</surname>
          </string-name>
          .
          <article-title>A Conceptual Framework and a Toolkit for Supporting the Rapid Prototyping of Context-aware Applications, anchor article of a special issue on Human Computer Interaction</article-title>
          , Vol.
          <volume>16</volume>
          , (
          <year>2001</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Cheverst</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Davies</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Mitchell</surname>
          </string-name>
          and
          <string-name>
            <given-names>C.</given-names>
            <surname>Efstratiou</surname>
          </string-name>
          .
          <article-title>Using Context as a Crystal Ball: Rewards and Pitfalls</article-title>
          .
          <source>Personal Technologies Journal</source>
          , Vol.
          <volume>3</volume>
          No5, pp.
          <fpage>8</fpage>
          -
          <lpage>11</lpage>
          ,
          <year>2001</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>F.</given-names>
            <surname>Plasil</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Visnovsky</surname>
          </string-name>
          .
          <article-title>Behavior Protocols for Software Components</article-title>
          .
          <source>IEEE Transactions on Software Engineering archive</source>
          ,
          <volume>28</volume>
          (
          <issue>11</issue>
          ), pp.
          <fpage>1056</fpage>
          -
          <lpage>1076</lpage>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>K.</given-names>
            <surname>Wan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.S.</given-names>
            <surname>Alagar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Paquet</surname>
          </string-name>
          .
          <article-title>Real Time Reactive Programming Enriched with Context</article-title>
          .
          <source>ICTAC2004</source>
          , Guiyang, China,
          <year>September 2004</year>
          , Lecture Notes in Computer Science,
          <volume>3407</volume>
          , Springer-Verlag.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>K.</given-names>
            <surname>Wan. Lucx</surname>
          </string-name>
          :
          <article-title>An Intensional Programming Language Enriched With Contexts</article-title>
          ,
          <source>Ph.d thesis(under preparation)</source>
          , Department of Computer Science, Concordia University, Montreal, Canada,
          <year>2005</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>