# ASP-Based Declarative Reasoning in Data-Intensive Enterprise and IoT Applications
## 1 Introduction  
Answer Set Programming (ASP) [1; 2] is an expressive and versatile [3; 4] logic programming paradigm that was introduced in the field of non-monotonic reasoning. It allows for defining complex computational problems in a clear and fully declarative fashion. With ASP, a problem can be expressed via a rule-based logic program, whose intended models, called answer sets, correspond one-to-one to solutions. These solutions can be found using ASP systems [5; 6; 7]. The intrinsic declarative nature of ASP, combined with its high expressive power, fostered the development of various supporting systems within the scientific community over time [8; 9]. This, in turn, has spurred the growth of numerous applications across various fields, including Scheduling [10; 11], Workflows [12], Optimization [13], and many others [14]. The availability of robust and reliable ASP systems has been a key factor in this growth. The DLV system [7] has been one of the first solid and reliable integrated ASP systems. Its project started a few years after the first definition of Answer Set semantics [1; 2]. Since its first versions, it has been a suitable tool for applications in academic and real-world scenarios, and significantly contributed both to spreading the usage of ASP and to fostering AI-based technological transfer activities. After years of incremental updates, a brand new version has been released, namely DLV2 [7], a modern ASP system featuring efficient evaluation techniques, proper development tools, versatility, and interoperability. In addition to the standard ASP language, DLV2 offers constructs and tools for further enhancing usability in real-world contexts [15]. The increased use of ASP in the industry has led to the development of advanced libraries [16] and tools [17; 18] for supporting programmers, knowledge engineers, and organizations in handling complex projects within real-world domains. However, practicalapplication scenarios have undergone continuous evolution over the years. Applications requiring reasoning over a large amount of data, possibly varying over time, have been arising and proper solutions have been conceived, e.g., in the context of big data platforms [19], social network analysis [20], biological networks [21], traffic analytic [22]. Moreover, in the latest years, we observed the emergence of compact computing devices and the increasing generation and accessibility of heterogeneous data, e.g., in the context of digital forensics [23], smart cities [24], and activity recognition [25]. This paper presents a framework for developing ASP-based applications in scalable data-intensive, called _DLV Enterprise Edition_ (DLV-EE). The framework relies on DLV2, whose existing functionalities have been significantly extended to optimize the evaluation techniques in data-intensive environments. Moreover, the system has been made capable of inter-operate with relational DBMS and NoSQL technologies. Furthermore, DLV-EE provides a service interface, based on the REST philosophy, allowing client environments to interact with it. In addition, the paper introduces DLV-IoT, an ASP system able to shift the execution of reasoning tasks directly on Smart Devices, hence compatible with \"mobile\" technologies (Android-based devices and Raspberry). This allows edge devices to perform local reasoning over, for example, data provided by their own sensors. This work also presents an Integrated Development Environment (IDE) consisting of an extended version of the most comprehensive IDE for ASP, namely _ASPIDE_[17]. In particular, the IDE can support the entire life-cycle of ASP development, from program editing to application deployment, combining a cutting-edge editing tool with a collection of user-friendly graphical tools for program composition, debugging, testing, profiling, DBMS access, solver execution configuration, and output-handling. The rest of the paper is structured as follows.