<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A Declarative Goal-oriented Framework for Smart Environments with LPaaS?</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Giuseppe Bisicchia</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Stefano Forti</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Antonio Brogi</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Department of Computer Science, University of Pisa</institution>
          ,
          <addr-line>Pisa</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Smart environments powered by the Internet of Things aim at improving our daily lives by automatically tuning ambient parameters (e.g. temperature, interior light) and by achieving energy savings through self-managing cyber-physical systems. Commercial solutions, however, only permit setting simple target goals on those parameters and do not consider mediating con icting goals among di erent users and/or system administrators, and feature limited compatibility across di erent IoT verticals. In this article, we propose a declarative framework to represent smart environments, user-set goals and customisable mediation policies to reconcile contrasting goals encompassing multiple IoT systems. An open-source Prolog prototype of the framework is showcased over two lifelike motivating examples.</p>
      </abstract>
      <kwd-group>
        <kwd>Goal-oriented systems</kwd>
        <kwd>IoT</kwd>
        <kwd>Logic Programming</kwd>
        <kwd>LPaaS</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The Internet of Things (IoT) is continuously growing and becoming an
integrated part of our daily lives with a plethora of new di erent applications (e.g.
smart-environments, wearables, home appliances) [
        <xref ref-type="bibr" rid="ref18 ref26">18, 26</xref>
        ], that show even
capable of a ecting our mood [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. Among the new verticals the IoT is enabling,
smart environments are getting increasing attention from the market and the
research community [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. Indeed, they empower private and public ambients to
self-manage cyber-physical systems (e.g. A/C, lights, plants watering) based on
data from IoT sensors, triggering reactions enabled by IoT actuators. Besides
their high potential to improve people's routines, these applications can also lead
to a more sustainable energy and resource management.
      </p>
      <p>
        Especially for those applications that include human goals in the
self-management loop of smart environments, the problem of reconciling contrasting goals
among di erent users emerges clearly [
        <xref ref-type="bibr" rid="ref25 ref31">25, 31</xref>
        ]. Colleagues sharing a room in a
public building { even for a limited amount of time { can possibly express very
di erent desiderata on the temperature and on the light intensity they prefer to
experience while they work. To this end, many techniques have been proposed
to reconcile such contrasting goals set by users or system administrators, e.g.
via fuzzy logic [
        <xref ref-type="bibr" rid="ref28">28</xref>
        ], multi-agent systems [
        <xref ref-type="bibr" rid="ref12 ref7">7, 12</xref>
        ] or neural networks [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]. However,
most commercial solutions, such as IFTTT [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] or Amazon Alexa [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ], only allow
setting simple goals to be met by the IoT systems they manage and do not
consider the possibility of mediating among contrasting objectives [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
      </p>
      <p>Additionally, despite being deployable out-of-the-box by their nal users,
existing commercial solutions show inherent limitations, mainly due to their
proprietary nature. These limitations prevent them to be extended and from
work across IoT verticals enabled by di erent vendors. They also make it di cult
to develop policies to mediate between users and administrator objectives, i.e.
set local and global goals. Factually, two di erent types of con ict can arise:
User-user { Di erent users can set di erent goals on their desired state of the
environment (e.g. on target temperature),
User-admin { The System Administrator can set global objectives that must
be met (e.g. on maximum energy consumption, on law constraints), which may
con ict with the user-set goals.</p>
      <p>Even after reconciling the previous types of con icts into one target state
satisfying all set (user and/or global) goals, a nal con guration of the actuators
involved must also be determined. Indeed, given a nal target state, we need to
(a) determine the correct con guration for each actuator acting on that state,
and (b) mediate between any con icting con gurations that a single actuator
possibly receives.</p>
      <p>
        In this article, we propose1 a declarative methodology to specify customisable
mediation policies for reconciling contrasting goals and actuator settings in smart
environments. The methodology can solve contrasting goals by reasoning on the
available IoT infrastructure and on (possibly contrasting) goals set by the users
and by system administrators. The novel contribution mainly consists of:
(1) a declarative framework to specify mediation policies for reconciling
contrasting (user and/or global) goals and actuator settings in smart environments,
(2) a Prolog prototype implementation of (1), Solomon, provisioned as a REST
service by relying on Logic Programming-as-a-Service (LPaaS ), recently
proposed by Calegari et al. [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] and succesfully applied to complex IoT wireless
networks [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>Solomon tames the e ects of the aforementioned types of con ict by
allowing to exibly specify ad-hoc mediation policies for distinct zones of a
smartenvironment and possible con icting settings of target actuators. Such policies
can resolve con icts (i ) among users' goals, (ii ) among users' and system
administrator's goals, and (iii) on actuators con guration. Last, but not least,
the declarative nature of Solomon makes it easy to write, maintain and extend
arbitrary mediation policies encompassing multiple IoT verticals.</p>
      <p>
        The rest of this article is organised as follows. After illustrating two
motivating examples (Sect. 2), we present our methodology for goal mediation and its
prototype (Sect. 3), showcasing them over the rst motivating example. The full
1 A work-in-progress and preliminary version of this study was presented in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
prototype is subsequently assessed over the second motivating example (Sect. 4).
Finally, we discuss some closely related work (Sect. 5) before concluding (Sect. 6).
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Motivating Examples</title>
      <p>In this section, we illustrate two scenarios from smart environments to better
highlight the need for reasoning solutions capable of mediating among
contrasting goals and encompassing di erent IoT verticals. Both scenarios consider two
main stakeholders:
User { a human or digital agent that can set goals on the ambient around them,
aiming at creating the most comfortable environment for them to live in,
System Administrator { a human or digital agent that can de ne con ict
resolution policies, and set global goals on the environment (e.g. on energy savings).
Smart Home { Consider a shared room in a student apartment, equipped
with three lights { the main light, a bed light and a corner light { and an A/C
system. In this case, depending on the time of day and the activity that is
taking place (e.g. studying, watching a lm, reading a book), di erent lighting
con gurations could be required. Con icts might arise as, for instance, Alice may
want to watch a movie while Bob is still studying in the same room. Moreover,
Alice might prefer to stay in a cool room (20 C) while Bob prefers a warmer
ambient (26 C). Natural questions raised by the above scenario are:
{ Is it possible to nd a con guration of the three lights which allows Alice and</p>
      <p>Bob to comfortably carry on their di erent activities?
{ Is it possible to nd a con guration of the A/C system which mediates among
the preferences of Bob and Alice on the environment temperature?
Smart Building { Consider now
the smart building oor sketched
in Fig. 1, consisting of a West and
an East wings. The West wing is
exposed to light most of the day
while the East wing is less
illuminated.</p>
      <p>In each wing, there are 5
rooms (4 single and one shared),
the single rooms in pairs share the
air conditioning system and the
relative temperature sensor. Also,
each room has a large light and a Fig. 1. An example of Smart Building
desk light and a brightness sensor. The shared rooms have two large lights and
their air conditioning system as well as a temperature sensor and a brightness
sensor. Besides, the rst single room in the East wing ha a small heater.</p>
      <p>Each user has been assigned a single room and has full access to shared
rooms. Furthermore, targeting sustainability, company policies require that the
temperature in the environment stays within 18 C and 22 C in autumn and
winter, and between 24 C and 28 C in spring and summer. Also in these settings,
some questions arise such as:
Q1 How to describe the available Smart Building so that it is possible to apply
ad-hoc policies for the West and East wings?
Q2 How to specify policies to manage temperature and brightness in the di erent
rooms of the building, handling con icts so as to ensure the comfort of its
inhabitants and to meet sustainability policies?
Q3 After nding a target state for a speci c room, how to determine suitable
settings of the available (shared and non-shared) actuators to reach it?
All questions raised above highlight the need for novel models and methodologies
to exibly manage smart environments, such as the one we propose in this article.
In the next section, we will detail our proposal by relying on the Smart Home
example. The Smart Building example will be used instead in Sect. 4 to assess
the methodology over a larger scale scenario.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Methodology and Prototype</title>
      <p>In this section, we illustrate Solomon, a declarative framework featuring
autonomic goal mediation in smart environments, in presence of multiple users.
Solomon is prototyped and open-sourced2 in Prolog, using LPaaS . Hereinafter,
we give an overview of the architecture we foresee for Solomon to be deployed
(Sect. 3.1), and we detail the model (Sect. 3.2) and methodology (Sect. 3.3)
underlying our framework.
3.1</p>
      <sec id="sec-3-1">
        <title>Overview</title>
        <p>2 Open-sourced and freely available at: https://github.com/di-unipi-socc/Solomon
goals and solve user-admin con icts, and to determine actuator con gurations
useful to reach a target state for the smart environment, after goal mediation.
Note that Solomon is provisioned as a service, enabled by an LPaaS engine,
which allows (i ) to easily integrate it with other pieces of software such as user
interfaces (UIs) or mobile applications and (ii ) to deploy it either to Cloud or
Edge servers, depending on the usage context.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>Model</title>
        <p>Smart Environment. To model smart environments, we rst build up a
dictionary of all types of environmental parameters we can monitor (via sensors)
and/or act upon (via actuators). We call property types the elements in such a
dictionary, assuming they are declared as in
propertyType(TypeId).
where TypeId is a literal value denoting the unique property type identi er. Given
a propertyType we can then de ne actuators and sensors that sense or operate
on that.</p>
        <p>Actuators are declared as in
actuator(ActuatorId, TypeId).
where ActuatorId is the unique actuator identi er and TypeId the associated
property type.</p>
        <p>Analogously, sensors are declared as in:
where SensorId is the unique sensor identi er and TypeId is the associated
property type. Environmental values monitored by each sensor are denoted by
sensor(SensorId, TypeId).
sensorValue(SensorId, Value).
where SensorId identi es the sensor and Value is the last value it read.
Example. Based on the above, the shared room of the Smart Home example
of Sect. 2 can be declared as in
propertyType(light). propertyType(temp).
sensor(brightness, light). sensorValue(brightness, 20).
sensor(temperature, temp). sensorValue(temperature, 22).
actuator(smallLight, light). actuator(mainLight, light).
actuator(cornerLight, light). actuator(ac, temp).
where two sensors measure two di erent property types (i.e. temperature and
brightness), having three lamps that can act on brightness and the AC system
capable of changing the temperature. Please note that the current temperature
settles at 22 C and the brightness at 20 out of 255.</p>
        <p>System administrators can divide smart environments into di erent zones, which
allow distinguishing which global policy to apply to speci c sets of sensors and
actuators:
zone(ZoneId, MediationPolicy).
where ZoneId is the unique zone identi er and MediationPolicy is the unique
identi er of the global management policy the zone is subject to. A zone groups
one or more property instances, de ning a set of actuators and a set of sensors
that operate on a speci c property type. A property instance is declared as in
propertyInstance(ZId, PIId, TypeId, Actuators, Sensors).
where ZId identi es the zone to which the instance belongs, PIId is the property
instance identi er, TypeId is the propertyType of PIId, Actuators is a list of
actuators that operate on the property and Sensors is a list of sensors that monitor
it within the zone. All actuators and sensors in a given property instance must
have the same property type. The identi er of a property instance is unique
only within the zone, allowing for distinct zones to have instances with the same
identi er.</p>
        <p>Example. The property instances of the Smart Home example can be described
by declaring a single livingroom zone and, for instance, four property instances
as in
zone(livingroom, _).
propertyInstance(livingroom, studyingLight, light, [cornerLight, mainLight], [brightness]).
propertyInstance(livingroom, movieLight, light, [cornerLight, smallLight], [brightness]).
propertyInstance(livingroom, readingLight, light, [smallLight], [brightness]).
propertyInstance(livingroom, roomTemp, temp, [ac], [temperature]).</p>
        <p>It is worth noting that the rst three property instances all refer to the light
property, grouping the brightness sensor with the lamps needed to realise
different settings on such property, e.g. for studying (cornerLight and mainLight),
watching a movie (cornerLight and smallLight), or reading a book (smallLight
only). The last property instance refers instead to the temp property, grouping
to the temperature sensor and the A/C system (i.e. ac).</p>
        <p>Users and Goals. A user is declared as in
user(UserId, AllowedZones).
where UserId is the unique user identi er and AllowedZones is the list of the zones
on which the user can set goals. User goals are declared as in
set(UId, ZId, PIId, Value).
where UId is the user identi er, ZId identi es a zone, PIId is one of the property
instances of the zone, and Value is the goal expressed by the user on the property
instance.</p>
        <p>Example. Still following the Smart Home scenario, Alice and Bob, and their
goals on brightness and temperature are represented as per
user(alice, [livingroom]).
set(alice, livingroom, movieLight, 20).
set(alice, livingroom, roomTemp, 20).</p>
        <p>user(bob, [livingroom]).
set(bob, livingroom, studyingLight, 80).</p>
        <p>set(bob, livingroom, roomTemp, 26).</p>
        <p>Alice aims at setting the movieLight property instance to 20 out of 255 and the
roomTemp to 20 C. Bob, on the contrary, wants to set the studyingLight property
instance to 80 out of 255, and the roomTemp to 26 C.
3.3</p>
      </sec>
      <sec id="sec-3-3">
        <title>Reasoner</title>
        <p>The model described up to now denotes the inputs that Solomon receives from
the smart environment it manages as well as from its users. Fig. 3 lists the core
code of Solomon, which works in three main steps that constitute the top-down
methodology of the proposed framework to determine a target state for a smart
environment. Those steps are as follows:
1. it collects all user requests 3 that are currently submitted to the system
(getRequests/2, line 2) and extracts only those that are valid,
2. it mediates requests referring to the same property instance by applying the
mediation policies speci ed by the system administrator, so to determine a
target state for each property instance (mediateRequests/2, line 3) by solving
all user-user and user-admin con icts,
3. it nally determines actions (i.e. settings) for individual IoT actuators so to
achieve the target state, by also resolving possible con icting actions found
for a single actuator (associateActions/2, line 4).
1 react(Requests, MediatedRequests, Actions)
:2 getRequests(Requests, ValidRequests),
3 mediateRequests(ValidRequests, MediatedRequests), validMediation(MediatedRequests),
4 associateActions(MediatedRequests, Actions), validActions(Actions).
5 getRequests(Requests, ValidRequests)
:6 findall((ZId, PIId, Value, UId), set(UId, ZId, PIId, Value), Requests),
7 findall( (ZId, PIId, Value, UId),
8 ( member((ZId, PIId, Value, UId), Requests), user(UId, Zones), member(ZId ,Zones),
9 validRequest(ZId, PIId, Value) ), ValidRequests).
10 validMediation(Reqs)
:11 sort(Reqs, OrderedReqs),
12 \+( ( member((Z,PI,V1), OrderedReqs), member((Z,PI,V2), OrderedReqs), dif(V1,V2) ) ),
13 \+( ( member((Z,PI,V), OrderedReqs), \+( validRequest(Z,PI,V) ) ) ).
14 validActions(Actions)
:15 sort(Actions, OrderedActions),
16 \+( ( member((A,V1), OrderedActions), member((A,V2), OrderedActions), dif(V1,V2) ) ),
17 \+( ( member((A,V), OrderedActions), \+( validValue(A,V) ) ) ).</p>
        <p>Overall, the react/3 predicate (line 1) returns three lists: the list of all
Requests, the list of MediatedRequests containing the target states for each
property instance and the list of Actions to perform to reach a nal target state. It is
worth noting that, while the framework leaves complete exibility to the system
administrators in de ning their own mediation policies, it also checks that inputs
and outputs of each phase are well-formed (through predicates validMediation/1,
line 3, and validActions/1, line 4). This guides the system administrators in their
task of writing (formally) valid mediation policies.
3 findall(Template, Goal, Result) nds all successful solutions of Goal and
collects the corresponding instantiations of Template in the list Result. If Goal has no
solutions then Result is instantiated to the empty list.</p>
        <p>Collecting Requests. First, Solomon collects all the requests through getRequests/2
(line 2, lines 5{9), which determines two lists of tuples (ZId, PIId, Value, UId),
where each tuple corresponds to a set(UId, ZId, PIId, Value) with arguments
rearranged for easier handling in later stages. The rst list Requests contains all
current requests from users (line 6). The second one, ValidRequests, only contains
valid requests (line 7{9), i.e. by default4, requests for which the zone and the
property instance exist, and the zone is among those the user associated with
the request can set goals on.</p>
        <p>Example. In the Smart Home scenario, querying
?- getRequests(Requests, ValidRequests).
returns the following:
Requests = ValidRequests,
ValidRequests = [(livingroom, movieLight, 20, alice), (livingroom, studyingLight, 80, bob),
(livingroom, roomTemp, 20, alice), (livingroom, roomTemp, 26, bob)].
collecting all requests from Alice and Bob.</p>
        <p>Mediating Requests. Valid requests are then passed to the mediateRequest/3
predicate (line 3) which can be exibly and freely speci ed by the system
administrator. The objective of this phase is to mediate between the possible con icting
goals of the users by determining one target value for each property instance.
The mediateRequests/2 predicate outputs a list, MediatedRequests, of such values
for each property instance, in the form of triples (ZoneId, PropertyInstanceId,
Value). Then, the validMediation/1 predicate (lines 3, 10{13) checks that the
list contains no duplicates (line 12) and that all requests are still valid after
mediation (line 13).</p>
        <p>Example. In our Smart Home scenario, a possible mediateRequests/2 that simply
averages user requests for a same property instance is as follows:
mediateRequests(Requests, Mediated)
:groupPerPI(Requests, NewRequests),
mediateRequest(NewRequests, Mediated).
mediateRequest([],[]).
mediateRequest([(Z,PI,Rs)|Reqs], [Mediated|OtherMedReqs])
:mediatePI(Z,PI,Rs,Mediated),
mediateRequest(Reqs, OtherMedReqs).
mediatePI(Z, PI, Ls, (Z, PI, Avg))
:</p>
        <p>findall(V, member((V,_),Ls), Values), avg(Values,Avg).</p>
        <p>Input Requests are rst grouped per property instance by groupPerPI/2, which
returns a list of triples (Z,PI,Rs) where Z and PI identify a property instance
and Rs is the list of requests that target it. By recursively scanning such list,
mediateRequest/2 exploits mediatePI/4 to average all requests grouped for each
property instance.</p>
        <p>By querying mediateRequests/4, we obtain
4 System administrators can easily extend the concept of valid request by including
further checks based on domain-speci c knowledge, e.g. on the range of allowed
values for a given property. This can be done by extending the validRequest/3
predicate exploited by getRequests/2 (line 9).</p>
        <p>Mediated = [(livingroom,movieLight,20), (livingroom,roomTemp,23), (livingroom,studyingLight,80)].
which represents a target state where movieLight and studyingLight are set to 20
and 80 respectively, and roomTemp to 23 C, i.e. the average of Bob and Alice's
goals.</p>
        <p>Determining Actions. After obtaining a target state for each property instance,
Solomon generates a list of actions for available actuators to reach such a target.
An action is a pair (AId, Value) where AId is the identi er of an actuator and
Value is the value it needs to be set to. The associatedActions/2 predicate (line
4) inputs a list of mediated requests and returns a list of actions, according to
System Administrator policies.</p>
        <p>The validActions/1 predicate (lines 4, 14{17) checks whether there are no
duplicate settings (line 16) and that obtained values are valid according to
System Administrator policies (line 17), which can check if the con guration for an
actuator can factually be implemented, using validValue/2.</p>
        <p>Example. A simple policy that computes the setting for each actuator by
dividing the target value of a propertyInstance by the number of its actuators, is
speci ed as in
associateActions(Requests, ExecutableActions)
:actionsFor(Requests, Actions),
setActuators(Actions, ExecutableActions).
actionsFor([],[]).
actionsFor([(Z, PI, V)|Reqs], Actions)
:propertyInstance(Z, PI, _, Actuators, _),
selectActionsForPI(Z, PI, V, Actuators, _, Actions1),
actionsFor(Reqs, Actions2),
append(Actions1, Actions2, Actions).
selectActionsForPI(_, _, V, Actuators, _, Actions)
:</p>
        <p>length(Actuators, L),triggerAll(V, L, Actuators, Actions).
triggerAll(_, _, [], []).
triggerAll(V, L, [A|Actuators], [(A,VNew)|Actions])
:</p>
        <p>VNew is V/L, triggerAll(V, L, Actuators, Actions).
setActuators(Actions, ExecutableActions)
:</p>
        <p>setActuatorsWithMax(Actions, 0, 100, ExecutableActions).</p>
        <p>First, for each input requests, a triple (Zone, PropertyInstance, TargetValue),
actionsFor/2 gets the list of actuators of that speci c propertyInstance. Then, it
selectActionsForPI/6 computes the list of actions to be performed by dividing the
target value for each propertyInstance by the number of its actuators. Note that
when an actuator belongs to more than one propertyInstances, setActuators/2
selects the highest value available cutting that value with a lower bound of 0
and an upper bound of 100.</p>
        <p>By querying associateActions/2 in the Smart Home scenario, given the target
state of the previous example, we obtain:
?- associateActions(Mediated, Actions).</p>
        <p>Actions = [(ac, 23), (cornerLight, 40), (mainLight, 40), (smallLight, 10)]
Note that the ac actuator is set to 23 C, i.e. the value of the target state.
As for movieLight and studyingLight, being composed of several actuators, a
further mediation happens. The target value of 20 for movieLight is split across
cornerLight and smallLight, setting each to 10. Analogously, the target value of
80 for the studyingLight is split across mainLight and cornerLight, setting each to
40. The con ict on cornerLight, being in both property instances, is solved by
picking the maximum between 10 and 40, viz. 40.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Smart Building Example Retaken</title>
      <p>In this section, we exploit Solomon to answer the questions raised about the
Smart Building scenario of Sect. 2. The answer to Q1 is obtained by specifying
di erent zone(ZoneId, MediationPolicy) facts for the rooms in the smart building
(Fig. 1), as in
zone(room_E_1, east).
zone(room_E_3, east).
zone(commonRoom_E, east).</p>
      <p>zone(room_W_1, west). zone(room_E_2, east).
zone(room_W_3, west). zone(room_E_4, east).</p>
      <p>zone(commonRoom_W, west).</p>
      <p>zone(room_W_2, west).
zone(room_W_4, west).</p>
      <p>The east and west literals identify two di erent mediation policies, speci ed by
System Administrator , to be applied to the property instances grouped under the
zone. Such grouping can be obtained by specifying suitable propertyInstance(ZId,
PIId, TypeId, Actuators, Sensors) facts as, for instance, in
propertyInstance(room_E_1,roomTemp,temp,[acOdd_E,heater],[tempOdd_E]).
propertyInstance(room_E_1,roomLight,light,[biglightRoom_E_1,smalllightRoom_E_1], [lightRoom_E_1]).
propertyInstance(room_E_3,roomTemp,temp,[acOdd_E],[tempOdd_E]).
propertyInstance(room_E_3,roomLight,light,[biglightRoom_E_3,smalllightRoom_E_3],[lightRoom_E_3]).
that describes the sensors and actuators available in the Room 1 and Room 3 of
the East wing. Note that the two rooms share the acOdd E actuator for the A/C
system and that Room 1 contains the heater actuator that is not available in
Room 3.</p>
      <p>Based on the knowledge representation above, we can now answer Q2 by
suitable implementations of mediateRequests/2. Indeed, the System Administrator
can easily declare mediation policies to solve user-user and user-admin con icts
in a context-aware manner. Such behaviour can be obtained through predicate
mediatePI/4 (which is used by mediateRequests/2 as illustrated in Sect. 3) :
mediatePI(Z, PI, Ls, (Z, PI, Avg))
:findall(V, member((V,_),Ls), Values),
avg(Values,AvgTmp),
zone(Z, MediationPolicy),
propertyInstance(Z, PI, Prop, _, [Sensor]),
sensorValue(Sensor, SensedValue),
findValue(Policy, Prop, SensedValue, AvgTmp, Avg).</p>
      <p>First mediatePI/4 averages all user requests for a speci c propertyInstance so
to mediate possible user-user con icts. Then, it exploit findValue/4 to mediate
between the obtained average with the global policy enforce by the System
Administrator . Such mediation is based on the MediationPolicy of the wing (i.e.
east, west), on the property type Prop (i.e. light, temp) on the value obtained by
the sensor of that instance (i.e. SensedValue) and on the computed average value
AvgTmp.</p>
      <p>Fig. 4 lists the code of predicate findValue/4. The rst clause of findValue/4
(lines 1{4), manages the temperature in both wings in the same way. After
determining the current season (line 2), it enforces that the target value is within
the season-dependent ranges speci ed for sustainability purposes (line 3{4), viz.
18{22 C in Winter and Autumn and 28{24 C in Summer and Spring. The second
and the third clauses of findValue/4 (lines 5{6 and 7{9) manage instead the
environmental brightness, depending on the wing of the room, on the current
brightness and the weather. This process determines a mediated target state
that reconciles all user-user and user-admin con icts on each property instance,
which fully answers Q2.</p>
      <p>Finally, the answer to Q3 is achieved through the implementation of the
associateActions/2 predicate. In our Smart Building, the policy we chose to adopt
consists of dividing the workload equally between the various actuators, with
the only exception of the heater that only accepts two values, viz. 0 or 100. The
code is similar to the one proposed in the previous section for the Smart Home,
in which the selectActionsForPI/6 is adapted to the new policy and in case of
multiple requests to the same actuator, now the maximum value is chosen.
selectActionsForPI(_, _, V, Actuators, _,
Actions):</p>
      <p>length(Actuators, L),triggerAll(V, L, Actuators, Actions).
triggerAll(_, _, [], []).
triggerAll(V, L, [A|Actuators],
[(A,VNew)|Actions]):dif(A, heater),</p>
      <p>VNew is V/L, triggerAll(V, L, Actuators, Actions).
triggerAll(V, L, [heater|Actuators],
[(heater,100)|Actions]):</p>
      <p>V &gt; 0, triggerAll(V, L, Actuators, Actions).
triggerAll(V, L, [heater|Actuators],
[(heater,0)|Actions]):</p>
      <p>V =&lt; 0, triggerAll(V, L, Actuators, Actions).
setActuators(Actions, ExecutableActions)
:</p>
      <p>setActuatorsWithMin(Actions, -inf,inf, ExecutableActions).</p>
      <p>First selectActionsForPI/6 computes the number L of actuators of the
propertyInstance, then triggerAll/4 is called which distributes the workload to the
actuators with the exception of the heater. Finally, setActuators choose the maximum
in case of multiple sets for a speci c actuator (with no lower or upper bound).
With this process we can determine the correct con guration for each actuator
acting on that state, and mediate between any con icting con gurations that a
single actuator possibly receives, answering to Q3.</p>
      <p>We conclude this section by describing a use case for the scenario above
exploiting the policies described. Suppose that it is a sunny day in winter, with
the brightness value sensed in the West common room at 160 out of 255, and
user u1 sets the brightness of her room to 0 and the temperature to 18 C. On
the contrary, user 3 sets the temperature at 28 . Assume that the two rooms
share the A/C system but not the lighting system. Meanwhile, user u4 sets the
temperature and brightness of room2, which she is not authorised to handle.
Finally, users u2 and u8 are both in the commonRoom E with the same goal for the
light but di erent goals for the temperature (respectively 23 C and 18 C).
season(winter).
user(u1, [room_E_1,commonRoom_E,commonRoom_W]).
user(u3, [room_E_3,commonRoom_E,commonRoom_W]).
user(u8, [room_W_4,commonRoom_E,commonRoom_W]).
set(u1, room_E_1, roomLight, 0).
set(u1, room_E_1, roomTemp, 18).
set(u3, room_E_3, roomTemp, 28).
set(u4, room_E_2, roomLight, 0).
set(u4, room_E_2, roomTemp, 18).
sensorValue(lightCommonRoom_W, 160).
user(u2, [room_E_2,commonRoom_E,commonRoom_W]).
user(u4, [room_E_4,commonRoom_E,commonRoom_W]).
set(u2, commonRoom_W, commonRoomLight, 255).
set(u2, commonRoom_W, commonRoomTemp, 23).
set(u8, commonRoom_W, commonRoomLight, 255).
set(u8, commonRoom_W, commonRoomTemp, 18).</p>
      <p>For each room the result of the mediation phase with the application of global
policies described before is:
[(room_E_1,roomLight,100), (room_E_1,roomTemp,18), (room_E_3,roomTemp,22),
(commonRoom_W,commonRoomLight,255), (commonRoom_W,commonRoomTemp,20.5)]
where roomLight of room E 1 is bounded on 100 because it is the minimum bound
for the light in the East wing, while the roomTemp is within the bounds. Meanwhile,
roomTemp of room E 3 is bounded to 22 the maximum temperature allowed in
winter. Instead in commonRoom W the temperature is the average of the two requests
because it is within the boundaries and also the light because we are in the West
wing and it is sunny (brightness &gt; 100) so the maximum bound is 255, the goal
of both users. Finally, the goals of user u4 are ignored because is not authorised
to interact with room E 2. Then, the actions to be carried out, given the states
computed, will be:
[(acCommonRoom_W, 20.5), (biglightCommonRoom_W_1, 127.5),(biglightCommonRoom_W_2, 127.5),
(acOdd_E, 22), (heater, 100), (biglightRoom_E_1, 50), (smalllightRoom_E_1, 50)]
where the temperature of commonRoom W is managed only by acCommonRoom W and the
light is implemented by two main light which equally divide the goal. Meanwhile,
acOdd E is the air conditioning system shared by room 1 and 3 and is setted to
the maximum of the two goals (18 and 22) and also in room E 1 the heater is
working. Finally, the small and big light work together to implement the goal.</p>
    </sec>
    <sec id="sec-5">
      <title>Related Work</title>
      <p>
        In this section, we discuss some closely related work on the self-management of
smart environments. Most of these works fall within three main categories, viz.
goal-oriented [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ], hierarchical [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], and neural and fuzzy [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ].
      </p>
      <p>
        First, [
        <xref ref-type="bibr" rid="ref29 ref3 ref32 ref33">3, 29, 32, 33</xref>
        ] and [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ] propose goal-oriented approaches to con ict
mediation. Targeting global goals like energy e ciency, users comfort, and system
security, [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] presents a solution to manage smart buildings by adding a semantic
layer on top of the stack of IoT devices for reaching the desired global goals,
exploiting an ontology of goal types. With a more formal approach, [
        <xref ref-type="bibr" rid="ref29">29</xref>
        ] devise
a methodology for autonomic device management describing the evolution of a
smart environment as the set of evolutions of single device states, modelled as
command sequences. Given a global goal, this solution determines the correct
sequence of commands to reach it. Besides, [
        <xref ref-type="bibr" rid="ref33">33</xref>
        ] proposes an access control
mechanism exploiting a priority-based policy negotiation technique to solve user-user
con icts in a smart home, made of multiple devices. Finally, Tartarus [
        <xref ref-type="bibr" rid="ref30">30</xref>
        ], is a
Prolog platform designed to integrate cyber-physical systems and robots,
supporting mobility, cloning, and payload carrying. More in general, [
        <xref ref-type="bibr" rid="ref32">32</xref>
        ] propose a
solution for the problem of con icts resolution in a multi-agent system, through
argumentation-based reasoning. Similarly, [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] propose a multi-agent framework
to contextually compose existing web services in Smart Envirnoments via
reasoning and learning. As per its goal-oriented nature, Solomon enables system
administrators to write customised policies that can accommodate sophisticated
and expressive mediation policies exploiting for example the semantic ontology
of [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] or the negotiation technique of [
        <xref ref-type="bibr" rid="ref33">33</xref>
        ].
      </p>
      <p>
        Second, hierarchical solutions for goal mediation have been proposed by [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ]
and [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ]. Dynamic hierarchical goal management for di erent IoT systems is
discussed in [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], considering con icting local and global goals, and the availability
of limited resources that can vary at runtime. Regarding security in smart
environments and in particular Smart O ces, [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] propose a hierarchical,
agentbased solution that considers the high number of potential users, their security
roles and the heterogeneity of devices and spaces. An interesting extension to
Solomon is to include hierarchical approaches to solve goals and to consider
security aspects as well.
      </p>
      <p>
        Third, and last, fuzzy logic [
        <xref ref-type="bibr" rid="ref10 ref24 ref28">10, 24, 28</xref>
        ] and neural network [
        <xref ref-type="bibr" rid="ref17 ref4">4, 17</xref>
        ] approaches
to goal mediation have been studied recently, along with their combination [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ].
Fuzzy logic can be used for context-awareness in Smart Home as illustrated
in [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ], where raw data from the sensors are processed to manages actuators
according to the computed context based on the user movement and activity.
The works in [
        <xref ref-type="bibr" rid="ref10 ref28">10, 28</xref>
        ] propose expert systems to control the A/C of smart
buildings, based on the current status of the sensors and the outside temperature.
Similarly, [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ] manages A/C systems through a neuro-fuzzy controller where an
adaptive neural network is used to better tuning the fuzzy rules, making them
more robust. Neural networks have also been successfully used to predict energy
consumption more reliably than traditional techniques [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] and for indoor
temperature forecasting [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. As Prolog is well-suited to implement fuzzy logic [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ], an
interesting extension of Solomon is to accommodate fuzzy controllers. Similarly,
predictions based on neural networks can be made available in the knowledge
base of Solomon from external services or by relying on recent implementations
of Prolog that support neural networks (e.g. DeepProbLog [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]).
6
      </p>
    </sec>
    <sec id="sec-6">
      <title>Concluding Remarks</title>
      <p>This article proposed a declarative framework { and its Prolog prototype Solomon{
to specify policies for mediating contrasting (user and/or global) goals and
actuator settings in smart environments. The prototype is provisioned as a service
through LPaaS , and it can resolve user-user and user-admin con icts into a
target state for the smart environment with actuator settings.</p>
      <p>The wide variety of smart environments and the desiderata of their users and
system administrators calls for new frameworks to easily develop and
continuously adapt domain-speci c mediation policies. This work moves some rst steps
towards this direction, aiming at contributing a novel declarative approach,
enabled by LPaaS , to the eld of goal-driven management of smart environments.
As showcased in our example, thanks to its declarative nature, Solomon features
a suitable level of abstraction and exibility to accommodate di erent needs of
smart environments, making it easy to express, maintain and update mediation
policies as per the ever-changing needs of IoT scenarios.</p>
      <p>In our future work, we intend to:
{ New Policies and Data. Implement other mediation policies (e.g. based on
fuzzy logic, learning or heuristics), by also proposing a set of building blocks
that System Administrators can use to compose their own policies, and by
enabling users' geolocalisation to predict movements and preferences.
{ Answer Set Programming. Extend Solomon's API to support Answer Set</p>
      <p>
        Programming (ASP) as in [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ] so to allow processing more expressive policies.
{ Web of Things. Integrate Solomon with Web of Things to make it more
interoperable and easier to exploit in existing smart environments.
      </p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1. IFTTT:
          <article-title>If This Then That</article-title>
          . https://ifttt.com/
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>2. Amazon: What Is Alexa? https://developer.amazon.com/en-US/alexa</mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Andrushevich</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , et al.:
          <article-title>Towards semantic buildings: Goal-driven approach for building automation service allocation and control</article-title>
          .
          <source>In: ETFA 2010</source>
          . pp.
          <volume>1</volume>
          {
          <issue>6</issue>
          (
          <year>2010</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Attoue</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          , et al.:
          <article-title>Smart building: Use of the arti cial neural network approach for indoor temperature forecasting</article-title>
          .
          <source>Energies</source>
          <volume>11</volume>
          (
          <issue>2</issue>
          ),
          <volume>395</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Becker</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          , et al.:
          <article-title>Pervasive computing middleware: current trends and emerging challenges</article-title>
          .
          <source>CCF Trans. Pervasive Comput. Interact. 1 1</source>
          ,
          <issue>10</issue>
          {
          <fpage>23</fpage>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Bisicchia</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Forti</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Brogi</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Declarative goal mediation in smart environments</article-title>
          . In: SMARTCOMP, Work in Progress Track (
          <year>2021</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Booy</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Liu</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Qiao</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Guy</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>A Semiotic Multi-Agent System for Intelligent Building Control</article-title>
          .
          <source>AMBI-SYS</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Calegari</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Denti</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mariani</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Omicini</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Logic Programming as a Service (LPaaS): Intelligence for the IoT</article-title>
          . In: ICNSC. pp.
          <volume>72</volume>
          {
          <issue>77</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Calegari</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Denti</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mariani</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Omicini</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Logic programming as a service</article-title>
          .
          <source>Theory and Pract</source>
          . Log. Program.
          <volume>18</volume>
          (
          <issue>5-6</issue>
          ),
          <volume>846873</volume>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Calvino</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          , et al.:
          <article-title>The control of indoor thermal comfort conditions: introducing a fuzzy adaptive controller</article-title>
          .
          <source>Energy &amp; Buildings</source>
          <volume>36</volume>
          (
          <issue>2</issue>
          ),
          <volume>97</volume>
          {
          <fpage>102</fpage>
          (
          <year>2004</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Catalano</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          , et al.:
          <article-title>A rest-based development framework for ASP: tools and application</article-title>
          .
          <source>In: PADL 2018. LNCS</source>
          , vol.
          <volume>10702</volume>
          , pp.
          <volume>161</volume>
          {
          <fpage>169</fpage>
          . Springer (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Davidsson</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Boman</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Saving Energy and Providing Value Added Services in Intelligent Buildings: A MAS Approach</article-title>
          . In: ASA/MA. pp.
          <volume>166</volume>
          {
          <issue>177</issue>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Ferilli</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , et al.:
          <article-title>An agent architecture for adaptive supervision and control of smart environments</article-title>
          .
          <source>In: 2015 International Conference on Pervasive and Embedded Computing and Communication Systems (PECCS)</source>
          . pp.
          <volume>1</volume>
          {
          <issue>8</issue>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Gyrard</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sheth</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>IAMHAPPY: Towards an IoT knowledge-based crossdomain well-being recommendation system for everyday happiness</article-title>
          .
          <source>Smart Health</source>
          <volume>15</volume>
          ,
          <issue>100083</issue>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Jantsch</surname>
            et al.,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Hierarchical dynamic goal management for IoT systems</article-title>
          . In: ISQED. pp.
          <volume>370</volume>
          {
          <issue>375</issue>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Jian</surname>
            ,
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wenjian</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Development of an adaptive neuro-fuzzy method for supply air pressure control in HVAC system</article-title>
          .
          <source>In: SMC</source>
          . pp.
          <volume>3806</volume>
          {
          <issue>3809</issue>
          (
          <year>2000</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          17.
          <string-name>
            <surname>Kumar</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Aggarwal</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sharma</surname>
          </string-name>
          , J.:
          <article-title>Energy analysis of a building using arti cial neural network: A review</article-title>
          .
          <source>Energy &amp;</source>
          Buildings pp.
          <volume>352</volume>
          {
          <issue>358</issue>
          (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Lee</surname>
            ,
            <given-names>S.K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bae</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kim</surname>
          </string-name>
          , H.:
          <article-title>Future of IoT Networks: A Survey</article-title>
          .
          <source>Applied Sciences</source>
          <volume>7</volume>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Manhaeve</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dumancic</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kimmig</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Demeester</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Raedt</surname>
          </string-name>
          , L.D.:
          <article-title>DeepProbLog: Neural Probabilistic Logic Programming</article-title>
          . arXiv
          <year>1907</year>
          .
          <volume>08194</volume>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          20.
          <string-name>
            <surname>Marsa-Maestre</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>De La Hoz</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Alarcos</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Velasco</surname>
            ,
            <given-names>J.R.:</given-names>
          </string-name>
          <article-title>A Hierarchical, Agentbased Approach to Security in Smart O ces</article-title>
          .
          <source>In: ICUC</source>
          (
          <year>2006</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          21.
          <string-name>
            <surname>Merabti</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Draoui</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bounaama</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>A review of control systems for energy and comfort management in buildings</article-title>
          . In: ICMIC. pp.
          <volume>478</volume>
          {
          <issue>486</issue>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          22.
          <string-name>
            <surname>Naji</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          , et al.:
          <article-title>Application of adaptive neuro-fuzzy methodology for estimating building energy consumption</article-title>
          .
          <source>Renew. and Sustain. En. Reviews</source>
          <volume>53</volume>
          ,
          <issue>1520</issue>
          {
          <fpage>1528</fpage>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          23.
          <string-name>
            <surname>Palanca</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          , et al.:
          <article-title>Designing a goal-oriented smart-home environment</article-title>
          .
          <source>Inf. Syst. Frontiers</source>
          <volume>20</volume>
          (
          <issue>1</issue>
          ),
          <volume>125</volume>
          {
          <fpage>142</fpage>
          (
          <year>2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          24.
          <string-name>
            <surname>Patel</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Champaneria</surname>
            ,
            <given-names>T.A.</given-names>
          </string-name>
          :
          <article-title>Fuzzy logic based algorithm for Context Awareness in IoT for Smart home environment</article-title>
          .
          <source>In: TENCON</source>
          . pp.
          <volume>1057</volume>
          {
          <issue>1060</issue>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          25.
          <string-name>
            <surname>Perumal</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , et al.:
          <article-title>Rule-based con ict resolution framework for Internet of Things device management in smart home environment</article-title>
          .
          <source>In: GCC</source>
          . pp.
          <volume>1</volume>
          {
          <issue>2</issue>
          (
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          26.
          <string-name>
            <surname>Perwej</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>AbouGhaly</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kerim</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harb</surname>
            ,
            <given-names>H.A.M.:</given-names>
          </string-name>
          <article-title>An extended review on internet of things (iot) and its promising applications</article-title>
          . CAE pp.
          <volume>2394</volume>
          {
          <issue>4714</issue>
          (
          <year>2019</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          27.
          <string-name>
            <surname>Rubio-Manzano</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Iranzo</surname>
            ,
            <given-names>P.J.:</given-names>
          </string-name>
          <article-title>A Fuzzy Linguistic Prolog and its Applications</article-title>
          .
          <source>J. Intell. Fuzzy Syst</source>
          .
          <volume>26</volume>
          (
          <issue>3</issue>
          )(
          <issue>3</issue>
          ),
          <volume>1503</volume>
          {
          <fpage>1516</fpage>
          (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref28">
        <mixed-citation>
          28.
          <string-name>
            <surname>Salih</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Fuzzy Expert Systems to Control the Heating, Ventilating and Air Conditioning (HVAC) Systems</article-title>
          . IJERT 4 (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref29">
        <mixed-citation>
          29.
          <string-name>
            <surname>Sanaullah</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Corno</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Razzak</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Autonomic goal-oriented device management for Smart Environments</article-title>
          .
          <source>J. Ambient Intell. Smart Environ</source>
          .
          <volume>7</volume>
          (
          <issue>4</issue>
          ),
          <volume>425</volume>
          {
          <fpage>448</fpage>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref30">
        <mixed-citation>
          30.
          <string-name>
            <surname>Semwal</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , et al.:
          <article-title>Tartarus: a multi-agent platform for integrating cyber-physical systems and robots</article-title>
          .
          <source>In: AIR</source>
          . pp.
          <volume>20</volume>
          :
          <issue>1</issue>
          {
          <issue>20</issue>
          :
          <article-title>6</article-title>
          .
          <string-name>
            <surname>ACM</surname>
          </string-name>
          (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref31">
        <mixed-citation>
          31.
          <string-name>
            <surname>Sfar</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Raddaoui</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bouzeghoub</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>Reasoning Under Con icts in Smart Environment</article-title>
          .
          <source>In: ICONIP (3)</source>
          . pp.
          <volume>924</volume>
          {
          <issue>934</issue>
          (
          <year>2017</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref32">
        <mixed-citation>
          32.
          <string-name>
            <surname>Shams</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          , et al.:
          <article-title>Argumentation-Based Reasoning about Plans, Maintenance Goals, and Norms</article-title>
          .
          <source>ACM Trans. Auton. Adapt. Syst</source>
          .
          <volume>14</volume>
          (
          <issue>3</issue>
          ), 9:
          <issue>1</issue>
          {9:
          <issue>39</issue>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref33">
        <mixed-citation>
          33.
          <string-name>
            <surname>Sikder</surname>
            ,
            <given-names>A.K.</given-names>
          </string-name>
          , et al.:
          <article-title>Kratos: Multi-User Multi-Device-Aware Access Control System for the Smart Home</article-title>
          . p.
          <fpage>112</fpage>
          . WiSec '
          <volume>20</volume>
          (
          <year>2020</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>