Chapter 18: Communication Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005 Highlights of this Chapter Agent Communication Languages Chapter 18 Speech Act Theory Semantics Interaction Patterns Combining ACLs with Web Services Contract Net Protocol Business Protocols Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 2 Interaction and Communication Interactions occur when agents exist and act in close proximity: Communications are the interactions that preserve autonomy of all participants, but maybe realized through physical actions that don’t: resource contention, e.g., bumping into each other Communications are inevitable when composing services. Communications can be realized in several ways, e.g., Chapter 18 through shared memory because of shared conventions by messaging passing Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 3 A Classification of Message Classifications Structure-based (syntactic) Meaning-based (semantic) distinguish messages based on grammatical forms in natural language distinguish messages based on a notion of intrinsic meaning prohibitive is different from directive, despite syntactic similarity Use-based (pragmatic) Chapter 18 distinguish messages based on their roles in specific classes of protocols assertion is different from acknowledgment Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 4 Speech Act Theory Speech act theory, developed for natural language, views communication as action It considers three aspects of a message: Locution, or how it is phrased, e.g., "It is hot here" or "Turn on the air conditioner" Illocution, or how it is meant by the sender or understood by the receiver, e.g., a request to turn on the air conditioner or an assertion about the temperature Perlocution, or how it influences the recipient, e.g., turns on the air conditioner, opens the window, ignores the speaker Illocution is the core aspect Here is an interesting example of speech act theory Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 5 Speech Act Theory Applied Classifications of illocutions motivate message types, but are typically designed for natural language rely on NL syntax, e.g., they conflate directives and prohibitives Most research in speech act theory is about determining the agents’ beliefs and intentions, e.g., how locutions map to illocutions For Web Services, Chapter 18 determining the message type is trivial, because it is explicitly encoded determining the agents’ beliefs and intentions is impossible, because the internal details of the agents are not known Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 6 ACL Semantics What is the semantics of queries, requests, promises? Mentalist: each agent has a knowledge base that its messages refer to. An agent promises something if it intended to make that promise Public: semantics depends on laws, protocols, and observable behavior Evaluation: For open systems, public semantics is appropriate, because a semantics without compliance doesn’t make sense Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 7 Informing How can one agent tell another agent something? Send the information in a message (message passing) Write the information in a location where the other agent is likely to look (shared memory) Show or demonstrate to the other agent (teaching) Insert or program the information directly into the other agent (master --> slave; controller --> controllee; "brain surgery") Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 8 Querying How can one agent get information from another agent? Ask the other agent a question (message passing) Read a location where the other agent is likely to write something (shared memory) Observe the other agent (learning) Access the information directly from the other agent ("brain surgery") Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 9 Syntax, Semantics, Pragmatics For message passing Syntax: requires a common language to represent information and queries, or languages that are intertranslatable Semantics: requires a structured vocabulary and a shared framework of knowledge-a shared ontology Pragmatics: Chapter 18 knowing whom to communicate with and how to find them knowing how to initiate and maintain an exchange knowing the effect of the communication on the recipient Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 10 Agent Communication Languages (ACL) • KQML: Knowledge Query and Manipulation Language • FIPA ACL ACL Agent Chapter 18 ACL Agent Application Program Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 11 FIPA Chapter 18 FIPA is the Foundation for Intelligent Physical Agents, with website at www.fipa.org Specifies standards for heterogeneous, interoperating agent-based systems. Concerned with agency as it relates to 1. Autonomy (goal-driven) 2. Communal integration; mostly communication, but also cooperation. Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 12 FIPA (contd.) Chapter 18 Mission Statement: The promotion of technologies and interoperability specifications that facilitate the end-to-end interworking of intelligent agent systems in modern commercial and industrial settings. Goal: through a combination of speech acts, predicate logic and public ontologies, FIPA can offer standard ways of interpreting communication between agents in a way that respects the intended meaning of the communication. This is much more ambitious than, for example, XML, which only aims to standardize the syntactic structure of documents. Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 13 Structure of Specifications Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 14 Agent Message Transport Chapter 18 Agent Message Transport (AMT) defines a message as an envelope plus a body. Together they handle Guidelines for various transport protocols (e.g., IIOP, HTTP, WAP) Message envelope representation (e.g., XML for HTTP, bit-efficient for WAP). FIPA ACL representions (e.g., string encoding, XML encoding, bit-efficient encoding). Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 15 Interaction Patterns Query Requester Provider Reply Synchronous: a blocking query waits for an expected reply Query Handle Requester Next Reply Provider Next Reply Provider maintains state; replies sent individually when requested Subscribe Reply Requester Reply Provider Reply Asynchronous: a nonblocking subscribe; replies sent as available Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 16 Combining Agents with Traditional Web Services Web Service Client SOAP Request SOAP Response Web Service Agent Gateway ACL Request ACL Inform Agent Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 17 Planning and Control Needed How to maintain global coherence without explicit global control? Important aspects include how to Determine shared goals Determine common tasks across services Avoid unnecessary conflicts Pool knowledge and evidence Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 18 Coordination A property of interaction among a set of agents performing some activity in a shared state. The degree of coordination is the extent to which they Avoid extraneous activity reduce resource contention avoid livelock Avoid deadlock Maintain safety conditions Cooperation is coordination among nonantagonistic agents. Typically, Each agent must maintain a model of the other agents Each agent must develop a model of future interactions Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 19 Goals for Multiagent Control Develop techniques for Chapter 18 Locating and allocating capabilities and resources that are dispersed in the environment Predicting, avoiding, or resolving contentions over capabilities and resources Mediating among more agents, with more heterogeneity and more complex interactions Maintaining stability, coherence, and effectiveness Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 20 Control Challenges The difficulty of control depends on some major characteristics of the overall system, including: Chapter 18 agents comprising the system problems being solved by the agents individually and/or collectively critical solution characteristics Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 21 Control Challenges: Agents Control gets harder as agents become more: quantity complexity heterogeneity Chapter 18 numerous complex individually (e.g., more versatile) heterogeneous (in capabilities, representations, languages) Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 22 Control Challenges: Problems Control gets harder as the problems agents solve become more degree of interaction volatility severity of failure Chapter 18 interrelated rapidly changing, or pursued in an uncertain and changing world unforgiving of control failures (e.g., involving irreversible actions) Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 23 Control Challenges: Solutions Control gets harder as solutions to agent problems are required to be more quality / efficiency robustness low overhead Chapter 18 efficient robust to changing circumstances cheaper or faster to develop individually and in concert Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 24 Technologies for Agent Control Chapter 18 Broker-based Matchmaker-based Market-based; auctions BDI and commitment based Decision theoretic Workflow (procedural) based Standard operating procedures Learning / adaptive Coordinated planning Conventions / protocols Stochastic or physicsbased Organizations: teams and coalitions Constraint satisfaction/ optimization Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 25 Dimensions of Control Control how capabilities are Possibly by Why difficult? Why needed? Allocated or scheduled Markets, CSP, hierarchy, planning, teamwork Many demands, scarce supply Avoid contention, use resources well Located Brokers, matchmakers, markets, broadcast Arrival/ departure rate, variety, scale Must find resources to employ them Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 26 Control how capabilities are Possibly by Why difficult? Why needed? Not wasted Brokermonitored requests, caching, communication Reacting to prices, replanning, goal adjustment Similar tasks arising various places Efficiency Number of alternative choices, self interest Avoid contention Reprogram or train agents, evolve/spawn, inject "friction" Oscillations or Adapt/grow with chaos from need sporadic demand, allocating processes Demanded Supplied Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 27 Control how capabilities are Possibly by Described Provide more or less detail, lump or differentiate capabilities Initially allocated Differentiated Chapter 18 Why difficult? Why needed? Rich space of capabilities, disagree on better description, propagating descriptions Organization or Detecting need, role restructuring assessing choices, propagating Description must follow use Prevention Continuous (maintain operation, agent consistency), adaptation response (enlarge capability language) Differentiation inevitable Choice constrains quality of coordination Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 28 Task Decomposition Divide-and-conquer to reduce complexity: smaller subtasks require less capable agents and fewer resources Task decomposition must consider the resources and capabilities of the agents, and potential conflicts among tasks and agents The designer decides what operators to decompose over The system decides among alternative decompositions, if available Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 29 Task Decomposition Methods Chapter 18 Inherent (free!): the representation of the problem contains its decomposition, as in an AND-OR graph Composition designer (human does it): decomposition is programmed during implementation. (There are few principles for automatically decomposing tasks) Hierarchical planning (agents implementing the services do it): decomposition again depends heavily on task and operator representation Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 30 Task Decomposition Examples Spatial decomposition: service is info source or decision point: Agent 1 Agent 3 Agent 2 Functional decomposition: service offers specialized expertise: Pediatrician Neurologist Internist Cardiologist Chapter 18 Psychologist Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 31 Task Distribution Criteria Chapter 18 Avoid overloading critical resources Engage services on tasks where expertise matches Make an agent with a wide view assign tasks to other agents Assign overlapping responsibilities to agents to achieve coherence Assign highly interdependent tasks to agents in spatial or semantic proximity. This minimizes communication and synchronization costs Reassign tasks if necessary for completing urgent tasks Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 32 Task Distribution Mechanisms Chapter 18 Market mechanisms: tasks are matched to agents by generalized agreement or mutual selection (analogous to pricing commodities) Contract net: announce, bid, and award cycles Multiagent planning: planning agents have the responsibility for task assignment Organizational structure: agents have fixed responsibilities for particular tasks Recursive allocation: responsible agent may further decompose task and allocate the resultant subtasks Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 33 The Contract Net Protocol An important generic protocol Chapter 18 Manager announces tasks via a (possibly selective) multicast Agents evaluate the announcement. Some submit bids Manager awards a contract to the most appropriate agent Manager and contractor communicate privately as necessary Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 34 Task Announcement Message Chapter 18 Eligibility specification: criteria that a node must meet to be eligible to submit a bid Task abstraction: a brief description of the task to be executed Bid specification: a description of the expected format of the bid Expiration time: a statement of the time interval during which the task announcement is valid Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 35 Bid and Award Messages Chapter 18 A bid consists of a node abstraction—a brief specification of the agent’s capabilities that are relevant to the task An award consists of a task specification—the complete specification of the task Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 36 Applicability of Contract Net The Contract Net is a high-level communication protocol a way of distributing tasks a means of self-organization for a group of agents Best used when Chapter 18 the application has a well-defined hierarchy of tasks the problem has a coarse-grained decomposition the subtasks minimally interact with each other, but cooperate when they do Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 37 Commitment Protocols Protocols enable open systems to be constructed Interaction protocols expressed in terms of Participants’ commitments Actions for performing operations on commitments (to create and manipulate them) Constraints on the above, e.g., captured in temporal logic Examples: escrow, payment, RosettaNet (107 request-response PIPs) Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 39 Example: NetBill Protocol FSM Representation C: rfq M: offer C: accept M: goods C: pay Some variations: The merchant may start the protocol by sending a quote The customer may send an accept prior to offer The merchant may send the goods prior to accept These variations are not allowed by the FSM M: receipt Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 40 NetBill Enhanced by CMs M: g o C: C: Meanings: ods 1. true rfq M: offer acc 2. request ept 3. offer M: offer M: go od s C: accept M: goods C: 4. Cmgoods accept promiseReceipt pa y 5. goods Ccpay promiseReceipt 6. goods pay Cmreceipt C: pay M: receipt 7. goods pay receipt 8. goods promiseReceipt 9. accept Final state: No open commitments remain Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 41 Message Patterns for Commitment Operations Ensure that information about commitment operations flows to the right parties, to enable local decisions x y z create(x,c) x y create(x,c) delegate(x,z,c) assign(x,y,z) delegate(x,z,c) discharge(x,c) Chapter 18 z assign(x,y,z) discharge(x,c) Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 42 Compliance with Protocols In an open environment, agents are contributed by different vendors and serve different interests How can an application check if the agents comply with specified protocols? Coordination aspects: traditional techniques Commitment aspects: representations of the agents’ commitments in temporal logic Commitment protocols are specified in terms of Chapter 18 Main roles and sphere of commitment Roles essential for coordination Domain-specific propositions and actions Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 43 Verifying Compliance with Commitment Protocols Specification models based on potential causality commitments based on branching-time TL Run-time Verification Chapter 18 respects design autonomy uses TL model-checking local verification based on observed messages Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 44 Run-Time Compliance Checking An agent can keep track of its pending commitments commitments made by others that are not satisfied It uses this local model to see if a commitment has been violated An agent who benefits from a commitment can always determine if it was violated Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 45 Fish-Market Sample Execution Bidder B1 Auctioneer A [0,0,0] m1 “50”: [1,0,0] [0,0,0] [1,1,0] m2 “50”: [2,0,0] [3,2,0] [4,2,2] m4 “No”: [6,2,4] [5,3,2] m6 “40”: [6,2,2] [8,4,4] Chapter 18 [2,0,1] m3 “No”: [1,2,0] m5 “40”: [5,2,2] [7,4,2] Bidder B2 [0,0,0] [6,2,3] m7 “Yes”: [5,4,2] m8 “No”: [6,2,4] fish money Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 46 Fish-Market Local Observations Auctioneer A start [1,0,0] Bidder B1 start s(m1) s(m1) [1,0,0] [2,0,0] s(m2) [1,1,0] r(m1) s(m4) [2,0,2] [3,2,0] [4,2,2] [5,2,2] r(m3) [1,2,0] s(m3) s(m5) [5,2,2] r(m4) [5,3,2] r(m5) s(m5) [5,4,2] [6,2,2] s(m6) [7,4,2] r(m7) s(m7) end end Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 47 Fish-Market Compliance Chapter 18 Auctioneer can verify if the bidders comply An individual bidder cannot verify if the auctioneer complies If bidders pool their observations, then they can verify if the auctioneer complies Asymmetry indicates need for third party Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 48 Policies and Structure Spheres of commitment (SoComs) abstract specifications of societies made concrete prior to execution Policies apply on performing social actions Policies relate to the nesting of SoComs Role conflicts can occur when agents play multiple roles, e.g., because of nonunique nesting - Munindar Singh and Michael Huhns Chapter 18 Summary Chapter 18 Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and Michael Huhns 50