Abstract
One of the primary objectives of ambient systems is to provide services based on the ability to interact with the environment (including objects, humans and system components). An ambient system must deal with the dynamic integration of new and unexpected elements (e.g. users or devices). To fulfil the system functions, we need to specify the ambient system and its dynamic context. In this paper, we present an elaborated formal approach to model the core concepts of context-aware systems and their dynamic reconfigurations. The approach enables a high-level of abstraction and supports building context-aware systems by providing modularity and separation of concerns. For this purpose, one, we use Milner’s standard bigraphs to model the contextual part of the context-aware system and second, we provide an extension of the Bigraphical Reactive System (BRS) to model the functional part of multi-agent system architectures (BRS-MAS). Finally, to evaluate the proposed approach, we use a Bigraphical Model Checker (BigMC) to verify safety and liveliness properties through a smart car management system case study.
Keywords
Introduction
Technological developments made in the field of computer science are growing and profoundly marked our society, where access to knowledge and information is critical. Further, integration and exploitation of the latest technologies of communication and information, have contributed to the emergence of the computer in different fields.
Today, with the miniaturization of hardware, many computer objects are dissolved in our daily lives, and the idea of the personal computer as the only computer object gradually disappears [8].
Ubiquitous computing in general and context-aware systems, in particular, are an important class of applications. These systems are considered as a network of intelligent sensors and devices, acting as a global interface between users and their environment [8]. In fact, systems tend to have flexible and adaptive architectures to deal with continuous emerging requirements of the environment and users.
Modelling context-aware systems consist of representing explicitly the structure and the dynamics and different possible states that the system can meet and the factors that cause these changes. To that purpose, there exist many formal and semi-formal modelling approaches proposed in the literature. However, these methods represent self-tailored solutions to a given problem. In these approaches, a context-aware system is described as a pre-established often-rigid structure where interactions, users and changes are fixed at design time. These approaches leave no freedom to the actual system to reconfigure its structure and behaviours in response to its physical world changes. We note that no generic approach can be applied to model a broad range of applications. In addition, they lack techniques and tools to validate the resulting design. In the literature, there are many definitions of the term “context”, but until now there is no universal one. In Dey et al. [5], a generic definition of context is “any information that can be used to characterise the situation of an entity”.
Motivated by these raised facts, this research is part of the emerging field of modelling and verifying context-aware system dynamic reconfiguration. Therefore, to better model, process and manage contextual information, and express how a system adapts in response to unforeseen changes, we propose a formal approach based Bigraphical Reactive System (BRS) by providing a separation between the contextual part and the operational part of the system. The composition of the two parts of the system is modelled as a BRS. Indeed, the approach enables a high-level of abstraction and supports building context-aware systems by providing modularity and separation of concerns. To illustrate the power and the capability of our approach, we apply it to a smart car system case study. Finally, to evaluate the proposed approach, we use a Bigraphical Model Checker (BigMC) [15] to verify safety and liveliness properties.
The rest of this paper is organised as follows. Section 2 briefly reviews some related work on the existing approaches. In Section 3, we introduce the Bigraphical Reactive Systems and introduce the bigraphical model concepts. In Section 4, we describe our Bigraphical Reactive System (BRS) model to deal with context changes. Section 5 presents a case study of a smart car system. Section 6 describes how to use Bigraphical Model Checker (BigMC) to implement the case study to validate the correctness of our proposed approach. Finally, a conclusion is given in Section 7.
Literature review
Different approaches have been proposed for modelling of context-aware systems. These approaches can be classified into semi-formal and formal models.
From a semi-formal perspective, several approaches have been proposed. Due to its generic structure, Bauer uses Unified Modelling Language (UML) in [1] to propose a model that has a very strong graphical component. More particularly, a specific Unified Modelling Language (UML) extension is proposed for modelling contextual aspects relevant to air traffic management. Henricksen [9] proposed an extension of the Object Role Modelling (ORM), where the facts and type of facts are the basic concepts of this model. In this approach, a clear separation between entity roles is provided. It allows fact types to be categorised, according to their persistence and source, either as static or dynamic. Key-value pairs are the simplest data structure for modelling contextual information in context-aware systems. This modelling approach is frequently used in distributed services. Schilit et al. [21] and Strang [23], used key-value pairs to model the context by giving each application a contextual information value as environment variables. The modelling in this approach is easy to manage, but it lacks capabilities enabling efficient context retrieval algorithms.
One of the most important aspects of semi-formal approaches is that they are well structured and easy to use. However, we note that these approaches are only adequate for small systems and due to a lack of a rigorous base they do not deal with complex issues. In addition, these approaches are too specific and domains oriented such as [1] or focus on some aspects of the context-aware system such as context information [9, 21, 23].
From the formal perspective, several contributions propose different approaches. Yet, a solid conceptual and formal foundation for modelling context-aware systems is still missing. In the literature, there have been several approaches where a plethora of different formalisms were used. In the following, we organize the related works according to their underlying formalism.
Among the most common formalisms, Petri net approaches, Reignier et al. [18] and Sahnoun et al. [19] proposed a Petri Net models using the concept of the situation on places and events on transitions. These approaches represent the context and the behaviour of the application, but it does not show dynamic context changes in a run-time process. They also do not show the dependencies between system components.
Calculus process appears to be an adequate formalism to represent systems where the notion of instantaneous change is omnipresent. Context-Aware Calculus (CAC) introduced by Zimmer [28] is used to specify and describe dynamic mobile systems composed of agents that react and move depending on their location. This approach is helpful for hierarchical structures such as in mobile ambient systems. However, the proposed method lacks in explicitly representing context information and its types as well as the agent’s internal information and control. Calculus of context-aware ambient (CCA) offered by Siewe et al. [22] proposes a theory allowing the identification of systems equivalence using context-aware behaviour. This approach uses the equivalence of processes, but does not describe precisely the dependencies between entities and contextual information.
Among the recent formal approaches proposed in the domain of context-aware systems, Birkedal et al. [3] proposed Plato-graphical models based on three bigraphs (actual context, proxy and computational agent), which describe the system’s states and dynamics. The interaction of the actual context and the computational agent is performed over the proxy. Another bigraph-based approach proposed in [27], uses three types of context information: physical, virtual and action. Each one has a control and a graphical representation. Authors in [24] defined three independent sets of nodes: contexts, calculations and capabilities. Finally, in [16] authors introduced the Bigraphical Agents model (BiAgents), based on a separation between system-aware and unaware. The aware part is described by bigraphs and the unaware part is described (modelled) as agents. In BRS (Bigraphical Reactive Systems) based approaches, only graphicals representations have been used to model context-aware systems and their evolution. There is no information or formal definition of the relationship between the context changes and the system reactions.
As we notice, several approaches for context modelling have been proposed. It becomes necessary to choose the most suitable modelling techniques that consider dynamic context at different levels.
Proposed approach
In a context-aware systems modelling, designers must consider some additional aspects in contrast with classical software systems. In fact, the modelling of context-aware systems encompass the modelling and managing of context aspects or elements (i.e. humans, sensors, effector, and so forth) and their dynamic evolution; which makes such systems hard to model and therefore manage through time.
In this section, we present our approach for the modelling of context-aware systems. Influenced by a software engineering background, concepts like abstraction, separation of concerns and modularity are employed to provide a modelling approach where expressiveness and simplicity are the primary objectives of the our approach.
The proposed approach is structured into two main steps. The first one focuses on the definition of the overall structure of the system for both the contextual and functional parts. At this stage, the resulted model will be represented by a bigraph. In the second step, we model the dynamics of our context-aware system in term of context reconfiguration at the local and the global level by using bigraphical reaction rules.
In this work, we consider the concept of context as defined by Dey [6]“Context is any information that can be used to characterize the situation of an entity. An entity is a person, place, or object that is considered relevant to the interaction between a user and an application”.
Bigraphical reactive systems
Bigraphical Reactive Systems were introduced by Milner [12] to provide a graphical, intuitive formal model capable of representing at the same time connectivity and locality concepts of distributed systems such as Multi-agent system (MAS).
The anatomy of bigraphs.
Bigraphical Reactive Systems (BRS) provide a model for information systems with mobile place and mobile link, where real world-pervasive and distributed systems can be described and analysed. Moreover, they provide a unification of existing process calculi for concurrency and mobility (such as
Structural aspects: a bigraph is the combination of two independent structures placing and linking graphs (see Fig. 1b and c respectively). The placing graph represents system entities geographical distribution. While the linking graph is a hypergraph representing interconnections between these entities. A bigraph is contained in a root representing its logical or physical location. It is composed of a hierarchical set of interacting nodes and may also include sites. Within a bigraph, system entities are represented by nodes
where
Bigraph can also be expressed by term language, the primary operations and elements used in this paper are summarised in Table 1.
Algebraic expression of bigraphs
Dynamical aspects: bigraphs structural dynamics is expressed through a BRS (Bigraphical Reactive System) consisting of a category of bigraphs and a set of reaction rules, each one defines a redex bigraph to be transformed to a reactum bigraph.
Therefore, there exist two types of reaction rules: linking and placing. As an example, we provide the dynamics of a simple agent (denoted by
In our approach, a context-aware system is modelled by the composition of two bigraphs denoted by GC and GMAS. The first bigraph (GC) defines the contextual parts of the system represented as a set of interconnected nodes modelling the (logical/physical) distribution and the relations between the context entities. Therefore, the functional/decisional part of the system is modelled by the bigraph GMAS which represents a set of interconnected agents that compose our MAS.
Reaction rule for entering the room (placing).
Reaction rule for connecting to the computer (linking).
To encode the context, we use Milner’s standard bigraph definition to model the different context entities. This choice is motivated by the genericity (abstraction) and the expressiveness of this conventional definition to encode a large number of aspects related to context-aware systems. Besides, we want our approach to be as generic as possible, and we do not want to restrict our context to just a known set of entities, thus, promoting the extensibility and dynamicity of our approach. Further, we give the designer the possibility to model the contextual part of the system by defining the context entities that he needs at the design time.
An example of a GC bigraph encoding the contextual part of a context-aware system is given in Fig. 4. It describes a traffic situation composed of a car
where
An example of a context bigraph GC.
The second bigraph GMAS modelling the functional part of a context-aware system is encoded as a bigraph modelling the MAS managing our context-aware system.
where
SA is a finite set of simple agents that are neither autonomous nor intelligent (e.g. Simple Network Management Protocol (SNMP) agents [12]). This type of agents can be employed to specify hierarchical MAS organisations (e.g. Federated MAS such as OAA [11] and also subsumption MAS organisations, (e.g. ADEPT (Advanced Decision Environment for Process Tasks) [15]). An SA agent is composed of WA type agents, and modules of type AM (e.g. communication facilitators, etc.), it formally takes the following form:
WA is a finite set of sophisticated agents that may exhibit either autonomy or intelligence. Example: belief, desire, intention (BDI) agents [18]. We use this type of agents to specify flat and modular MAS organisations. For instance, MAS based on the JADE platform [2], Archon [26], OSACA [20] and other open organisations. An WA agent is composed of a set of agent modules AM. AM is a finite set of agent specialised software constructs or modules, implementing capabilities (such as reasoning, planning, decision-making, learning modules, etc.).
GMAS bigraph.
In BRS-MAS, a multi-agent system is specified following core principles that we organise in two levels of abstraction: social (or MAS) level and internal (or agent) level. At the social level, the MAS designer focuses on defining the social structure of MAS. Further, the BRS-MAS model provides an explicit notation for describing the structure of MAS architecture. Therefore, the structural aspect at the social level is expressed using two graphs: The place graph representing the organisational topology in term of concepts such as groups and roles (agents enacting a specific role), and the link graph representing the links and interconnections between these entities. These combined two graphs shape the bigraph
Following the two perspectives (top-down or bottom-up), we can build a system where the building blocks may have the same control, and thus an identical internal structure or different controls and consequently different internal structures. In both cases, the model allows such abstraction and heterogeneity thanks to the notion of abstract interface represented by inner/outer face. Indeed, agents in our system must have structurally identical interfaces to communicate with one another and, therefore, work together to solve a local or global goal.
The BDI agent nodes
Bigraphical model of the BDI Agent.
In the following, we show through an example of a BDI agent, how we can specify using our bigraphical-based model, agents’ internal structure. This type of agents will be used all throughout the rest of the paper.
The bigraph
An example of an algebraic specification of BDI-MAS bigraph given in Fig. 6 is as follows:
where
The signature
Nodes of the BDI-MAS architecture
As a result, a context-aware system is defined as the composition of the bigraphs GC and GMAS using the tensor and the parallel products. This results in a bigraph representing the structural part of our context-aware system.
where
Context-aware system bigraph nodes
We illustrate in the following how we encode the key structural aspects of context-aware systems into bigraphical expressions. Our primary purpose is to provide an exhaustive and unambiguous approach for modelling context-aware systems while keeping the model complexity under consideration. To accomplish this task, we reflect the essential aspects by defining a sorting for each bigraph modelling a particular part of the system: the context, MAS bigraphs
In our model, we represent each context entity with a node nested in a precise region. The interactions between the different entities are modelled by links (edges and names). The controls used to encode the different bigraphs forming the main context-aware system bigraph CAS are listed in Table 4.
In the previous section, we have discussed the structural aspects of our proposed approach. Yet, we did not speak about how to represent our model dynamics in terms of reconfiguration. The dynamic behaviour of context-aware systems is specified using a set of bigraphical reaction rules. In this section, we define a set of parametric reaction rules to deal with the behavioural aspects of this kind of systems from the context and MAS perspectives while respecting the system constraint. A parametric reaction rule takes the form:
Particularly, we propose two main reaction rules categories to handle the various interactions between the context entities and the agents that manage each entity and more importantly. The reconfiguration of a context-aware system is whether trigged in response to the emergence of new environmental changes or objectives. In our BRS-based approach, we exhibit a high level of reconfiguration. Besides, to the specification of flexible constructs for context-aware systems. Our main contribution relies on the definition of a set of reaction rules expressing the reconfiguration of the system at different levels.
The reconfiguration at the context level is represented as the dynamic evolution of the system entities by adding or deleting new entities. Thus, modifying drastically or simply reorganising the actual structure where entities can move from a location to another. In addition, the organisational interaction pattern can dynamically change by adding or deleting one or more external links. Similarly, the agent internal reconfiguration consists of adapting its internal behaviour by adjusting its structure in order to achieve a global or a local goal. For a better understanding, we use the previously defined BDI agent as an example. Table 5 illustrates the context and the BDI-MAS architecture behavioural model.
GMAS reconfiguration
GMAS reconfiguration
The reaction rules defined in the previous section may serve to model various and complex reconfiguration patterns to simulate different evolution scenarios of context-aware systems. Each scenario consists of a sequence of reaction rules applications.
Smart car architecture.
Bigraphical traffic management system representation.
In this section, we illustrate our proposed approach through a motivating example of a smart car traffic management system.
At first, we encode the structural aspects of this example by a bigraph CAS that models the initial state of a smart car traffic management system. Then, we define some executions scenarios for the system representing different behavioural situations at runtime. The various scenarios are encoded using a set of sequences of reaction rules applications instantiated from the ones described above (see Table 5).
A smart car traffic management system is designed to help driver while driving and also prevent accidents. A smart car includes a number of sensors (i.e. speed sensors, rain sensors, GPS, etc.), control modules and actuators (i.e. Adaptive Cruise Control, warning alarm, the self-parking system, etc.) that are used to collect and interpret context information about the driver, the traffic and the car it self. This information is employed to provide the most reliable assistance services in real time [4].
Scenario 1 reaction rules.
A general smart car architecture is shown in Fig. 7.
The structural part of the smart car traffic management system is modelled by the bigraph CAS depicted in Fig. 8. As you can see the root 0 represents the actual environments of our current system. It contains a set of interconnected nodes and a number of sites. The grey square 0-site is used to represent other parts of the context that have been abstracted away. The nodes of type
In this section, we demonstrate the ability of our BRS-based approach to model the context-aware systems as shown in Fig. 8.
The algebraic expression of the model is as follows.
where
In the following, we introduce a motivating traffic sign recognition scenario that illustrates how a smart car system could adapt itself in response to environmental context changes.
Scenario 1: At first, the driver must get into the car. Then, since the driver is in the car and using the driving components (Ac, brake) of the car. It moves through the different road parcels to reach the driver’s destinatio. While moving forwar, the car passes from a parcel to another.
Scenario 2: The speed limit may change. When a traffic sign is detected by the car’s sensors (1) as shown in Fig. 8, (2) if the detected sign exceeds the actual speed limit the (3) car’s Notification Management Unit (NMU) alerts the driver through a sound alert and by displaying a text message of the speed limit; (4) simultaneously the Speed Management Unit (SMU) components automatically adjust the speed limit. Formally, the aforementioned scenarios are modelled by a sequence of reaction rules (see Table 6).
Traffic management system reaction rules
Reaction rules sequence is as below.
Starting from the bigraph
The execution plan
The traffic management system reconfigurations described in Scenario 2 are given by the execution plan
We notice that the initial state of Scenario 2 is the last situation in Scenario 1. That is since the car is moving from one parcel to another. The speed limit may change by the presence of a traffic sign in the actual road parcel. So, the car automatically detects the new traffic and analyses the traffic sign information; this done by the execution of the RL5. Then, if the actual car speed is beyond the allowed speed the SMU node sends a notification to the driver through the NMU node, at the same, it automatically adapts the car speed by applying the reaction rules RL11, RL10, RL9. Figure 10 represents the final state of Scenario 2.
Smart car system reconfiguration.
Modelling the context is to show the adaptation of the system to the environment. In other words, it explicitly shows, in a high-level language, how the system has been and what it will become. One of the main objectives of a context model is to explain and show how the applications support the operations organisation. The context model should also articulate all major system components and dependencies between elements.
The main goal of creating a model is to analyse and validate the systems operations.
To ensure the reliability and advantages of our model, we implemented and checked important criteria in the context-aware systems.
#Smart Car nodes
%active SmartCar1 : 1;
%active SmartCar 2 : 1;
%passive Driver : 2;
%active SMU : 4;
%active NMU : 2;
%active Engine : 1;
%passive Accelerator: 2;
%passive Brake: 2;
#Road nodes
%active Road1 : 2;
%active Road2 : 2;
%active Road3 : 2;
%active Road4 : 2;
%passive TrafficSign : 1;
#System edges
%name e1;
%name e2;
%name e3;
%name e4;
%name e5;
%name e6;
%name e7;
%name e8;
#Smart car initial state
Listing 2 represents the specification of the reaction rules applied to perform the composition operation.
#RL 1 Get into the car reaction rule
#RL 3 Move forward reaction rule
#RL5 Traffic sign detection reaction rule
#RL7 Move into the car reaction rule
#RL8 Initiate acceleration reaction rule
#RL10 Notify the driver reaction rule
#RL9 Brake reaction rule
#RL11 Resolution of an internal goal reaction rule
$Road[-,-].(SmartCar[z,-].((Driver [x,y,-,-].($3)|$2) | $0)|Road’ [-,-].($1)
Road[-,-].($0) | Road’ [-,-]. (SmartCar[z,-].(Driver[x,y,-,-].($3)|$2)|$0)
Once the smart car modelled and all the reaction rules are defined, it is time to specify the property to be checked.
Here, we focus on proving that the final state corresponding to the bigraph reconfiguration displayed in Fig. 10 is reachable.
We note that the final state is a terminal state which does not lead to any further states and there are no reactions that can be applied to it.
The specification of the final_state property in BigMC is presented in Listing 3
#Properties
%property
%check
The execution of the BigMc model checker prove that final_state is reached in Step 10 as shown in Listing 4.
>C:\progra∼1\BigMC\bin\bigmc-m 1000-r 50-p
>C:\DOCUME∼\Ali\LOCAL∼1\Temp\bigmc_model55436573467634.bgm
The contribution of this paper, is to present a coherent and graphically intuitive architectural notation, along with a mathematical specification which allows the designer to reason and analyse context-aware systems and their dynamicity. Earlier works in the literature such as in [1, 9, 21, 23] are based on semi-formal approaches and focus on modelling context-aware systems from a limited perspective namely a context-oriented perspective, where the relation between the system and it running environment is not explicitly specified. Moreover, they reduced the design of a context-aware system to a pre-established often-rigid structure. Consequently, it restricts the design of reconfigurable and dynamic systems.
In this paper, we settle those issues by proposing a formal and flexible approach. Hence, offering the designer the possibility to model a context-aware system following structured modelling perspectives. By proposing a set of generic key abstractions such as bigraphical nodes, abstract interfaces and sites, etc. Using two independent and complementary bigraphs enabled us to models our system context, structure and dynamics independently from the system’s functional part.
Formal approaches were introduced to model context-aware systems in order to ensure the efficiency and correctness of these systems. In this perspective, [18, 19] proposed Petri Nets based approaches while authors in [28, 22] used Process calculus as an underlying formal basis for the specification of system’s structure and behaviour. Nonetheless, these solutions offer less abstraction and may result in complex design. In addition, the context-aware system structure is fixed at the design stage and no architectural evolution mechanisms are provided in order to settle reconfiguration and dynamic issues. Differently from all the related works above, in our proposed model, we clearly settle these limitations thanks to the underlying formalism where concepts of distribution and interaction are modelled separately using two structures, the place and link graphs. As a result, we have a verifiable specification which can be validated using model checking tools.
Similarly, to our proposed approach. [24, 16, 27] used bigraphs to model context-aware systems following different system’s decomposition in order to reduce the complexity of the modelling. However, we note that there is no information or formal definition of the relationship between the context changes and the system reactions. In this paper, we follow a two-step modelling approach to design a context-aware system by defining two bigraphs, modelling respectively the context and the functional (SMA) part of the system. In contrast with all the related works cited above a detailed specification of the functional part of the system [7] and its relation to the contextual part is clearly defined using bigraphs and bigraph’s operations. Moreover, to the best of our knowledge, none of the existing approaches considered the local and global contexts. Finally, the reconfiguration and dynamic of our system architecture is carried out by defining a set of placing and linking reaction rules, reducing the complexity and resulting in a better scalability of the context-aware system modelling.
Table 7 summarises a small comparative study, organised according to the following features: methodology, context modelling, relationships and dependencies of context entities and functional ones, dynamicity and properties verification.
Related work comparison
Related work comparison
The main aim of this article is to propose an intuitive and a purely formal approach that allows modelling context-aware systems. The system’s specification is based on BRS as a formal framework and the multi-agent systems paradigm as a development methodology. Our BRS based approach encourages a high-level of abstraction and supports building context-aware systems by providing modularity and separation of concerns. At a high level of abstraction, a context aware-system is modelled on two complementary conceptual steps. The first step consists explicitly in describing the contextual part of the system. It represents the physical dimension that refers to the context part that can be represented and measured by hardware sensors (e.g. the car’s speed sensor, camera, the car) and the remaining parts (context-unaware) of the system represent the physical world of the context-aware system (e.g. Traffic sign, road parcel, light, pressure, and so forth). In the second step, the modelling focuses on the operational part. It represents the logical dimension. It is mostly specified by the agents and their interactions, i.e., the user’s goals, tasks and the business processes, we use the MAS paradigm to model this dimension. More precisely, a context-aware system specification is the composition of the two bigraphs GC (for the context part) and GMAS (for operational part (SMA)). Further, the context-aware system behaviour and dynamic reconfiguration are specified using reaction rules. Finally, the resulted modelling can be validated using a bigraphical model checker (BigMC). The main contributions of the paper are:
Proposing a formal approach representing the context-aware systems. A formal approach for contextual part of the system. A formal model to represent the global and local context of context-aware systems.
The perspectives of this study are:
Refining and detailing the MAS: To get a coherent system with regards to its context model. We are planning to use the Agent Architecture. Description Language (AADL) to formally specify the MAS for context-aware systems. Checking other properties such as integrity and compatibility with other environments.
Footnotes
Authors’ Bios
