JavaLog: a framework-based integration of Java and Prolog for agent-oriented programming

https://doi.org/10.1016/j.cl.2004.03.001Get rights and content

Abstract

Intelligent agent development has imposed new challenges on the necessary language support. Object-oriented languages have been proposed as an appropriate tool, although logic-oriented languages are more adequate for managing mental attitudes. Multi-paradigm languages supporting encapsulation of actions, hiding of private knowledge and flexible manipulation of knowledge are, certainly, a good alternative for programming agents. However, a unique language to support flexible and efficient development of multi-agent systems confronts with the tradeoffs imposed by expressive power, efficiency and support technology. An alternative to conciliate these tradeoffs is not to think about a single language but an incrementally compatible family of agent-oriented multi-paradigm languages. In this work we present an approach based on object-oriented framework technology for integrating object and logic paradigms in such a way that new language features can be incrementally added to the core language. This core language is based on logic modules integrated as object abstractions in the object paradigm. JavaLog is a materialization of this framework integrating Java and Prolog. This core was extended to provide multi-threading support, mobility and temporal-logic operators to Prolog. MoviLog, the mobile part of the family provides a novel mobility mechanism, reactive mobility by failure, which enables virtual Prolog databases distributed across Web sites.

Introduction

Intelligent agent programming requires particular capabilities of a programming language. This fact relies on both experiences gained developing applications with standard languages and from the many proposed agent-oriented languages [1].

Many applications have been developed using object-oriented languages and characteristics of these languages such as encapsulation and inheritance are considered important benefits for agent development [2], [3]. On the other side, several proposals for agent languages such as Metatem [4] or Gaea [5], among others, are supported on logic bases. A logic-oriented programming approach is a straightforward consequence of the requirement of managing mental attitudes, since they are generally based on special logics defined for that purpose [6]. For this reason, logic languages such as Prolog may be considered an obvious way for representing and inferring relationships among mental attitudes such as intentions, goals and beliefs. However, they present several limitations for the definition of action capabilities that object-oriented languages naturally support. Usually, logic-based agent languages are enhanced with non-declarative features inherent to other type of languages, such as objects, threads, etc. Thus, in order to have a language that makes it easier the development of different kind of agents, this language should provide, at least, support to smoothly manage mental attitudes, actions, and private information in an integrated way.

Certainly, multi-paradigm languages [7], [8], [9], [10], [11] integrating logic and object-oriented paradigms represent a convenient choice for the definition of agent programming languages. However, the existing proposals of multi-paradigm languages, particularly the ones proposed in the 1980s and their evolutions, present limitations to satisfy the multiple requirements of modern multi-agent systems. In addition, flexibility to cope with specific language capabilities required by the many potential application areas is an essential factor. Also, as efficiency is involved, the use of a language providing a set features not necessary for the domain can be negative, in terms of memory usage or speed, despite the expressive power of the language. Therefore, the main challenge behind the design of an effective language for agent programming relies on how to maintain the right balance among expressive power, support technologies and functionality. We believe that object-oriented framework technology [12], [13] is the current most viable answer.

Under these considerations we have designed JavaLog, a language that integrates Java and Prolog, enabling to exploit the advantages of both programming paradigms in an extensible way. JavaLog is based on a Java framework that can be extended to incrementally add new functionalities to the core language, giving a family of languages. The core language is based on logic modules that encapsulate clauses for the manipulation of mental attitudes. These modules are used through variables or directly in Java methods, defining precise bridges between the two paradigms. Features such as temporal Prolog extensions, concurrency or strong mobility, optional for some agent systems, are provided as incremental extensions of the framework. Concurrency is supported by Java threads; logic threads are also supported. Strong mobility is incorporated supporting logic modules that can be transparently executed using clauses at different sites.

In the remainder of the article, we will first describe our approach based on logic modules for agent programming, then, in Section 3 we summarize relevant characteristics of the JavaLog language. The JavaLog framework is briefly described in Section 4. Then, Section 5 describes an extension of the JavaLog framework to support concurrency. Mobility extensions and a novel form of mobility are presented in Section 6. In Section 7 we describe a number of applications of the framework. Section 8 discusses the most relevant related work. Finally, in Section 9 we conclude with a summary and directions for future work.

Section snippets

Integrating logic and object paradigms

The object-oriented and logic paradigms work over different conceptual worlds. The integration of these worlds presents several problems, which are a consequence of the different nature of the computational elements involved and the way in which they are manipulated in each paradigm.

The object-oriented paradigm works over objects, which are only accessed by methods. The logic programming paradigm is based on logic clauses, which manipulate a defined set of terms.

Our approach for agent-oriented

Integration schemes

Several interaction alternatives among objects and logic modules are defined in JavaLog. We call these alternatives as interaction schemes. Interaction schemes are classified as integration by reference, value and composition schemes. Reference specify the composition limits of different modules. Value specify the role of objects in logic modules and the role of logic variables in methods. Composition specifies how logic modules can be combined, expressing also the composition of a knowledge

The framework

JavaLog is designed as an object-oriented framework [12], [13] to add new language features as needed. Fig. 2 shows a class diagram with the most important classes of the framework. The fundamental concept on which the language is based is the logic module, which is represented by the class LogicModule. A LogicModule is a sequence of Prolog clauses (class PlClause). These fundamental constructs are extended to support extra features such as modules with temporal operators (class

Thinking concurrently

Complex cognitive agents may need to think concurrently about their goals, choices and future courses of action. For this, JavaLog was extended to provide a mechanism to create and synchronize threads. We call this extension JavaLog©.

The clause thread(G1), G2,…,Gn where Gi are goals, creates a new JavaLog© thread which tries to prove G1 in a new thread, while the execution of G2,…,Gn continues. For example, thread(search(Pr, A)), searches a list of articles matching a number of preferences. If

Mobility

The huge amount of information available on the Internet became one of the main motivations for the development of mobile agent technology [17], [18]. Such a capability is particularly interesting when an agent makes sporadic use of a valuable shared resource. But also, efficiency can be improved by moving agents to a host to query a large database, as well as, response time and availability would improve when performing interactions over network links subject to long delays or interruptions of

Experimental results

JavaLog has been used in several agent-related research projects. For example, NewsAgent [21] is an intelligent agent that has the capability of generating personal newspapers from particular users’ preferences extracted by observing users’ behavior. This agent uses static word classification and case-based reasoning for dynamic sub-classification of interesting documents.

The QueryGuesser Agent [22] is an interface agent that assists users who work with database systems. QueryGuesser has the

Related work

Several languages have been proposed for programming agents [4], [7], [27], [28], [29], [30]. Some of them use some object-oriented concepts in a logic context. For example, Concurrent Metatem [4], [28] uses a set of rules based on temporal logic to represent an object's internal definition. Daisy [7] takes an object-oriented approach for building agents that communicate and derive future actions based on the speech act theory.

From the object-oriented perspective, both language extensions and

Conclusions

In this article, an approach for the development of intelligent agents from the programming point of view has been presented. This approach is based on the fact that the object-oriented paradigm is a good paradigm for programming agents but it presents some problems in the manipulation of mental attitudes. The problem of the manipulation of mental attitudes, usually treated on specific logic formalisms, is solved by the use of logic programming. In short, we present a multi-paradigm approach

Analı́a Amandi received a Ph.D. Degree in Computer Science from the Universidade Federal do Rio Grande do Sul, Porto Alegre, Brazil in 1997 and the Computer Science degree from the UNLP University, La Plata, Argentina in 1990. Currently she is a Professor at Computer Science Department and head of the agent group of the ISISTAN Research Institute of the UNICEN University at Tandil, Argentina. She has over 30 papers published in conferences and journals about agents. Her research interests

References (37)

  • J.H.M. Lee et al.

    Object logic integrationa multiparadigm design methodology and a programming language

    Computer Languages

    (1997)
  • M. Bugliesi et al.

    Modularity in logic programming

    The Journal of Logic Programming

    (1994)
  • H.J. Levesque et al.

    GOLOGa logic programming language for dynamic domains

    Journal of Logic Programming

    (1997)
  • Dix J, Leite JA, Satoh K, editors. Computational logic in multi-agent systems, Datalogiske skrifter, vol. 93. Roskilde,...
  • Crnogorac L, Rao AS, Ramamohanarao K. Analysis of inheritance mechanisms in agent-oriented programming. In: Proceedings...
  • Shoham Y. An overview of agent-oriented programming. In: Software agents, Menlo Park, USA, AAAI;...
  • Fisher M. A survey of concurrent METATEM—the language and its applications. In: Gabbay DM, Ohlbach HJ, editors....
  • Noda I, Nakashima H, Handa K. Programming language gaea and its application for multiagent systems. In: Workshop on...
  • J. Dix

    The logic programming paradigm

    AI Communications

    (1998)
  • Poggi A. Daisy: an object-oriented system for distributed artificial intelligence. In: Proceedings of the ECAI-94...
  • Van Roy P, Haridi S. Mozart: a programming system for agent applications. In: International Workshop on Distributed and...
  • K. Yamazaki et al.

    Implementation of logic computation in a multi-paradigm language tao

    Information Processing Society of Japan

    (2001)
  • Ng KW, Huang L, Sun Y. A multiparadigm language for developing agent-oriented applications. In: Proceedings of...
  • M.E. Fayad et al.

    Object-oriented application frameworks (special issue introduction)

    Communications of the ACM

    (1997)
  • Fayad ME, Johnson R, editors. Domain-specific application frameworks: frameworks experience by industry. New York:...
  • O'Keefe RA. Towards an algebra for constructing logic programs. In: Proceedings of the International Symposium on Logic...
  • Zunino A, Campo M, Mateos C. Simplifying mobile agent development through reactive mobility by failure. In: Bittencourt...
  • D.B. Lange et al.

    Seven good reasons for mobile agents

    Communications of the ACM

    (1999)
  • Cited by (19)

    • Extending movilog for supporting Web services

      2007, Computer Languages, Systems and Structures
      Citation Excerpt :

      A MARlet is a Java servlet [32], which provides inference, communication and authorization services to Brainlets. Also, MARlets offer services for supporting the RMF by extending JavaLog [31], a Prolog-based language designed for programming stationary intelligent agents. Fig. 3 shows the architecture of a WS-Log site and its components.

    • A Predicate Construct for Declarative Programming in Imperative Languages

      2022, ACM International Conference Proceeding Series
    • Integrating a General Search Agent into an Imperative Programming Language

      2021, Proceedings - 2021 IEEE 4th International Conference on Artificial Intelligence and Knowledge Engineering, AIKE 2021
    View all citing articles on Scopus

    Analı́a Amandi received a Ph.D. Degree in Computer Science from the Universidade Federal do Rio Grande do Sul, Porto Alegre, Brazil in 1997 and the Computer Science degree from the UNLP University, La Plata, Argentina in 1990. Currently she is a Professor at Computer Science Department and head of the agent group of the ISISTAN Research Institute of the UNICEN University at Tandil, Argentina. She has over 30 papers published in conferences and journals about agents. Her research interests includes interface agents and software architecture.

    Marcelo Campo received a Ph.D. Degree in Computer Science from the Universidade Federal do Rio Grande do Sul, Porto Alegre, Brazil in 1997 and the Systems Engineer degree from the UNICEN University, Tandil, Argentina in 1988. Currently he is an Associate Professor at Computer Science Department and Head of the ISISTAN Research Institute of the UNICEN University at Tandil, Argentina. He is also a research fellow of the National Council for Scientific and Technical Research of Argentina (CONICET). He has over 50 papers published in main conferences and journals about software engineering topics. His research interests includes intelligent aided software engineering, software architecture and frameworks, agent technology and software visualization.

    Alejandro Zunino received a Ph.D. Degree in Computer Science from the Universidad Nacional del Centro (UNICEN), Tandil, Argentina, in 2003, his MSc. in Systems Engineering in 2000 and the Systems Engineer degree in 1998. He is a full time research assistant at the UNICEN. He has published over 15 papers in journals and conferences. His current research interest focus on development tools for intelligent agents, mobile agents and logic programming.

    View full text