1 Introduction
Answer set programming (ASP) (Baral, Reference Baral2003; Gelfond, Reference Gelfond2008; Truszczyńki, Reference Truszczyński2007; Borchert et al., Reference Borchert, Anger, Schaub and Truszczynski2004; Leone, Reference Leone2007) is a well-established logic programming paradigm under the answer set semantics, whose origins go quite a long time back. In fact, ASP is a successful outcome of a long research line in the areas of knowledge representation (KR), logic programming, and constraint satisfaction. ASP finds applications in many areas such as, for example, information integration, constraint satisfaction, routing, planning, diagnosis, security analysis, configuration, computer-aided verification, biology/biomedicine, knowledge management, etc. The ASP approach to problem-solving consists basically in the following: (i) encoding of given problem via an ASP program; (ii) computing the ‘answer sets’ of such program via an inference engine, or ‘ASP solver’; (iii) extracting the problem solution by examining such answer sets; answer set contents can be in general reformulated in order to presentat the solution in the terms of the given problem.
Many real-world and industrial applications have demonstrated the effectiveness of ASP in practice, as complex specifications can be implemented and deployed via ASP-based technologies at a lower development cost with respect to imperative languages. This in conjunction to other several advantages observed from the software engineering perspective while developing real-world applications: flexibility, readability, extensibility, ease of maintenance, etc. Indeed, the possibility of developing the implementation of complex problemsby simply editing a text file containing ASP rules, and testing it on site together with the customer by running an ASP solver, is a widely recognized advantage of ASP-based development. This aspect of ASP-based software development constituted a success factor for applications where the high complexity of the requirements was a main obstacle. Moreover, ASP inference engines implement advanced optimization techniques (e.g. Magic Set Optimization Alviano et al. (Reference Alviano, Faber, Greco and Leone2012)) leading to a substantial speed up of the computation that allows to handle industrial applications where a timely response has to be provided for queries involving huge data sets. In addition, ASP has been endowed with effective programming tools to support the activities of researchers and implementers, and to simplify the integration of ASP into existing well-assessed development processes and platforms which are tailored for object-oriented programming languages, and into distributed and service-oriented frameworks.
Agent-based systems constitute one of the most important areas of research and development in information technology in the last few decades. The concept of agency has been exploited in a diverse range of sub-disciplines of information technology, including computer networks, software engineering, artificial intelligence, human-computer interaction, distributed and concurrent systems, mobile systems, telematics, computer-supported cooperative work, control systems, decision support systems (business intelligence), information retrieval and management and electronic commerce. In fact, designing and implementing intelligent agents has been the main focus of the field of artificial intelligence since its birth. Naturally, a prerequisite to constructing systems capable of reasoning and operating autonomously in the environment is to provide dedicated infrastructure and supporting tools: this includes the development of agent-oriented programming (AOP) languages and related software engineering methodologies. Several agent theories, architectures and languages have emerged, concerned with the definition of an agent and its properties, and with the mathematical formalisms for representing and reasoning about these properties. Nice surveys on agents can be found; we mention, for example, Bordini et al. (Reference Bordini, Braubach, Dastani, Fallah-Seghrouchni, Gómez-Sanz, Leite, O’Hare, Pokahr and Ricci2006) and Fisher et al. (Reference Fisher, Bordini, Hirsch and Torroni2007). Agents can then be organized into multi-agent systems (MAS).
Based on the wide success of the ASP approach in the artificial intelligence (AI) field, testified by the many works on theory and practice of ASP presented in the last years at the main AI Conferences, various approaches exist in the literature, which strongly support the adoption of ASP for the design of intelligent agents (please refer to Sections 4.2, 5). In the ‘oldest’ approaches, the use of ASP did mainly take the form of ‘Action Description Languages,’ which are formal models used to describe dynamic domains by focusing on the representation of effects of actions. In particular, an action specification represents the direct effects of each action on the state of the world, while the language semantics takes care of all the other aspects concerning the evolution of the world (e.g. the ramification problem). These approaches have been extended over the years in many ways in order to cope with, interpret, and recover from, exogenous events and unexpected observations. In subsequent work, ASP-based agent architectures have been proposed, where the description of both domain’s behavior and agents’ reasoning components is provided in ASP. The adoption of ASP is due to its ability to represent various forms of knowledge representation and reasoning including defaults, causal relations, statements referring to incompleteness of knowledge, etc. Later on, extensions of ASP to enable reactivity and forms of communication between agents have been introduced through, for example, the introduction of special named sets of fluents known as ‘requests’. A different line of work focuses on modeling agent and MAS decisions in an extended ASP by means of game theory. Also, there is relevant work where ASP is exploited to model dynamic updates to an agent’s knowledge base.
In our opinion, the ASP approach to problem-solving (based upon computing at each step the answer sets of given program), does not appear to be a fully appropriate modeling tool for the dynamic flexible functioning of agents as concerns reactivity, proactivity and communication. The superposition of such features ‘on top’ of the ASP approach appears forced. Thus, ASP-based architectures are under these aspects too rigid in comparison with other approaches to defining agents and MAS in computational logic, among which we mention at least METATEM, 3APL, AgentSpeak, Goal, Impact, KGP and DALI. All these architectures, and their operational models, are in practice more dynamic and flexible. Nonetheless, we believe that ASP can find a relevant role in agent-based applications, as it is suitable to represent important aspects of an agent’s commonsense reasoning tasks. Such exploitation of ASP features in agents’ design appears more smooth and feasible in the context of modular agent-oriented architectures. In our view in fact, an ‘ideal’ agent architecture should be able to exploit the potential of integrating several modules/components representing different behaviors/forms of reasoning, with these modules possibly based upon different formalisms. The ‘overall agent’ should emerge from dynamic, non-deterministic combination of these behaviors that should occur also in consequence of the evolution due to changes in an agent’s environment.
As a practical example of such an integrated approach, Costantini (Reference Costantini2011) advocated an agent architecture capable of smoothly incorporating several modules/components representing different forms of reasoning. In their architecture, the authors propose in particular to adopt ASP modules in the context of agent-oriented Prolog-like languages, and implemented this solution in the DALI language (cf. Costantini and Tocchio, Reference Costantini and Tocchio2002; Costantini & Tocchio, Reference Costantini and Tocchio2004). In a later paper (Costantini et al., Reference Costantini, De Gasperis and Nazzicone2015), they show the effectiveness of this solution by means of a case study where DALI agents cooperate in order to explore un unknown territory upon occurrence of some kind of catastrophic event (earthquake, fire, flooding, terrorist attack, etc.). There, the DALI MAS in charge of managing the overall situation was equipped with ASP modules which provided flexible and affordable planning capabilities. In fact, there is significant research work on the exploitation of ASP modules within logical agents frameworks, where such modules are employed for tasks in which ASP is particularly well-suited: the provided results are filtered and exploited by agents.
As a matter of fact, approaches that rely on heterogeneous frameworks may have many interesting advantages: (i) different components (modules) of the system can be implemented using the most suitable language for the task at hand (task of the module); (ii) these approaches pave the way toward reusable modules libraries; (iii) they allow in principle parallel implementation of different parts; (iv) they naturally offer a structured view of the model. Approaches that do not provide support for integration of heterogeneous knowledge representation and reasoning technologies in a single agent limit their own applicability only to domains in which their particular technology is appropriate. In general in fact, the particular mental attitudes that a programming approach implements and the nature of interactions between these attitudes determines a certain programming style, which could hardly fit every particular domain. Instead, allowing the possibility to partition an agent’s set of tasks into subsets and to choose for each subset an appropriate application-specific knowledge representation technology (with an associated reasoning technique) can more easily result in a flexible, scalable and robust (hybrid) agent system. Therefore, it should be left to the agent designer to choose the most suitable knowledge representation and reasoning technology for each task at hand. Thus, the underlying programming framework should be modular enough to accommodate a wide range of suitable tools. In this paper, we argue in favor of such a perspective, devoting particular attention to modular agent architectures based on Computational Logic, and in favor of the role that ASP might profitably play in such frameworks.
This paper is in fact intended as a position paper, aimed to: (i) revise the aspects of interest and mentioning the relevant literature; (ii) at the same time, propose a discussion to support our proposition. Specifically, the paper is organized as follows. We provide an overview on agents in Section 2; after shortly illustrating the concept of agency, we discuss the most prominent existing agent architectures and agent-oriented languages, and finally we shortly review MAS. Then, we dedicate Section 3 to agent-oriented software engineering (AOSE), that is crucial in view of complex and industrial applications. We provide an overview on the ASP approach in Section 4; specifically, after illustrating the basic aspects of the ASP paradigm, we shortly discuss software engineering issues for ASP, and the use of ASP in industrial applications. In Section 5, we review the application of ASP in agents and MAS. Section 6 is devoted to exploring the possibilities of integrating different computational approaches to agency. As, in our view, the key to doing so is modularity, we discuss modularity in logic programming, agents and ASP. Section 7 concerns modular distributed architectures, which are becoming increasingly important in view of Cyber-Physical Systems (CPS; cf. Khaitan & McCalley, Reference Khaitan and McCalley2015, for a survey) and of ‘the Internet of Everything.’ In Section 8, we propose a discussion about the possibility of integrating ASP and agent-based formalisms and frameworks on the basis of potential practical applications, outlining possible future directions and prospective developments. The paper is meant to be readable by the non-expert: so, it provides a wide perspective concerning all the issues involved. We assume some basic knowledge about logic and logic programming, and we often mention Datalog and Prolog; the reader may refer to Lloyd (Reference Lloyd1987), Apt and Bol (Reference Apt and Bol1994) and Przymusinski (Reference Przymusinski1988) for comprehensive surveys.
2 An overview on agents
2.1 What is an agent
The definition of what is an ‘agent’ has been debated for quite some time, and researchers and developers tend to describe these entities in the context of specific domains of interest. According to Shardlow (Reference Shardlow1990), ‘Agents do things, they act: that is why they are called agents.’ Wooldridge et al. (Reference Wooldridge and Jennings1995) describe an agent as ‘one who, or that which, exerts power or produces an effect,’ exercised through actions. For further discussion, please refer to Franklin and Graesser (Reference Franklin and Graesser1996).
In the field of artificial intelligence, researchers are more concerned with ‘Intelligent Agents,’ that is, their objective is to add the concept of ‘intelligence’ in the description of agents’ behavior. The original perspective in artificial intelligence focused on agents’ reasoning process, thus identifying ‘intelligence’ with rationality. This view was strongly criticized by many researchers and proved in fact to be insufficient. A novel view of intelligent agents, able to be both rational and reactive, that is, capable of timely response to external events, was introduced in Kowalski and Sadri (Reference Kowalski and Sadri1996). Later, Wooldridge and Jennings improved the definition of intelligent agent by adding the property of ‘autonomy’, and then of ‘proactivity’, in the sense of being able to take initiatives and to start and perform activities based on one’s own decision. The reader can refer to Wooldridge et al. (Reference Wooldridge and Jennings1995) for a definition of agent that explicitly includes the concept of intelligence. Many other definitions appeared over time, emphasizing different properties like, for example, communication capabilities (Coen, Reference Coen1994), mobility (Maes, Reference Maes1993), typed-message agents (Petrie, Reference Petrie1996) or trying to classify software agents according to the tasks they perform (e.g. information gathering agents or email filtering agents) or according to their control architecture. Agents may also be classified by senses range and sensitivity, or by the actions range and effectiveness, or by how much internal state they are equipped with, etc. See, for example, a taxonomy of software agents in Brustoloni (Reference Brustoloni1991), and the approach of Keil (Reference Keil1989). For a discussion about the theory of agency, the reader can refer to Wooldridge and Jennings (Reference Wooldridge and Jennings1994).
2.2 Agent architectures
An ‘Agent Architecture’ can be considered as the ‘functional brain structure’ of an agent in making decisions and reasoning for solving problems. An architecture describes an agent system’s components, and how these components are organized to produce the overall agent behavior. A large number of architectures have been developed. Wooldridge et al. (Reference Wooldridge and Jennings1995) propose a description of an agent architecture following an abstract approach and introducing the concept of environment with which the agent interacts. It is also emphasized that agent architectures represent the move from specification to implementation. Kaelbling (Reference Kaelbling1991) considers an ‘agent architecture as a general methodology for designing particular modular decompositions for particular tasks.’ Maes (Reference Maes1991) defines an agent architecture as a particular methodology for building agents. It specifies ‘how the agent can be decomposed into the construction of a set of component modules and how these modules should be made to interact.’ Sloman and Logan (Reference Sloman and Logan1998) observes that a complete functioning agent, whether biological, or simulated in software, or implemented in the form of a robot, needs an integrated collection of diverse but interrelated capabilities, that is, an architecture.
Wooldridge et al. (Reference Wooldridge and Jennings1995) classify agent architectures into four categories:
∙ Logic-based architectures, where each decision is made through logical deduction.
∙ Reactive architectures, in which decision making is implemented via some form of direct mapping from situation to action.
∙ Belief–desire–intention (BDI) architectures, where an agent takes a decision according to the manipulation of data structures representing the beliefs, desires and intentions of the agent, that is, the informative, the motivational and the deliberative components of the system.
∙ Layered architectures, in which decision making is realized via various software layers.
We can add to these categories the cognitive architectures, which are based on the results of cognitive science, and aims at summarizing the results of cognitive psychology in a comprehensive computer model. Below we provide some more detail and references for each category.
2.2.1 Logic-based architectures
Also known as the symbolic-based or deliberative architectures, they are one of the earliest kinds of agent architectures. They are based on the symbolic artificial intelligence approach for representing and modeling the environment and the agent behavior. Examples of this architecture include classical planning agents such as STRIPS (Fikes & Nilsson, Reference Fikes and Nilsson1971), IPEM (Ambros-Ingerson & Steel, Reference Ambros-Ingerson and Steel1988), Autodrive (Wood, Reference Wood1993), Softbots (Etzioni et al., Reference Etzioni, Lesh and Segal1994), the Phoenix systems (Cohen et al., Reference Cohen, Greenberg, Hart and Howe1989), IRMA (Bratman et al., Reference Bratman, Israel and Pollack1988), HOMER (Vere & Bickmore, Reference Vere and Bickmore1990) and GRATE (Jennings, Reference Jennings1993). Despite the simplicity and elegance of logical semantics, this approach is somewhat problematic. First, the transduction problem; in fact, it is difficult to translate and model the environment’s information into an accurate symbolic representation, especially for complex environments. Second, the adopted symbolic form should be suitable for the agents to reason in a time-constrained environment, which can be non-trivial, in relation to the computational complexity of theorem proving. Third, the transformation of percepts input may not be accurate enough to describe the environment due to certain faults such as sensor errors, reasoning errors, and etc.
2.2.2 Reactive architectures
In the mid-1980s, a new direction of thought emerged, strongly influenced by a refusal of symbolic AI. The reactive agent architecture is based on the direct mapping of situation to action. Brook’s subsumption architecture is known as the best pure reactive architecture (Brooks, Reference Brooks1986), aimed to support intelligence via reactive behavior only. Related approaches are the ‘situated automata’ paradigm by Kaelbling (Reference Kaelbling1991), and the Agent Network Architecture, where agent acts as a set of reactive ‘competence modules,’ presented in Maes (Reference Maes1991). An evolution of the subsumption architecture has been proposed by Togelius (Reference Togelius2003). This approach combines incremental and modularized evolution with elements from the subsumption architecture. Other examples of reactive architectures are systems like Joseph Weizenbaum’s Eliza and Agre and Chapman’s Pengi. Reactive architectures offer many advantages like simplicity, economy, robustness and computational tractability. The disadvantages include: insufficient information about agent’s current state, that may determine difficulties in actions activation; it is hard to see how reactive agents can learn from their experience; while small agent can be easily generated based upon a small number of behaviors, it is hard to engineer agents with large number of layers (behaviors). Dynamics of interactions become too complex to understand, and the development of the system may take a lot of time.
2.2.3 Belief–desire–intention architectures
Rao and Georgeff (Reference Rao and Georgeff1991) and Rao and Georgeff (Reference Rao and Georgeff1995) proposed an abstract architecture called BDI, standing for ‘Belief, Desire, Intention,’ that has become very successful and widely adopted both in practice, and as a conceptual reference. The BDI architecture is based on practical reasoning by Bratman Bratman (Reference Bratman1999). Practical reasoning is reasoning toward actions—the process of figuring out what to do. In this architecture, an agent consists of three logic components referring to ‘mental states’ ‘mental attitudes,’ namely beliefs, desires and intentions. The Beliefs component represents knowledge about the world. An agent must also have information about the objectives to be accomplished; in BDI, these objectives are called Desires; desires represent goals that might in principle be selected for actual accomplishment. Finally, Intentions represent the current agent’ course of action, that is, the objectives that are presently being pursued. Since the first formalization, the BDI model has evolved, thus generating several related approaches, as summarized in Georgeff et al. (Reference Georgeff, Pell, Pollack, Tambe and Wooldridge1998). The design of the BDI architecture is clear and intuitive. However, the question is how to effectively implement its basic concepts and how to achieve a balance between commitment (to intentions and to specific plans) and reconsideration, especially in resource-bounded agents acting in a changing environment. Specification, design and verification of BDI agents have received a great dea: Dagli Oggetti agli Agenti. 6th AI*IA/TABOO Joint Workshop ‘From Objects to Agents’: Simulation and Formal Analysis of Complex Systemsl of attention. Although beliefs, desires and intentions represent a nice method to model intelligent agents in a dynamic environment, the BDI architecture is semantically too complex to be fully and efficiently implemented (Rao, Reference Rao1996). Thus, the BDI model has been integrated with other approaches from computational logic. This integration resulted in the languages AgentSpeak(L) (Rao, Reference Rao1996), 3APL (d’Inverno et al., Reference d’Inverno, Hindriks and Luck2000) and others (cf. Mascardi et al., Reference Mascardi, Demergasso and Ancona2005, for a review).
2.2.4 Layered (hybrid) architectures
Layered architectures respond to the need of having agents that exhibit different kinds of behavior. These architectures combine the advantages of both reactive and logic-based architecture. An agent can be thought of as a system consisting of separate subsystems, decomposed into a layered structure, where each of them implements a particular behavior. Usually, in this architecture subsystems are arranged into two layers, reactive and proactive, but it is possible to have as many layers as the desired behaviors. Wooldridge (Reference Wooldridge1999) notes that this kind of architectures may have two types of control flow: horizontal, and vertical. The problem with horizontal architectures is the complexity of interactions between layers. With vertical layered architectures this problem is solved because the control flows pass sequentially through each layer. The limit of the vertical architecture is however the lack of flexibility: in order to make a decision, control must pass through all layers and failure of one of them implies the failure of the overall decision process. An example of horizontal layered architecture is the TOURINGMACHINES of Ferguson (Reference Ferguson1992). InteRRaP is an example of vertically two-pass agent architecture (cf. Müller & Pischel, Reference Müller and Pischel1994). Another relevant architecture adopting the layered approach is JADE (cf. JADE Website, 2016). A JADE evolution towards the BDI model is JADEX (Pokahr et al., Reference Pokahr, Braubach and Lamersdorf2005). JADEX is an implementation of a reactive and deliberative architecture, integrating into JADE ‘mentalistic’ concepts typical of BDI model.
2.2.5 Cognitive architectures
These kind of architectures are aimed to construct intelligent systems/agents that models human performance, like in Newell (Reference Newell1990), Meyer and Kieras (Reference Meyer and Kieras1997). A cognitive architecture is a theory about the fixed computational structure of cognition (see, e.g. Anderson and Lebiere, Reference Anderson and Lebiere1998; Newell, Reference Newell1990; Pylyshyn, Reference Pylyshyn1990). The origin of cognitive architectures lies in ‘production systems’ (Newell, Reference Newell1973; Neches et al., Reference Neches, Langley and Klahr1987), which can be used to form a ‘recognition memory’ or ‘production memory’ (for explanation please refer to the book ‘Unified Theories of Cognition’ by Newell (Reference Newell1990: 165, 486). Memory and learning are the two important key components in developing cognitive architecture. By combining these two components we can distinguish three main categories of cognitive agent architectures: symbolic, emergent, and hybrid models, as illustrated in Duch et al. (Reference Duch, Oentaryo and Pasquier2008). Examples of cognitive symbolic architectures are SOAR (cf. Laird et al., Reference Laird, Newell and Rosenbloom1987; Newell, Reference Newell1990), EPIC (cf. Meyer & Kieras, Reference Meyer and Kieras1997), ICARUS (cf. Langley, Reference Langley2005). A comprehensive review of implemented cognitive architectures has been undertaken in Samsonovich (Reference Samsonovich2010). For another review, the reader can also refer to Langley et al. (Reference Langley, Laird and Rogers2009).
2.3 Agent-oriented programming languages
We now move to talk briefly about AOP, that is, the programming paradigm that allow developers to program agents which are closely related to a certain agent architecture. An AOP language should provide support to a wide range of key agent characteristics like autonomy, communication, distribution, concurrency, naming, mobility, decision making, representation of mental attributes and knowledge, etc. Since the seminal paper of more than two decades ago by Shoham (Reference Shoham1993) on AOP, many specialized programming languages for the development of agents with mental states have been proposed. For surveys, the reader can refer to Bordini et al. (Reference Bordini, Braubach, Dastani, Fallah-Seghrouchni, Gómez-Sanz, Leite, O’Hare, Pokahr and Ricci2006), Fisher et al. (Reference Fisher, Bordini, Hirsch and Torroni2007), Mascardi et al. (Reference Mascardi, Demergasso and Ancona2005). The first attempt to design an AOP was AGENT-0 (Shoham, Reference Shoham1993). AGENT-0 was refined in Thomas (Reference R.Thomas1993), resulting in the ‘Planning Communicating Agents’ (PLACA) language. Concurrent METATEM language was developed by Fisher (Reference Fisher1994) to address the drawbacks of both AGENT-0 and PLACA.
Many other agent oriented languages have been developed so far, with these languages following two main lines. On the one hand are the pragmatic approaches, where the most prominent examples are JACK (JADE Website, 2016) and Jadex (Pokahr et al., Reference Pokahr, Braubach and Lamersdorf2005), both based on Java as the underlying language. These approaches enjoy the practically proven object-oriented syntax, vast range of libraries and easy integration with legacy and third-party systems, which make them very popular among practitioners. However, a drawback of these approaches is the difficult integration of specialized knowledge-representation techniques.
On the other hand are the theoretically driven approaches, mainly based upon Computational Logic and Prolog, which aim at designing a stand-alone agent programming language using mental attitudes and knowledge representation as primary concepts. We consider this line as particularly interesting because Computational Logic brings the advantages of clarity, where the code can be understandable even by the non-expert, and of verifiability of agents, MAS and protocols via formal techniques. In fact, agent models have been implemented for a long time by means of imperative programming languages, mainly for the sake of computational efficiency. While, however, efficiency may not always be an issue, while instead clear specification and correctness are. In addition, declarative approaches are suitable to handle the complexity of agent systems, where the efficiency and effectiveness of implementations is constantly improving. So, the logical approaches to building agents have now become effective in the direction of practical usability in real-world applications. Well-established languages based upon Computational Logic are 3APL (d’Inverno et al., Reference d’Inverno, Hindriks and Luck2000), AgentSpeak(L) (Rao, Reference Rao1996; d’Inverno & Luck, Reference d’Inverno and Luck1998), GOAL, IMPACT (cf. Dix et al., Reference Dix, Eiter, Kraus, Ozcan and Subrahmanian2000; Rogers et al., Reference Rogers, Ross and Subrahmanian2000), DALI (cf. Costantini & Tocchio, Reference Costantini and Tocchio2002; Costantini & Tocchio, Reference Costantini and Tocchio2004; Costantini & Tocchio, Reference Costantini and Tocchio2005). More generally, there are approaches fully based upon declarative paradigms, and others depending partially on computational logic (hybrid approaches which combine both declarative and imperative features) for both single-agents and MAS. For a detailed discussion of different computational programming approaches, the reader may refer to the surveys (Dastani, Reference Dastani2015; Bordini et al., Reference Bordini, Braubach, Dastani, Fallah-Seghrouchni, Gómez-Sanz, Leite, O’Hare, Pokahr and Ricci2006; Fisher et al., Reference Fisher, Bordini, Hirsch and Torroni2007).
2.4 Multi-agent systems
Agents are social entities:696 they exist in an environment with other agents, with which they will generally be expected to interact in some way. Agents can thus be organized into MAS composed of either homogeneous or heterogeneous agents (the latter being defined via different agent-oriented languages and architectures). According to the seminal work of Jennings et al. (Reference Jennings, Sycara and Wooldridge1998), the features of MASs are the following: (i) each agent has incomplete information, or capabilities for solving the problem; (ii) there is no global system control; (iii) data are decentralized; (iv) computation is asynchronous.
Interaction is crucial in MAS, as it allows agents to share information which is necessary to achieve their goals. Often, communities of agents interact in order to resolve a common problem; sometimes, however, agents have egoistic interests to pursue independently or even in competition with others. These two modalities of interaction, cooperation and competition, has been treated for a long time in Distributed Artificial Intelligence.
MAS began to invade the scientific and industrial world since the 1980s. In fact, their ability to adapt themselves flexibly and intelligently to different contexts determined the development of interesting applications. From the mid-1980s, many control architectures for MAS have been developed, that we do not discuss here as MASs are not a central topic of this paper. For surveys, the reader may refer to Jennings et al. (Reference Jennings, Sycara and Wooldridge1998), Baldoni et al. (Reference Baldoni, Baroglio, Mascardi, Omicini and Torroni2010), Torroni (Reference Torroni2004). The wide applicability of agents and MAS has fostered the upcoming (since the seminal work of Wooldridge (Reference Wooldridge1997)) of AOSE, which is a software engineering paradigm aimed at applying best practice in the development of such systems. AOSE is focused on the use of agents and organizations (communities) of agents as the main abstractions.
3 Agent-oriented software engineering
Software engineering is crucial for real-world (industrial) applications, as software systems are required to operate in an increasingly complex, distributed, large, open, unpredictable, heterogeneous and highly interactive applications environments. Agent-based computing is considered to be very promising and natural for building these systems in terms of MAS. AOSE has emerged from the interaction among agent-oriented computing and software engineering and can serve as a useful paradigm for the development of agent-based systems. There exist several methodologies for AOSE; many of them argue the adequacy of OOSE (Object-Orientes Software Engineering) to model AOSE and give emphasis to ‘agentifying’ software entities, namely turning software components (agents and non agents) into agent entities. Among these methodologies are Gaia (Wooldridge et al., Reference Wooldridge, Jennings and Kinny2000) and SODA (Omicini, Reference Omicini2001). Other approaches are based on object-oriented methodologies which provide an engineering process based, vice versa, on ‘objectifying’ the software system components, so as to model all components at the same level of abstraction. Examples of such approaches are MaSE (Wood & DeLoach, Reference Wood and DeLoach2001) and KGR (Kinny et al., Reference Kinny, Georgeff and Rao1996). Other approaches give emphasis to the extension to AOSE of modeling techniques developed for OOSE, specifically Unified Modeling Language, which becomes Agent-Oriented Unified Modeling Language (cf. Bauer et al., Reference Bauer, Müller and Odell2001).
Since AOSE combines software engineering and agency theory, it is necessary to establish evaluation criteria to help assess the suitability of a technique or a language for industrial software development. Such criteria are required to be coherent with software engineering objectives, while keeping agents’ characteristics into account. General evaluation criteria concentrate on features that should be naturally supported by any given methodology Juneidi and Vouros (Reference Juneidi and Vouros2004) and usually include the following.
∙ Preciseness: the semantics of a modeling technique must be unambiguous.
∙ Accessibility: modeling techniques should be understandable to both experts and novices.
∙ Expressiveness: a modeling technique should be able to present the structure of the system, the encapsulated knowledge, the data flow, the control flow within the system and also the interactions with other systems.
∙ Modularity and objectiveness: the ability to articulate a modeling technique into stages.
∙ Complexity management: a modeling technique should be expressed and then examined at various levels of detail.
∙ Executability and testability: prototyping capacity or simulation capacity.
∙ Refinability: ability to provide guidelines for refining a model.
∙ Analizability: availability of tools to check internal consistency.
∙ Openness and portability: implementation issues should be left to the programmers without obliging them to adopt a specific architecture or language.
∙ Formalization: modeling constructs should be complete and comprehensive, so as to instruct or even generate implementation.
Agency characteristics must however be checked in a given AOSE methodology, by means of at least the following criteria.
∙ Autonomy: the modeling technique should support the capability of describing an agent’s self control feature.
∙ Complexity: agent-oriented systems are complex systems consisting of sets of components (agents) that interact with each other to achieve their goals. These systems may exploit many complex mechanisms and algorithms (learning, reasoning, decision making, etc.). Modeling them requires strong expressive power, so a modeling technique should support such expressiveness. Moreover, the complexity feature requires that a modeling technique should be modular, and able to support complexity management.
∙ Adaptability: agent-oriented systems should be flexible enough to adjust their activities to the dynamic environmental changes; so, the adaptability feature requires the modeling technique to be modular and able to specify activation of each component according to the environmental state.
∙ Concurrency: an agent may need to perform several tasks concurrently; for this reason, some agent-oriented systems must be designed as parallel processing systems. So, this requires the ability to express parallelism and concurrency in design and implementation stages.
∙ Distribution: MAS are sometimes distributed over the network. This requires the ability to express distribution in design and implementation stages.
∙ Communications richness: a modeling technique should be able to express a characterization of communication in order to produce agent communication commands or sentences during the implementation stage.
For logical agents, relevant existing work includes JaCaMo (http://jacamo.sourceforge.net), which is a methodology for the design and implementation of agents and MAS based upon the AgentSpeak Rao and Georgeff (Reference Rao and Georgeff1991) language (a very popular language based on the BDI agent model) under the Jason interpreter Bordini and Hübner (Reference Bordini and Hübner2006), Bordini et al. (Reference Bordini, Hübner and Wooldridge2007), integrated with CArtAgO, which is a platform for programming distributed artifact-based environments Ricci et al. (Reference Ricci, Viroli and Omicini2007), according to the ‘Agents and Artifacts’ metamodel. MAS in JaCaMo should be built in accord to the Moise organizational model Hübner et al. (Reference Hübner, Sichman and Boissier2007) where a MAS is considered to be an organization structured as agents groups and sub-groups, in term of their roles and objectives. A survey about AOSE and its prospective employment in industry can be found in Akbari (Reference Akbari2010). The reader may also refer to the EMAS series of workshops, http://emas.in.tu-clausthal.de/.
4 Answer set programming: an overview
4.1 The answer set programming approach
ASP is a logic programming paradigm under answer set (or ‘stable model’) semantics Gelfond and Lifschitz (Reference Gelfond and Lifschitz1988), which applies ideas of autoepistemic logic Moore (Reference Moore1985) and default logic Reiter (Reference Reiter1980). ASP features a highly declarative and expressive programming language, oriented towards difficult search problems. It has been used in a wide variety of applications in different areas like problem solving, configuration, information integration, security analysis, agent systems, semantic Web and planning (for more information about ASP and its application the reader can refer, among many, Baral, Reference Baral2003; Borchert et al., Reference Borchert, Anger, Schaub and Truszczynski2004; Leone, Reference Leone2007; Truszczyńki, Reference Truszczyński2007; Gelfond, Reference Gelfond2008 and the references therein) and, more generally, to represent combinatorial problems in knowledge representation and automated reasoning.
ASP has emerged from interaction between two lines of research: first on the semantics of negation in logic programming, and second on applications of satisfiability solvers to search problems Kautz and Selman (Reference Kautz and Selman1992). It was (independently) identified as a new programming paradigm in Lifschitz (Reference Lifschitz1999), Marek and Truszczyński (Reference Marek and Truszczyński1999), Niemelä (Reference Niemelä1999). In ASP, search problems are reduced to computing answer sets (or ‘stable models’ as they were originally denominated), and an answer set solver (i.e. a program for generating stable models) is used to find solutions (if any exists). The search algorithms adopted in the design of answer set systems are mostly enhancements of the Davis-Putnam Logemann-Loveland procedure. Unlike SLDNF resolution employed in Prolog, such algorithms, in principle, always terminate.
The expressiveness of ASP, the readability of its code and the performance of the available ‘solvers’ gained ASP an important role in the field of artificial intelligence; ASP applications have in fact been developed in several fields, as seen below. In the answer set semantics Gelfond and Lifschitz (Reference Gelfond and Lifschitz1988, Reference Gelfond and Lifschitz1991), a (logic) program Π is a collection of rules of the form: H←L 1, … , L n
The left-hand side and right-hand side of rules are called head and body, respectively, where H is an atom, n≥0 and each literal L i either an atom A i or its default negation notA i . A rule can be rephrased as H← A 1, … , A m , notA m+1, … , notA n where A 1, … , A m can be called positive body and notA m+1, … , notA n can be called negative body. In practical programming, ‘←’ is usually indicated as ‘:−’. A rule with empty body (n=0) is called a unit rule, or fact. A rule with empty head, of the form ←L 1, … , L n , is a constraint, and states that literals L 1, … , L n cannot be simultaneously true in any answer set.
The answer sets semantics Gelfond and Lifschitz (Reference Gelfond and Lifschitz1988, Reference Gelfond and Lifschitz1991) can be considered a view of a logic program as a set of inference rules (more precisely, default inference rules), or, equivalently, a set of constraints on the solution of a problem: each answer set represents a solution compatible with the constraints expressed by the program. Consider simple program: {q←not p p←not q}. The first rule is read as ‘assuming that p is false, we can conclude that q is true.’ The second rule is analogous though complementary, as truth of p depends upon assuming falsity of q. This program has two answer sets. In the first one, q is true while p is false; in the second one, p is true while q is false. So, negation in this paradigm is understood as default negation, that is, nota indicates the (default) assumption that a is false and thus its negation holds. Unlike other semantics, a program may have several answer sets or may have no answer set, where however every answer set is a minimal model of given programFootnote 1 , and thus the answer sets form an anti-chain. Whenever a program has no answer sets (as some minimal models may not be answer sets), the program is said to be inconsistent . For instance, the following program has no answer set: {a←notb b←notc c←nota.}. The reason is that in every minimal model of this program there is a true atom that depends (in the program) on the negation of another true atom, which is strictly forbidden in this semantics, where every answer set can be considered as a self-consistent and self-supporting set of consequences of a given program. The program {p←not p} has no answer sets either as it is contradictory not in the sense of classical logic, but in the sense that p cannot be derived from notp, that is, from the (default) assumption that p itself is false. Constraints of the form defined above can be in fact simulated by plain rules of the form p←notp,L 1, … , L n . where p is a fresh atom. Consistency of an ASP program is related (as discussed at length in Costantini, Reference Costantini1995, Reference Costantini2006; Costantini et al., Reference Costantini, D’Antona and Provetti2002) to the occurrence of ‘odd cycles’ (of which p←notp is the basic case, though odd cycles may involve any odd number of atoms) and to their connections to other parts of the program. The reason is that, in principle, the negation notA of atom A is an assumption, that must be dropped whenever A can be proved, as answer sets are by definition non-contradictory. Many extensions of the original ‘Answer Set Prolog’ have been proposed, mainly motivated by applications. Some of them are syntactic sugar and some other strictly adds expressiveness to the language. For details about these extensions, the reader can reefr to Gelfond (Reference Gelfond2008), Gelfond and Kahl (Reference Gelfond and Kahl2014,) and to references therein.
In the ASP paradigm, as mentioned each answer set is seen as a solution of given problem, encoded as an ASP program (or, better, the solution is extracted from an answer set by ignoring irrelevant details and possibly re-organizing the presentation). So, differently from traditional logic programming, the solutions of a problem are not obtained through substitutions of variables values in answer to a query. Rather, a program Π describes a problem, of which its answer sets represent the possible solutions. To find these solutions, an ASP-solver is used. Several solvers have become available, see Answer Set Programming Solvers (2016), each of them being characterized by its own prominent valuable features. Recently ‘meta-solvers’ such as multi-engine ASP system Maratea et al. (Reference Maratea, Pulina and Ricca2015) have been developed, which select the most appropriate solver according to specific syntactic features of given program. The expressive power of ASP and its computational complexity have been deeply investigated (cf., e.g., Dantsin et al., Reference Dantsin, Eiter, Gottlob and Voronkov2001).
4.2 Industrial answer set programming applications
In this section we intend to shed light on some of the many challenges addressed by ASP in industrial applications. ASP-based software development provides many advantages, such as flexibility, readability, extensibility and ease of maintenance due to its powerful and expressive framework. One of the success factors of ASP-based software development in many industrial applications has been the flexibility in developing complex reasoning tasks by simply editing a text file containing the ASP rules, and testing it on-site together with the customer. This has been evident, for example, for the workforce-management application concerning the employees of the Gioia Tauro seaport (Ricca et al., Reference Ricca, Grasso, Alviano, Manna, Lio, Iiritano and Leone2012),where the main obstacle was the high complexity of the requirements; the use of ASP as an executable specification language made the process of clarifying and formalizing the requirements much easier. This in addition to the advantages of lower (implementation) costs by realizing complex features of an application in such a way, compared to traditional imperative languages.
Another challenge in industrial applications addressed by ASP is computational efficiency, which is handled by optimization techniques implemented by ASP solvers. For instance, in the Intelligent call-routing application (the company ’Exeura’ developed a platform for customer profiling for phone-call routing based on ASP that is called Zlog (n.d.), an immediate response has to be given to queries over huge data sets. The DLV solver adopts the Magic Set optimization (Alviano et al., Reference Alviano, Faber, Greco and Leone2012) technique can localize the computation to the small part of the database that is relevant for the specific query at hand; this leads to a huge speedup of the computation. Telecom Italia employs the zLog platform in a production system that handles its call centers.
In many other applications of ASP, concerning knowledge representation and reasoning, robotics, and bioinformatics and computational biology as well as some other related applications, ASP addresses different types of challenges. For instance, some of the important challenges in knowledge representation and reasoning concern the representation of defaults to handle exceptions and the commonsense law of inertia, so as to be able to reason about the effects of actions. In robotic applications ASP addresses other type of challenges like hybrid reasoning, reasoning about commonsense knowledge and exceptions, optimizations over plans or diagnoses; Erdem et al. (Reference Erdem, Aker and Patoglu2012) uses ASP to plan the actions of multiple robots that collaborate to organize a house within a specific time and Erdem et al. (Reference Erdem, Patoglu, Saribatur, Schüller and Uras2013) uses ASP to find an optimal global plan for a number of teams of heterogeneous robots in a cognitive factory to manufacture a number of orders within a specific time. In Erdem et al. (Reference Erdem, Patoglu and Saribatur2015), ASP is exploited for diagnosing plan failures during monitoring of plan execution. ASP is also used for geometric rearrangement of multiple movable objects on a cluttered surface in Havur et al. (Reference Havur, Ozbilgin, Erdem and Patoglu2014), where locations of objects can be changed by pick and/or push actions. Zhang et al. (Reference Zhang, Sridharan and Wyatt2015) use ASP to describe objects and relations between them, where this knowledge is used to improve localization of target objects. Provability of computational problems formulation, expressing sophisticated concepts that require recursion and/or aggregates, and integration of heterogeneous knowledge are some of many challenges addressed by ASP in bioinformatics. For example, Nam and Baral (Reference Nam and Baral2009) introduce a method to model a biological signaling network as an action description in ASP which allows for prediction, planning and explanation generation about the network. Gebser et al. (Reference Gebser, Schaub, Thiele and Veber2011) introduce a method to model biochemical reactions and genetic regulations as influence graphs in ASP, to detect and explain inconsistencies between experimental profiles and influence graphs. In Brooks et al. (Reference Brooks, Erdem, Erdogan, Minett and Ringe2007), ASP was used to solve the problem of reconstructing phylogenies for specified taxa, with a character-based cladistics approach. Erdem et al. (Reference Erdem, Erdem, Erdogan and Öztok2011) and Erdem and Öztok (Reference Erdem and Öztok2015) use ASP to answer complex queries over biomedical ontologies and databases, and to generate the shortest explanations to justify these answers. Many similar challenges are also addressed by ASP in other industrial applications, such as data cleaning, extraction of relevant knowledge from large databases and software-engineering challenges.
ASP has been profitably applied in applications concerning tourism industry. For instance, Ricca et al. (Reference Ricca, Dimasi, Grasso, Ielpa, Iiritano, Manna and Leone2010) has developed an intelligent advisor to select the most promising offers for travel agency’s customers. ASP has been used as the intelligent engine of a semantic-based information extractor (cf. Manna et al., Reference Manna, Scarcello and Leone2011), which analyzes touristic offers, extracts the relevant information (e.g. place, date, prize), and classifies them in an ontology. In addition, ASP has been used for developing several search modules which simplify selecting the holiday packages that best fit the customer needs. This helps the employees of a travel agency to find the best possible travel solutions in a short time.
ASP has been successfully employed in context of e-Medicine, in particular for data-cleaning of medical knowledge bases. These knowledge bases are in fact the result of the integration of different databases: thus, they often present errors and anomalies that severely limit their usefulness. Leone and Ricca (Reference Leone and Ricca2015) developed a data-cleaning system, based on ASP and called DLVCleaner; this system detects and automatically corrects both syntactic and semantic anomalies in medical knowledge bases on the basis on ontological domain descriptions and measures for string similarities (cf. Greco & Terracina, Reference Greco and Terracina2013). In this application, ASP allows for a simplified and flexible specification of the logic of the data-cleaning task.
One of the first industrial applications of ASP was for product configuration (Tiihonen et al., Reference Tiihonen, Soininen, Niemelä and Sulonen2003), used by Variantum Oy. More recently, the group of Gerhard Friedrich at Alpen-Adria Universität Klagenfurt, Austria has developed a configuration and reconfiguration application, deployed by Siemens. In particular, ASP has been used for configuration of railway safety systems. This configuration problem is NP-hard and has proved challenging for problem-solving frameworks such as SAT, constraint programming, MIP and ASP (cf. Aschinger et al., Reference Aschinger, Drescher, Friedrich, Gottlob, Jeavons, Ryabokon and Thorstensen2011). Thus, ASP made it possible to solve configuration problems that could not be solved by specialized configuration tools. ASP is applied to model possible changes of existing systems and to compute reconfiguration solutions that optimize the adaptation actions. For example, in Friedrich et al. (Reference Friedrich, Ryabokon, Falkner, Haselböck, Schenner and Schreiner2011) the aim is to maximize the number of reused modules and minimize the costs of additional equipment. In addition to configuration tasks, ASP was applied in Friedrich et al. (Reference Friedrich, Fugini, Mussi, Pernici and Tagni2010) to diagnose and repair systems. For more details on ASP applications, the reader can refer Erdem et al. (Reference Erdem, Gelfond and Leone2016), Grasso et al. (Reference Grasso, Leone and Ricca2013) and to the references therein.
4.3 Software engineering for answer set programming
ASP has become one of the most increasingly used tools for knowledge representation and reasoning; in fact, ASP has proved to be very effective in developing complex knowledge intensive applications at a lower price (for implementation) than the imperative languages. In addition, it has been observed by developers that the use of ASP brings many benefits from the point view of software engineering practices like expressiveness, flexibility, extensibility, readability, ease of maintenance, etc.
However, developing complex systems in any programming language is not an easy task, and ASP is not an exception. In fact, developers have faced many practical obstacles, due to the shortage of development tools and software engineering methodologies tailored particularly for ASP. This issue was recognized by the research community, thus the SEA (Software Engineering and ASP) series of workshops was initiated, which provide an international forum to discuss software engineering problems that the field may experience either currently or in perspective. The aim of this forum is to start a general discussion on the requirements and specification of input, output and intermediate languages for answer set solvers. In addition, there has been the development of many interfaces, frameworks and development tools like APIs, ASPIDE, Jazzyk, and JDLV to ease the use of ASP in real world applications.
The first step in addressing the above-mentioned need was the development of APIs (cf. Gallucci & Ricca, Reference Gallucci and Ricca2007; Ricca, Reference Ricca2003) which offer a method for interacting with ASP solvers from an embedding Java program. This is relevant since ASP is not a general purpose language; thus, ASP programs often need to be embedded within components built by using some imperative language, for interfacing with the environment or for user interaction. ASPIDE (cf. Febbraro et al., Reference Febbraro, Reale and Ricca2011) is an IDE that supports the entire life-cycle of the development of ASP-based applications. ASPIDE is written in Java and includes a DLV wrapper (cf. Ricca, Reference Ricca2003) for interacting with DLV, which is one of the most famous and well-developed ASP solvers (http://www.dlvsystem.com/). SeaLion (sealion.at) is an Integrated Development Environment for Answer-Set Programming which comes as an Eclipse plugin and aims at offering support to write, evaluate, debug and test answer-set programs.
JDLV (available at http://www.dlvsystem.com/dlvsystem/index.php/JDLV), is an advanced platform for integrating Java with DLV, which comes as a plug-in for the Eclipse platform, offering a seamless integration of ASP-based technologies within the most popular development environment for Java. JDLV is based on JASP (cf. Febbraro et al., Reference Febbraro, Leone, Grasso and Ricca2012), a hybrid language that transparently supports a bilateral interaction between ASP and Java. JASP embeds ASP code in a Java program, where a logical ASP module can access Java variables; the answer sets resulting from the execution of ASP code are automatically stored in Java objects, where the collections of Java objects are mapped to ASP facts. In addition, JASP allows a programmer to include arbitrary Java expressions in logic rules, to be evaluated at runtime.
5 Answer set programming and agents
A large number of papers have proposed the application of ASP in the modeling of intelligent agents. In fact this is not surprising, since ASP was developed specially for non-monotonic reasoning, including forms of common-sense reasoning required in agent modeling (cf. Gelfond & Kahl, Reference Gelfond and Kahl2014). In this section we provide a review of such proposals.
5.1 Agents in answer set programming
ASP have been used in agents since quite a long time, though this use was initially mainly in the form of action description languages. They were first introduced in Gelfond and Lifschitz (Reference Gelfond and Lifschitz1998) and in Baral and Gelfond (Reference Baral and Gelfond2000), where a simple ASP-based agent architecture was proposed. This work was then extended and refined by many authors: Balduccini and Gelfond (Reference Balduccini and Gelfond2003), Balduccini et al. (Reference Balduccini, Gelfond and Nogueira2006), Balduccini (Reference Balduccini2007a). This architecture is further refined and described in Balduccini and Gelfond (Reference Balduccini and Gelfond2008), where it is named ‘AAA’ (Autonomous Agents Architecture) and is intended for intelligent agents acting and reasoning in a changing environment. The agent behavior is based on the simple control loop of the kind that Kowalski, in Kowalski and Sadri (Reference Kowalski and Sadri1996), called ‘observe-think-act’ cycle. The description of domain’s behavior and of the reasoning components are written in Answer Set Prolog. The architecture gives the agent capabilities of planning, detecting, interpreting and recovering from, unexpected observations. In addition, the design and the knowledge bases are elaboration-tolerant. Another special feature of the architecture is that the same domain description is shared by all the reasoning modules. A prototype of the implementation of the architecture can be found at: http://mbal.tk/APLAgentMgr/
Building upon this work, a new architecture, AIA, was proposed in Blount et al. (Reference Blount, Gelfond and Balduccini2015). The AIA framework is an architecture for intelligent agents whose behavior is driven by their intentions and that reason about, and act in a changing environment. The domain description includes both the agents’ environment and a general Theory of Intentions. The main difference between AAA and AIA architectures is in the organization of the control loop that is in AIA centered around the notion of intention, which is something absent in AAA. The AIA architecture is meant to enable agents explain unexpected observations and decide the intended action at the present moment. Reasoning tasks are reduced to computing answer sets of CR-Prolog programs constructed automatically from an agent’s knowledge. A prototype can be found at http://www.depts.ttu.edu/cs/research/krlab/software-aia.php. An evolution of the AAA architecture was proposed for UAVs (unmanned aerial vehicles) operation in Balduccini et al. (Reference Balduccini, Regli and Nguyen2014). There, both agent architecture and reasoning algorithms based on ASP were developed. ASP has been chosen for this task because it enables high flexibility of representation, both of knowledge and of reasoning tasks. This work is part of a project aimed at investigating how traditional AI reasoning techniques can be extended to coordinate teams of UAVs in dynamic environments. This work demonstrates the reliability and performance gains deriving from network-aware reasoning. Overall, this work was the first practical application of a complete ASP-based agent architecture. It is also the first practical application of ASP involving a combination of centralized reasoning, decentralized reasoning, execution monitoring and reasoning about network communications.
Jazzyk (cf. Novák, Reference Novák2009) is a hybrid, special-purpose programming language for development of knowledge intensive (intelligent) agent systems. Jazzyk agents consist of: a number of knowledge bases, each realized by a separate specialized knowledge representation module (called ’plug-in’), and an agent program in a form of a set of possibly nested rules of the basic form: ’when Query then Update’. Jazzyk integrates an ASP solver for handling ASP modules.
5.2 Answer set programming and multi-agent systems
In the realm of MAS, ASP has been used for defining and for modeling aspects of MASs, for reasoning about these systems, and for configuration of (features of) MAS. De Vos and Vermeir (Reference De Vos and Vermeir2004) presents systems composed of logic programming agents systems (LPAS) to model the interactions between decision-makers in the process of reaching a conclusion. The system consists of a group of agents connected by means of unidirectional communication channels. These agents communicate with each other by passing answer sets obtained by updating the information received from connected agents with their own private information. The authors introduce a simple answer set semantics for LPAS. This kind of systems is useful for modeling decision problems. As an application, the authors show how extensive games with perfect information can be conveniently represented as LPAS, where each agent embodies the reasoning of a game player, such that the equilibria of the game correspond with the semantics agreements among the agents in the LPAS.
Amongst the most demanding properties with respect to the design and implementation of MAS systems is how the agents may individually reason about and communicate their knowledge and beliefs, within a perspective of cooperation and collaboration. Here it is vital for the agents to be able to verify the reliability of information providers especially when the pieces of information coming from different sources contradict each other. In De Vos et al. (Reference De Vos, Cliffe, Watson, Crick, Padget, Needham and Brain2005), the authors present a hybrid multi-agent platform, called T-LAIMA, using an extension of ASP. They show that their framework is capable of dealing with the specification and implementation of the system’s architecture, and with the communication and the individual reasoning capabilities of the agents. Agents use ASP to represent their reasoning capabilities. Agents interact with each other, and via such interactions the agents may update trust values, make or break connections with other agents, etc. As steps in the agent loop, the agent may also choose goals to try and satisfy, plan to achieve such goals, and can also make observations, perform diagnosis, execute actions, etc.
Buccafurri and Gottlob (Reference Buccafurri and Gottlob2002) introduced a new notion of ‘compromises’ for MAS desiring to reach a common decision using joint fixpoints and stable models. In a multi-agent setting, a joint decision of the agents, reflecting a compromise of the various requirements, corresponds in this approach to a suitable joint model of the respective ogic programs. The authors proposed an appropriate semantics, namely the joint fixpoint semantics, where intended joint models are defined to be the (minimal) joint fixpoints of the agent programs. This work was then extended in Buccafurri and Caminiti (Reference Buccafurri and Caminiti2005) to model social behavior among a community of agents represented by logic programs. This by focusing on a language derived from logic programming which supports the representation of mental states of agent communities and provides each agent with the capability of reasoning about other agents’ mental states and acting accordingly. The proposed semantics is shown to be translatable into stable model semantics of logic programs with aggregates.
‘Communicating answer set programming’ (CASP) is an intuitive extension of ASP, in which multiple ASP programs collaborate to solve some problem. The expressiveness of CASP has not been thoroughly studied yet. Bauters et al. (Reference Bauters, Schockaert, Janssen, Vermeir and De Cock2013) presents a systematic study of the additional expressiveness offered by allowing ASP programs to communicate. This paper aggregates and extends the work from Bauters (Reference Bauters2011b) and Bauters et al. (Reference Bauters, Janssen, Schockaert, De Cock and Vermeir2010).
Van Nieuwenborgh et al. (Reference Van Nieuwenborgh, De Vos, Heymans and Vermeir2006) proposed a multi-agent framework that is capable of modeling hierarchical decision problems. This framework is a multi-agent formalism based on extended ASP. The system consists of independent agents connected via a communication channel, where knowledge and beliefs of each agent are represented by a logic program. The resulting semantics is very expressive, and it essentially captures the polynomial hierarchy, thus enabling complex applications.
In Cliffe et al. (Reference Cliffe, De Vos and Padget2006), the authors describe the use of ASP as an institutional modeling technique. Basically, they demonstrate how formal specifications of institutions for the purpose of obligations, permissions and violations, can be translated into ASP programs in such a way that ordered traces which record their actions can be obtained as answer sets. These answer sets have a one-to-one relationship with the institutional event traces of the formal model. This provides an easy way to inspect properties of models. The ability to reason about and query time-related information is a strong point for using ASP. In contrast to symbolic model checking, ASP allows the statement of problems and queries in domain-specific terms as executable logic programs therefore eliminating the gap between specification and verification language.
Resource allocation in MAS is a growing area of research. It involves many aspects: economical, game-theoretical and purely computational ones. The work of Leite et al. (Reference Leite, Alferes and Mito2009) is concerned with computational aspects of resource allocation, particularly concerning complex combinatorial problems. In spite of the extensive theoretical work and the raising number of practical applications, many fundamental problems in multi-agent resource allocation still lack proper solutions. Here, the authors show how ASP can be used for providing general and flexible solutions of these problems in a compact and declarative manner.
Baral et al. (Reference Baral, Gelfond, Son and Pontelli2010) discussed and explored the use of ASP for defining action techniques that address one of the most challenging aspects of reasoning, namely planning and acting in a multi-agent domain: which is, reasoning about what the agents know about the knowledge of their fellows, and take such knowledge into account when planning and acting. This approach presents a number of advantages; from the theoretical perspective, the property of nonmonotonicity of ASP (and many other features) allows one to express causality in an elegant way; from the practical point of view, recent implementations of ASP solvers have become very efficient. Finally, the use of ASP for reasoning about action techniques allows for the adaptation of a large body of research developed for single-agent to multiagent domains.
Bauters (Reference Bauters2011a) presents a case study exploring how one can use ‘multi-focused answer sets’ to model the process of coalition formation; via multi focused answer sets, one can impose constraints so as to reach a unique agreement, represented by an answer set, that optimizes the preferences of the parties involved. This work uses CASP to encode preferences and soft constraints. CASP allows in fact a number of ASP programs to collaborate by asking each other questions. In CASP, there is no longer a unique way to define a stable model. By using a mechanism called ‘focusing’ it becomes possible to eliminate some of these stable models, that is, to assign preferences to the stable models of a CASP program.
In Ianni et al. (Reference Ianni, Calimeri, Lio and Galizia2003), the authors propose an innovative architecture where they integrate a framework based on ASP into an Information Retrival Agent named GSA (Global Search Agent, illustrated in Castellucci et al., Reference Castellucci, Ianni, Vasile and Costa2001; Ianni, Reference Ianni2001). In order to improve the original system effectiveness, the ’GSA2’ system introduces a new internal architecture based on a message-passing framework and on an ontology description formalism (WOLF (Web Ontology Framework)). The system consists of a set of cooperating agents where each one is a specialized module. The role of central intelligence is played by a reasoning system based on ASP, and makes the agents able to take independent decisions. The high expressive power of ASP allows to describe program and plan behaviors of the agents easily and quickly, and to experiment with any (even future) information retrieval strategy. Both the system architecture and WOLF are very general and reusable, and constitute a very good and interesting example of actual exploitation of ASP for real applications.
In Osorio et al. (Reference Osorio, Zepeda, Nieves and Cortés2005), the authors propose the use of ASP and of the argumentation framework proposed by Dung (Reference Dung1995) to represent a medical transplantation knowledge base. They define CARREL-ASP, namely CARREL Cortés et al. (Reference Cortés, Tolchinsky, Nieves, López-Navidad and Caballero2005) extended with ASP, to perform decision making based on argumentation framework.
In Amendola et al. (Reference Amendola, Greco, Leone and Veltri2016), the authors propose a compact representation for the non-transferable utility games based on ASP. The representation is fully expressive, in that it can capture all games defined over a finite set of alternatives. The approach can easily accommodate the definition of games within wide range of application domains, ranging from scheduling to routing and planning, etc.
In Son et al. (Reference Son, Pontelli, Gelfond and Balduccini2016), the authors present a framework based on ASP to reason about the truthfulness of statements made by an agent. The framework does not assume complete knowledge about the agent being observed and the reasoning process builds on observations about the state of the world and the occurrences of actions. The authors explore the use of their framework in the detection of Man-In-The-Middle attacks targeting computers and CPS.
In Nogueira et al. (Reference Nogueira, Balduccini, Gelfond, Watson and Barry2001), authors describe a medium-sized decision support system for shuttle flight controllers written in ASP. The system consists of a collection of largely independent modules represented by lp-functions and a graphical Java interface.
A general overview of approaches investigating and specifying methodologies for modeling agents by means ASP can be found in Gelfond (Reference Gelfond2004). Overall however, with due recognition to the wide corpus of existing work it is possible to observe that the features of the ASP approach (4) are not fully appropriate to modeling the dynamic flexible functioning of agents as concerns reactivity, proactivity and communication. The superposition of such features ‘on top’ of the ASP approach appears forced, awkward and not fully satisfactory. Instead, ASP can clearly model important aspects of agents, concerning their commonsense reasoning and planning tasks. So, in our opinion ASP can find its relevant place in agent architectures provided that such architectures are sufficiently well-structured and flexible to accommodate and integrate ASP components (as done, e.g. in Costantini, Reference Costantini2011; Costantini et al., Reference Costantini, De Gasperis and Nazzicone2015).
6 Integrating different computational logic approaches in agents: discussion
In our view, an ‘ideal’ agent architecture should be able to exploit the potential of integrating several modules/components representing different behaviors/forms of reasoning, with these modules possibly based upon different formalisms. The ‘overall agent’ should emerge from dynamic, non-deterministic combination of these behaviors that should occur also in consequence of the evolution of the agent’s environment. The developers of large and open systems in fact usually handle the complexity and heterogeneity of these systems by applying component-based approaches, where each part/component of the system could be designed and implemented using a specific suitable formalism. Thus, a premise for the integration of different agent programming approaches within an overall framework, requires such framework to be ‘modular,’ that is, able to accommodate (possibly heterogeneous) modules that are combined through suitable interfaces. In this way, parts of a program can be developed and verified independently and then can be more easily reused. In addition, the system should be maintained in a modular fashion; system’s errors and deficiencies should be traced to specific system modules, thus limiting the scope of detailed error searching. A modular programming framework should ideally satisfy the following properties:
∙ allow abstraction, parametrization, and information hiding;
∙ ease program development and maintenance of large programs;
∙ facilitate re-usability;
∙ have a non-trivial notion of program equivalence to justify replacement of program components;
∙ preserve the declarativity of logic-based languages, if employed.
In the following subsections we discuss modularity in logic programming, agent-oriented logic programming and ASP, in view of the potential integration of such approaches for building agents.
6.1 Modularity in logic programming
The need for modular extensions to logic programming has been always widely agreed upon. In the modern approaches to software development, complex systems are usually built by composing different modules, also in view of code reusability and extensibility. An important point here which is a key factor in the effectiveness of the composed program is the possibility of reasoning on the composition process. The quest for a structured Logic Programming has motivated a large number of research, which evolved in the area of modular logic programming, for example, Miller (Reference Miller1986), O’Keefe (Reference O’Keefe1985), Mancarella and Pedreschi (Reference Mancarella and Pedreschi1988), Gaifman and Shapiro (Reference Gaifman and Shapiro1989), Giordano and Martelli (Reference Giordano and Martelli1994), Bugliesi et al. (Reference Bugliesi, Lamma and Mello1994). The reader may refer to Bugliesi et al. (Reference Bugliesi, Lamma and Mello1994) for a comprehensive survey.
The research conducted in the last decades on logic programming with modules can be divided into two directions (according to Bugliesi et al., Reference Bugliesi, Lamma and Mello1994). The first one is programming-in-the-large where modules are combined by means of compositional operators for building programs as combinations of separate and independent components. The second direction is programming-in-the-small in which logic programming is enriched with new logical connectives.
In the programming-in-the-large approaches, for example, O’Keefe (Reference O’Keefe1985), Mancarella and Pedreschi (Reference Mancarella and Pedreschi1988), Gaifman and Shapiro (Reference Gaifman and Shapiro1989), the adopted method is to provide algebraic operators for programs composition such as union, deletion, overriding union, and closure, avoiding the need of an extension of the underlying language of Horn clauses. This provides high flexibility, due to the possibility of obtaining new composition mechanisms by introducing a corresponding operator in the algebra or by combining existing ones. This approach by its nature supports code reusability. Different components of programs can be combined, equivalent components can be replaced using a suitable equivalence relation. Finally, one can obtain encapsulation and information hiding by introducing suitable interfaces between components (cf., e.g. Mancarella & Pedreschi, Reference Mancarella and Pedreschi1988; Gaifman & Shapiro, Reference Gaifman and Shapiro1989; Brogi et al., Reference Brogi, Mancarella, Pedreschi and Turini1994). The other direction is programming-in-the-small, which uses logical connectives of an extended form of Horn clause language to model the composition of modules (cf, e.g. Miller, Reference Miller1986; Giordano & Martelli, Reference Giordano and Martelli1994).
The aim of many researches has been to find a general model-theoretic approach that combines programming in-the-large and in-the-small in a satisfactory way. Many approaches resort to a well-known concept in formal logic, which appears to be a valuable tool for modular logic programming: ‘generalized quantifiers’. Generalized quantifiers (Mostowski, Reference Mostowski1957; Lindström, Reference Lindström1966) have been conceived as devices for expressing higher order properties which are not first-order definable. Enriching a first order language by such quantifiers allows to increase its expressive capabilities. The extension of first-order logic by generalized quantifiers was studied in depth in the seminal work by Lindström (Reference Lindström1966). A logic program can be seen as a generalized quantifier; for modularly nested logic programs, a logic programs P1 can refer to a module P2 by using P2 as a generalized quantifier. A clean and simple semantics for modular logic programs can be obtained by using this approach, which enjoys the following advantages: it extends the classical semantics of logic programming in a conservative way, complies with various extensions of basic Horn-clause semantics, and facilitates the use of modules employing different semantics; it allows the use of the same module in a program multiple times (re-usability); also, it is highly expressive and it supports information hiding.
Eiter et al. (Reference Eiter, Gottlob and Veith1997) presents a general model-theoretic approach to modular logic programming which combines programming in-the-large and in-the-small in a satisfactory way. The authors use generalized quantifiers instead of inventing completely new constructs, showing how generalized quantifiers can be incorporated into logic programs. They observe observed that, since a logic program can be seen as a generalized quantifier, a semantics for modular logic programs follows immediately.
MAD is a Modular Action Description language introduced in Lifschitz and Ren( Reference Lifschitz and Ren2006); it is a descendant of the C+ action language described in Giunchiglia et al. (Reference Giunchiglia, Lee, Lifschitz, McCain and Turner2004). MAD extends C+ by adding the capability of splitting action descriptions into modules. In MAD, an action description consists of several modules; each module describes a set of interrelated fluents and actions. ‘Import statements’ allow the user to provide references to other modules and thus characterize new fluents and actions by relating them to others, introduced earlier. This capability is a key for designing a repository of background knowledge involving actions, because descriptions of specific action domains will need to ‘import’ parts of the repository.
6.2 Modular agent-oriented programming languages
There is still big gap between industrial agent programming languages and those developed in academia. To fill this gap or at least to provide a bridge between research-level and industrial-level approaches, agent-oriented languages should provide transparent interfaces for easy integration with external code and legacy software. In addition, the underlying architecture of such programming languages has to be flexible enough to support various approaches to knowledge representation and agent reasoning models.
3APL (Hindriks et al., Reference Hindriks, De Boer, Van der Hoek and Meyer1999; Dastani et al., Reference Dastani, van Birna Riemsdijk and Meyer2005) is the most advanced rule-based language w.r.t. agent programs modularity. Later works by Dastani (cf. Dastani et al., Reference Dastani, Van Riemsdijk, Hulstijn, Dignum and Meyer2004; van Riemsdijk et al., Reference van Riemsdijk, Dastani, Meyer and de Boer2006) introduce a semantically oriented modularity to 3APL. In Dastani et al. (Reference Dastani, Van Riemsdijk, Hulstijn, Dignum and Meyer2004) the authors emphasized the need for defining what it means that the agent ‘takes up’ a role and ‘enacts’ it, because agents in open systems like, for example, e-commerce applications usually take up roles temporarily. So, they introduced a notion of role, grouping together beliefs, goals, plans, and reasoning rules of a BDI agent. This role-based approach in the context of AOP facilitates reusability. In van Riemsdijk et al. (Reference van Riemsdijk, Dastani, Meyer and de Boer2006), the authors introduce a concept of goal-oriented modularity for 3APL. It is based on decomposing a set of practical reasoning rules of 3APL agent into modules, according to goals they are supposed to achieve. A rule can call a module to achieve a subgoal in the context of a plan. When the subgoal is achieved, control returns back to the context from which the module was called. This is similar to the stack of routine calls in procedural languages. Implementation of these 3APL extensions required modification to 3APL semantics and to the language interpreter. Both role- and goal- oriented approaches to modularize an agent program are based on particularities of the internal BDI architecture of the agent (the ‘mental state’). 3APL was thus modified and extended into 2APL (Dastani, Reference Dastani2008), which adds new programming constructs that allow the programmer to control and determine the activation and use of modules. These constructs and other modifications further support modularity in 2APL.
AgentSpeak(L)/Jason (cf. Rao, Reference Rao1996; d’Inverno and Luck, Reference d’Inverno and Luck1998) and GOAL (Hindriks et al., Reference Hindriks, De Boer, Van Der Hoek and Meyer2000) do not facilitate modularity in the sense of decomposition of an agent program to conceptually encapsulated components. It is worth mentioning that GOAL was later extended with the notion of modularity by Hindriks (Reference Hindriks2008).
MINERVA (cf. Leite et al., Reference Leite, Alferes and Pereira2001; Leite, Reference Leite2003) and DALI (cf. Costantini & Tocchio, Reference Costantini and Tocchio2002; Costantini & Tocchio, Reference Costantini and Tocchio2004) do not support source code modularity. These two languages exploit the strengths of declarative logic programming and the semantics of both of them is closely connected to logic program updates. The IMPACT (cf. Dix et al., Reference Dix, Eiter, Kraus, Ozcan and Subrahmanian2000; Rogers et al., Reference Rogers, Ross and Subrahmanian2000) programming framework introduces a vertical modularity to agent programming, where the programmer encodes how an agent system should move from one mental state to another by means of ‘updates’, which are independent of the internal structure of the agent’s mental states. The programmer is free to choose any knowledge representation technique for developing the agent’s mental state.
Novák and Dix (Reference Novák and Dix2008) presents a method for extending the syntax of an existing specialized AOP languages to meet the requirements of modern programming. A ‘core’ language is extended by means of higher-level syntactic constructs, thus improving the support for source code modularity and readability. Their approach follows the tiered approach to programming language design (cf. Meyer, Reference Meyer1990). The authors introduce what they call a ‘mental state transformer’ (mst) based on a functional view of an agent program. Then, they construct ‘named mental state transformers’ on top of previously-introduced plain mst. Named mst provide a powerful means for agent-program decomposition and modularization. The tiered structure helps to maintain the simplicity and clarity of the programming language semantics in addition to facilitating easier extension of the language. mst constructs can be used to break the agent program into several functionally encapsulated subunits (the higher level ones can ‘call’ the lower level ones, which facilitates the agent program structuring into several conceptually separated layers). This method is particularly tailored to programming languages oriented to agents with mental states.
6.3 Modular architectures
A modular, flexible and practical agent architecture is one that does not impose specific techniques on design and implementation of an application, but rather allows the programmer to freely choose among the techniques at hand. Several frameworks were proposed driven by the need for such architecture. Here we try to give an insight into some of them.
Fisher (Reference Fisher1998) considers an abstract representation of agent architectures which is very general. The author describes the basic organization of an agent architecture by using group structuring, in which the components of an agent can be considered as sub-agents, and the internal organization can be characterized via appropriate patterns of interaction and structuring between these sub-agents. Particularly, the author shows how the layered architectures consisting of various modeling layers (reactive, deliberative, etc.) might be represented by grouping these sub-agents together. Grouping provides a natural modeling technique which is clear and easy to understand, thus supporting both the system designer and the user.
In Kakas et al. (Reference Kakas, Mancarella, Sadri, Stathis and Toni2004) and Bracciali et al. (Reference Bracciali, Demetriou, Endriss, Kakas, Lu, Mancarella, Sadri, Stathis, Terreni and Toni2005), the KGP agent model is presented as a declarative model based on computational logic (particularly, abductive logic programming and logic programming with priorities). The KGP model adopts a hierarchical architecture with a highly modular structure that encompasses various reasoning and sensing capabilities which allow an agent to be designed for acting in an open and dynamic environment. The modular separation of concerns leads to flexibility in developing the various components of an agent independently of each other. The control of agents’ operational behavior is provided through a context-sensitive cycle-theory component, which breaks the conventional ‘one-size-fits-all’ control of operation. This facilitates the design of heterogeneous agents. The ‘core’ of the KGP model is the knowledge base of the agent, which is accessed by a modular collection of capabilities that enable the agent to plan or react, decide new goals, reason temporally and sense the environment in order to check whether goals or (for cautious agents) the preconditions of actions in plans are satisfied.
DALI (cf. Costantini & Tocchio, Reference Costantini and Tocchio2002; Costantini & Tocchio, Reference Costantini and Tocchio2004) is an AOP language and framework which, though not supporting code modularity, is modular by nature. In fact, a DALI agent ‘emerges’ as the synthesis of a collection of capabilities interconnected among them, that can even be exchanged among agents in a MAS (cf. Costantini & Tocchio, Reference Costantini and Tocchio2005, Reference Costantini and Tocchio2008). Also, DALI allows for sub-agents generation and DALI agents may employ ASP modules. Specifically, Costantini (Reference Costantini2011) proposed a framework for integrating ASP modules into virtually any agent architecture so as to allow for complex reactivity, hypothetical reasoning based upon possibility and necessity, planning, etc. From the implementation point of view, the integration of such modules into logic-based architectures is straightforward. In fact, this approach has been implemented within the DALI interpreter. Costantini et al. (Reference Costantini, De Gasperis and Nazzicone2015) exploits the extended DALI framework to implement affordable and flexible planning capabilities, with the possibility to select plans according to a suite of possible preferences. The effectiveness of this solution was shown by means of a case-study where DALI agents (organized in a MAS) cooperate in order to explore an unknown territory. The DALI programming environment at current stage of development (De Gasperis et al., Reference De Gasperis, Costantini and Nazzicone2014) offers a multi-platform folder environment, built upon the DALI interpreter, shells scripts, Python scripts to integrate external applications, a JSON/HTML5/jQuery Web interface integrated with DALI applications, with a Python/Twisted/Flask Web server capable to interact with a DALI MAS at the back-end. Thus, DALI is fully compatible with legacy/industrial applications. In addition, a cloud DALI implementation, reported in Costantini, De Gasperis and Nazzicone (Reference Costantini, De Gasperis and Nazzicone2017), Costantini, De Gasperis, Pitoni and Salutari (Reference Costantini, De Gasperis, Pitoni and Salutari2017), has recently been developed in view of distributed modular applications, for instance in the Cognitive Robotics and eHealth fields (cf. Aielli et al., Reference Aielli, Ancona, Caianiello, Costantini, De Gasperis, Marco, Ferrando and Mascardi2016, for a recently proposed DALI-related project in this field).
Novák and Dix (Reference Novák2008) and Novák (Reference Novák2008) propose a ‘modular BDI agent programming architecture,’ which is component-based, and independent of the internal structure and underlying formalism of its components. Components of such a BDI system are connected by ‘interaction rules.’ Thus, a clear distinction is made between knowledge representation in the system’s components, and overall system’s dynamics. The architecture is equipped with transparent interfaces to existing ‘mainstream’ programming languages so as to make integration with external code and legacy software easily feasible. In related work, Novák (Reference Novák2008) introduces the theoretical foundations of an agent programming framework called ‘Behavioral State Machines’ (BSM). The proposed framework draws a strict and clear distinction between the knowledge representation layer and the behavioral layer of an agent program. It supports a high level of modularity w.r.t. employed KR technologies, thus facilitating the implementation of hybrid agents (i.e. agents mixing both reactive as well as sequential behavior), and provides a clear and concise semantics based on the well-studied computational model of Gurevich’s Abstract State Machines (Börger and Stärk (Reference Börger and Stärk2003)). The Knowledge Representation layer is kept abstract and open, thus giving the possibility of integrating different KR modules (possibly realized in different KR technologies) into the agent’s knowledge base. The main focus of the BSM computational model is in fact the agent’s behaviors. Basically, in this framework a KR module has to provide a language of query and update formulas and two sets of interfaces: entailment operators for querying the knowledge base and update operators to modify it. To demonstrate the flexibility of the architecture, the aforementioned paper introduces a practical example involving three different KR technologies, namely ASP, Prolog and Java. It formally states the compatibility of the three modules. BSM do not natively feature any of the usual characteristics of rational agents Wooldridge (Reference Wooldridge2000), such as goals, beliefs, intentions, commitments and alike. The BSM programming framework only guides a programmer to the design of a practical agent system while leaving a high degree of freedom. In order to practically test the BSM approach to programming agent systems, the programming language ‘Jazzyk’ has been designed and implemented (see Novák, Reference Novák2009).
6.4 Modularity in answer set programming
Research on modularity in ASP is still at early stages. There are several approaches to modularization of ASP programs, but in fact only few of them provide a flexible, easy-to-use modular architecture with a clearly defined interface for module interaction. Below we try to give an insight into some of them.
Eiter et al. (Reference Eiter, Gottlob and Veith1997) approaches modularity in ASP in the programming-in-the-small sense. In this approach, program modules are viewed as generalized quantifiers (Lindström, Reference Lindström1966). The programming-in-the-small approach of Ianni et al. (Reference Ianni, Ielpa, Pietramala, Santoro and Calimeri2004) addresses modularity in ASP based on templates for defining subprograms. Tari et al. (Reference Tari, Baral and Anwar2005) developed a declarative language for modular ASP; their language allows to declaratively state how one ASP module can import processed answer sets from another ASP module (by means of introducing ‘import rules’) where no cycles are admitted among modules.
Programming-in-the-large approaches to modularity in ASP are mostly based on Lifschitz and Turner’s ‘splitting set theorem’ (cf. Lifschitz & Turner, Reference Lifschitz and Turner1994) or on variants of it. The basic idea is that a program can in general be divided into two parts: a ‘bottom’ part and a ‘top’ part, such that the former does not refer to predicates defined in the latter. Computation of the answer sets of a program can be simplified when the program is split into such parts. Faber et al. (Reference Faber, Greco and Leone2007) applies the magic set method in the evaluation of Datalog programs with negation, that is, normal logic programs without function symbols. The notion of modules and independent sets are introduced to guarantee ‘query equivalence’ for consistent programs. The modularity results provide a better understanding of Datalog’s structural properties. The authors show by experiments that their techniques allow to solve very advanced data-integration tasks.
Janhunen et al. (Reference Janhunen, Oikarinen, Tompits and Woltran2009) considers the stable-model semantics of disjunctive logic programs (DLPs), and define the notion of a DLP-function where a well-defined input/output interface is provided, and a suitable compositional semantics for modules is introduced. Oikarinen (Reference Oikarinen2008) establishes a simple and intuitive notion of a logic program module that interacts through an input/output interface. This is achieved by accommodating modules as proposed by Gaifman and Shapiro (Reference Gaifman and Shapiro1989) to the context of ASP. Full compatibility of the module system with the stable model semantics is achieved by allowing positive recursion to occur inside modules only.
Dao-Tran et al. (Reference Dao-Tran, Eiter, Fink and Krennwallner2009) focuses on modular non-monotonic logic programs (MLP) under the answer set semantics, whose modules may have contextually dependent input provided by other modules. Moreover, (mutually) recursive module calls are allowed. The authors define a model-theoretic semantics for this extended setting, showing that many desired properties of ordinary logic programming generalize to their modular ASP. They characterize the computational complexity of modular ASP programs. Then, they investigate the relationship of modular programs to DLPs with well-defined input/output interface (DLP-functions), and show that they can be embedded into MLPs.
Balduccini (Reference Balduccini2007b) provides modules specification with information hiding, where modules exchange information with a global state. Baral et al. (Reference Baral, Dzifcak and Takahashi2006) defines modules in terms of macros that can be called from a program. This with the aim to facilitate the creation and use of a repository of modules that can be used by knowledge engineers without having to re-implement basic knowledge representation concepts from scratch.
In Faber and Woltran (Reference Faber and Woltran2009) a technique is proposed that allows an answer set program to access the brave or cautious consequences of another answer set program. Lierler and Truszczyński (Reference Lierler and Truszczyński2013) propose ‘modular logic programs’ as a modular version of ASP. This work consider programs as modules and define modular programs as sets of modules. The authors introduce ‘input answer sets,’ the key semantic object for facilitating the communication between modules.
7 Modular distributed architectures
In many application fields, agents and MAS are situated in complex, open, and dynamic computational environments which include heterogeneous software components, physical devices and sensors including wearable devices, third part services, data centers, expert systems and other knowledge sources available on the ‘Internet of Everything.’ The availability of such components may evolve in time, as new knowledge can be discovered, and components may join or leave the environment, or become momentarily unreachable. Such environments can actually constitute CPS (see Khaitan & McCalley, Reference Khaitan and McCalley2015, for a survey), and they may include physical components that interact with or are integrated into the computational ‘ecosystem.’ Architectures suitable for modeling such scenarios have been recently proposed, and prototype implementations are or will be soon available.
7.1 Multi-context systems
Multi-context systems (MCS), introduced by Brewka et al. (Reference Brewka, Eiter and Fink2011a, Reference Brewka, Eiter, Fink and Weinzierl2011b, Reference Brewka, Ellmauthaler and Pührer2014), model the information flow among multiple possibly heterogeneous data sources. The device for doing so is constituted by ‘bridge rules,’ which are similar to Prolog or, more precisely, Datalog rules, but allow for knowledge acquisition from external sources; in fact, in each element of their ‘body’ the ‘context,’ that is, the source, from which information is to be obtained is explicitly indicated. In Managed MCS (mMCS) the conclusion of a bridge rule is not simply added to the ‘destination’ context’s knowledge base; rather, it is subjected to an elaboration via specific operators; the new knowledge can thus be processed (for instance with the aim of making it compatible in terms of format and terminology) and can lead to any (even non-monotonic) re-elaboration of the knowledge base. In order to account for heterogeneity of sources each context is supposed to be based on its own logic. Semantics of mMCS is in terms of equilibria, where an equilibrium is a global data state composed of partial data states, one for each context, encompassing however inter-context communication determined by bridge rules, and where each element is ‘acceptable’ w.r.t. the corresponding context’s semantics. An equilibrium is thus ‘stable’ w.r.t. bridge-rules. In view of practical applications it can be noticed that, being logic-based, any context in an mMCS can be a logical agent, to which MCSs have in fact already been explicitly extended (cf. Gonçalves et al., Reference Gonçalves, Knorr and Leite2014; Costantini. 2015 Reference Costantinib ; Costantini & De Gasperis, Reference Costantini and De Gasperis2015).
7.2 Agent computational environments
Costantini (Reference Costantini2015a) proposes the general software engineering approach of transforming an agent into an agent computational environment (ACE) composed of: (1) the ‘main’ agent program, or ‘basic agent’; (2) a number of reasoning modules available to the main agent program; (3) a number of data sources ( ‘contexts’) that the agent is able to access; some contexts will be internal, or local; some will be external, where the set of accessible contexts may vary over time. There is no assumption about how the various components are defined, except that they are based upon Computational Logic. As an interesting development, an ACE component can in turn be an ACE, thus leading to K-ACE, which is a multi-level modular architecture suitable for highly distributed applications.
Costantini (Reference Costantini2015a) proposes a full formalization with a semantics, which draws inspiration from MCSs’ equilibrium semantics, and discusses an application to Complex Event Processing. Costantini and Formisano (Reference Costantini and Formisano2016) enhances the approach by introducing the evolution of the system in time under components’ update, and by making bridge-rules application tailored to agents on the line of Costantini (2015 Reference Costantinib ), Costantini and De Gasperis (Reference Costantini and De Gasperis2015): in fact, bridge rules are proactively triggered upon specific conditions and the obtained knowledge is reactively elaborated via a management function which generalizes the analogous MCS’s concept. Also, bridge rules are generalized to ‘bridge-rule patterns’ where the involved contexts are left unspecified: such patterns can be thus dynamically specialized and the resulting bridge rules can be activated so as to put them into action. Capabilities of Enhanced ACE are demonstrated on a case study concerning quantitative reasoning in agents; a situation is outlined where data might be potentially accessible to an agent so as to build a plan to reach some objective; however, in the case study the agent is constrained by the available budget since access to knowledge bases is subject to fees where one or more stages of the devised plan also imply to pay. The involved quantitative reasoning module is defined in RASP (resource-based answer set programming) (cf. Costantini & Formisano, Reference Costantini and Formisano2010; Costantini et al., Reference Costantini, Formisano and Petturiti2010; Formisano & Petturiti, Reference Formisano and Petturiti2010) plus suitable preference mechanisms (Costantini & Formisano, Reference Costantini and Formisano2011), where RASP is an extension of ASP which handles resources and preferences on resource usage. RASP has been proven in Costantini and Formisano (Reference Costantini and Formisano2013) to be equivalent to an interesting fragment of Linear Logic.
ACEs share with Modular BDI Architecture and BSM the possibility of accommodating heterogeneous modules. However, ACE go towards distribution, and bridge rules do not define control but rather knowledge interchange among modules. Nonetheless, BDI and BSM might be employed to define any of an ACE’s composing modules.
8 Discussion and concluding remarks
A flexible and robust AOP framework should, in our view, neither enforce a specific knowledge representation technique nor commit to one single scheme of behavior. Rather, it should facilitate the integration of heterogeneous knowledge representation techniques and different schemes of behavior in building agents or MAS. The implementation of a software development platform based upon a modular architecture should indeed include support for the development of components in various programming and knowledge representation languages and formalisms, where the underlying infrastructure should serve to ‘glue’ components together.
The modular BDI and BSM architectures (mentioned earlier) introduce a clear distinction between the knowledge representation layer of an agent system and its dynamics (behavioral layer), with the former composed of a set of heterogeneous KR modules, particularly of logic-based ones (where ASP modules can also be exploited), connected by means of interaction rules. However, related rule-based languages are constrained only to BDI-type agents and this does not facilitate compositional modularity w.r.t. behavioral decomposition. Both AgentSpeak(L) and 3APL in fact enforce a particular software development methodology together with a specific knowledge representation technique. In addition, there is a tight coupling of interactions between the components of an agent system, such as the belief base and goal base. This has a strong influence on the possibility of their integration with other systems.
METATEM and Golog (cf. Mascardi et al., Reference Mascardi, Martelli and Sterling2004, for a review) in their basic form are not easily extensible to handle several heterogeneous knowledge bases, because of a tight coupling of the KR approach (usually Prolog, or an FOL-style language) with the language for encoding agent’s behaviors. IMPACT provides insteaf a high degree of freedom w.r.t. heterogeneous KR technologies and their integration. An IMPACT agent consists of a set of packages with a clearly defined interface composed of a set of data types, data access functions and type composition operations. An agent program is, there, a set of declarative rules involving invocations of the underlying components via predefined data access functions.
KGP knowledge bases describe the knowledge of the agent, also concerning its environment. A KGP agent consists of separate modules supporting the different reasoning capabilities (capabilities modules). These capabilities are based upon abductive logic programming but the architecture might in principle accommodate modules defined in different ways. This modularity in the architecture facilitates in fact the integration of heterogeneous modules in one agent program. ASP modules might in principle be exploited in this architecture to implement various capabilities, for instance planning.
Lots of research and experiments have been done on integrating ASP modules in different agent systems. Various kinds of ASP modules have been integrated into DALI agents, and experimented in significant applications. In the architecture proposed in Sridharan (Reference Sridharan2016), the coarse-resolution symbolic domain representation is translated into an ASP program, which is solved to provide a tentative plan of abstract actions, and to explain unexpected outcomes. BSM have demonstrated by practical examples the potential of the integration of several knowledge representation techniques among which ASP. As a matter of fact, after reviewing a good corpus of papers about agents, and about the use of ASP in agents and MAS, we are able to remark that ASP is usefully exploited mainly in the form of modules for handling knowledge representation and implementing reasoning capabilities in tasks where ASP proved to be very effective. Few approaches suggest a complete ASP-based agent architecture like done, for example, in Gelfond (Reference Gelfond2004), Balduccini et al. (Reference Balduccini, Regli and Nguyen2014) (see also Gelfond & Kahl, Reference Gelfond and Kahl2014, and the many references therein).
We believe that modularization is the key for flexibility, and naturally for efficiency and scalability. Modularizing an agent and/or transforming it into an ACE is in our opinion the best way to design a robust agent through the integration of heterogeneous modules representing different behaviors or forms of reasoning in one agent system. A flexible agent system or, more generally, an MCS or an ACE, should be able to integrate modules represented by using imperative approaches; this can in fact be practically useful for some functions, for example, for interacting with the environment, and for the user interfaces. Such an agent system might also integrate non-symbolic reasoning modules as done in SOAR, a very well-known ‘cognitive architecture’ (presented in Laird et al., Reference Laird, Newell and Rosenbloom1987; Laird, Reference Laird2008, Reference Laird2012); a list of references can be found at the SOAR Website, URL http://soar.eecs.umich.edu/) which integrates connectionistic and software components. Declarative approaches will be profitably exploited in domains such as knowledge representation and for ‘executable specification’ of different behaviors/forms-of-reasoning where declarative programming and ASP have since long proved to bring many advantages, among which clear and robust semantics, high-level concepts like beliefs or goals, flexibility, ease of maintenance, and verifiabilityFootnote 2 . This modular way of representing agents could exploit, where deemed convenient, the advantages of existing well-established imperative approaches like JACK and JADEX, which have object-oriented syntax and large range of available libraries, and the flexibility and generality of architectures such a SOAR for representing, for example, long-term and short-term memory (in Gero & Peng (Reference Gero and Peng2009) the reader can find a nice summary with many references of cognitive studies on memory and their applications to agents).
So, the resulting agent systems will be able to explain at best the advantages of all approaches so as to avoid the ‘brittleness’ that may allegedly result, according to SOAR-Research-Group (2010), from over-commitment to logic-based approaches. The use of agent technologies in industry is growing since the 1990s. The rate of this growth can be further increased by concentrating more on the issues of standards and on adoption of software development tools and methodologies to facilitate and empower the use of integrated multi-paradigm solutions, and the development of highly distributed heterogeneous systems.
Acknowledgement
Abeer Dyoub acknowledges support by the Project ‘Machine Ethics for Cybersecurity’ of the Department of Information Engineering, Computer Science and Mathematics of the University of L’Aquila. The authors wish to thank the anonymous reviewers for the useful comments and advice.