# Cognitive Pervasive Service Composition Applied to Predatory Crime Deterrence
## 2 Related Works
### Service Composition  
In [21] a service is defined as an abstract entity that provides a consistent set of capabilities and has an interface to communicate with clients. We classify services as web services and pervasive services. Web services can be invoked independently of the place and do not consider user context. Pervasive services can provide services only to nearby clients, consider their context and use hardware devices to interact with the environment to satisfy users' requirements. Unlike web services, pervasive services are focused on meeting user intentions, not just producing an output [21].  
Frequently, users' requirements are impossible to satisfy with a single service, mainly because of the requirements' complexity. This situation generates the need to use multiple services working together to solve complex problems. The overall service delivers individual services that satisfy final user requirements [22]. Thus, service composition is the chaining of service interfaces syntactically or semantically. A service's output is channeled as the next service(s)'s input while content filtering and format modification tasks are performed [23]. There are different service composition mechanisms; one of the most relevant for us is dynamic composition achieved using graph construction. This mechanism is important because it combines existing services to reach a complex solution [24], and because it is very close to the way the human brain constructs an action plan [25].  
Service composition results are particularly useful in pervasive computing, also known as ubiquitous computing [26]. The main characteristic of pervasive computing is its dynamic complex environment, made up of many InfoCom devices supporting mobility and perceiving information regarding their environment [21]. Pervasive service composition is service composition performed using software services, using hardware and considering the context. Pervasive service composition is useful in open, dynamic environments where device and network availability cannot be ensured.  
Pervasive service composition allows pervasive systems to exploit the capabilities of a variety of devices in the environment, allowing it to offer enriched functionality and serve as a basis for creating ambient intelligence or AmI. For this reason, service composition has become a topic of interest in fields such as IoT and AmI [22; 27; 28; 29].  
Before we can perform a service composition, we must be able to find the required services for the aforementioned composition: a process known as service discovery, and usually supported by protocols known as service discovery protocols (SDP). We use these protocols to detect devices and services in a network [21]. They are essential because the result of pervasive service composition depends on finding available and useful services in the user's environment.  
Given that we intend to develop a system that creates composite services without human intervention, we focus on automatic service composition [30], which is the name given to composition techniques with no human intervention. Automatic service composition approaches include AI planning, data integration, process synthesis and conversations [31]. The primary approach to achieving automatic service composition deals with it as a planning problem [32].  
In an urban environment, all available devices and their network infrastructure constitute a pervasive system. It is possible to create a complex composite service with the capabilities of this infrastructure. The key is to plan and decide which of these services and devices are appropriate to create the required service.