An Architecture For Contract-based

0 downloads 0 Views 55KB Size Report
The contracts are represented as event calculus rules which dic- tate the evolution of obligations and permissions on the agents concerned. The event calculus ...
An Architecture For Contract-based Communicating Agents John Knottenbelt and Keith Clark Dept of Computing, Imperial College London, 180 Queens Gate, London, SW7 2AZ, UK {jak97,klc}@imperial.ac.uk

Abstract We extend AgentSpeak (L), a belief-desires-intentions architecture, to reason about and plan with contracts between communicating agents. Our architecture is hybrid in the sense that it incorporates both immediate reaction rules and a more complex planning component. We represent contracts as first-class entities to allow the relationships between agents to be specified and developed separately from their built-in capabilities. The agent’s problem-solving ability is augmented by outsourcing tasks to other agents. The contracts are represented as event calculus rules which dictate the evolution of obligations and permissions on the agents concerned. The event calculus is used deductively to infer current and past obligations and permissions, and abductively to make plans to fulfil obligations subject to any restrictions imposed by the contracts.

1. Introduction Multi-agent systems is a growing research area and has already started to find application in industry in web services and the semantic web. There is also increased interest in agent coordination and choreography. Our approach sees contracts as a means of formally describing the relationships between agents in terms of obligations and permissions, as well as providing a coordination function. By allowing contracts to be reasoned about in the agent cycle, the agent gains a precise understanding of what obligations it bears and which agents are obliged to it. Furthermore enough information is encoded in the contracts to allow the agent to outsource its own goals and obligations to other agents. First we give a brief introduction to our variant of the event calculus and explain how it is used to represent contracts. We give some examples in the purchasing domain and show how a customer agent might be specified. We describe in more detail the kinds of communi-

cation events and how the agent cycle has been modified from AgentSpeak(L)[13] to incorporate reasoning about contracts. Finally we give some ideas about planning and future work.

2. Event Calculus The core of the contract representation language is the event calculus, where communications are events and the contract rules specify how the events initiate and terminate obligation and permission fluents. In this paper we employ the Prolog variable syntax convention where variables begin with an uppercase letter. We are using the full event-calculus[16] without the releases predicate since the examples we have considered so far do not require the use of non-inertial fluents. We also dispense with the initiallyP and initiallyN predicates by providing a contract start event, and writing initiates(start, F, T) and terminates(start, F, T) respectively. Figure 1 summarises the predicates and the axioms of the event calculus.

3. Contract Representation The text of a contract is represented by a binary relation, contractClause, between the label of the contract and the clauses belonging to the contract. Variables can be shared between the contract label and the clauses, those appearing in the label are conceptually parameters to the contract. If we were representing the contracts directly in Prolog, there would be one contractClause definition for each rule of the contract. For example, figure 2 shows the first rule of a short term contract about a purchase transaction. The label of the contract is customerVendorContract purchase(...). The parameters to the left 1

To aid readability we employ the syntax field:Value to indicate a named field or parameter.

initiates(A,B,T) A initiates the fluent B at time T. terminates(A,B,T) action A terminates B at time T. T1