Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and...

57
Agent Communication Amit K. Chopra and Munindar P. Singh University of Trento North Carolina State University May 23, 2012 c Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 1 / 57

Transcript of Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and...

Page 1: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Agent Communication

Amit K. Chopra and Munindar P. Singh

University of Trento

North Carolina State University

May 23, 2012

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 1 / 57

Page 2: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

MAS as Distributed Systems

◮ Agents

◮ Autonomous: independently acting◮ Heterogeneous: independently designed

◮ Agents communicate with each other

◮ Protocols define how the agents ought to communicate with oneanother

◮ A protocol is a modular, potentially reusable specification of theinteractions between two or more entities

◮ Defining a protocol helps ensure interoperability, i.e., being able towork together

◮ Communities of practice define appropriate protocols◮ RosettaNet: manufacturing◮ Foreign exchange transactions: TWIST◮ Health care: HL7

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 2 / 57

Page 3: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

ExerciseIdentify the agents and communications (including protocols) involved in the specificsetting of consumer-to-consumer auctions

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 3 / 57

Page 4: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Objectives of this ChapterStudy the key conceptual underpinnings of agent communication

◮ What are the main requirements for protocol specifications?

◮ How can we specify a communication protocol?

◮ Which way is the field headed?

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 4 / 57

Page 5: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Traditional Distributed Computing

◮ Ignore autonomy and heterogeneity

◮ Specify interaction in low-level operational terms via message orderand occurrence

◮ Specify interoperation in low-level terms

◮ A system may be fragile because of its interoperation depending uponlow-level details that can easily change when one of the partiesmodifies its internals

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 5 / 57

Page 6: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Autonomy

◮ Each agent is free to act as it pleases◮ We must design protocols so that they do not over-constrain an

agent’s interactions◮ Intelligence is irrelevant in a protocol: must design a protocol whose

correctness does not depend upon the agents’ internal reasoning

◮ The agents are the logical units of distribution◮ Physical distribution is based on considerations such as geographical

distribution, throughput, redundancy◮ Cannot treat two or more agents as a single operating system process,

even though that’s how they may be realized, e.g., within the samevirtual machine in an agent platform

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 6 / 57

Page 7: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Heterogeneity

◮ In traditional systems, it is enough that protocols specify the◮ Schemas of the messages exchanged◮ Legal flows, that is, their ordering and occurrence

◮ In multiagent systems, protocols must specify the meaning of themessages

◮ Logically, agents interoperate on the basis of meanings of theircommunications

◮ Since the meanings determine their social state, i.e., state of theirinteraction

◮ Whatever is in the protocol◮ Becomes the standard to which agents are implemented◮ Defines the level of heterogeneity: the agents can be heterogeneous

with regard to everything else◮ Giving prominence to low-level concerns (such as ordering and

occurrence of messages) couples the agent designs at thecorresponding low level

◮ Even though such concerns are appropriate for lower levels of theimplementation

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 7 / 57

Page 8: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Example Finite State Machine RepresentationPart of a purchase protocol that deals with making offers

◮ Roles: buyer (b) and seller (s)

◮ Transitions labeled with messages◮ Specify legal message flows

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 8 / 57

Page 9: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Critique of the FSM Representation

◮ The FSM specification does not account for meanings of messages

◮ Implicit meanings can cause violation of interoperability because theparties may interpret messages differently

◮ Designers agree offline regarding the meanings, thereby limiting theheterogeneity of their agents

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 9 / 57

Page 10: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Criteria for Evaluating Protocols

◮ Software engineering of systems: Use representations close tostakeholder requirements

◮ Flexibility of agents

◮ Compliance checking of an agent with a protocol

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 10 / 57

Page 11: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Communicative Act TheorySpeech act theory in philosophy

◮ Communication is a form of action◮ Goes beyond traditional logic, which deals with assertions (true or false)

◮ Canonical example: when a judge declares a couple married, the judge

◮ Does not merely report on some privately or publicly known fact◮ Brings the fact into existence◮ Assumption: the judge has suitable powers and acts autonomously

◮ The above is an example of a declarative

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 11 / 57

Page 12: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Performatives: 1All communications can be expressed as declaratives

◮ Informatives◮ “the shipment will arrive on Wednesday” maps to◮ “I inform you that the shipment will arrive on Wednesday”

◮ Directives◮ “send me the goods” maps to◮ “I request that you send me the goods”

◮ Commissives◮ “I’ll pay you $5” maps to◮ “I promise that I’ll pay you $5”

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 12 / 57

Page 13: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Related to Multiagent Systems

◮ Emphasizes autonomy of the sending agent (speaker)◮ May not control the real world◮ But controls when it informs, requests, promises, . . .

◮ The performative provides type information on a communicationseparately from its content

◮ Consider the proposition “the door is open”◮ “I inform that” + “the door is open”◮ “I request that” + “the door is open”◮ “I promise that” + “the door is open”

◮ That is, we see a modular structure separating types from the content

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 13 / 57

Page 14: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Agent Communication Primitives

◮ Customary to consider a small set of primitives based on theperformative types

◮ KQML, FIPA ACL, and the lesser known languages do so (with smallvariations)

◮ Give a unique meaning for the types (sometimes only informally)

◮ The above proves problematic

◮ MAS applications are diverse◮ The standard, broad-brush meaning is rarely adequate◮ Developers build in additional layers of meaning but leave it

undocumented

◮ Dispense with a fixed set of primitives◮ Define application-specific primitives◮ Provide suitable meaning based on social state primitives such as

commitments

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 14 / 57

Page 15: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Traditional Software Engineering Approaches

◮ Emphasize operational details, mostly concentrating on theoccurrence and ordering of messages

◮ Leave open the formulation of the message syntax (good)◮ Disregard the meanings of the messages (bad)

◮ Traditional representations capture occurrence and ordering ofmessages, mostly in procedural terms

◮ Finite state machines (procedural)◮ Petri nets (procedural)◮ State diagrams or statecharts (procedural)◮ Pi-calculus (procedural)◮ Temporal logic (declarative)

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 15 / 57

Page 16: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Traditional Software Engineering Tradeoffs

◮ Benefits◮ Formal tools for verification◮ Natural to implement agents who satisfy protocol requirements◮ Easy to check compliance

◮ Shortcomings◮ No account of meaning◮ No application-centric standard of correctness◮ No support for flexibility based on meanings

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 16 / 57

Page 17: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

ChoreographyA specification of the message flow among the participants from a neutral perspective

◮ Benefits◮ Decentralized nature agrees with the MAS way of thinking

◮ Current approaches: WS-CDL and ebBP

◮ Shortcomings of current approaches◮ No encoding of the meaning◮ Focus on ordering and occurrence◮ Makes private actions of agents visible◮ No support for composition of choreographies

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 17 / 57

Page 18: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Sequence DiagramsUsed by FIPA (Foundation for Intelligent Physical Agents)

Also known as Message Sequence Charts (MSCs)

◮ Procedural constructs: sequencing (default), alternative, parallel, loop

◮ FIPA uses UML Sequence Diagrams to specify its interactionprotocols

◮ FIPA added constructs that have subsequently become part of theUML 2.0 standard

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 18 / 57

Page 19: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

FIPA Request Interaction Protocol

◮ Roles: initiator and participant

◮ The initiator sends a request to the participant

◮ The participant either responds with a refuse or an agree.

◮ If it agrees, it follows up with a detailed response, which could be afailure, an inform-done, or an inform-result

◮ The participant may omit the agree message unless the initiator

asked for a notification

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 19 / 57

Page 20: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

FIPA Request Interaction Protocol

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 20 / 57

Page 21: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

FIPA Request Interaction Protocol

◮ Highlights benefits of a protocol◮ Clear roles◮ Decouples agents from one another

◮ Ignores meanings specific to the protocol◮ FIPA offers a semantics for the message types that we review below

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 21 / 57

Page 22: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

State Machine Example: 1

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 22 / 57

Page 23: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

State Machine Example: 2

◮ Roles: merchant (mer) and customer (cus)

◮ Transitions: labeled with messages as sender, receiver

◮ No representation of internal decision policies: hence it describes aprotocol

◮ Two executions◮ The customer rejects the merchant’s offer◮ The customer accepts the merchant’s offer, following which the

merchant and the customer exchange the item and the payment for theitem

◮ Shortcomings◮ Syntactic notion of correctness◮ Omits additional paths (next picture) that are equally reasonable

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 23 / 57

Page 24: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

State Machine Example: 3

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 24 / 57

Page 25: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Produce Larger FSMs?Can we not use FSMs to capture all reasonable paths?

◮ Producing ever-larger FSMs with additional paths◮ Complicates the agent implementation◮ Does not support runtime flexibility◮ Presupposes an arbitrary selection of paths: which path is reasonable,

which is not?

◮ The same argument holds against merely expandingdeclaratively-specified—though conceptually low-level protocols

◮ For example, those specified using temporal logic

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 25 / 57

Page 26: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Evaluation with Respect to MAS

◮ Software engineering: low-level abstractions

◮ Flexibility: limited because of the protocols tending to over-specifymessage order and occurrence

◮ Compliance checking: easy since the protocol is explicit aboutmessage order and occurrence but failure to comply may not indicatean application-level problem

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 26 / 57

Page 27: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

AI ApproachesHuman assisting tools

◮ Based on work on tools for assisting humans◮ Human-computer interaction◮ Natural language understanding for helping users

◮ Assume cooperative settings, based on the above◮ Seek to infer what the user wants◮ Assume the user wants to be helped

◮ Give prominence to mental or cognitive concepts◮ Model the user’s cognitive state◮ Project a cognitive state to the user

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 27 / 57

Page 28: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

AI ApproachesDistributed knowledge-based systems

◮ Expert systems that communicate with each other

◮ Leading to agents with a reasoner and a knowledge base

◮ All the agents would be built by the same party◮ Cooperative◮ Not quite autonomous◮ Largely homogeneous, although potentially with different reasoning

rules and knowledge

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 28 / 57

Page 29: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

KQML: Knowledge Query and Manipulation Language◮ Underlying assumptions

◮ Each agent maintains a knowledge (belief) base or KB◮ The agents are cooperative, sincere, credulous◮ Beliefs provide an abstraction over the implementation details of agents

◮ The name reflects a control perspective◮ An agent cannot query the knowledge of another◮ Much less manipulate it

◮ Provides a small set of primitives, each defined in relation to theagents’ KBs

◮ tell : sender takes some beliefs from its KB and tells another; receiverinserts the received beliefs into its KB

◮ query : receiver responds with a tell of the query result◮ Evaluation

◮ KQML doesn’t provide a basis for choosing among the message types◮ Most times, developers would use tell and encode (in an ad hoc way)

the necessary information within the body of the tell◮ The above led to reduced interoperability because the semantics

offered by the language had no value as such to a MAS

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 29 / 57

Page 30: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

FIPA ACLAgent Communication Language

◮ Provides primitives for message types along with their syntax

◮ States the semantics of each primitive◮ In terms of the beliefs and intentions of the participants◮ Including their beliefs and intentions about each other’s beliefs and

intentions◮ That is, incorporating assumptions of sincerity and cooperation

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 30 / 57

Page 31: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Evaluating Cognitive Concepts for Communication

◮ Cognitive concepts provide a natural way to capture the internalrepresentation and reasoning of an agent

◮ Good way to capture stakeholder wishes◮ High-level way of describing agent reasoning independent of low-level

details of data structures and such

◮ Cognitive concepts cannot be used as a basis for interoperation,which is what communication is about

◮ Internally focused◮ One designer cannot determine the beliefs or intentions of another

designer’s agents◮ Without making unrealistic assumptions, e.g., one designer controls all

designs, thereby abolishing heterogeneity

◮ One agent cannot determine another agent’s beliefs or intentions◮ Without making unrealistic assumptions, e.g., abolishing autonomy and

heterogeneity

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 31 / 57

Page 32: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

FIPA EvaluatedSplit personality

◮ Practically valuable◮ Discussion of multiagent architecture and interoperations◮ Implementation of powerful systems, such as JADE◮ Description (though limited in style and scope) of useful interaction

protocols

◮ Nonsense◮ Misguided, cognitive approach to formal semantics◮ Irrelevant assumptions◮ Never used (fortunately)

◮ What we should do: discard the second and strengthen the first

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 32 / 57

Page 33: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

AI Approaches Evaluated

◮ Software engineering:◮ High-level abstractions are a positive◮ Mentalism in the abstractions is a negative

◮ Flexibility: curtailed through the assumptions underlying thesemantics

◮ In FIPA, to inform another agent the sender must believe the receiverdoesn’t already know the content

◮ Compliance: impossible under mentalism

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 33 / 57

Page 34: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Commitment-Based Multiagent ApproachesGive primacy to business meanings of service engagements

◮ Identify messages

◮ Identify their meanings in terms of their effect on the social state◮ Creation of the commitments among the participants◮ Manipulation of commitments◮ Changes to parts of the state relevant to commitments

◮ Instead of explicit state transitions, consider inference on the socialstate based on the messages

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 34 / 57

Page 35: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Example: Commitment ProgressionVia explicit operations or because of logical properties

C(Buyer, Seller, goods, pay) signifies an active and conditionalcommitment

◮ If goods ∧ C(Buyer, Seller, goods, pay) Then◮ Active and detached (or unconditional or base)◮ C(Buyer, Seller, T, pay)

◮ If C(Buyer, Seller, T, pay) Then◮ If pay Then Satisfied◮ If never pay Then Violated

◮ If C(Buyer, Seller, goods, pay) Then◮ If pay Then Satisfied◮ If never pay and never goods Then Expired

Can be nested:C(Seller, Buyer, pay, C(Shipper, Buyer, T, deliverGoods))

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 35 / 57

Page 36: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Example Commitment ProtocolPurely declarative specification

Offer(mer , cus, price , item) means create(mer , cus , price , item)Accept(cus,mer , price , item) means create(cus ,mer , item, price)Reject(cus ,mer , price, item) means release(mer , cus , price , item)Deliver(mer , cus , item) means declare(mer , cus , item)Pay(cus ,mer , price) means declare(cus ,mer , price)

◮ Specifies how each message affects the social state◮ By acting on a commitment explicitly◮ By bringing about a social fact via Declare that may cause

commitments to detach or discharge

◮ The social state is conceptual

◮ In general, no centralized store of social state◮ Raises the challenge of commitment alignment in distributed systems

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 36 / 57

Page 37: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Distinguishing Message Syntax and MeaningTwo views of the same enactment

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 37 / 57

Page 38: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Evaluation with respect to MAS

◮ Compliance: At the business level. A protocol enactment is correct aslong as the parties involved do not violate their commitments

◮ Flexibility: Enhanced by expanding the operational choices for eachparty, e.g., discharge a commitment when convenient (even sooner);delegate or assign

◮ Software engineering: Commitments are a high-level abstraction forcapturing business interactions

◮ Support loose coupling among agents◮ Accommodate the autonomy of each participant

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 38 / 57

Page 39: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Illustrating Flexible EnactmentThese are compliant executions in terms of commitments, and thus realize the aboveprotocol

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 39 / 57

Page 40: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Comparing Agent Communication Approaches

Traditional Traditional Commitment

SE AI Protocols

Abstraction control flow mentalist business relationshipCompliance lexical basis unverifiable semantic basisFlexibility low low highInteroperability message-

levelintegration business-level

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 40 / 57

Page 41: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Engineering with Agent Communication

◮ Beginning from a protocol

◮ Generate role skeletons (or endpoints) from the protocol

◮ Challenge: Generating role skeletons such that implementing agentsensures interoperation

◮ Not trivial when a protocol involves more than two roles◮ The protocol must be such that such skeletons are derivable from it

◮ For each role skeleton, implement one or more agents who realize(“flesh out”) it

◮ Map each skeleton to a set of incoming and outgoing messages and thechanges each message induces in the local state

◮ Implement methods to process each incoming message◮ Send messages allowed by the protocol

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 41 / 57

Page 42: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Programming with Communications

Java Agent Development Framework or JADE is a leading platform

◮ Behavior: a specification of a role skeleton that characterizesimportant events such as the receipt of specified messages and theoccurrence of timeouts

◮ Implement an agent according to a behavior by defining the methodsit specifies as callbacks

◮ Define the handlers for any incoming methods

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 42 / 57

Page 43: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Modeling CommunicationsComing up with the right specifications

◮ Need for a methodology to elicit stakeholder requirements

◮ We advocate a pattern-based approach

◮ Operational patterns are easy but often trivial and miss businessmeanings

◮ Commitment-based business patterns help capture ways in whichagents may interact at a high level

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 43 / 57

Page 44: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Example Operational PatternsPatterns such as these can help a designer in specifying a protocol

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 44 / 57

Page 45: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Motivating Principles Behind our Patterns

◮ Autonomy compatibility: no agent controls another’s actions

◮ Explicit meanings: The business meaning ought to be public andexplicit

◮ Not hidden within implementations◮ Not hidden within offline agreements between designers

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 45 / 57

Page 46: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

PatternsEncode the common ways in which agents interact

◮ Business patterns: what relationships to express

◮ Enactment patterns: the conditions under which an agent shouldenact a business pattern

◮ Semantic antipatterns: the relationships antithetical to our principles

◮ We write each type of pattern in a template specific to that type

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 46 / 57

Page 47: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Compensation

Intent To compensate the creditor in case of commitmentcancellation or violation

Motivation Compensation commitments provides some assurance to thecreditor in case of violations

Implementation Compensate(x , y , r , u, p) meansCreate(x , y , violated(x , y , r , u), p)

Example Compensate(mer , cus, price, item, discount), i.e., themerchant will offer the customer a discount on the nextpurchase if the item is paid for but not delivered

Consequences The only recourse a creditor may have is escalation to thesurrounding business context such as the applicablejurisdiction

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 47 / 57

Page 48: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Counter OfferExample of an enactment pattern

Intent Responding to an offer via an offer

Motivation Supporting negotiation

When ◮ Original offer: C(x , y , r , u)◮ Counter offer: C(y , x , u′, r ′)

◮ Flips debtor and creditor and antecedent and consequent◮ Antecedent is stronger than original consequent◮ Consequent is weaker than original antecedent

◮ Alternative counter offer: above plus Release(x , y , r , u)

Example Assume C(EBook ,Alice, $12,BNW )

◮ Alice makes the counter offerC(Alice,EBook ,BNW ∧ Dune, $12) meaning that shewants Dune in addition to BNW for the same price

Consequences When u ≡ u′ and r ≡ r ′, the counter offer results in amutual commitment

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 48 / 57

Page 49: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Semantic AntipatternsForms of representation and reasoning to be avoided

Conflict with

◮ The autonomy of the participants or

◮ With a logical basis for commitments

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 49 / 57

Page 50: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Commit Another as Debtor

Intent An agent creates a commitment in which the debtor isanother agent

Motivation To capture delegation where the delegator holds a powerover the delegatee

Implementation The sender of Create(y, z, p, q) is x (x 6= y), thuscontravening the autonomy of y

Example EBook makes an offer Create(BookWorld ,Alice, $12 ,BNW )to Alice, which violates BookWorld’s autonomy

Criteria Failed The debtor’s autonomy is not respected

Consequences Calls into question the idea of modeling with agents

Alternative Apply delegation to achieve the desired business relationship,based on prior commitments

◮ BookWorld could have a standing commitment withEBook to accept delegations

◮ EBook can then send a delegate “instruction” toBookWorld upon which BookWorld commits to Alice

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 50 / 57

Page 51: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Communication-Based Engineering MethodologiesHow to design a protocol

◮ Identify stakeholder requirements

◮ Identify the roles involved◮ customer, merchant, shipper, and banker

◮ If possible, select a suitable protocol from a repository◮ The purchase protocol shown earlier

◮ Otherwise, compose existing protocols if possible◮ Compose the Ordering, Payment, and Shipping protocols

◮ Otherwise, specify a protocol or parts of it from scratch◮ Identify the communications among the roles

◮ Messages for ordering items and messages for payment

◮ Identify how the messages affect commitments◮ Offer could create a commitment, as shown earlier◮ A delivery by the shipper would discharge the merchant’s commitment

to provide the goods

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 51 / 57

Page 52: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Primacy of MeaningUnderstand agent communication in terms of the participants’ social state

◮ Helps avoid inadvertent dependencies upon implementation and yieldsflexibility

◮ Older meaning-based work combines meanings and operational detailson message ordering and occurrence

◮ Operational details interfere with reasoning about meaning◮ No compelling natural situation where operational details, outside of

commitments, are necessary◮ Occurrence of a message: requiring an agent to send a message violates

its autonomy—it may choose to violate its commitments, for example◮ Nonoccurrence of a message: where it is necessary for integrity, we

should model it via commitments◮ Ordering messages for conventions: reasonable and should be encoded

within the antecedents and consequents of commitments◮ Ordering messages otherwise: almost never useful and merely included

just by habit◮ The Blindingly Simple Protocol Language declaratively captures the

necessary operational details, facilitating assertions about social state

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 52 / 57

Page 53: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Verifying ComplianceEach protocol functions as a small standard

◮ Agents must be able to judge if their counterparties are interacting ascodified in their agreed upon protocol

◮ Worthless otherwise

◮ The mentalist approaches preclude such verification

◮ Despite long research on this point, several researchers return tomentalism repeatedly

◮ Challenges◮ Design specification languages that promote the verification of

compliance◮ Develop algorithms by which one or more cooperating agents could

verify the compliance of others based on the communications they canmonitor

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 53 / 57

Page 54: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Protocol Refinement and AggregationApply traditional conceptual modeling relations to communication

◮ Refinement: how a concept refines another (is-a hierarchy)

◮ Aggregation: how concepts are put together into composites(part-whole hierarchy)

◮ Well-understood for traditional object-oriented design and supportedby programming languages (as type checking)

◮ Nontrivial for communication protocols (especially, refinement)

◮ Challenge: produce a generalized theory and associated languages andtools that would support refinement and aggregation of protocols formore powerful meaning specifications

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 54 / 57

Page 55: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Role ConformanceDeveloping an agent that conforms to a role specification

◮ Produce a role skeleton from a protocol specification

◮ An agent who plays (and hence implements) a role fleshes out theskeleton

◮ A challenge is to determine sufficient constraints on messages an agentplaying a role can receive and send and any constraints on how thelocal representation of the social state should progress

◮ We can then publish role skeletons along with the protocol specification

◮ Software vendors produce agent implementations

◮ An agent vendor does not reveal internal details but specifies whatroles the agent can play

◮ Conformance means that an agent can play a particular protocol role

◮ Challenge: identifying formal languages for specifying roles along withalgorithms for checking conformance

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 55 / 57

Page 56: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

ConclusionsCommunication lies at the heart of multiagent systems

◮ Autonomous agents depend on each other, i.e., interoperate, torealize important real-world applications

◮ A good multiagent system must be loosely coupled; communication isthe highly elastic glue that keeps it together

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 56 / 57

Page 57: Amit K. Chopra and Munindar P. Singh · 2012-05-23 · Agent Communication Amit K. Chopra and Munindar P. Singh UniversityofTrento NorthCarolinaStateUniversity May 23, 2012 cChopraandSingh

Digging DeeperRelevant topics to explore further

◮ Philosophical foundations

◮ Organizations and institutions

◮ Norms, conventions, and commitments

◮ Software engineering

c©Chopra and Singh (Trento and NCSU) Agent Communication May 23, 2012 57 / 57