1 Object Oriented Logic Programming as an Agent Building Infrastructure Paul Tarau Abstract—We show that agent programming patterns are well expressed in terms of an object oriented layer extended with a gen- eralized inheritance mechanism and independent logic program- ming based inference engines. Instead of proposing yet another agent programming “model” we simply derive key agent program- ming patterns as the natural result of a set of programming lan- guage constructs. The suggested equation: Agents = Objects + Logic + Infer- ence Engines + Coordination + Remote Action provides orthogonal agent composition mechanisms which are expressive and highly reusable. The approach described in this paper has emerged in the pro- cess of building Agent classes as extensions to our industrial strength Object Oriented Prolog system, Jinni 2002, available for online evaluation at: http://www.binnetcorp.com/Jinni Keywords: Agent Programming Languages, Remote Execution, Blackboard-based Agent Coordination, Multi-threaded Logic Pro- gramming Engines, Distributed AI I. I NTRODUCTION The paradigm shift towards networked, mobile, ubiquitous computing has brought a number of challenges which require new ways to deal with increasingly complex patterns of inter- action: autonomous, reactive and mobile computational entities are needed to take care of unforeseen problems, to optimize the flow of communication, to offer a simplified and person- alized view to end users. These requirements naturally lead towards the emergence of agent programs with increasingly so- phisticated inference capabilities, as well as autonomy and self- reliance. Jinni (Java INference engine and Networked Interactor) [1], [2], is a lightweight, multi-threaded compiled Prolog system with powerful Object and Agent Oriented extensions, intended to be used as a flexible scripting tool for gluing together knowl- edge processors with Java and .NET components in distributed applications. Jinni’s high level, portable, secure networking layer provides intelligent interoperation between Java and .NET components on Windows on Linux/Unix and Pocket PC plat- forms. Jinni threads are coordinated through blackboards, local to each process. Associative search based on term unification (a variant of Linda [3], [4]) is used as the basic synchroniza- tion mechanism. Threads, blackboard and networking opera- tions are controlled with lightweight, fast bytecode Prolog in- terpreters. The synergy of these features makes Jinni a conve- Contact address: Paul Tarau, Ph.D. Department of Computer Science, Uni- versity of North Texas, P.O. Box 311366, Denton, Texas 76203, E-mail: ta- rau@cs.unt.edu ) nient development platform for distributed AI, and in particular, for building intelligent autonomous agent applications. II. THE J INNI ONTOLOGY:ORTHOGONAL LANGUAGE CONSTRUCTS FOR AGENT PROGRAMMING As technology matures and design patterns emerge and con- solidate, Agent Programming is getting closer and closer to a programming paradigm status [5]. This implies a high degree of compositionality - ability to put together general purpose programs from simple, reusable building blocks. With this in mind, we will overview here the set of orthogonal components which make up Jinni’s Ontology. Objects: provide proven program composition and code reuse mechanisms and allow extension of a libraries of behav- iors and knowledge processing components. Logic: Logic programming provides well understood, res- olution based inference mechanisms. Beyond clause selec- tion in the resolution process and generalized parameter pass- ing, unification provides flexible search in message queues and databases. Inference Engines: execution of multiple independent goals is needed for implementing complex reactive patterns in agent programs. Engines are lightweight and highly autonomous instances of language interpreters - running through various scheduling models - in particular through blackboard coordi- nated multi-threading. Coordination: agent coordination can (and should) be sep- arated from the details of agent communication and the agent’s computational mechanisms (engines). We suggest coordina- tion through blackboards - databases with intelligent, constraint based search - instead of conventional message passing. Remote Action: a simple client-server style remote call mechanism is suggested, as a building bloc for various forms of remote action - in particular for supporting remote event propa- gation. Building blocks for implementing agent security layers are provided as a combination of server side sandboxing, strong cryptography and password controlled server access. Once se- curity is in place, the suggested infrastructure can safely emu- late more flexible P2P interaction patterns. III. EXPRESSING KEY AGENT PROGRAMMING PATTERNS We will start by outlining how Jinni’s programming language constructs cover key agent programming idioms. Reactive Behavior: We have avoided any form of interleav- ing ”thinking” and ”action” stages in the agent programming model itself. The availability of multi-threading, local and re- mote blackboard based coordination mechanisms, and multi- ple reentrant language interpreters allows a logical separation