chapter 18: communication service-oriented computing: semantics, processes, agents – munindar p....

49
Chapter 18: Communication Service-Oriented Computing: Semantics, Processes, Agents – Munindar P. Singh and Michael N. Huhns, Wiley, 2005

Upload: osborn-little

Post on 29-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Chapter 18:Communication

Service-Oriented Computing: Semantics, Processes, Agents– Munindar P. Singh and Michael N. Huhns, Wiley, 2005

Chapter 18 2Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Highlights of this Chapter

Agent Communication Languages Speech Act Theory Semantics Interaction Patterns

Combining ACLs with Web Services Contract Net Protocol Business Protocols

Chapter 18 3Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Interaction and Communication

Interactions occur when agents exist and act in close proximity:

resource contention, e.g., bumping into each other Communications are the interactions that

preserve autonomy of all participants, but maybe realized through physical actions that don’t:

Communications are inevitable when composing services.

Communications can be realized in several ways, e.g.,

through shared memory because of shared conventions by messaging passing

Chapter 18 4Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

A Classification of Message Classifications

Structure-based (syntactic) distinguish messages based on grammatical forms in

natural language Meaning-based (semantic)

distinguish messages based on a notion of intrinsic meaning

prohibitive is different from directive, despite syntactic similarity

Use-based (pragmatic) distinguish messages based on their roles in specific

classes of protocolsassertion is different from acknowledgment

Chapter 18 5Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 aspectHere is an interesting example of speech act theory

Chapter 18 6Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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, 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

Chapter 18 7Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 8Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 9Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 10Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Syntax, Semantics, PragmaticsFor 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: 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

Chapter 18 11Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Agent Communication Languages (ACL)

ACL ACL

Agent AgentApplication

Program

• KQML: Knowledge Query and Manipulation Language

• FIPA ACL

Chapter 18 12Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

FIPA

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.

Chapter 18 13Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

FIPA (contd.) 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.

Chapter 18 14Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Structure of Specifications

Chapter 18 15Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Agent Message Transport

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).

Chapter 18 16Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Interaction Patterns

Requester

Requester

Requester

Provider

Provider

Provider

Synchronous: a blocking query waits for an expected reply

Provider maintains state; replies sent individually when requested

Asynchronous: a nonblocking subscribe; replies sent as available

Query

Reply

Next

Handle

Query

Reply

Next

Reply

Subscribe

Reply

Reply

Reply

Chapter 18 17Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Combining Agents with Traditional Web Services

WebService Agent

Gateway

Web ServiceClient

SOAPRequest

SOAPResponse

Agent

ACLRequest

ACLInform

Chapter 18 18Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Planning and Control NeededHow 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 19Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 conditionsCooperation 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 20Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Goals for Multiagent Control

Develop techniques for 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

Chapter 18 21Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Control Challenges

The difficulty of control depends on some major characteristics of the overall system, including: agents comprising the system problems being solved by the agents

individually and/or collectively critical solution characteristics

Chapter 18 22Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Control Challenges: Agents

Control gets harder as agents become more: numerous complex individually

(e.g., more versatile) heterogeneous (in

capabilities, representations, languages)

quantity

heterogeneity

complexity

Chapter 18 23Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Control Challenges: Problems

Control gets harder as the problems agents solve become more interrelated rapidly changing, or pursued

in an uncertain and changing world

unforgiving of control failures (e.g., involving irreversible actions)

degree of interaction

severity of failure

volatility

Chapter 18 24Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Control Challenges: Solutions

Control gets harder as solutions to agent problems are required to be more efficient robust to changing

circumstances cheaper or faster to

develop individually and in concert

quality / efficiency

low overhead

robustness

Chapter 18 25Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Technologies for Agent Control

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 physics-

based Organizations: teams

and coalitions Constraint satisfaction/

optimization

Chapter 18 26Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Dimensions of Control

Control howcapabilitiesare

Possibly by Why difficult? Why needed?

Allocated orscheduled

Markets, CSP,hierarchy,planning,teamwork

Many demands,scarce supply

Avoidcontention, useresources well

Located Brokers,matchmakers,markets,broadcast

Arrival/departure rate,variety, scale

Must findresources toemploy them

Chapter 18 27Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Control howcapabilitiesare

Possibly by Why difficult? Why needed?

Not wasted Broker-monitoredrequests,caching,communication

Similar tasksarising variousplaces

Efficiency

Demanded Reacting toprices,replanning, goaladjustment

Number ofalternativechoices, selfinterest

Avoid contention

Supplied Reprogram ortrain agents,evolve/spawn,inject "friction"

Oscillations orchaos fromsporadic demand,allocatingprocesses

Adapt/grow withneed

Chapter 18 28Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Control howcapabilitiesare

Possibly by Why difficult? Why needed?

Described Provide more orless detail, lumpor differentiatecapabilities

Rich space ofcapabilities,disagree on betterdescription,propagatingdescriptions

Description mustfollow use

Initiallyallocated

Organization orrole restructuring

Detecting need,assessingchoices,propagating

Choiceconstrains qualityof coordination

Differentiated Prevention(maintainconsistency),response (enlargecapabilitylanguage)

Continuousoperation, agentadaptation

Differentiationinevitable

Chapter 18 29Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 30Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Task Decomposition Methods 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

Chapter 18 31Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Task Decomposition Examples Spatial decomposition: service is info source or decision

point:

Functional decomposition: service offers specialized expertise:

Pediatrician

Internist

Psychologist

Neurologist

Cardiologist

Agent 1

Agent 2

Agent 3

Chapter 18 32Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Task Distribution Criteria

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

Chapter 18 33Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Task Distribution Mechanisms 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

Chapter 18 34Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

The Contract Net Protocol

An important generic protocol

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

Chapter 18 35Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Task Announcement Message 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

Chapter 18 36Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Bid and Award Messages

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

Chapter 18 37Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Applicability of Contract NetThe 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 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

Chapter 18 39Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 40Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Example: NetBill Protocol

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

FSM Representation

C: rfq

M: offer

C: accept

C: pay

M: receipt

M: goods

Chapter 18 41Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

NetBill Enhanced by CMs

Meanings:

1. true

2. request

3. offer

4. Cmgoods accept promiseReceipt

5. goods Ccpay promiseReceipt

6. goods pay Cmreceipt

7. goods pay receipt

8. goods promiseReceipt

9. acceptFinal state: No open commitments remain

C: rfq

M: offer

C: accept

C: pay

M: receipt

M: goods

M: offer

M: goods

C: pay

C: accept

M: g

oods

Chapter 18 42Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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)

delegate(x,z,c)

delegate(x,z,c)

discharge(x,c)

x y z

create(x,c)

assign(x,y,z)

discharge(x,c)

assign(x,y,z)

Chapter 18 43Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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

Main roles and sphere of commitment Roles essential for coordination Domain-specific propositions and actions

Chapter 18 44Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Verifying Compliance with Commitment Protocols

Specification models based on potential causality commitments based on branching-

time TL Run-time Verification

respects design autonomy uses TL model-checking local verification based on observed

messages

Chapter 18 45Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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 46Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Fish-Market Sample Execution

Auctioneer A Bidder B1

m1 “50”: [1,0,0]

m3 “No”: [1,2,0]

m5 “40”: [5,2,2]

m8 “No”: [6,2,4]

Bidder B2

m2 “50”: [2,0,0]

[0,0,0] [0,0,0] [0,0,0]

[2,0,1]

[4,2,2]

[3,2,0]

[5,3,2]

m6 “40”: [6,2,2] [6,2,3]

m7 “Yes”: [5,4,2][7,4,2]

fishmoney

[1,1,0]

[8,4,4]

m4 “No”: [6,2,4]

Chapter 18 47Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Fish-Market Local Observations

Auctioneer A

[1,0,0]

[2,0,0]

[3,2,0]

[4,2,2]

start

s(m1)

s(m2)

s(m4)

r(m3)

r(m4)

[2,0,2]

[5,2,2]

[6,2,2]

[7,4,2]

end

s(m5)

s(m6)

r(m7)

Bidder B1

start

s(m1)

[1,0,0]

r(m1)

s(m3)

r(m5)

s(m7)

end

[1,1,0]

[1,2,0]

[5,2,2]

[5,3,2]

[5,4,2]

s(m5)

Chapter 18 48Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Fish-Market Compliance

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

Chapter 18Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

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

Chapter 18 50Service-Oriented Computing: Semantics, Processes, Agents - Munindar Singh and

Michael Huhns

Chapter 18 Summary