Abstract
Context-aware systems are ubiquitous computing systems capable to adapt themselves to a dynamically changing environment. Ensuring consistency in context-aware systems has proved a challenging task due to the inherent expressive power required to model dynamical systems. In the current work, we propose the use of the μ-calculus with converse, an expressive modal logic, for modeling and verifying consistency. In particular, we propose a consistency model for a context-aware communication system. Consistency is tested in terms of the satisfiability of a μ-calculus formula. We show this consistency verification method is correct and a complexity analysis is provided. We also describe an implementation with several experiments.
Introduction
Context-aware systems are flexible and adaptable to the context of information [4]. Due to the inherent huge amount of context variables in these systems, developing a context-aware system tends to be a complex task for developers. In order to help reduce complexity and improve the maintenance and scalability in context-aware systems, it then is necessary to use modeling and reasoning techniques.
Basic modal logic K is an extension of propositional logic with necessity and possibility operators [5]. Many extensions of K, such as linear temporal logic (LTL), propositional dynamic logic (PDL), computational tree logic (CTL) and description logics (DLs), have been successfully used as reasoning frameworks in a wide range of domains, such as program analysis, knowledge representation, databases, programming languages.
Due to the well-known balance of expressive power and efficient reasoning algorithms associated to modal logics [11], we propose in the current work the use of expressive modal logics as a reasoning framework for context-aware pervasive systems. In particular, we propose a consistency model for a context-aware communication system. The system is composed of a set of users with communication preferences, and a set of locations with communications constraints. Location of users at different times are described in a schedule. Communication can be synchronous or asynchronous. The system is free of inconsistencies when users are able to communicate in spite of location and communication preferences and constraints. We characterize this consistency model in terms of the satisfiability of a μ-calculus (an expressive modal logic) formula. We show this characterization is correct and optimal. Also, an implementation is described and tested with several experiments.
Related works and motivation
The context-aware communication system described in this work is inspired from the one introduced in [4, 8]. In contrast with [4, 8], where a communication recommendation results from a set of user and location communication constraints (preferences), in our proposal, the system is verified and consistency is guaranteed, that is, users communication capability is tested in the setting of location and communication constraints. Furthermore, the communication system described in the current paper considers also a time schedule for each user, verifying also asynchronous communication. These types of time constraints were not modeled in the approaches followed in [4, 8], due to the well-known hierarchical specification limitations of the modeling language CML (Context Modeling Language).
Other approaches for modeling of context-aware systems are those who can model space constraints. These models can be expressed as [3]: where you are, who you are with and what resources are nearby. There are different types of spatial modeling such as set-based, hierarchical, graph-based, and hybrid. In the current proposal, locations are modeled symbolically by logic propositions. In contrast with known space modeling approaches [3, 4], one major feature of the consistency model described in the current work is that time and space constraints are modeled in a sole verification framework.
Ontologies have been also successfully used as a modeling language for context-aware systems [6, 10, 12]. In particular, in [1] several intelligent environments are modeled and simulated by means of an OWL 2 (Web Ontology Language) reasoning framework. Space modeling is a known limitation of ontology frameworks [4]. This is due to the expressiveness limitations associated with the corresponding efficient reasoning algorithms in description logics. The μ-calculus may expressive description logics [11]. In the current proposal, we use an efficient implementation of a μ-calculus reasoning algorithm [9] to test the consistency model.
In [7], it is described a modeling and verification framework for context-aware systems. The modeling part of this framework is based on Model Driven Engineering (MDE), and the verification part is based on the model checking of Linear Temporal Logic (LTL) formulas. System invariants are generated from the MDE model, then these invariants are tested by the Maude LTL model checker. The expressive power of the modeling language used in our proposal, μ-calculus, which also subsumes LTL, allows to describe more complex specification invariants, such as the consistency notion proposed in the current paper, which involves non-linear tree-shaped models, and time and location constraints.
Outline
In Section 2, we describe the communication system, their input and define the consistency system. In Section 3, we introduce the μ-calculus with converse modalities, defined the consistency formula and queries of the communication system. We present the experiments in Section 4 and finally, in Section 5 we present the conclusions.
A context-aware system
Following the description of the context-aware communication system [8], in this section, we define the notion of system consistency in terms of tree structures. We present the tree structure in the style of Kripke.
A tree structure K is defined as a tuple (N, R, L) where: N is a set of nodes; R is a family of binary relations R
m
among nodes (N × N) forming a tree, that is, R1 denotes the first child relation, R2 the following (right) sibling, R3 the parent, and R4 the previous (left) sibling, we often write n′ ∈ R (n, m) instead of (n, n′) ∈ R
m
; and L is a function labeling L : N → 2
PROP
, where PROP is a set of proposition variables.
The input of the communication system consists of a set of user communication preferences, a set of location constraints, and a schedule that describing when users are at a specific location.
We present two types of communications that can be synchronous and asynchronous in a company. For instance, let say the communication system is composed of two users, whose communications preferences consist of e-mail and chat, and e-mail and phone, respectively. E-mail and chat and chat imply asynchronous communication and mobile call implies synchronous communication. It is then easy to see that user 1 can start communication asynchronously with user 2. However, it may be the case that according to the schedule, user 2 will be located at places where e-mail is not available. Furthermore, user 2 may have access to e-mail but only before user 1. In this two cases, we say the communication system is not consistent because constraints forbid communication. The μ-calculus formula characterizing the system is satisfiable, if and only if, the system is consistent.
Formally, we describe the input of the system as sets.
The set of communication channels CH = {c1, …, c
n
} is divided in asynchronous AC and synchronous SC, that is, CH = AC ∪ SC and AC∩ SC = ∅. The set of user preferences (restrictions) PC is composed of pairs (u, c), where u is a proposition naming an user, and c is a proposition used to name a communication channel. The set of communication constraints for locations PL is composed of pairs (l, c), where l is a proposition naming a location and c is a proposition for a communication channel. The schedule is defined as the set: SCH composed by triples (u, t, l), where u is a proposition for a user, t is a proposition for a particular time, l is a proposition for a location.
We present the constraints, preferences and schedule where the user u
y
arrives at t1 to the warehouse and user u
c
arrives at t2 to the office also show user preferences and the location where they will be. We introduce the consistent system input. The set of communication channels is CH = {mobilecall, landline, message}. The set of user preferences is PC = {(u
y
, mobile call), (u
y
, message), (u
c
, mobile call), (u
c
, message), (u
c
, landline)} The set of constraints is PL = {(warehouse, mobile call), (warehouse, message), (office, mobile call), (office, landline), (office, message)} The schedule is the following set: SCH = {(u
y
, t1, warehouse), (u
y
, t2, warehouse), (u
y
, t3, warehouse), (u
c
, t2, office), (u
c
, t3, office)}
Now consider the inconsistent system input where the user u
y
has not preferences. We are based on the previous sets, the inconsistent system is presented with the following sets: The set of user preferences is PC = {(u
c
, mobilecall), (u
c
, message), (u
c
, landline)}
In order to semantically define the consistency of the communication system, we define a consistency model.
there is one node for the root r ∈ L (n); one node for each time proposition t
i
∈ L (n
t
i
) (i = 1, …, k1), which are the children of the root, that is, R (n, 1) = n
t
1
, R (n
t
j
, 2) = n
t
j+1
(j = 1, …, k1 - 1); each time node has one child per location, that is, l
j
∈ L (n
l
i,j
) and R (n
t
i
, 1) = n
l
i,1
and R (nlj,s,2) = nj,s+1, where i = 1, …, k1, j = 1, …, k2 and s = 1, …, k2 - 1; each location node has one child per channel available, that is, c
s
∈ L (ni,j,w), R (n
l
i,j
, 1) = n
c
i,j,1
and R (n
c
i,j,w
, 2) = n
c
i,j,w+1
, where i = 1, …, k1, j = 1, …, k2, s = 1, …, k3 and w = 1, …, k3 - 1; and each channel node has one child per user with that channel preference, that is, u
w
∈ L (n
c
i,j,s
), R (n
c
i,j,s
, 1) = n
u
i,j,1
and R (n
u
i,j,z
, 2) = n
u
i,j,z
, where i = 1, …, k1, j = 1, …, k2, s = 1, …, k3, w = 1, …, k4 and z = 1, …, k4 - 1.
Intuitively, a consistency model is tree of 5 levels: the first level is the root; the second is composed by the time lapses considered in the schedule; the third level contains the locations; the communication channels available at a particular location compose the fourth level; the last level contains the users associated with each communication channel. In Fig. 1 it is depicted a graphical representation of a consistency communication model.

Graphical representation of a consistency communication model.
In order to define the consistency of the communication system, we define the following relations in a tree (N, R, L): a node n1 is a child of a node n2, written child (n1, n2), if and only if, R (n1, 1) = n2 or there is a non empty sequence
(Synchronously) there is a channel node n
c
, such that child (n
c
, n
u
1
) and child (n
c
, n
u
2
), and there is a time node n
t
, such that descendant (n
t
, n
c
), descendant (n
t
, n
u
1
) and descendant (n
t
, n
u
2
); (Asynchronously) there is a channel node n
c
, such that child (n
c
, n
u
1
) and child (n
c
, n
u
2
), and there are two time nodes n
t
1
and n
t
2
, such that fsibling (n
t
1
, n
t
2
), descendant (n
t
1
, n
c
), descendant (n
t
2
, n
c
), descendant (n
t
1
, n
u
1
) and descendant (n
t
2
, n
u
2
).
Synchronous communication among two users occurs in the system consistency model when the user nodes are children of the same communication channel node and descendants of same time node.
Asynchronous communication eliminates the time restriction: the user node who starts communication must be a descendant of a time node, which is a previous sibling of ancestor time node of the other user node.
The tree has a root (r). The time nodes are three t1, t2 and t3 children of r. Each time node has two child nodes office and warehouse. Each location node has two synchronous channels (mobile call and landline) and an asynchronous channel (message). Each channel node has one user (u
y
and u
c
), which are essential to the user’s preference.
In Fig. 2 is depicted the CModel for the consistent system with synchronous and asynchronous communication. Figure 3 is observed the CModel for the inconsistent system with synchronous and asynchronous communication. In this figure we observe that the user u y does not appear in the CModel, this is because he has not preferences.

The CModel A is the synchronous communication, the formula is root ∧ N1 (tc) ∧ SC (u c , u y ) and the CModel B is the asynchronous communication and the formula is root ∧ N1 (t c ) ∧ AC (u c , u y ). Where r is the root, c1 is the mobile call, c2 is landline, c3 is the message, l1 is the office and l2 is the warehouse.
In this section, we characterize the notion of system consistency in terms of a logic formula of the μ-calculus with converse. Before defining the set of formulas, we consider a fixed alphabet composed of three sets PROP, MOD and Var, where PROP is a set of propositions, MOD = {1, 2, 3, 4} is a set of modalities, and Var is a set of variables.
We assume variables can only occur bounded and in the scope of a modality.
Formulas are interpreted as node subsets in unranked trees K = (N, R, L).
A formula φ is satisfiable, if and only if, there is a tree such as the interpretation of φ over the tree is not empty, that is
Intuitively, propositions are used as labels for nodes, negation (¬) is interpreted as set complement, disjunctions are interpreted as set union. Modal formulas 〈m〉φ hold in nodes where there is an m-adjacent node supporting φ. The least fixed-point is intuitively interpreted as a recursion operator.
Notation: φ ∧ φ : = ¬ (¬ φ ∨ ¬ φ), [m] φ : = ¬ 〈m〉 ¬ φ, νx. φ : = ¬ μx. ¬ φ [ x /¬x], ⊤ : = p ∨ ¬ p, and ⊥ : =¬ ⊤, 〈m〉0φ : = φ, 〈m〉1φ : = 〈m〉φ, 〈m〉 i φ : = 〈m〉i-1〈m〉φ where i is the natural number.
We describe a characterization of the consistency model in terms of a μ-calculus formulas.
Given the three times of N1, the locations are added for each of time. The second level is as follows:
Given the locations of office and warehouse, the third level of a consistent system is the following. The communication system is using a synchronous communication channel.
The communication system is using a asynchronous communication channel.
The third level of a inconsistent system. The system is using a synchronous communication channel.
The system is using a asynchronous communication channel.
Now, we present the fourth level where the users are in the locations with the common channels between users and locations. The fourth level of a consistent system.
The system is using a synchronous communication channel.
The system is using a asynchronous communication channel.
The fourth level of a inconsistent system.
The system is using a synchronous communication channel.
The system is using a asynchronous communication channel.
The base case is when there is only 1 time in the schedule, and 1 location. There are two subcases, when there is one communication channel of type tc available at the location, and when there is not. For the last subcase, according to Definition 6:
According to Definition 2, CModel = (N, R, L) is then defined as: N = {r, n
t
1
, n
l
1,1
}, R = R1 = {(r, n
t
1
), (n
t
1
, n
l
1,1
)}, and L (n
t
1
) = {t1}, L (n
l
1,1
) = {l1}. Which clearly satisfies N1 (tc). For the first subcase, two additional cases arise: when there is one user with the communication channel among its preferences, and when there is not. For this last case:
And the corresponding satisfying CModel = (N, R, L): N = {r, n t 1 , n l 1,1 , n c 1,1,1 }, R = R1 = {(r, n t 1 ), (n t 1 , n l 1,1 ), (n l 1,1 , n c 1,1,1 )}, and L (n t 1 ) = {t1}, L (n l 1,1 ) = {l1}, L (n c 1,1,1 ) = c1.
When there is one user with preference channel c1, then:
The corresponding satisfying CModel is then:
CModel = (N, R, L): N = {r, n t 1 , n l 1,1 , n c 1,1,1 , n u 1,1,1,1 }, R = R1 = {(r, n t 1 ), (n t 1 , n l 1,1 ), (n l 1,1 , n c 1,1,1 ), (n c 1,1,1 , n u 1,1,1,1 )}, and L (n t 1 ) = {t1}, L (n l 1,1 ) = {l1}, L (n c 1,1,1 ) = c1, L (n u 1,1,1,1 ) = u1.
For the induction step, assume there are k1 time variables, k2 locations, h (tc, t
i
, l
j
) communication channels of type tc per location (i = 1, …, k1,j = 1, …, k2), respectively, and k (tc, t
i
, l
j
, u
m
) users per communication channel (m = 1, …, h (tc, t
i
, l
j
)), resp. Assume
The second condition of the lemma goes straightforward by contradiction, that is, we assume
We now define a characterization formula for each type of communication.
In this example shows the mobile call channel because this channel is only in common for the two users. In this case, it is possible to communicate between the two users, the consistent CModel is presented in Fig. 2 and in the case where the user does not have preferences, the communication system is inconsistent and the inconsistent CModel is presented in Fig. 3. In row one of Table 4, we show the execution time for users u y and u c .

The inconsistent CModel A is the synchronous communication, the formula is root ∧ N1 (tc) ∧ SC (u c , u y ) and the inconsistent CModel B is the asynchronous communication and the formula is root ∧ N1 (t c ) ∧ AC (u c , u y ). Where r is the root, c1 is the mobile call, c2 is landline, c3 is the message, l1 is the office and l2 is the warehouse.
Location constraints
Preferences of the user
Schedule
In this communication system, the consistency is identified when 2 users or more within the company need communicate. In this case, the user U1 needs to communicate with the user U2, the user U3 with U4. For this example, the users must have a communication during the day. In a real situation, if a user can not communicate, then, the system should notify him that the preferences or schedule are not appropriate.
Table 4 shows the execution time for users U1 and U2 in row two where communication between them is possible for synchronous and asynchronous channels, but in the case where the users U3 and U4 wish to communicate is not possible for synchronous and asynchronous channels, then, the communication system is inconsistent for the users U3 and U4.
Evaluation time of the communication system
child (n
c
, n
u
i
) holds in CModel, if and only if, c ∧ 〈 # 1 〉 1 (μP. u
i
∨ 〈 # 1 〉 2P) is satisfied by CModel; descendant (n
t
, n
c
) holds in CModel, if and only if, t ∧ 〈 # 1 〉 1 (μL. (〈 # 1 〉 1 (μC. c ∨ 〈 # 1 〉 2C) ∨ 〈 # 1 〉 2L)) is satisfied by CModel; and descendant (n
t
, n
u
i
) holds in CModel, if and only if, t ∧ 〈 # 1 〉 1 (μL. (〈 # 1 〉 1 (μC. 〈 # 1 〉 1 (μP. u
i
∨ 〈 # 1 〉 2P) ∨ 〈 # 1 〉 2C) ∨ 〈 # 1 〉 2L)) is satisfied by CModel.
For asynchronous communication the proof is analogous. □
In this section, the experiments were carried out in a computer with the following features: Windows 8 operating system, AMD processor A6 2.7 GHz, 8 GB of RAM. This algorithm is online in the following url https://148.226.81.4:8181/AlgoritmoWeb/
In this work, we used for the experiments an implementation of satisfiability algorithm of μ-calculus [9]. In these experiments, considering the system input described in Definition 2, that given a set of communication channels, a set of user preferences, a set of constraints and schedule, we analyzed the consistency of the communication system, for which it was used the satisfiability algorithm of μ-calculus for identifying consistency of communication system, where if the algorithm returns true then the system is consistent but when it returns false then the system is inconsistent. Now for the following experiments, the evaluation time is in milliseconds.
Table 4 shows the system input in the columns U, L, Channels and T, where U is the number of users, L is the number of locations, the next two columns (Channels) are the number of channels for synchronous and asynchronous communication and T is the number of times. The next two columns are the CModel evaluation for the channel of communication synchronous and asynchronous, this is the satisfiability of N1. The following four columns are consistent and inconsistent queries for synchronous and asynchronous communication channels. Finally, the last two columns are the number of nodes in the CModel for synchronous and asynchronous channels.
In Example 1, the communication system is consistent since the two users can communicate. Also, Table 4 shows the experiments when a user has no preferences (row one).
Now, in Example 6, the communication system is consistent for the users U1 and U2 because can be communicated, but the users U3 and U4 have not communication, so when somebody will implement the reasoner in a communication system, this could notify the inconsistency of system when the users are declaring their preferences (row two).
Table 4 shows the experiments where these show different inputs of the communication system. We observed that the query does not increase the execution time. Also, if CModel has a higher number of nodes, then execution time of CModel is higher. Table 4 shows the system input where if we increase the number of users or the time, then the execution time has a polynomial increase, this can be observed in experiments 19, 20, 21 and 22. When we have a greater number of users, this generates more execution time because the algorithm performs a depth-first search in CModel. In another case when we increase the number of times, then, the CModel increases the size of nodes because the locations are repeated in each time, this case increases of execution time. We presented experiments with at least 20 users and 20 locations where the evaluation time is 12 seconds in synchronous communication and 25 seconds in asynchronous communication and the model size is 617 and 603 nodes, it shows in row 11. In CModel, the increment of locations is not relevant since if the users are not added to the location then this branch of CModel is truncated.
We propose this reasoner for communication systems where communication is synchronous, this is because only the current time would be evaluated. This gives the possibility of implementation in a real-time system.
Conclusions
In this paper, we proposed the used the propositional μ-calculus with converse as a modeling language for context-aware systems. In particular, we described a notion of consistency for a context-aware communication system. In a consistent system, users are able to communicate, synchronously or asynchronously, in spite of a set of communication, location and time constraints. Consistency is characterized in terms of the satisfiability of a μ-calculus formula. We tested the efficiency of this characterization with a recent implementation of a μ-calculus satisfiability algorithm [9]. Several experiments are described. We tested up to 30 users and 30 locations.
As further research perspectives, we aim to develop efficient reasoning algorithms for more expressive specification languages, such as the ones with arithmetic constructors [5]. We believe these arithmetic constructors can be used to model more complex space constraints in context-aware systems [2].
