Context-Aware System Modeling Based on Boolean Control Network

Boolean control network consists of a set of Boolean variables whose state is determined by other variables in the network. Boolean network is used for modeling complex system. In this paper, we have presented a model of a context-aware system used in smart home based on Boolean control networks. This modeling describes the relationship between the context elements (person, time, location, and activity) and services (Morning Call, Sleeping, Guarding, Entertainment, and normal), which is effective to logical inference. We apply semi tensor matrix product to describe the dynamic of the system. This matrix form of expression is a convenient and reasonable way to design logic control system.


Introduction
Context-awareness is an important characteristic for smart home.Context-aware system reacts and adapts according to the changes in the domain environment.Researchers in different fields make a lot of contribution for context-aware system.The goal of the context-aware system in smart home is to provide services that maximize the user's comfort and safety while minimizing the user's explicit interaction with the environment as well as the cost of the service [1].Context-aware systems can be implemented using production rules (if-then relationships), neural networks, support vector machines, fuzzy logic, Bayesian networks, etc. [2]- [5].Boolean network (BN) was introduced by Kauffman to formulate the cellular networks [6].A BN network consists of a set of Boolean variables whose state is determined by other variables in the network.BN is also used for modeling some other complex systems such as neural networks, social and economic networks.The state of each variable at time t + 1 can be determined by the state of its spatial neighbors at time t.A BN network with n variables has 2 n possible states and the dynamics of BN is converted into an equivalent algebraic form as a standard discrete-time linear system using the matrix expression of logic.One possible way to enrich the dynamics is to consider BN with inputs and outputs called Boolean control network (BCN).Our aim is to create a mathematical model that explains the system and represents the effects of different components and to make predictions about behavior.A context-aware system can be considered as a Boolean control networks, where context elements are treated as control inputs and different services as state variables.We used left semi-tensor matrix product to describe the dynamics of the system.
In real environment, different types of sensor is used to collect situational (user ID, location, activity, etc.) and environmental (temperature, humidity, illumination, CO 2 , etc.) data.Context is formed with this data.Contextaware system offer different types of services to the user based on the context information.The set of rules (logic expression) are used for this purpose.Using left semi tensor product, we can derive linear algebraic equation of these logic expression.These linear algebraic equations express state-spaces.For smart home architecture, an important term is inference.Inference system can deduce knowledge from knowledge base which helps to provide context-aware service for home user.Matrix expression is a new and convenient approach for logic inference.
The rest of the paper is organized as follows: Section 2 presents a brief review of related topics for Boolean control network.Section 3 presents mathematical modeling of context-aware system followed by conclusion and future work are drawn in Section 4.

Boolean Control Networks
A Boolean control network (BCN) is a discrete-time logical dynamic control system.Its dynamics can be expressed as where,

{ } { }
: , , or 1, 0 , 1, , , =  are control inputs.Boolean control network can be represented as directed graph with n nodes and m inputs.An edge from node i to node j represents that node j is effected by node i. Figure 1 shows the graphical representation of a BCN.D. Cheng, et al. proposed the concept of left semi-tensor product and used it to represent BCNs in a linear algebraic state-space form [7] [8].A briefly review on some topics are represented, which is useful for studying BCNs in a control-theoretic framework.

Matrix Expression of Logic
A logical variable represents value from a set D = {T, F}, or {1, 0}.For matrix expression we identify truth "T" and false "F", with the vectors where, i k δ is the ith column of the identity matrix I k and

Left Semi-Tensor Matrix Product
Definition 2: Unlike Kronecker product (⊗), the semi-tensor product (⋉) is a generalization of the conventional matrix product that allows multiplying two matrices of arbitrary dimensions.The left semi tensor product of two matrices where α is equal to least common multiple of n and p (lcm(n, p)).

Algebraic Representation of Boolean Functions
A Boolean function can be converted into an algebraic form using the left semi-tensor matrix product.Any is said to be the structure matrix of the r-ary logical operator σ if ( ) , , : Table 1 listed some of the structure matrices used in BCN.Definition 4: A swap matrix W [m,n] is an mn × mn matrix, defined as follows.Its rows and columns are labeled by double index (i, j), the columns are arranged by the ordered multi-index Id(i, j: m, n), and the rows are arranged by the ordered multi-index Id(j, i: m, n).The element at position [(I, J), (i, j)] is then otherwise

Procedure to Make Structure Matrix
We can make structure matrix of the function ( ) , , , r p p p σ  in the following three steps.
Step 1.Using the fact that pM = (I 2 ⊗ M)p , all factors of structure matrices M j or I 2 ⊗ M j can be move to the front and move all the variables, p i , to the rear of the product.
Using a swap matrix the order of two logical variables can be changed W [2] p i p j = p j p i Step 3. Using a power-reducing matrix, the power of the p i 's can all be reduced to 1.The coefficient matrices, generated by reducing orders, can be moved to the front part.

Algebraic Representation of BCNs
The dynamics of BCNs can be represented by a set of Boolean functions, so a linear algebraic state-space representation can be possible using left semi-tensor matrix product.
i i x u δ δ ∈ Then the dynamics of Equation ( 1) can be expressed as ( ) ( ) ( ) where, the matrix L is called the transition matrix of the BCN and

Solution of a Logical Equation
Using the following algorithm, scalar form of the logical unknowns can be easily calculated.
are in vector form.Then: The scalar form of {p j } can be calculated from i inductively as follows: Step 1. Set 0 : 2 .
2 , 1, 2, , j j n j n j j j j q p q q p j n

Mathematical Modeling of Context-Aware System
In smart home context-aware system provides different types of services.We can define each service as a logical function of context elements and states.These context elements and states are Boolean logical variables with value either true or false.Logical equation of smart home context-aware system are expressed as This model realizes five output services, Morning Call Service (y 1 ), normal service (y 2 ), Entertainment Service (y 3 ), Sleeping Service (y 4 ) and Guarding Service (y 5 ).For each service we consider separate service state.So there are five service states, Morning Call state (x 1 ), normal state (x 2 ), Entertainment state (x 3 ), Sleeping state (x 4 ), and Guarding state (x 5 ).For input it uses eight context elements with Boolean logic values true and false.These context elements are categorized as person u 1 (father (p), mother (q), son (r), daughter (s)), time (morning (u 2 ), evening (u 7 ), night (u 5 )), location (bedroom (u 3 ), sofa (u 8 ), outside (u 6 )) and activity (lying (u 4 )).Each service state can be defined by logical relation between the context elements.Figure 2 Using logic variables we can express logic Equation (9) as follows: ( ) x x p q r s u u u x x x x p q r s u x x x x p q r s u u x x x x p q r s u u u x x x p q r s u This logical function (11) can be converted into an algebraic function using left semi-tensor matrix product (⋉), definition and theorems described in introduction section as: where, x p q r s =    , M d structure matrix, [ ] ) The logical functions in (13) can be represented by structure matrix of logical operator and the applying the properties of left semi-tensor product can be represented as: ( ) where, M c = structure matrix of logical conjunction operation, M d = structure matrix of logical disjunction operation, I 2 = identity matrix and W [2] = swap matrix.Applying left semi-tensor product on both sides the system of logical Equation ( 14) can be converted into a linear algebraic equation as: Morning call service (y 1 ), sleeping service (y 4 ), entertainment service (y 3 ) is a subset of normal service.When any of the service (morning call, sleeping and entertainment) is true that time normal service will be false.We can define each services as The logical functions in ( 16) can be represented by structure matrix of logical operator and the applying the properties of left semi-tensor product can be represented as: where, M c = structure matrix of logical conjunction operation, M d = structure matrix of logical disjunction operation, I 2 = identity matrix and W [2] = swap matrix.Applying left semi-tensor product on both sides the system of logical equations can be converted into a linear algebraic equation as: ( ) ( ) where, ( ) ( ) ( ) ( ) Every service is composed of some controlling facilities to turn on and off of home appliances and device.Morning call service (c 1 ) turns on the alarm device (b), room light (c), blind (d), coffee maker (e), water heater (f).Sleeping service (c 2 ) turns off the room light and blind.Whenever nobody is inroom that time Guarding service (c 3 ) turns off all the appliances and device.Entertainment service (c 4 ) turns on the TV (h), room light.When a user is in home then normal service (c 5 ) turns on light, air conditioner (g), blind.We can describe the service by the output function of home appliances and device.
Applying left semi-tensor matrix product together on both sides of algebraic equation of (18).

Conclusion
Boolean control network is a logic-based control system.Boolean control network is realizable in Smart home context-aware control system.All the logical variables represented by values 1 or 0 in this system.In this paper, we have used Boolean control network for context-aware system.To control any system modeling is an important issue.We have defined the logic relation between context information and state variables.Then these logic relations are converted to matrix expression using semi tensor matrix product.With this matrix expression, we can control and do inference easily.At present, we have applied the network with 5 nodes, number of nodes can be extended based on the state of the service.In future, we will use k-value logic to express the logic relation more efficiently.

Figure 1 .
Figure 1.Graphical representation of two inputs and four nodes boolean control network. x

Table 1 .
Structure matrix for basic logical operators.
shows the state diagram of this system.

Table 2 .Table 2 .
The first and last few columns L s areδ 32 [32 16 32 32 32 32 32 32 32 32 32 32 32 32 ⋅⋅⋅ 32 32 32 32 24 32 28].This liner model considers vector values of logic, in real world we use scalar values for controlling.According to algorithm presented in Section 1.6 the values of different service outputs can be calculated and tabulated in Solutions of equation.