3.1.2. Attribute Functions and Values
Each of the users, sessions, environment states, devices, and operations possess characteristics that are expressed as their attributes. An attribute is a function that takes an element such as a user and returns a certain value from its range. User/Session attribute functions set () is the set of attributes associated with both users and sessions. Each session s inherits a subset of the attributes of its unique user creator. This is controlled by the unique user creator . If a session s inherited a user session attribute from his user , then it is required that . The device attribute functions set () consists of attributes related to smart devices, such as “kitchen devices” and “Alex devices”. The operation attribute functions set () is a collection of attributes corresponding to different operations. For example, if you wish to characterize kid-friendly operations, you may create an operation attribute entitled “Kid-Friendly Operations” and associate it with those operations. Environment-state attribute functions set () describes the environment condition of the current instance of time. For example, “day”, “time”, and “weather condition”.
To better demonstrate the concept of attributes, we will use the use case illustrated in
Figure 3. We should mention that this use case is incomplete since it does not contain an authorization function. However, the main purpose is to illustrate the concept of attributes. In this use case, we have three users
,
, and
. The user/session attribute function
captures the user relationship to the home. From
Figure 3 we can notice that
is the parent,
is the kid, and
is the teenager in the house. The user/session attribute function
captures the user’s current location inside the house. Moreover, we have four devices
,
,
, and
. We have one device attribute function
.
captures whether the device is a dangerous kitchen device or not. Finally, we have two environment-state attribute functions,
and
, which capture the current day and users inside the house, respectively.
The main reason for using different sets of attribute functions for different components in our model is that different components have different attribute functions. For instance, the user/session attribute function is not relevant to the set of devices D. Moreover, the device attribute function does not apply to the set of users. We cannot consider a specific user as a dangerous kitchen device; the evaluation
is not semantically correct.
Basically, an attribute range is composed of a finite set of atomic values. Each attribute function
has a range
, where
represents the range of values to which the attribute function
can be evaluated. For example, in
Figure 3, the user/session attribute function
range is
, the user/ session attribute function
range is
. Similarly, the device attribute function
range is
, the environment-state attribute function
range is
, and finally the environment-state attribute function
range is the set of users
U.
Each attribute function is an atomic-valued attribute or a set-valued attribute. An atomic-valued attribute will return exactly one value from its range. In the use case given in
Figure 3, the user/session attribute functions
and
are both atomic-valued attributes since they map different users into one value only from the attribute range. The device attribute function
is an atomic-valued attribute too. It takes one device as an input and returns only one value from the attribute function range as an output, either
or
, since one device cannot be dangerous and non-dangerous at the same time. Similarly, the environment-state attribute function
is an example of an atomic-valued attribute.
On the other hand, a set-valued attribute will return a subset of the range, and not only one value from the range as in the case of atomic-valued attribute functions. For instance, in the use case given in
Figure 3, the environment-state attribute function
is a set-valued attribute.
attribute function has a range equal to the set of users
U, and it maps the environment state to a subset of values from that range. It returns a set with the names of users who are currently inside the house.
Moreover, we distinguish between two types of attributes: static and dynamic. All attributes indeed may change over a long time. However, some attributes are “relatively” static, as they tend to remain static (they evaluate to the same values) over a long period of time. Setting and changing the values of static attributes may require administrator intervention. For example, in our use case, the user/session attribute function is considered static. To further illustrate this, let us consider the user . The attribute function , in this case, evaluates to , which tends to remain constant for a long time till grows up and becomes a teenager, at which point an administrator action is required to change the value of this attribute to ; as a result, will evaluate to . Similarly, is considered a static device attribute too.
On the other hand, dynamic attributes are always changing due to various circumstances, such as time of the day, user location, etc. In our use case, , , and are all considered to be dynamic attributes. Values of dynamic attributes are automatically determined by sensors deployed in the smart home and under homeowner control.
User/session attribute functions, device attribute functions, operation attribute functions, and environment-state attribute functions can all be classified as static or dynamic attribute functions. Moreover, all attribute functions can be classified as static or dynamic, whether atomic-valued or set-valued. However, the differentiation between static and dynamic attribute functions is unnecessary for how the model works formally. The process for triggering different attributes is outside the scope of our model.
Operation and device attribute functions are partial functions. Hence, some devices or operations will not be associated with some attributes. User/Session and environment-state attributes, on the other hand, are total functions.
In mathematics, a partial function
f from a set
X to a set
Y is a function from a subset
S of
X (possibly X itself) to Y [
57]. Since operation attribute functions and device attribute functions are defined as partial functions, in the use case illustrated in
Figure 3, the device attribute function
does not have to map each device
d in the set of devices
D into a value from the range
. The
attribute function only maps the devices
and
into the values
and
respectively. However, it does not map the devices
and
into any value. In other words,
will be evaluated to be undefined.
On the other hand, total functions are defined for all elements in its domain. That being said, any static or dynamic attribute function in the set of user/session attribute functions is defined for every user in the set of users U. For instance, the user/session attribute function is defined for every user u in the set of users U. Moreover, any static or dynamic environment-state attribute function in the set of environment-state attribute functions is defined for every environment state in the set of environment state .