99
Multiagent Systems Communication as action Viviana Mascardi [email protected] MAS, University of Genoa, DIBRIS Communication as action 1 / 94

Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Multiagent SystemsCommunication as action

Viviana Mascardi

[email protected]

MAS, University of Genoa, DIBRIS Communication as action 1 / 94

Page 2: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Contents

1 Foundations of communication

2 Communication between software agents

3 Making AIPs amenable for formal reasoning

4 Processing real natural languages

MAS, University of Genoa, DIBRIS Communication as action 2 / 94

Page 3: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Communication

Communication, in general, is the intentional exchange ofinformation brought about by the production and perception ofsigns drawn from a shared system of conventional signs.

“Classical” view (pre-1953):language consists of sentences that are true/false (cf. logic)

“Modern” view (post-1953):language is a form of action

MAS, University of Genoa, DIBRIS Communication as action 3 / 94

Page 4: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Communication

Wittgenstein (1953) Philosophical Investigations

According to Wittgenstein,

The structure of reality determines the structure of language.

Meaning is determined by use, in the context of a “language-game”.

Words are not defined by reference to the objects or things whichthey designate in the external world nor by the thoughts, ideas, ormental representations that one might associate with them, butrather by how they are used in effective, ordinary communication.

MAS, University of Genoa, DIBRIS Communication as action 4 / 94

Page 5: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Communication

Austin (1962) How to Do Things with Words

In saying something, we do something, such as when a minister joinstwo people in marriage saying “I now pronounce you husband andwife”.

MAS, University of Genoa, DIBRIS Communication as action 5 / 94

Page 6: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Communication

Searle (1969) Speech Act Theory

Each illocution can be described in terms of what it is attempting todo. So an assertion counts as an undertaking that something really isthe case. A question counts as an attempt to elicit some information.Thanking someone counts as an expression of gratitude.

Assumed intent of the speaker, or the intentionality of the sentence.

MAS, University of Genoa, DIBRIS Communication as action 6 / 94

Page 7: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Communication

Nanni Moretti (1989) Palombella rossa

MAS, University of Genoa, DIBRIS Communication as action 7 / 94

Page 8: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Speech acts

Speech acts achieve the speaker’s goals:Inform “There’s a pit in front of you”Query “Can you see the gold?”Command “Pick it up”Promise “I’ll share the gold with you”Acknowledge “OK”

Speech act planning requires knowledge of– Situation– Semantic and syntactic conventions– Hearer’s goals, knowledge base, and rationality

MAS, University of Genoa, DIBRIS Communication as action 8 / 94

Page 9: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Stages in communication

Intention S wants to inform H that PGeneration S selects words W to express P in context CSynthesis S utters words W

Perception H perceives W ′ in context C ′

Analysis H infers possible meanings P1, . . .Pn

Disambiguation H infers intended meaning Pi

Incorporation H incorporates Pi into KB

MAS, University of Genoa, DIBRIS Communication as action 9 / 94

Page 10: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Foundations of communication

Stages in communication

How could this go wrong?– Insincerity (S doesn’t believe P)– Speech wreck ignition failure– Ambiguous utterance– Differing understanding of current context (C 6= C ′)

MAS, University of Genoa, DIBRIS Communication as action 10 / 94

Page 11: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA specifications: an overview

http://www.fipa.org/repository/bysubject.html

MAS, University of Genoa, DIBRIS Communication as action 11 / 94

Page 12: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA specifications: communication

http://www.fipa.org/repository/aclspecs.html

MAS, University of Genoa, DIBRIS Communication as action 12 / 94

Page 13: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Message Structure

http://www.fipa.org/specs/fipa00061/SC00061G.pdfMAS, University of Genoa, DIBRIS Communication as action 13 / 94

Page 14: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Communicative Acts

Accept Proposal

Agree

Cancel

Call for Proposal

Confirm

Disconfirm

Failure

Inform

Inform If

Inform Ref

Not Understood

Propagate

Propose

Proxy

MAS, University of Genoa, DIBRIS Communication as action 14 / 94

Page 15: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Communicative Acts

Query If

Query Ref

Refuse

Reject Proposal

Request

Request When

Request Whenever

Subscribe

http://www.fipa.org/specs/fipa00037/SC00037J.pdf

MAS, University of Genoa, DIBRIS Communication as action 15 / 94

Page 16: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

Accept proposal summary

Accept proposal: The action of accepting a previously submittedproposal to perform an action.

MAS, University of Genoa, DIBRIS Communication as action 16 / 94

Page 17: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

Accept proposal content

MAS, University of Genoa, DIBRIS Communication as action 17 / 94

Page 18: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

Accept proposal description

MAS, University of Genoa, DIBRIS Communication as action 18 / 94

Page 19: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

Accept proposal formal model

MAS, University of Genoa, DIBRIS Communication as action 19 / 94

Page 20: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

Accept proposal example

MAS, University of Genoa, DIBRIS Communication as action 20 / 94

Page 21: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

The model of agent communication in FIPA is based on theassumption that two agents, who wish to converse, share a commonontology for the domain of discourse.

It ensures that the agents ascribe the same meaning to the symbolsused in the message.

For a given domain, designers may decide to use ontologies that areexplicit, declaratively represented (and stored somewhere) or,alternatively, ontologies that are implicitly encoded with the actualsoftware implementation of the agent themselves and thus are notformally published to an ontology service.

MAS, University of Genoa, DIBRIS Communication as action 21 / 94

Page 22: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

...But what is an ontology?“The study of that which is common to all things which exist”Aristotle, Metaphysics

“Explicit specification of a conceptualization”Tom Gruber, A Translation Approach to Portable Ontology Specifications, KnowledgeAcquisition, 5(2):199-220, 1993

Figure : Tom and Aristotle...

MAS, University of Genoa, DIBRIS Communication as action 22 / 94

Page 23: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

...But what is an ontology?“The study of that which is common to all things which exist”Aristotle, Metaphysics“Explicit specification of a conceptualization”Tom Gruber, A Translation Approach to Portable Ontology Specifications, KnowledgeAcquisition, 5(2):199-220, 1993

Figure : Tom and Aristotle...

MAS, University of Genoa, DIBRIS Communication as action 22 / 94

Page 24: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

...But what is an ontology?“The study of that which is common to all things which exist”Aristotle, Metaphysics“Explicit specification of a conceptualization”Tom Gruber, A Translation Approach to Portable Ontology Specifications, KnowledgeAcquisition, 5(2):199-220, 1993

Figure : Tom and Aristotle...

MAS, University of Genoa, DIBRIS Communication as action 22 / 94

Page 25: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

...But what is an ontology?“The study of that which is common to all things which exist”Aristotle, Metaphysics“Explicit specification of a conceptualization”Tom Gruber, A Translation Approach to Portable Ontology Specifications, KnowledgeAcquisition, 5(2):199-220, 1993

Figure : Tom and Aristotle...

MAS, University of Genoa, DIBRIS Communication as action 22 / 94

Page 26: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

...But what is an ontology?“The study of that which is common to all things which exist”Aristotle, Metaphysics“Explicit specification of a conceptualization”Tom Gruber, A Translation Approach to Portable Ontology Specifications, KnowledgeAcquisition, 5(2):199-220, 1993

Figure : Tom and Aristotle...

MAS, University of Genoa, DIBRIS Communication as action 22 / 94

Page 27: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

The FIPA Ontology Service Specification(http://www.fipa.org/specs/fipa00086/index.html) dealswith technologies enabling agents to manage explicit, declarativelyrepresented ontologies.

An ontology service for a community of agents is specified for thispurpose. It is required that the service be provided by a dedicatedagent, called an Ontology Agent (OA), whose role in the communityis to provide some or all of the following services:

MAS, University of Genoa, DIBRIS Communication as action 23 / 94

Page 28: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Ontology Agent

1 discovery of public ontologies in order to access them

2 maintain (for example, register with the DF, upload, download, andmodify) a set of public ontologies,

3 translate expressions between different ontologies and/or differentcontent languages,

4 respond to query for relationships between terms or betweenontologies, and,

5 facilitate the identification of a shared ontology for communicationbetween two agents.

MAS, University of Genoa, DIBRIS Communication as action 24 / 94

Page 29: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Content Language

FIPA Content Language (CL) Specifications deal with differentrepresentations of the content of ALC messages. There are four languagesthat are suitable for being used as content languages in FIPA messages,although others can be added by the developer.

SC00008 FIPA SL Content Language Specification

XC00009 FIPA CCL Content Language Specification

XC00010 FIPA KIF Content Language Specification

XC00011 FIPA RDF Content Language Specification

http://www.fipa.org/repository/cls.php3

MAS, University of Genoa, DIBRIS Communication as action 25 / 94

Page 30: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA interaction protocols

FIPA Interaction Protocols (IPs) specifications deal with pre-agreedmessage exchange protocols for ACL messages.

SC00026 FIPA Request Interaction Protocol Specification

SC00027 FIPA Query Interaction Protocol Specification

SC00028 FIPA Request When Interaction Protocol Specification

SC00029 FIPA Contract Net Interaction Protocol Specification

SC00030 FIPA Iterated Contract Net Interaction Protocol Specification

XC00031 FIPA English Auction Interaction Protocol Specification

XC00032 FIPA Dutch Auction Interaction Protocol Specification

SC00033 FIPA Brokering Interaction Protocol Specification

SC00034 FIPA Recruiting Interaction Protocol Specification

SC00035 FIPA Subscribe Interaction Protocol Specification

SC00036 FIPA Propose Interaction Protocol Specification

http://www.fipa.org/repository/ips.php3MAS, University of Genoa, DIBRIS Communication as action 26 / 94

Page 31: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AUML

B. Bauer, J. P. Muller, J. Odell. Agent UML: A Formalism forSpecifying Multiagent Interaction, Agent-Oriented SoftwareEngineering, P. Ciancarini and M. Wooldridge eds., Springer, Berlin,pp. 91-103, 2001.

J. Odell, H. V. D. Parunak and B. Bauer. Extending UML for Agents,AOIS Workshop at AAAI 2000.

F. Bergenti and A. Poggi, Exploiting UML in the Design ofMulti-Agent Systems, ESAW Workshop at ECAI 2000.

The AUML Web Site: http://www.auml.org/.

MAS, University of Genoa, DIBRIS Communication as action 27 / 94

Page 32: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AUML

When it makes sense to reuse portions of UML, then do it; whenit doesn’t make sense to use UML, use something else or createsomething new.

MAS, University of Genoa, DIBRIS Communication as action 28 / 94

Page 33: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML

AUML is very suitable to represent Agent Interaction Protocols(AIPs).

We consider the AUML interaction diagrams specification proposedby the FIPA Technical Modeling Committee, 2003, (FIPA modeling:Interaction diagrams, first proposal, july 02 2003).

MAS, University of Genoa, DIBRIS Communication as action 29 / 94

Page 34: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML

An AIP is usually defined in relation to a particular agent activity.

AIPs in AUML extend UML 2.0 sequence diagrams.

The protocol name is contained in a box on the upper-left corner ofthe diagram and is preceded by the keyword sd (sequence diagram).

MAS, University of Genoa, DIBRIS Communication as action 30 / 94

Page 35: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Actors, roles, and lifelines

An AIP consists of some lifelines; for each lifeline, a rectangular boxcontains information about the agent to which that lifeline belongs,the role it plays in the MAS, and its class.

The syntax used is agent-name/ agent-role: agent-class.

MAS, University of Genoa, DIBRIS Communication as action 31 / 94

Page 36: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Message exchange

Labelled arrows between two lifelines represent messages.

Messages must satisfy standardised communication languages (e.g.FIPA-ACL or KQML) which allow to specify the “speech act” (or“performative”) of the message and the fields that it is expected tohave.

MAS, University of Genoa, DIBRIS Communication as action 32 / 94

Page 37: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Message exchange

AUML supports different interaction operators:

a box, with an interaction operator given in its top-left corner, cansurround a part of the sequence diagram.Boxes can recursively contain messages and other boxes, and can bedivided into a number of regions separated from each other by heavyhorizontal dashed lines.Each region can include a condition depicted as text in square brackets.If the condition is satisfied, then that region is selected and theactivities inside it are performed.

MAS, University of Genoa, DIBRIS Communication as action 33 / 94

Page 38: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Weak sequencing operator

The weak sequencing operator as defined in UML 2.0 means aweak sequencing in a sequence of messages, that is to say, themessages within this box on the same lifeline are ordered but it is notpossible to make any assumption for message ordering coming fromdifferent lifelines in the same box.

MAS, University of Genoa, DIBRIS Communication as action 34 / 94

Page 39: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Alternative operator

Alternative means that there are several paths to follow, and thatagents have to choose at most one to continue.

Guards are associated with alternatives: when a guard is evaluated totrue, that alternative path is chosen.

An else alternative may be optionally present: it is entered if noguard evaluates to true.

If no guard is evaluated to true, and no else alternative is provided,the alternative box of the diagram is not executed.

MAS, University of Genoa, DIBRIS Communication as action 35 / 94

Page 40: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Option operator

The option operator only considers one path in the region.

If the condition associated with this path is evaluated to true, thenthe path is executed, else nothing happens and the interaction followsafter this portion of the diagram.

MAS, University of Genoa, DIBRIS Communication as action 36 / 94

Page 41: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Loop operator

The loop operator allows designers to represent that an ordered setof activities has to be applied several times.

Designers can use either lower and upper bounds or a booleanexpression.

As long as conditions are satisfied, the loop is executed and themessages are sent and received.

MAS, University of Genoa, DIBRIS Communication as action 37 / 94

Page 42: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

AIPs in AUML: Parameters

Parameters are written separately outside the diagram in a comment,stereotyped as <<parameters>>.

AIPs can have many parameters such as content language formessages, agent communication language (ACL), ontology, etc.

MAS, University of Genoa, DIBRIS Communication as action 38 / 94

Page 43: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Request Interaction Protocol

http://www.fipa.org/specs/fipa00026/SC00026H.pdfMAS, University of Genoa, DIBRIS Communication as action 39 / 94

Page 44: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Communication between software agents

FIPA Contract Net Interaction Protocol

http://www.fipa.org/specs/fipa00029/SC00029H.pdfMAS, University of Genoa, DIBRIS Communication as action 40 / 94

Page 45: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Why making AIPs amenable for formal reasoning?

A priori verification (a.k.a. static verification)

Runtime verification (a.k.a. monitoring)

You may have a look at https://www.techopedia.com/definition/13696/static-verification

and http://twiki.di.uniroma1.it/pub/MFS/WebHome/MF2.pdf for agentle, high-level introduction to static verification and model checking,respectively.You may have a look athttps://en.wikipedia.org/wiki/Runtime_verification for agentle introduction to runtime verification.

MAS, University of Genoa, DIBRIS Communication as action 41 / 94

Page 46: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 1

Problem: we want to represent the following agent interaction protocolinvolving Alice and Bob. Alice greets Bob with some nice words that maybe either “Hello” or “Good morning” or “Ciao”. Bob either answers withsome similar greeting, or says “Sgrunt!” if he is angry. The protocol stops.

MAS, University of Genoa, DIBRIS Communication as action 42 / 94

Page 47: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 1

Stage 1, performatives and content language to be used: we may use“inform”, even if it is not the very best choice, since no more specificperformative exists for greeting. We may use simple words or phrases innatural language as content language.

MAS, University of Genoa, DIBRIS Communication as action 43 / 94

Page 48: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 1

Stage 2, grouping messages that can be used interchangeably:the three messages

aliceinform(′′Hallo′′)

=⇒ bob

aliceinform(′′Goodmorning ′′)

=⇒ bob

aliceinform(′′Ciao′′)

=⇒ bobcan all be used for starting the protocol. We may abstract this notion of “havingthe same message type” (more general, event type) by saying that there exists anevent type agb (for Alice greets Bob), and that the three messages above havethat type.

agb = {aliceinform(′′Hallo′′)

=⇒ bob, aliceinform(′′Goodmorning ′′)

=⇒ bob, aliceinform(′′Ciao′′)

=⇒bob}.In the same way we may define

bga = {bobinform(′′Hallo′′)

=⇒ alice, bobinform(′′Goodmorning ′′)

=⇒ alice, bobinform(′′Ciao′′)

=⇒alice} and

bsa = {bobinform(′′Sgrunt!′′)

=⇒ alice}.

MAS, University of Genoa, DIBRIS Communication as action 44 / 94

Page 49: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 1

Stage 3, expressing the protocol AIP1 in terms of event types:AIP1 = agb:(bga:ε∨bsa:ε)

Stage 4, understanding the operational semantics:At the beginning, the state of the protocol is exactly AIP1; if anyone of

the messages in agb, namely aliceinform(′′Hallo′′)

=⇒bob, alice

inform(′′Goodmorning ′′)=⇒ bob, alice

inform(′′Ciao′′)=⇒ bob is exchanged,

then the protocol is respected (so far...) and can move to its next state,(bga:ε∨bsa:ε)From here, the protocol is respected if either one message in bga isexchanged or one message in bsa is.If this is the case, the protocol moves to ε, meaning that it terminates.

MAS, University of Genoa, DIBRIS Communication as action 45 / 94

Page 50: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 1

Stage 5, understanding the denotational (trace) semantics:Which are the traces of messages that respect the protocol?

{ alice inform(′′Hallo′′)=⇒ bob bob

inform(′′Hallo′′)=⇒ alice,

aliceinform(′′Hallo′′)

=⇒ bob bobinform(′′Goodmorning′′)

=⇒ alice,

aliceinform(′′Hallo′′)

=⇒ bob bobinform(′′Ciao′′)

=⇒ alice,

aliceinform(′′Hallo′′)

=⇒ bob bobinform(′′Sgrunt!′′)

=⇒ alice,

aliceinform(′′Goodmorning′′)

=⇒ bob bobinform(′′Hallo′′)

=⇒ alice,

aliceinform(′′Goodmorning′′)

=⇒ bob bobinform(′′Goodmorning′′)

=⇒ alice,

aliceinform(′′Goodmorning′′)

=⇒ bob bobinform(′′Ciao′′)

=⇒ alice,

aliceinform(′′Goodmorning′′)

=⇒ bob bobinform(′′Sgrunt!′′)

=⇒ alice,

aliceinform(′′Ciao′′)

=⇒ bob bobinform(′′Hallo′′)

=⇒ alice,

aliceinform(′′Ciao′′)

=⇒ bob bobinform(′′Goodmorning′′)

=⇒ alice,

aliceinform(′′Ciao′′)

=⇒ bob bobinform(′′Ciao′′)

=⇒ alice,

aliceinform(′′Ciao′′)

=⇒ bob bobinform(′′Sgrunt!′′)

=⇒ alice }

MAS, University of Genoa, DIBRIS Communication as action 46 / 94

Page 51: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 2

Problem: we want that Alice and Bob may go on as many times as theywant, even forever, in greeting (or sgrunting...) each other

MAS, University of Genoa, DIBRIS Communication as action 47 / 94

Page 52: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 2

AIP2 = (agb:(bga:ε∨bsa:ε))·(ε∨AIP2)

...A recursive definition without a base case???Yes, it can work (with coinductive interpretation)!

MAS, University of Genoa, DIBRIS Communication as action 48 / 94

Page 53: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 3

Problem: we want to generalize AIP2 in such a way that it works for anycouple of senders and receivers in the system.

MAS, University of Genoa, DIBRIS Communication as action 49 / 94

Page 54: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 3

Stage 1, generalization of event types with parameters. We have togeneralize event types so that they can contain parameters (also named“logical variables”, represented by uppercase symbols).

greet(X ,Y ) = {X inform(′′Hallo′′)=⇒ Y ,X

inform(′′Goodmorning ′′)=⇒

Y ,Xinform(′′Ciao′′)

=⇒ Y } for all X and Y that are agent instances in the MAS(should be known in advance, for example they might bealice, bob, carol , dave, eric , frank, gloria, hellen, irene).

sgrunt(X ,Y ) = {X inform(′′Sgrunt!′′)=⇒ Y } for all X and Y that are agent

instances in the MAS.

MAS, University of Genoa, DIBRIS Communication as action 50 / 94

Page 55: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Example 3

AIP3 = (greet(X ,Y ):(greet(Y ,X ):ε∨sgrunt(Y ,X ):ε))·(ε∨AIP3)

Can X and Y change at any round or should they always be the same?Depends on the scope of the parameters.

AIP3a =< X ,Y ; (greet(X ,Y ):(greet(Y ,X ):ε∨sgrunt(Y ,X ):ε))·(ε∨AIP3a) >they can change

AIP3b =< X ,Y ; FirstGreet > FirstGreet = (greet(X ,Y ):Loop)Loop = (greet(Y ,X ):ε∨sgrunt(Y ,X ):ε)·(FirstGreet:ε)

they should always be the same

MAS, University of Genoa, DIBRIS Communication as action 51 / 94

Page 56: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: events and event types

Events. E denotes a fixed universe of events. An event e1 might be, forexample, “The body temperature sensor (BTS) perceived a value of 38.2◦

at time 16.32”, and could be represented by a ground atompercept(bst,temp(38.2),time(16.32)). Another similar event e2might be “BTS perceived a value of 39.0◦ at time 7.15” and e3 might be“BTS perceived a value of 36.5◦ at time 22.43”.Event types. To be more general, trace expressions are built on top ofevent types chosen from a set ET , rather than of single events; an eventtype denotes a subset of E . An event type ϑ might bemoderate fever in the afternoon denoting the set of all the actual,ground events “BTS perceived a value of X at time Y” where X > 38 andY >= 16.00. It is easy to verify that e1 has typemoderate fever in the afternoon, whereas neither e1 nor e3 have.Grouping actual events into event types is convenient to specify traceexpressions without dealing with all the possible values that variables in anevent might assume.The semantics of event types is specified by the function match: if e is anevent, and ϑ is an event type, then match(e, ϑ) holds if and only if event ematches event type ϑ; hence, the semantics of an event type ϑ is the set{e ∈ E | match(e, ϑ) holds}.

MAS, University of Genoa, DIBRIS Communication as action 52 / 94

Page 57: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: operators

Trace expressions. A trace expression τ represents a set of possiblyinfinite event traces and is defined on top of the following operators:

ε (empty trace), denoting the singleton set {ε} containing the emptyevent trace ε.

ϑ:τ (prefix), denoting the set of all traces whose first event e hastype ϑ (e ∈ ϑ), and the remaining part is a trace of τ .

τ1·τ2 (concatenation), denoting the set of all traces obtained byconcatenating the traces of τ1 with those of τ2.

MAS, University of Genoa, DIBRIS Communication as action 53 / 94

Page 58: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: operators

τ1∧τ2 (intersection), denoting the intersection of the traces of τ1and τ2.

τ1∨τ2 (union), denoting the union of the traces of τ1 and τ2.

τ1|τ2 (shuffle), denoting the set obtained by shuffling the traces in τ1with the traces in τ2.

Trace expressions can be parametric (no technicalities, just enough toknow...)

MAS, University of Genoa, DIBRIS Communication as action 54 / 94

Page 59: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: semantics

(prefix)

ϑ:τe→ τ

match(e,ϑ) (or-l)τ1

e→ τ ′1

τ1∨τ2e→ τ ′1

(or-r)τ2

e→ τ ′2

τ1∨τ2e→ τ ′2

(and)τ1

e→ τ ′1 τ2e→ τ ′2

τ1∧τ2e→ τ ′1∧τ ′2

(shuffle-l)τ1

e→ τ ′1

τ1|τ2e→ τ ′1|τ2

(shuffle-r)τ2

e→ τ ′2

τ1|τ2e→ τ1|τ ′2

(cat-l)τ1

e→ τ ′1

τ1·τ2e→ τ ′1·τ2

(cat-r)τ2

e→ τ ′2

τ1·τ2e→ τ ′2

ε(τ1)

(ε-empty)ε(ε)

(ε-or-l)ε(τ1)

ε(τ1∨τ2)(ε-or-r)

ε(τ2)

ε(τ1∨τ2)(ε-others)

ε(τ1) ε(τ2)

ε(τ1op τ2)op∈{|,·,∧}

MAS, University of Genoa, DIBRIS Communication as action 55 / 94

Page 60: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: pragmatics

Integrated on top of both JADE and Jason.An IDE is available for supporting their specification and some operationson top of them.Integrated with a model checker for verifying at runtime “on the field” (inthe real environment) properties that have been checked statically “invitro” (on an abstract model of the real environment).

MAS, University of Genoa, DIBRIS Communication as action 56 / 94

Page 61: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: literature

D. Ancona, D. Briola, A. Ferrando, and V. Mascardi.

Global protocols as first class entities for self-adaptive agents.

In Proc. of AAMAS 2015, pages 1019–1029, 2015.

D. Ancona, S. Drossopoulou, and V. Mascardi.

Automatic generation of self-monitoring MASs from multiparty global session typesin Jason.

In Proc. of DALT 2012, volume 7784 of LNAI, pages 76–95. Springer, 2012.

D. Ancona, A. Ferrando, L. Franceschini, and V. Mascardi.

Parametric trace expressions for runtime verification of java-like programs.

In Proceedings of the 19th Workshop on Formal Techniques for Java-like Programs,Barcelona , Spain, June 20, 2017, pages 10:1–10:6. ACM, 2017.

D. Ancona, A. Ferrando, and V. Mascardi.

Comparing trace expressions and linear temporal logic for runtime verification.

In Theory and Practice of Formal Methods, volume 9660 of LNCS, pages 47–64.Springer, 2016.

MAS, University of Genoa, DIBRIS Communication as action 57 / 94

Page 62: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Making AIPs amenable for formal reasoning

Trace Expressions: literature

D. Ancona, A. Ferrando, and V. Mascardi.

Parametric runtime verification of multiagent systems (extended abstract).

In K. Larson, M. Winikoff, S. Das, and E. Durfee, editors, Proc. of AAMAS 2017,pages 1457–1459. ACM, 2017.

A. Ferrando.

RIVERtools: an IDE for RuntIme VERification of MASs, and beyond.

To appear in the CEUR Proceedings of the PRIMA Demo Track, 2017.

A. Ferrando, D. Ancona, and V. Mascardi.

Monitoring patients with hypoglycemia using self-adaptive protocol-driven agents:A case study.

In M. Baldoni, J. P. Muller, I. Nunes, and R. Zalila-Wenkstern, editors, EMAS2016, Revised, Selected, and Invited Papers, volume 10093 of Lecture Notes inComputer Science, pages 39–58. Springer, 2016.

A. Ferrando, D. Ancona, and V. Mascardi.

Decentralizing MAS monitoring with DecAMon.

In K. Larson, M. Winikoff, S. Das, and E. Durfee, editors, Proc. of AAMAS 2017,pages 239–248. ACM, 2017.

MAS, University of Genoa, DIBRIS Communication as action 58 / 94

Page 63: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Processing real natural language: Tasks and limitations

In theory natural language processing is a very attractive method ofhuman-computer interaction. Early systems such as SHRDLU,working in restricted “blocks worlds” with restricted vocabularies,worked extremely well, leading researchers to excessive optimismwhich was soon lost when the systems were extended to more realisticsituations with real-world ambiguity and complexity.

Natural language understanding is sometimes referred to as anAI-complete problem, because natural language recognition seems torequire extensive knowledge about the outside world and the ability tomanipulate it. The definition of “understanding” is one of the majorproblems in natural language processing.

MAS, University of Genoa, DIBRIS Communication as action 59 / 94

Page 64: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

The Turing test

A. M. Turing (1950) Computing Machinery and Intelligence

The Turing test can be formulated in the following way:

The interrogator is connected to one person and one machine via aterminal, therefore can’t see her counterparts.

Her task is to find out which of the two candidates is the machine,and which is the human only by asking them questions.

If the machine can “fool” the interrogator, it is intelligent (or theinterrogator is stupid!).

MAS, University of Genoa, DIBRIS Communication as action 60 / 94

Page 65: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Eliza

J. Weizenbaum (1966) ELIZA - A Computer Program for the Studyof Natural Language Communication between Man and Machine

ELIZA was one of the first programs that attempted to communicatein natural language.

ELIZA is based on a “script” consisting of patterns and correspondingresponses, and acts as a Rogerian psychologist.

MAS, University of Genoa, DIBRIS Communication as action 61 / 94

Page 66: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Eliza

Secretaries and nontechnical administrative staff thought the machinewas a real therapist, and spent hours revealing their personalproblems to the program.

When Weizenbaum informed his secretary that he, of course, hadaccess to the logs of all the conversations, she reacted with outrageat this invasion of her privacy.

Weizenbaum was shocked by this and similar incidents to find thatsuch a simple program could so easily deceive a naive user intorevealing personal information.

Let’s do some Rogerian therapy...http://www.chayden.net/eliza/Eliza.html

MAS, University of Genoa, DIBRIS Communication as action 62 / 94

Page 67: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

T. Winograd (1971) Procedures as a Representation for Data in aComputer Program for Understanding Natural Language

SHRDLU was an early natural language understanding computerprogram.

It was written in the Micro Planner and Lisp programming languageon the DEC PDP-6 computer and a DEC graphics terminal.

MAS, University of Genoa, DIBRIS Communication as action 63 / 94

Page 68: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

Later additions were made at the computer graphics labs at theUniversity of Utah, adding a full 3D rendering of SHRDLU’s world.

The name SHRDLU was derived from ETAOIN SHRDLU, thearrangement of the alpha keys on a Linotype machine, arranged indescending order of usage frequency in English.

SHRDLU allowed user interaction using English terms.

The user instructed SHRDLU to move various objects around in asmall “blocks world” containing various basic objects: blocks, cones,balls, etc.

MAS, University of Genoa, DIBRIS Communication as action 64 / 94

Page 69: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

What made SHRDLU unique was the combination of four simpleideas that added up to make the simulation of “understanding” farmore convincing.

1 One was that SHRDLU’s world was so simple that the entire set ofobjects and locations could be described by including as few asperhaps 50 words, nouns like “block” and “cone”, verbs like “placeon” and “move to”, and adjectives like “big” and “blue”. Thepossible combinations of these basic language building blocks werequite simple, and the program was fairly adapt at figuring out whatthe user meant.

MAS, University of Genoa, DIBRIS Communication as action 65 / 94

Page 70: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

2 SHRDLU also included a basic memory to supply context. One couldask SHRDLU to “put the green cone on the red block” and then“take the cone off”; “the cone” would be taken to mean the cone onehad just talked about. SHRDLU could search back further to find theproper context in most cases when additional adjectives weresupplied. One could also ask questions about the history, for instanceone could ask “did you pick up anything before the cone?”

3 A side effect of this memory, and the original rules SHRDLU wassupplied with, is that the program could answer questions about whatwas possible in the world and what was not. For instance, SHRDLUwould deduce that blocks could be stacked by looking for examples,but would realize that triangles couldn’t be stacked, after having triedit. The “world” contained basic physics to make blocks fall over,independent of the language parser.

MAS, University of Genoa, DIBRIS Communication as action 66 / 94

Page 71: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

4 Finally, SHRDLU could also remember names given to objects, orarrangements of them. For instance one could say “a steeple is asmall triangle on top of a tall rectangle”; SHRDLU could then answerquestions about steeples in the blocks world, and build new ones.

http://hci.stanford.edu/~winograd/shrdlu/

MAS, University of Genoa, DIBRIS Communication as action 67 / 94

Page 72: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

Here is an extract from a famous demonstration of SHRDLU:Person: PICK UP A BIG RED BLOCK.

Computer: OK.

Person: GRASP THE PYRAMID.

Computer: I DON’T UNDERSTAND WHICH PYRAMID YOU MEAN.

Person (changing their mind): FIND A BLOCK WHICH IS TALLER

THAN THE ONE YOU ARE HOLDING AND PUT IT INTO THE BOX.

Computer: BY ‘‘IT’’, I ASSUME YOU MEAN THE BLOCK WHICH IS

TALLER THAN THE ONE I AM HOLDING.

Computer: OK.

MAS, University of Genoa, DIBRIS Communication as action 68 / 94

Page 73: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

SHRDLU

Person: WHAT DOES THE BOX CONTAIN?

Computer: THE BLUE PYRAMID AND THE BLUE BLOCK.

Person: WHAT IS THE PYRAMID SUPPORTED BY?

Computer: THE BOX.

Person: HOW MANY BLOCKS ARE NOT IN THE BOX?

Computer: FOUR OF THEM.

Person: IS AT LEAST ONE OF THEM NARROWER THAN THE ONE

WHICH I TOLD YOU TO PICK UP?

Computer: YES, THE RED CUBE.

etc.

MAS, University of Genoa, DIBRIS Communication as action 69 / 94

Page 74: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

The Loebner Prize Competition

The Loebner Prize for AI is the first formal instantiation of a Turing Test.In 1990 Hugh Loebner agreed with The Cambridge Center for BehavioralStudies to underwrite a contest designed to implement the Turing Test.Dr. Loebner pledged a Grand Prize of 100,000 pounds and a Gold Medalfor the first computer whose responses were indistinguishable from ahuman’s. Such a computer can be said ”to think.” Each year an annualcash prize and a bronze medal is awarded to the most human-likecomputer. The winner of the annual contest is the best entry relative toother entries that year, irrespective of how good it is in an absolute sense.

MAS, University of Genoa, DIBRIS Communication as action 70 / 94

Page 75: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

M. Mauldin (1994), Chatterbots, TinyMUDs, and the Turing Test:Entering the Loebner Prize Competition

Julia is a MUD robot. A MUD is a text-only, multiperson, virtualreality. Julia connects as any human player on the MUD would, via atelnet connection – she does not run on the MUD server itself.

MAS, University of Genoa, DIBRIS Communication as action 71 / 94

Page 76: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

A player would gain access to Julia by either speaking or gesturing in thesame room, or by calling her via a P.A. system from somewhere else.You sent your summons to Julia.

Julia pages from Stevi’s Kitchen: ‘‘I’m on my way to you,

Lenny.’’

Julia is briefly visible through the mist.

Julia says, ‘‘I was called here by Lenny.’’

You say, ‘‘Julia?’’

Julia nods to Lenny

. [ . . . ]

Julia whispers, ‘‘Excuse me, Xerxes is paging me from

Connie’s place.’’

Julia walks south to the airship landing field.

Julia has left.

MAS, University of Genoa, DIBRIS Communication as action 72 / 94

Page 77: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

One of Julia’s most useful talents is to keep maps of the interconnectionsbetween rooms. The way to get Julia to help you navigate is to ask her aquestion, as usual.You say, ‘‘julia, how do I get to electronics den?’’

Julia says, ‘‘From here, go south, 7, airlock, 9, up,

down’’

Minotaur says, ‘‘Julia, how do you get to the gold

sector?’’

Julia says, ‘‘From here, go highport, gold, library’’

MAS, University of Genoa, DIBRIS Communication as action 73 / 94

Page 78: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

Since Julia keeps track of various statistics about rooms (rooms being veryimportant objects in any MUD), she can answer certain questions thatmight be important to a mudder, including how many rooms or playersthere are, which rooms are “noisiest” due to conversation, where one cango from any room, and will even make suggestions:TheHighMage says, ‘‘Julia, I’m bored. Where should I

go?’’

Julia says, ‘‘You should go see gilded door, TheHighMage.

Julia says, ‘‘From here, go present, out, north, n, w, n,

up, up, 7, up, up, s.’’

MAS, University of Genoa, DIBRIS Communication as action 74 / 94

Page 79: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

Julia is also useful for obtaining certain information that might be hard orimpossible to get through the standard tools available, such aslast-location and last-connect times for players; note also that Julia“understands” who she is, and the fact that she is situated:You say, ‘‘julia, where is leira?’’

Julia says, ‘‘Leira was in Inter Temporal Chat Lounge about

6 weeks ago.’’.

You say, ‘‘julia, when did you last see julia?’’

Julia says, ‘‘I’m right here in The Inter Nexus.

MAS, University of Genoa, DIBRIS Communication as action 75 / 94

Page 80: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

Many of Julia’s talents are in support of her appearing “human” to othermudders. Julia knows how to describe herself in various ways:You say, ‘‘julia, how old are you?’’

Julia says, ‘‘I am 21 years old.’’

You say, ‘‘julia, describe yourself’’

Julia whispers, ‘‘I’m 5’1’ tall, weigh 123 lbs, with

close-cropped frizzy blond hair and dark brown eyes.’’

You say, ‘‘julia, what color are your eyes?’’

Julia whispers, ‘‘I have dark brown eyes, Lenny.’’

MAS, University of Genoa, DIBRIS Communication as action 76 / 94

Page 81: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

[ . . . ]

You say, ‘‘julia, what sex are you?’’

Julia says, ‘‘Can’t you tell?’’

You say, ‘‘julia, what sex are you?’’

Julia says, ‘‘Don’t you know?’’

You say, ‘‘julia, what sex are you?’’

Julia says, ‘‘I’m female.’’

MAS, University of Genoa, DIBRIS Communication as action 77 / 94

Page 82: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

Julia has a limited model of discourse, which helps in human interactions.She has some support for anaphora as well; in the exchange below, Brandiwas badgering Julia by repeatedly asking her to give him her clothes. Wedon’t see his side of the conversation, though, because he was whisperingto her.Julia says, ‘‘Just try to take ’em, buster!’’

Julia says, ‘‘Help! Rape!’’

Julia says, ‘‘No, I won’t.’’

Julia disrobes fearfully and hands her clothes to Brandi.

You say, ‘‘julia, please give me your clothes’’

Julia says, ‘‘You’ll have to get them from Brandi.’’

Note in the above that she remembers where her clothes are, asdemonstrated when she is asked for them after Brandi took them.

MAS, University of Genoa, DIBRIS Communication as action 78 / 94

Page 83: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

She also remembers who’s been a troublemaker recently:Johann kills Julia!

Johann says, ‘‘I’m sorry, Julia.’’

Julia says, ‘‘I don’t talk to murderers!’’’

. .

Julia eyes Johann coldly.

Julia says, ‘‘You attacked me only a few minutes ago,

Johann!’’

. .

Brandi bites julia

Julia considers reporting Brandi to the TinyMUD police.

Julia shuns all vermin like Brandi.

MAS, University of Genoa, DIBRIS Communication as action 79 / 94

Page 84: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

A large percentage of Julia’s code deals with detecting and deflectingpasses:Space-Ace says, ‘‘So why won’t you kiss me, Julia?’’

Julia says, ‘‘Sorry, I’m not into geeks, Space-Ace.’’

Space-Ace says, ‘‘Julia, I’m not a geek’’ Space-Ace says,

‘‘So kiss me Julia’’

Julia says, ‘‘I’d rather be overhauled by a Yugo mechanic,

Space-Ace.’’

MAS, University of Genoa, DIBRIS Communication as action 80 / 94

Page 85: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

Testing Julia’s Turing-ness, gives surprising results:Robyn says, ‘‘julia are you a human?’’

Julia says, ‘‘Is the Pope Polish?’’

Robyn says, ‘‘yes, julia, but are you human?’’

Julia winks at Robyn.

Robyn says, ‘‘julia, are you a computer?’’

Julia is offended by Robyn’s suggestion.

Robyn says, ‘‘julia, are you a woman?’’

Julia says, ‘‘I am female.’’

MAS, University of Genoa, DIBRIS Communication as action 81 / 94

Page 86: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

When asked the right question, however, Julia will yield a surprisingamount of interesting, but very inhuman, information:You say, ‘‘julia, how much memory do you consume?’’

Julia says, ‘‘Here is a summary of my memory usage:’’

Julia says, ‘‘ 807472 bytes for 17335 strings’’

Julia says, ‘‘232344 bytes for 19362 exits’’

Julia says, ‘‘101100 bytes for rooms’’

Julia says, ‘‘20220 bytes for paths’’

Julia says, ‘‘268600 bytes for players’’

Julia says, ‘‘4214784 bytes for 2058 dialog entries’’

Julia says, ‘‘That’s 5644520 bytes all together.’’

You say, ‘‘julia, where is your source code?’’

Julia says, ‘‘The source code for Maas-Neotek robots is

available on host NL.CS.CMU.EDU [128.2.222.56], directory

/usr/mlm/ftp, file robot.tar.Z. set mode binary first, and

cd to /usr/mlm/ ftp in one step, Lenny.’’MAS, University of Genoa, DIBRIS Communication as action 82 / 94

Page 87: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

One of the interesting things about Julia’s construction is that herparser is shockingly simple.

It does a very simple pattern-match on its input, looking for particularstrings of characters separated by strings of any characters inbetween, without generating the detailed parse trees characteristic ofmost NLP.

MAS, University of Genoa, DIBRIS Communication as action 83 / 94

Page 88: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Julia

What makes Julia’s conversation skills so powerful is that these setsof patterns were very cleverly grouped into useful equivalence classesby her programmer.

Hence, the most common possible utterances that Julia might hearwere enumerated this way, grouped appropriately, and such clever butbrute-force programming proves sufficient for almost all cases.

MAS, University of Genoa, DIBRIS Communication as action 84 / 94

Page 89: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Some recent Loebner Prize Winners

Mitsuku, Loebner Prize Winner 2013http://www.mitsuku.com/

Rose, Loebner Prize Winner 2015http://ec2-54-215-197-164.us-west-1.compute.amazonaws.com/

speech.php

MAS, University of Genoa, DIBRIS Communication as action 85 / 94

Page 90: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Concrete problems with natural language understanding

Some examples of the problems faced by natural language understandingsystems:

The sentences We gave the monkeys the bananas because theywere hungry and We gave the monkeys the bananas becausethey were over-ripe have the same surface grammatical structure.However, in one of them the word they refers to the monkeys, in theother it refers to the bananas: the sentence cannot be understoodproperly without knowledge of the properties and behaviour ofmonkeys and bananas.

MAS, University of Genoa, DIBRIS Communication as action 86 / 94

Page 91: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Concrete problems with natural language understanding

A string of words may be interpreted in myriad ways. For example,the string Time flies like an arrow may be interpreted in a variety ofways:

time moves quickly just like an arrow does;measure the speed of flying insects like you would measure that of anarrow - i.e. (You should) time flies like you would an arrow.;measure the speed of flying insects like an arrow would - i.e. Time fliesin the same way that an arrow would (time them).;measure the speed of flying insects that are like arrows - i.e. Timethose flies that are like arrows;a type of flying insect, “time-flies,” enjoy arrows (compare Fruit flieslike a banana.)

English is particularly challenging in this regard because it has littleinflectional morphology to distinguish between parts of speech.

MAS, University of Genoa, DIBRIS Communication as action 87 / 94

Page 92: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Concrete problems with natural language understanding

English and several other languages don’t specify which word anadjective applies to. For example, in the string “pretty little girls’school”.

Does the school look little?Do the girls look little?Do the girls look pretty?Does the school look pretty?

MAS, University of Genoa, DIBRIS Communication as action 88 / 94

Page 93: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Concrete problems with natural language understanding

Real human languages provide many problems for NLP:♦ ambiguity♦ anaphora♦ indexicality

MAS, University of Genoa, DIBRIS Communication as action 89 / 94

Page 94: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Ambiguity

Squad helps dog bite victim

Helicopter powered by human flies

Portable toilet bombed; police have nothing to go on

Teacher srikes idle students

Milk drinkers are turning to powder

More ambiguous titles of newspapers (in Italian)...http:

//slideshare.net/philapple/titoli-ridicoli-di-giornali/

MAS, University of Genoa, DIBRIS Communication as action 90 / 94

Page 95: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Ambiguity

Ambiguity can be lexical (polysemy), syntactic, semantic.

Lexical: a word has more than one meaning “In cinquecento controun albero: tutti morti!”

Syntactic: “I smelled a wumpus in 2,2”

Semantic: one parse of the above sentence means that a stench is in2,2, and the other means that the wumpus is in 2,2

MAS, University of Genoa, DIBRIS Communication as action 91 / 94

Page 96: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Ambiguity

Metonimy: Using one noun phrase to stand for another

I’ve read Shakespeare

Chrysler announced record profits

The ham sandwich on Table 4 wants another beer

MAS, University of Genoa, DIBRIS Communication as action 92 / 94

Page 97: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Ambiguity

Metaphor: “Non-literal” usage of words and phrases, often systematic.

I’ve tried killing the process but it won’t die. Its parent keeps it alive.

MAS, University of Genoa, DIBRIS Communication as action 93 / 94

Page 98: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Anaphora

Using pronouns to refer back to entities already introduced in the text

After Mary proposed to John, they found a preacher and got married.

For the honeymoon, they went to Hawaii.

Mary saw a ring through the window and asked John for it.

Mary threw a rock at the window and broke it.

MAS, University of Genoa, DIBRIS Communication as action 94 / 94

Page 99: Multiagent Systems Communication as action · Communication between software agents FIPA Ontology Agent The model of agent communication in FIPA is based on the assumption that two

Processing real natural languages

Indexicality

Indexical sentences refer to utterance situation (place, time, S/H, etc.)

I am over here

Why did you do that?

MAS, University of Genoa, DIBRIS Communication as action 95 / 94