6
Dynamic Context-Aware Service Adaptation in a Pervasive Computing System Moeiz Miraoui LATIS Laboratory, Université du Québec, École de technologie supérieure 1100, rue Notre-Dame Ouest, Montréal, Québec H3C 1K3 Canada [email protected] Chakib Tadj LATIS Laboratory, Université du Québec, École de technologie supérieure 1100, rue Notre-Dame Ouest, Montréal, Québec H3C 1K3 Canada [email protected] Chokri ben Amar REGIM Laboratory, Université de Sfax, École Nationale d'Ingénieurs de Sfax, Route de Soukra, B.P. W, 3038 Sfax Tunisia [email protected] Abstract—Pervasive computing requires that devices must be context-aware in order to provide proactively adapted services to both user and applications according to the current context. Most of the proposed approaches of service adaptation in a pervasive computing system are either not context-aware or based on an inappropriate definition of context. In this paper we propose a context-aware dynamic service adaptation approach for a device operating in a pervasive computing system. The approach is then modeled using colored Petri Nets and simulated using the CPN-Tools in order to validate it. Keywords-pervasive computing, service, adaptation, context- awarenesse, colored Petri Nets. I. INTRODUCTION A pervasive computing system (PCS) is composed of a set of smart communicating devices. The main goal of a PCS is to provide proactively adapted services to user and applications according to the current context. Context plays a crucial role in PCS and the first task of designing a pervasive computing application consists of understanding context and establishing its components in a precise and concise manner. The inappropriate definition of the word will lead to a bad use of it, which will affect the process of service adaptation according to context. Several approaches were proposed for service adaptation some of them use the classic strategy which consists of specifying for each service a set of rules and associate them to each possible context configuration. The inconvenient of such approaches is that the rules are specified before the operation of the system (not dynamic). In addition the developer has to predict all possible context configurations which are not obvious. Other approaches are based on a weak specification of context elements which has a great impact on the adaptation task. Moreover the existing methods of service adaptation are not thought to be context- aware while context-awareness is a key feature of a PCS. Even existing context-aware service adaptation approaches remain superficial and do not deal with problem in depth because they are either specific to a particular domain or based on an inappropriate definition of context. Our aim in this paper is to propose a new approach for dynamic context- aware service adaptation based on our previous definitions of context and context-awareness as well as context categorization [1]. The adaptation system is modeled using the colored Petri Nets formalism [2] and simulated using the CPN-Tools [3] based on a typical scenario of a device operating in a PCS. The rest of this paper is organized as follows: Section II presents the related works in adaptation. Section III presents context and context-awareness principles in PCS. Section IV presents our approach of context-aware service adaptation. Section V describes the modeling and simulation of the proposed approach. Section VI draws the conclusions and the perspectives of our future work. II. RELATED WORK In computing, there are mainly four kinds of adaptation: a) content adaptation, b) adaptation of behavior (services), c) presentation (or interface) adaptation and software components adaptation [4-11]. We will restrict our adaptation approach to context-aware service adaptation. The need of service adaptation has been long recognized and both manual and automatic approaches to service adaptation have been proposed. Autili et al.[12] proposed a conceptual model for adaptable context-aware service within their works on the PLASTIC project. The model is based on a view of a two- layer approach combining services and components. However they do not give a precise definition of context according to which the adaptation is done. Their model looks rather a software components adaptation then a service adaptation. Kirsh-Pinheiro et al.[13] proposed an interesting context-aware services selection using graph matching. The method consists of selecting among available compatible services the most appropriate one using similarity measures, considering the current context and taking into account the incompleteness of context information. Their approach is based on Dey’s [14] definition of context which is somehow specific to the human-computer interaction domain. In addition the dynamic adaptation consists of executing a graph-based algorithm each time the adaptation is needed which exhaust the resources of devices. Cao et al. [15] proposed a context-aware service adaptation method based on designing a policy selection mechanism using the fuzzy logic for the service formulation and introducing some fitness functions in order to select the policy having the highest fitness degree. In their approach the authors do not have specifies the elements of the context according to which the adaptation is done. Moreover the method requires a lot of processing. Houssos et al. [16] introduced a conceptual 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies 978-0-7695-3834-1/09 $26.00 © 2009 IEEE DOI 10.1109/UBICOMM.2009.55 77

[IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

Embed Size (px)

Citation preview

Page 1: [IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

Dynamic Context-Aware Service Adaptation in a Pervasive Computing System

Moeiz Miraoui

LATIS Laboratory, Université du Québec, École de technologie supérieure 1100, rue Notre-Dame Ouest, Montréal,

Québec H3C 1K3 Canada [email protected]

Chakib Tadj

LATIS Laboratory, Université du Québec, École de technologie supérieure 1100, rue Notre-Dame Ouest, Montréal,

Québec H3C 1K3 Canada [email protected]

Chokri ben Amar

REGIM Laboratory, Université de Sfax, École Nationale d'Ingénieurs de Sfax, Route de Soukra, B.P. W, 3038 Sfax

Tunisia [email protected]

Abstract—Pervasive computing requires that devices must be

context-aware in order to provide proactively adapted services

to both user and applications according to the current context.

Most of the proposed approaches of service adaptation in a

pervasive computing system are either not context-aware or

based on an inappropriate definition of context. In this paper

we propose a context-aware dynamic service adaptation

approach for a device operating in a pervasive computing

system. The approach is then modeled using colored Petri Nets

and simulated using the CPN-Tools in order to validate it.

Keywords-pervasive computing, service, adaptation, context-

awarenesse, colored Petri Nets.

I. INTRODUCTION

A pervasive computing system (PCS) is composed of a set of smart communicating devices. The main goal of a PCS is to provide proactively adapted services to user and applications according to the current context. Context plays a crucial role in PCS and the first task of designing a pervasive computing application consists of understanding context and establishing its components in a precise and concise manner. The inappropriate definition of the word will lead to a bad use of it, which will affect the process of service adaptation according to context. Several approaches were proposed for service adaptation some of them use the classic strategy which consists of specifying for each service a set of rules and associate them to each possible context configuration. The inconvenient of such approaches is that the rules are specified before the operation of the system (not dynamic). In addition the developer has to predict all possible context configurations which are not obvious. Other approaches are based on a weak specification of context elements which has a great impact on the adaptation task. Moreover the existing methods of service adaptation are not thought to be context-aware while context-awareness is a key feature of a PCS. Even existing context-aware service adaptation approaches remain superficial and do not deal with problem in depth because they are either specific to a particular domain or based on an inappropriate definition of context. Our aim in this paper is to propose a new approach for dynamic context-aware service adaptation based on our previous definitions of context and context-awareness as well as context categorization [1]. The adaptation system is modeled using the colored Petri Nets formalism [2] and simulated using the

CPN-Tools [3] based on a typical scenario of a device operating in a PCS.

The rest of this paper is organized as follows: Section II

presents the related works in adaptation. Section III presents context and context-awareness principles in PCS. Section IV presents our approach of context-aware service adaptation. Section V describes the modeling and simulation of the proposed approach. Section VI draws the conclusions and the perspectives of our future work.

II. RELATED WORK

In computing, there are mainly four kinds of adaptation: a) content adaptation, b) adaptation of behavior (services), c) presentation (or interface) adaptation and software components adaptation [4-11]. We will restrict our adaptation approach to context-aware service adaptation. The need of service adaptation has been long recognized and both manual and automatic approaches to service adaptation have been proposed. Autili et al.[12] proposed a conceptual model for adaptable context-aware service within their works on the PLASTIC project. The model is based on a view of a two-layer approach combining services and components. However they do not give a precise definition of context according to which the adaptation is done. Their model looks rather a software components adaptation then a service adaptation. Kirsh-Pinheiro et al.[13] proposed an interesting context-aware services selection using graph matching. The method consists of selecting among available compatible services the most appropriate one using similarity measures, considering the current context and taking into account the incompleteness of context information. Their approach is based on Dey’s [14] definition of context which is somehow specific to the human-computer interaction domain. In addition the dynamic adaptation consists of executing a graph-based algorithm each time the adaptation is needed which exhaust the resources of devices. Cao et al. [15] proposed a context-aware service adaptation method based on designing a policy selection mechanism using the fuzzy logic for the service formulation and introducing some fitness functions in order to select the policy having the highest fitness degree. In their approach the authors do not have specifies the elements of the context according to which the adaptation is done. Moreover the method requires a lot of processing. Houssos et al. [16] introduced a conceptual

2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies

978-0-7695-3834-1/09 $26.00 © 2009 IEEE

DOI 10.1109/UBICOMM.2009.55

77

Page 2: [IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

model for context-aware adaptive services based on the Dey’s [14] definition of context and adding a categorization of a context entities in three domains. Their adaptation method is purely static which is contradict the nature of a PCS also the definition of context is not concise as mentioned before concerning the limitation of dey’s definition of context. There are other approaches of service adaptation but most of them suffer from same limitation that the approaches cited in this paper.

III. CONTEXT AND CONTEXT-AWARENESS

The first task of designing a pervasive computing application consists of understanding context and establishing its components in a precise and concise manner. The context is some information needed to interpret something but this definition is very general and does not permit a good understanding and is useless for computing [17]. Many researchers have proposed definitions of context. Some of them were based on enumerating contextual information (localization, nearby people, time, date, etc…) like those proposed by [18,19,20]. Others were based on providing more formal definitions in order to abstract the term like the one proposed by Dey [14]. Most of these definitions were specific to a particular domain such as human-computer interaction and localization systems. In our previous work [1] we have made a survey of existing definitions of context and we have proposed a service oriented definition of context for a PCS. Our definition is based on the concept of service because it plays a crucial role in the operation of a PCS. The main objective of a PCS is to proactively provide adapted services according to the global context. Service adaptation can be done in two ways: a) automatic triggering of a service according to the current context or b) changing the quality (form) of a provided service according to the current context because one or more of contextual information has or have changed its or their value(s). We have defined context in a PCS environment as follows: “Any information that triggers a service or changes the form of a service if its value changes”. This definition is enough abstract and limits the set of contextual information. Figure 1 shows the components of a PCS and the sets of information that causes the adaptation which considered as parts of the global context.

Figure 1. Components of a pervasive system: The change in values of {xi} will trigger service 1. The change in values of

{yj} will change the form of the service 1.

One important characteristic of a PCS environment is its high dynamic changes caused by the mobility. In order to support the user in his tasks, devices must be more autonomic, with minimum or no human intervention and must be context-aware to adapt provided services according to the global context. These capabilities are called context-awareness. In the same way and based on the concept of service, we have given the following definition of context-awareness: “A system is said to be context-aware if it can change automatically the form of its services or provide a service as a response to the change in the value of an information or a set of information that characterizes those services”. Not like other definition of context-awareness [17,21,22] our definition explains awareness as a reaction of the system to modifications of information values in term of triggering a service or changing its form independently from the application (more generic).

Context-awareness requires that contextual information must be collected and presented to the adaptation application. Because of the diversity, the heterogeneity and the quality of these information, it is suggested to classify or categorize these information in order to make the adaptation operation easier. Several categorizations were proposed, most of them made a classification in two categories [18,14,17,23,24]. Others have made a classification to several categories [25]. We have made a classification in two categories that seems to us more expressive and helpful: a) trigger information whose change in values causes automatic release of a service and b) form changing information whose change in values causes the changing of a service’s form. This categorization is simple because it has just two classes and complete because it covers all aspects of context.

IV. DYNAMIC CONTEXT-AWARE SERVICE ADAPTATION

The context-aware service adaptation consists of proactively trigger a service or providing it in a suitable form according to the current context. To do so, the device dynamically collects contextual information by using its sensors. The set of contextual information is fixed according to our previous definition of context. It is obvious that the sensed contextual information need some interpretation to be useful (for instance time=9 PM means it is night and no sun light). The task of the developer consists in determining for each device, the set of services that it can provide and for each service the set of forms over which the service can be provided (for instance a laptop computer can provide the service of network connection in both two forms : wired or wireless). For each service, there are a set of contextual information in which the change of their values will trigger the service or change its form. This set of contextual information is composed of two classes according to our categorization of contextual information: service triggering information and form changing information.

Each service has a triggering logical expression which consists of a conjunction of a sub set of values of its contextual information set (for example let the contextual information set of a service S contain the elements {a, b, c, d, e}, an example of a triggering logical expression can be the following: ((a=50) AND (c<10)). The service will be

78

Page 3: [IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

triggered when the evaluation of its triggering logical expression is true.

In the same manner each form of a service has a form changing logical expression having the same structure as well as the triggering logical expression of a service. A service will be provided in a specific form if the form changing logical expression of that form is evaluated to true. Each service is provided in its default form when triggered. This default form is fixed a priory by the developer. The structure of the adaptation system is given by Figure 2 and its formulation is as follows:

• Set of contextual information of the device

C � �C�, C�, … , C C� can be the speed of an internet connection, date, time, etc.

• Set of current values of contextual information V � � C�, D�� i � 1, … , n

• D� : is a value associated to a context element. Example : (localization, university)

• Set of services provided by a device S � �S�, S�, … , S�

• Set of forms of a service i SF� � �F�� , F�� , … , F���� x� is the number of forms of the service i F�� : the j� form of the service i, j � 1,… , x� and i � 1,… , k

• Each service uses a set of contextual information SC� � "C#$, y � 1, … ,m, m ' n

• Each service S� has a triggering logical expression SE�, i � 1,… , k

SE� is a logical combination (AND, OR, NOT) of V� � � C� , D�� with C� , SC�

• A service will be characterized by three components: service name, set of contextual information and triggering logical expression. We present it by a triplet :

-S�, SC�, SE�. i � 1,… , k • Each j� form of a service i has a form changing

expression FE�� where j � 1,… , x� and i � 1,… , k

FE�� is a logical combination (AND, Or, NOT) of V� � � C� , D�� with C� , SC�

• Finally a service is presented as follows : -S�, "F��, FE��$, SC�, SE�. where 1 � 1,… , 23and i � 1,… , k

V. MODELING AND SIMULATION

A. Colored Petri Nets and CPN-Tools

Petri Nets (PN) are used as a formal method for the

modeling of important class of systems. They permit to express both structural and behavioral properties of the systems. One important aspect of PN is that a Petri Nets can

be represented graphically as well as mathematically which enhance its clarity and readability. The state explosion problem remains a major impediment for the modeling and analyzing of complex systems. Colored Petri Nets (CPN) was proposed as an extension of ordinary PN in order to overcome the state explosion system by providing more compact models. CPN is a discrete-event modeling language combining Petri Nets [2] and the functional programming language CPN ML which is based on Standard ML [26]. The use of CPN is motivated also by the existence of software tools which support graphical construction and visualization of models. We have chosen the CPN Tools [3] to investigate the behavior of the modeled architecture using simulation, to verify properties by means of model checking, and to conduct simulation-based performance analysis.

Figure 2. Structure of the adaptation system.

B. Application scenario and simulation

In order to validate our adaptation system, we have used

a typical scenario detailed as follows : • Contextual information list of the device =

{"a","b","c","d","e","f","g","h","i","j"}. • Current values of contextual information

represented in this form : (contextual information, value). Consider the following example : ("a",10), ("b",5), ("c",20), ("d",1), ("e",30), ("f",3), ("g",50), ("h",0), ("i",2), ("j",15).

• Services provided by the device (service number) = {1, 2, 3, 4}.

• List of contextual information for each service of the device represented as follows:

(service number, [Liste list of contextual information])

Consider the following example : (1, ["a","b","c"]), (2, ["d","a","e","f"]), (3, ["g","h","b"]), (4, ["i","j"]). • New sensed value of a contextual information : ("i",

50). • The forms of each service : (service number, [list of

forms])

79

Page 4: [IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

Consider the following situation : (1, [F11, F12, F13]), (2, [F21, F22]), (3, [F31]), (4, [F41, F42, F43, F44]).

• Evaluation result of the service triggering logical expression represented in this form : (service number, Boolean value). Consider the following example : (1, true), (2, false), (3, true), (4, true).

• Evaluation result of the form changing logical expression represented in this form : (service number, [list of (form, Boolean value)]). Consider the following situation : (1, [(F11, true), (F12, false), (F13, false)]), (2, [(F21, false), (F22, false)]), (3, [(F31, true)]), (4, [(F41, false), (F42, false), (F43, true), (F44, false)]).

The adaptation system performs the following steps (Figure 3):

1. Checks if the sensed contextual information belongs to its set of context (Figure 4).

2. If it is the case it updates the value of the contextual information (Figure 5).

3. Selects one of the provided services (Figure 5). 4. Checks whether the sensed contextual

information belong or not to the set of contextual information of the selected service (Figure 6). If it belongs then go to 5 else return to 3.

5. Brings the set of contextual information of the selected service (Figure 7).

6. Evaluates the service triggering logical expression using both the new value of the sensed context element and the brought values (Figure 8).

7. Chooses one of the forms of the service (which was selected in 4 (Figure 9).

8. Evaluates the form changing logical expression using both the new value of the sensed context element and the brought values (Figure 10).

9. Reacts according to the results of both service triggering and form changing logical expression by triggering the service or changing its current form (Figure 11).

10. Returns to 4 to select another service if the evaluations of the form changing logical expressions of all the forms are done.

11. Repeats the steps 4 to 10 until the selection of all the concerned services.

After executing the simulation of this scenario we have obtained as output of the adaptation system the following results in this form: ((service number, service triggering logical expression value), (form, form changing logical expression value)).

((4, true), (F41, false)) ((4, true), (F42, false)) ((4, true), (F43, true))

((4, true), (F44, false)) This means that the service number 4 is concerned with the sensed context information and it will be triggered in its form F43.

Figure 3. Overall operation of the adaptation system.

We have made several modifications to the scenario parameters (number of provided services, number of sensed contextual information, size of the set of contextual information, number of forms of each service, values of service triggering expressions and form changing expressions, etc.) and each time we have obtained the expected results.

VI. CONCLUSION AND FUTURE WORK

The main goal of devices in a PCS is to provide adapted

services to both user and applications according to the current context. Most of the proposed approaches of service adaptation in a PCS are either not context-aware or based on an inadequate definition of context. In this paper we have proposed a context-aware service adaptation system for devices in a PCS based on service oriented definition of context. The adaptation system was modeled using colored Petri Nets and simulated using the CPN-Tools. Our future work consists of implementing the adaptation system for one device in a first step and then implementing it for a set a devices operating in a PCS in a second step.

Adaptation results

Adaptation results

Select service

context set

Select service context set

Evaluateform changeexpression

Evaluate form change expression

Select form of service

Select form of service

Select and evaluatetrigger expression

Select and evaluate trigger expression

Bring values

Bring values

Update and select service

Update and select service

Check sensed context

Check sensed context

C

Ctrl17

1`e

E

Ctrl14

E

Ctrl13

E

Ctrl11

INT

Ctrl10

E

Ctrl4

INT

T2

TT

T1

TT

Y

INT

V

Form

U

Form

C2

INT

Len

INT

check

INT

R

Service

Q

ContextVal

P

Trigger

O

ContextVal

L

Context

Context Values1`("a",10)++1`("b",5)++1`("c",20)++1`("d",1)++1`("e",30)++1`("f",3)++1`("g",50)++1`("h",0)++1`("i",2)++1`("j",15)

ContextVal

Ctrl2

1`e

E

E

Service

F

ContextList

G

Context

Services

1`(1,["a","b","c"])++1`(2,["d","a","e","f"])++1`(3,["g","h","b"])++1`(4,["i","j"])

ServiceContext

Check sensed context

Update and select service

Bring values

Select and evaluate trigger expression

Select form of service

Evaluate form change expression

Select service context set

ContextVal

Adaptation results

80

Page 5: [IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

Figure 4. Checking the sensed contextual information.

Figure 5. Updating the value and slecting service.

Figure 6. Checking the belonging to the service context set.

Figure 7. Bringing the set of the service contextual information.

Figure 8. Evaluating service triggering expression.

Figure 9. Selecting service form.

1`m

1`e

1`(n,z)

1`mExist

ContextVal

Ctrl1

1`e

E

1`("i",50)

ContextVal

Context List Context Element

ContextList

if mem m n then length m`(n,z)else empty

C

OutOut

1`(["a","b","c","d","e","f","g","h","i","j"])

1`n

1`(n1,z1)

1`(n,z)

1`(s,w)

1`(n,z)

if p=10 then 1`1else empty

1`w1`e

if mem w n then 1`selse empty

if p=10 then u`e else empty

1`n

if i=10 then 10`ielse empty

i

1`(n,z)

p if p=10 then1`1 else 1`(p+1)

e

if i=10 then 1`1else 1`(i+1)

if n=n1 andalso z<>z1 then u`n else empty

i

if n=n1 andalso z<>z1 then 1` (n,z1) else 1`(n,z)

Select Service

D3

Update

G

OutContext

ContextVal

Services

In

1`(1,["a","b","c"])++1`(2,["d","a","e","f"])++1`(3,["g","h","b"])++1`(4,["i","j"])

ServiceContext

Context Values

I/O

1`("a",10)++1`("b",5)++1`("c",20)++1`("d",1)++1`("e",30)++1`("f",3)++1`("g",50)++1`("h",0)++1`("i",2)++1`("j",15)

ContextVal

C2

OutINT

F

OutContextList

Ctrl2

In

1`e

E E

Out Service

D5

1`1

INT

D4

INT

D1

ContextVal

K

Context

Ctrl3

E

D2

1`1

INT

Out

InOut

Out

I/O

In

Out

C

InIn

Update

ContextVal

if n=n1 andalso z<>z1 then 1` (n,z1) else empty

if k=length w then 1`k else empty

1`length w

1`w 1`n

if not (mem w n) then 1`e else empty

if mem w n then length w`welse empty

1`w

if k=length w then 1`1 else 1`(k+1)

k

Selectelement

Check Context List

INT

check

Out

INTINT

ContextList

Context

Context

1`e

E

M

1`1

INT

H

ContextList

Out

GInIn

FInInCtrl2

OutOut

Ctrl4

OutOut

if k=length w then k`k else empty

Len

OutOut

L

OutOut

1`List.nth(w,k-1)

if q=k then 1`e else empty

k

e

10`n

e

j

C1

Ctrl10

OutE

ContextVal

INT

O

OutContextVal

INT

Context

Ctrl8

INT

Ctrl9

E

1`e

couple

Context

1`1

INT

INT

ContextVal

Out

Out

1`nq

1`1

q+1

ctrl5

E

e

CC2

CC1

(k,q)

(k,q)

if j=10then1`eelseempty

C4

(n1,z)

1`(n1,z)

C5

k

C2

I/OI/O

if j=10 then 1`1else empty

if k<10 then 1`(k+1)else empty

k

C2

if j=10 then 1`1else 1`(j+1)

Context Values

I/OI/O

C3

1`(n1,z)

1`(n1,z)

1`("a",10)++1`("b",5)++1`("c",20)++1`("d",1)++1`("e",30)++1`("f",3)++1`("g",50)++1`("h",0)++1`("i",2)++1`("j",15)

if k=10 then 10`k else empty

Bring Values

LInIn

C1

1`n

Ctrl4

InIn

if n1=n then1`(n,z) elseempty

z

Wait

INT

ContextVal

Service

INT

INT

Len

I/O INT

ContextVal

Ctrl10

I/OE

1`1

INT

INT

Trigger

INT

count1

1`1

INT

I/OI/O

Evaluate triggerQ

OutOut

Ctrl11

OutOut

Ready

Y

OutOut

I1

count2

R

OutOut

if z=k then 1`s else empty

O

InIn

ISelect Trigger

Expression

check

I/OI/O

if z=kthen emptyelse 1`(z+1)

1`k

1`y

if z=kthen 1`zelse empty

1`(s,exp)

1`y

1`k

TriggerContextVal

Service

if s<>s1 then 1`(s,exp)else empty

1`(1,true)++1`(2,false)++1`(3,true)++1`(4,true)

1`(s,exp)

if s<>s1 then 1`kelse empty

1`k

1`i

if i=k then 1`ielse empty

if i>k then 1`k else empty

k

if i=k then empty else 1`e

1`(n,z)

e

i

i+1

1`(n,z)

1`k

1`s1

Ctrl6

if s<>s1 then1`i else empty

if z=k then 1`(s,exp) else empty

POutOut

Trigger

W

if s=s1 then k`(s,exp)else empty

E

I/OI/O

if s<>s1then 1`s1else empty

e

if s<>s1 then 1`s else empty

1`List.nth(f,j-1)

(j,length f)

1`s

e

1`f

if s=s1 then length f`felse empty

if s<> s1 then 1`(s1,f)else empty

j

1`(s1,f)

E

Form

TT

TT

Service

1`e

E

1`1

INT

FormList

ServiceForm Select Form List

Forms

R

I/OI/O

1`(1,[("f11",true),("f12",false),("f13",false)])++1`(2,[("f21",false),("f22",false)])++1`(3,[("f31",true)])++1`(4,[("f41",false),("f42",false),("f43",true),("f44",false)])

T

count3

if j=length f then1`1 else 1`(j+1)

T2

OutOut

(j,length f)

Ctrl17

InIn

T1

OutOutCtrl13

OutOut

U

OutOut

Select Form

81

Page 6: [IEEE 2009 Third International Conference on Mobile Ubiquitous Computing, Systems, Services and Technologies (UBICOMM) - Sliema, Malta (2009.10.11-2009.10.16)] 2009 Third International

Figure 10. Evaluating form changing expression.

Figure 11. Adaptation results.

ACKNOWLEDGMENT

We acknowledge funding awarded by the Natural Sciences and Engineering Research Council of Canada (NSERC).

REFERENCES

[1] M. Miraoui and C. Tadj, A service oriented definition of context for pervasive computing, in Proceedings of the 16th International Conference on Computing, IEEE computer society press (to appear), Mexico city, Mexico, November 2007.

[2] W. Reisig, Petri Nets, volume 4 of EATCS Monographs on Theoretical Computer Science. Springer-Verlag, 1985.

[3] Home page of CPN-Tools, (visited 05/20/2009) http://wiki.daimi.au.dk/cpntools/cpntools.wiki

[4] M. Aksit and Z. Choukair, Dynamic, Adaptive and Reconfigurable Systems Overview and Prospective Vision, in Proceedings of the ICDCSW'03. 2003: Providence, Rhode Island, USA. p. 84-92.

[5] J. Keeney and V. Cahill, Chisel: A Policy-Driven, Context-Aware, Dynamic Adaptation Framework, in The 4th International Workshop on Policies for Distributed Systems and Networks. 2003, IEEE: Lake Como, Italie. p. 3-13.

[6] M.T. Segara, and F. André, A Framework for Dynamic Adaptation in Wireless Environments, in Proceedings of the Technology of Object Oriented Languages and systems (TOOLS 33). 2000: St. Malo, France.

[7] D. Narayanan, J. Flinn, and M. Satyanarayanan, Using history to improve mobile application adaptation, in Proceedings of the 3rd IEEE Workshop on Mobile Computing Systems and Applications. 2000: Monterey, California, USA.

[8] C. Efstratiou et al., An Architecture for the Effective Support of Adaptive Context- Aware Applications, in Proceedings of the. 2nd Int. Conf. in Mobile Data Management (MDM’01). 2001: Hong Kong. p. 15-26.

[9] M. Fayad and P.M. Cline, Aspects of software adaptability. Communications of the ACM, 1996. 39(10): p. 58-59.

[10] G. South, A.P. Lenaghan, and R.R. Malyan, Using reflection for service adaptation in mobile clients (t4), T. report, Editor. 2000, Kingston University, UK.

[11] M. Yarvis, P.L. Reiher, and G.J. Popek, Conductor: A framework for distributed adaptation, in Workshop on Hot Topics in Operating Systems. 1999. p. 44-49.

[12] M. Autili, V. Cortellessa, A. Di Marco and P. Inverardi, A Conceptual Model for Adaptable Context-aware Services, In Proceedings of Web Services Modeling and Testing (WS-MaTe 2006), Palermo, Sicily, ITALY, June 2006.

[13] M. Kirsch-Pinheiro, Y. Vanrompay, and Y. Berbers, Context-aware service selection using graph matching, 2nd Non Functional Properties and Service Level Agreements in Service Oriented Computing Workshop (NFPSLA-SOC'08), at ECOWS 2008, Dublin, Ireland, November 12, 2008.

[14] A. K. Dey, "Understanding and Using Context," Personal and ubiquitous computing, Vol. 5, pp. 4-7, 2001.

[15] J. Cao, N. Xing, A. T. S. Chan, Y. Feng, and Beihong Jin, Service Adaptation Using Fuzzy Theory in Context-aware Mobile Computing Middleware, Proceedings of the 11th IEEE International Conference on Real-Time and Embedded Computing Systems and Applications (RTCSA'05), Aug. 17 – 19, 2005, Hong Kong.

[16] N. Houssos, S. Pantazis, and A. Alonistioti, Generic adaptation mechanism for the support of context-aware service provision in 3G networks, IEEE 4th International Conference on Mobile Wireless Communication Networks (MWCN 2002), Stockholm, Sweden, September 2002.

[17] G. Chen and D. Kotz, A survey of context-aware mobile computing research, Department of computer science, Darmouth college, Technical report 2000.

[18] B. Schilit and M. Theimer, Disseminating Active Map Information to Mobile Hosts, IEEE Nenvork, 8(5):22-32, 1994.

[19] P. J. Brown, J. D. Bovey, and X. Chen, Context-aware Applications: From the Aboratory to the Marketplace, IEEE Personal Communications, 4(5):58–64, 1997.

[20] N. Ryan, J. Pascoe and D. Morse, Enhanced Reality Fieldwork:the Context-Aware Archeological Assistant, Computer Applications in Archeology, 1997.

[21] B. Schilit, N. Adams, and N. Want, Context-aware Computing Applications, Proceedings of the IEEE Workshop on Mobile Computing System and Application, pages 85-90, December 1994.

[22] J. Pascoe, Adding Generic Contextual Capabilities to Wearable Computers, 2nd International Symposium on Wearable Computers, 1998, p. 92-99.

[23] D. Petrelli, E. Not, C. Strapparava, O. Stock and M. Zancanaro, Modeling Context is Like Taking Pictures, CHI2000 Workshop,

[24] J. Gwizdka, What’s in the Context? In proceedings of workshop on context-awareness (CHI’2000), 2000.

[25] M. A. Razzaque, S. Dobson and P. Nixon, Categorization and Modeling of Quality in Context Information, In proceedings of the IJCAI 2005 Workshop on AI and Automatic communications, 2005.

[26] K. Jensen, L.M. Kristensen, and L. Wells, Coloured Petri Nets and CPN Tools for modeling and validation of concurrent systems, International Journal on Software Tools for Technology Transfer. Vol.9, No. (3-4), pp. 213-254, 2007

(j,z)

if z=1 then1`k else1`(z-1)

ft

e

1`k

z

1`y

e

if b<k then 1`ft else empty

1`y

if z=1 then empty else 1`e

if b=k andalso j<z then k`k else empty

1`y

1`y

e

1`k

if z=1 then k`e else empty

b

Evaluate Form Change

1`e

E

TT

E

INT

Form

ContextVal

Form

E

INT

INT

INT

1`1

INT

Q2 INT

Q4

E

ContextVal

Ctrl17

OutOut

Ctrl15

Ctrl16

b

if b=k then 1`belse empty

XY

if b=1 then empty else 1`(b-1)

if b=k andalso j<z then k`e else empty

Q3

if j<z then 1`y else empty

Reset

b

if b=1 then 1`e else empty

1`e

Ctrl14

InIn

Q1

Values

ContextVal 1`y

Ctrl12E

if b=k then 1`ft else empty

Y

I/OI/O

k

Ctrl13

I/OI/O

cont4

b

if b=k then 1`1 else 1`(b+1)

V

OutOut

T1

I/OI/O

if b=k then empty else 1`(j,z)

U

I/OI/O

Ctrl11

I/OI/O

Q

I/OI/O

if j<z then1`(s,exp)else empty

if j<z then1`e elseempty

1`(s,exp)

(j,z)

if j=z then1`e elseempty

1`ft

1`((s,exp),ft)

Adaptationresults

Ctrl14

OutE

P

I/OTrigger

T2

InTT

Ctrl2

Out

1`e

E

V

InForm

X

ServiceAndForm

In

Out

In

I/O

Out

82