Direct Execution of Team Specifications in STAPLE Sanjeev Kumar
Philip R. Cohen
Marcus J. Huber
OGI School of Science & Eng. 20000 NW Walker Road, Beaverton, OR 97006, USA +1-503-748-7803
OGI School of Science & Eng. 20000 NW Walker Road, Beaverton, OR 97006, USA +1-503-748-1326
OGI School of Science & Eng. 20000 NW Walker Road, Beaverton, OR 97006, USA +1-503-748-7666
[email protected]
[email protected]
[email protected]
ABSTRACT
2. REVIEW OF THE LANGUAGE
Formal theories of teamwork are typically treated as software design specifications of team behavior. We take a different approach to programming teamwork by directly executing logical specifications of joint commitment and joint intention. This approach leads to a domain-independent framework for programming teamwork where one can modify (or add new) behavior for a team of agents just by modifying (or adding) logical sentences. One may also be able to predict the behavior of an agent team offline using its team intention specification and verify it by running the actual system.
Our object language is a modal language with the usual connectives of a first order language with equality, as well as operators for propositional attitudes and event sequences. (BEL x p) and (GOAL x p) say that p follows from x’s beliefs or choices respectively. (HAPPENS a) and (DONE a) say that a sequence of actions described by the action expression a will happen next or has just happened, respectively. Temporal properties are expressed in a linear time temporal logic. ◊p says that the proposition p will eventually be true, and □p says that p will always be true. Letters such as τ are used to represent groups. (HAPPENS τ a) and (DONE τ a) specify the group τ as actor for the action sequence a without regard to which group members participate in the group action. An action expression is built from variables ranging over sequences of events using constructs of dynamic logic: a;b is action composition, a|b is non-deterministic choice, a||b is concurrent action, p? is a test action, and a* is indefinitely many repetitions. Complex action expressions are composed using these dynamic logic constructs. Mutual belief is defined in terms of unilateral mutual belief (BMB). Persistent goal (PGOAL) formalizes the notion of individual commitment and intention (INTEND) to do an action is defined to be a commitment to do the action knowingly. Team commitment (TPG) and team intention (TI) are similarly defined for a team of agents [3]. The model theory of this language is based on a possible-worlds semantics. Worlds are modeled as a linear sequence of primitive event types and the possible worlds can be related to each other via belief and goal accessibility relations. Details of this modal language and its semantics can be found in [1, 3, 4]. Next, we present an overview of the basic interpreter.
Categories and Subject Descriptors I.2.11 [Distributed Artificial Intelligence]: Intelligent agents, Multiagent systems.
General Terms: Design, Languages, Theory Keywords: Teamwork, Agent Languages and Environments 1. INTRODUCTION It is customary to treat formal theories of agency as specifications of agent behavior. As such, many implementations of teamwork [2, 3] use the joint-intention theory [4] only for specification purposes and hard-code the team behavior predicted by the theory. On the other hand, the benefits of directly interpreting a team specification are apparent from the experiences of the STEAM researchers [6] who have demonstrated successful reuse of the same STEAM code base for a number of applications. We take this concept of directly executing team specifications to the next step by offering interpretation of logical expressions involving a subset of modal logic, dynamic logic of actions, and temporal logic. This approach of directly executing a team specification in logic leads to a domain-independent framework for programming teamwork and therefore, it may be possible to modify (or add new) behavior for a team of agents just by modifying (or adding) logical sentences. It may also be possible to predict the behavior of an agent team offline using its team intention specification and verify it by running the actual system. The direct execution framework is part of an ongoing research to design and implement a multi-agent programming language called STAPLE (Social and Team Agents Programming Language) that is formally connected with a logical theory of agency. Here, we discuss the implementation of a STAPLE interpreter.
3. OVERVIEW OF THE INTERPRETER We view the STAPLE interpreter as consisting of six main components according to the tasks it needs to do: (1) a modal reasoner, (2) a knowledge base maintenance system, (3) a rule interpreter, (4) a plan interpreter, (5) an observer and actuator interpreter, and (6) the main interpreter. Observers and actuators are high-level abstractions for sensors and effectors. A Prolog dynamic database stores the knowledge base, the plan library, the rule base, and the observer/actuator library. Figure 1 shows some of these components and how they interact with each other. The components in bold outline (active plans, active observers and actuators, and the main modal interpreter) are active components at run-time i.e. all of them can run concurrently. An active plan consists of an instantiated plan from the plan library along with an instance of the plan interpreter running in a separate thread. Similarly, an active observer consists of an instantiated observer from the observer/actuator library along with an instance of the observer interpreter running in a separate thread. There may be any number of active plans, observers, and actuators in a STAPLE process at any given time. The main interpreter typically creates the other active components as and when needed. Interaction with the external world is only through the ac-
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. AAMAS’02, July 15-19, 2002, Bologna, Italy. Copyright 2002 ACM 1-58113-480-0/02/0007…$5.00.
567
tive observers and actuators. The directed arrows in figure 1 show the dependency of the components – they indicate which components invoke or use which other components.
Active Obs./Act.
Plan Lib Rule Base Obs. Act. Lib
KB Maint. System
Database
KB Main Interpreter
Modal Reasoner
Repetition ╞ (INTEND τ a* q) ⊃ (INTEND τ a;(a)* q) Non-Deterministic OR ╞ (INTEND τ a1|a2|…|an q) ⊃ (INTEND τ a1 (INTEND τ a1|a2|…|an q)) ∨ (INTEND τ a2 (INTEND τ a1|a2|…|an q)) ∨
External World
Active Plans
Action Sequences ╞ (INTEND τ a1;a2;…;an q) ∧ (BEL τ ¬(EARLIER (DONE a1))) ⊃ (INTEND τ a1 (INTEND τ a1;a2;…;an q)) ╞ (INTEND τ a1;a2;…;an q) ∧ (BEL τ (DONE a1;a2;…;ai)) ⊃ (INTEND τ ai+1;…;an (INTEND τ a1;a2;…;an q))
. .
(INTEND τ an (INTEND τ a1|a2|…|an q))
Figure 2: Sample Rules to Interpret Action Expressions per the definition of TI. Team intention for an action expression is interpreted similar to the individual agent case using rules as in figure 2 and these rules are implemented as stack modifications because joint intentions get reduced to individual intention. However, there are several issues that need to be accounted for in the joint case, for instance, establishing a starting mutual belief, and execution of concurrent as well as OR expressions by multiple agents.
Rule Interpreter
Figure 1: Architecture of STAPLE Interpreter
STAPLE provides two communicative acts – REQUEST and INFORM, which are defined to be primitive actions and are treated similar to any other action available to an agent. The goal and intention of a received communicative act is inferred using the formal definition of the speech acts. Every conversation among STAPLE agents takes place in the context of a protocol. Conversation protocols are treated and specified as joint action expressions and an overarching team commitment towards protocols is assumed. As such, the main modal interpreter executes protocols just like any other joint action expression with some additional support. The research on STAPLE is currently a work in progress and implementation is being done using a Prolog engine for logical reasoning and Java for procedural control.
The main interpreter uses a stack-based data structure to keep track of progress and to execute the logical terms such as PGOAL as per their definitions. Triggers are set on the knowledge base to check for achievement, impossibility, and irrelevance of committed goals. STAPLE agents can have multiple simultaneous commitments and intentions. We use a simple mechanism based on utility and penalty to implement this requirement. A rational agent will give more importance to a commitment or intention having higher utility. Such an agent will also give more importance to a commitment with higher penalty [5]. We use an importance function that combines the utility and the penalty of a commitment to compute its overall importance to the agent and assume that a rational agent will act concurrently on its most important executable intentions at all times. An intention to execute a complex action expression is interpreted by breaking it down into intentions for doing the individual actions in that action expression using rules as in figure 2. Next, we extend the single agent interpreter discussed so far to execute team specifications.
5. ACKNOWLEDGMENTS We gratefully acknowledge the support of the DARPA CoABS Program (AFRL contract F30602-98-2-0098, A0 G352) for supporting this research.
6. REFERENCES
4. EXECUTING TEAM SPECIFICATION
[1]
In order to be able to execute team commitments, team intentions and joint action expressions, support is provided for (1) reasoning about group beliefs, (2) interpreting definitions of team intentions (TI) and team commitments (TPG, or Team Persistent Goal), (3) executing actions jointly, and (4) multi-agent conversations. We use team intention (TI) and team commitment (TPG) [3] that are a modified definition of joint intention and joint commitment (joint persistent goal, or JPG [4]) to support dynamic teams. The terms (TI τ a q i) and (TPG τ (DONE τ a) q i) represent team intention and team commitment respectively of a team τ to do an action a relative to q and with importance function i. The importance function takes into account the penalty for breaking a commitment so a team intention or commitment with higher penalty (but having same utility) is more important to an agent. The interpretation of TI and TPG terms is essentially similar to that for individual commitment – the logical definitions are followed and inference rules are applied to lead to an individual intention that an agent can act upon. For instance, if it is believed that the jointly intended action has been achieved but there is no mutual belief yet about this fact, then the reasoning process leads to an intention to establish the corresponding mutual belief as
[2]
[3]
[4] [5]
[6]
568
Cohen, P. R. and Levesque, H. J. Intention Is Choice with Commitment. Artificial Intelligence, 42: 213-261, 1990. Jennings, N. R. Controlling Cooperative Problem Solving in Industrial Multi-Agent Systems using Joint Intentions. Artificial Intelligence, 75(2): 195-240, 1995. Kumar, S., Cohen, P. R., and Levesque, H. J. The Adaptive Agent Architecture: Achieving Fault-Tolerance Using Persistent Broker Teams. In Proceedings of ICMAS 2000, Boston, MA, USA, IEEE Press, 159-166, 2000. Levesque, H. J., Cohen, P. R., and Nunes, J. H. T. On Acting Together. In Proceedings of AAAI-90, Boston, 1990. Sandholm, T. W. and Lesser, V. R. Advantages of a Leveled Commitment Contracting Protocol. In Proceedings of AAAI96, Portland, OR, 126-133, 1996. Tambe, M. Towards Flexible Teamwork. Journal of Artificial Intelligence Research, 7: 83-124, 1997.