Global Types for Dynamic Checking of Protocol Conformance of - - PowerPoint PPT Presentation

global types for dynamic checking of protocol conformance
SMART_READER_LITE
LIVE PREVIEW

Global Types for Dynamic Checking of Protocol Conformance of - - PowerPoint PPT Presentation

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems Davide Ancona, Matteo Barbieri and Viviana Mascardi Universit` a di Genova Italian Conference on Theoretical Computer Science, Varese, September 19-21, 2012 D.


slide-1
SLIDE 1

Global Types for Dynamic Checking of Protocol Conformance of Multi-Agent Systems

Davide Ancona, Matteo Barbieri and Viviana Mascardi

Universit` a di Genova

Italian Conference on Theoretical Computer Science, Varese, September 19-21, 2012

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 1 / 36

slide-2
SLIDE 2

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 2 / 36

slide-3
SLIDE 3

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 3 / 36

slide-4
SLIDE 4

Multi-agent systems (MASs)

industrial-strength technology for integrating and coordinating heterogeneous systems intrinsically distributed nature, asynchronous message passing agent-oriented programming languages are typically dynamically typed

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 4 / 36

slide-5
SLIDE 5

Jason

AgentSpeak: a logic-based agent-oriented programming language, based on the belief-desire-intention (BDI) software model Jason: open source interpreter for an extended version of AgentSpeak, supporting a Prolog-like language for specifying agents behavior communication model: speech-act based, with performatives (a.k.a. illocutionary forces)

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 5 / 36

slide-6
SLIDE 6

Sending actions in Jason

.send(recipient,performative,content) recipient: the id of the agent that will receive the message performative: specifies the semantics/aim of the message tell untell achieve unachieve tell-how untell-how ask-if ask-all ask-how content: a (possibly empty) set of atoms or plans

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 6 / 36

slide-7
SLIDE 7

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 7 / 36

slide-8
SLIDE 8

Protocols and multi-agent systems

A protocol represents an agreement on how participating agents [systems] interact with each other. Without a protocol, it is hard to do a meaningful interaction: participants simply cannot communicate effectively.

[From the manifesto of Scribble, a language to describe application-level protocols among communicating systems initially designed by Kohei Honda and Gary Brown, http://www.jboss.org/scribble/]

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 8 / 36

slide-9
SLIDE 9

Protocol specification

Interaction diagrams in FIPA AUML

specify the behavior of a system from a global point of view suitable for humans, but not for verification A first example: ping-pong protocol

alice: Ping

tell(item) sd Ping-Pong loop

bob: Pong

tell(ping) tell(pong)

[FIPA Modeling: Interaction Diagrams, http://www.auml.org/auml/documents/ID-03-07-02.pdf]

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 9 / 36

slide-10
SLIDE 10

Protocol specification: a formal approach

protocol = (possibly infinite) set of (possibly infinite) sequences of sending actions Example 1: ping-pong protocol

msg(alice,bob,tell,ping) msg(bob,alice,tell,pong) msg(alice,bob,tell,ping) msg(bob,alice,tell,pong) ...

alice: Ping

tell(item) sd Ping-Pong loop

bob: Pong

tell(ping) tell(pong)

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 10 / 36

slide-11
SLIDE 11

Protocols as global types

Example 1: ping-pong protocol PingPong = α1:α2:PingPong where α1 sending action type corresponding to msg(alice,bob,tell,ping) where α2 sending action type corresponding to msg(bob,alice,tell,pong) sending action types = monadic predicates

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 11 / 36

slide-12
SLIDE 12

Global types as Prolog cyclic terms

Modern Prolog systems (and Jason as well) support cyclic terms (a.k.a. regular or rational terms) Example: the unification problem PingPong = ping:pong:PingPong. succeeds with the answer PingPong = ping:pong:PingPong Regular terms naturally support recursive types Regular Prolog terms: a very compact representation of protocol specifications through global types Protocols can be easily manipulated and exchanged by agents

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 12 / 36

slide-13
SLIDE 13

Automatic generation of a self-monitoring MAS

Jason implementation of a MAS S Jason implementation of a MAS S Protocol specification with a global type Protocol specification with a global type Sending action types as predicates Sending action types as predicates Generator Generator Jason extended self-monitoring MAS S' Jason extended self-monitoring MAS S'

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 13 / 36

slide-14
SLIDE 14

Centralized monitor agent

Monitor Monitor Agent1 Agent1 Agentk Agentk

... protocol conformance dynamically checked by a monitor agent M

  • ther agents ask M permission to send their messages

the monitor notifies all failures the monitor checks responsiveness of the agents

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 14 / 36

slide-15
SLIDE 15

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 15 / 36

slide-16
SLIDE 16

Global types

The set of regular terms defined on the following constructors: λ (empty sequence), representing the singleton set {ǫ} containing the empty sequence ǫ. α:τ (seq), representing the set of all sequences whose first element is a sending action matching type α, and the remaining part is a sequence in the set represented by τ. τ1 + τ2 (choice), representing the union of the sequences of τ1 and τ2. τ1|τ2 (fork), representing the set obtained by shuffling the sequences in τ1 with the sequences in τ2 . τ1 · τ2 (concat), representing the set of sequences obtained by concatenating the sequences of τ1 with those of τ2.

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 16 / 36

slide-17
SLIDE 17

Contractive global types

A global type τ is contractive if it does not contain paths whose nodes can only be constructors in {+, |, ·} (such paths are necessarily infinite). Examples: a contractive type: T1 = (λ + α:T1) a non contractive type: T2 = λ + (T2 | T2) + (T2 · T2)

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 17 / 36

slide-18
SLIDE 18

Transition rules

T contractive global types, A sending actions total function δ:T × A → Pfin(T ) τ1

a

→ τ2 means τ2 ∈ δ(τ1, a)

(seq)

α:τ

a

→ τ

a∈α (choice-l)

τ1

a

→ τ ′

1

τ1 + τ2

a

→ τ ′

1 (choice-r)

τ2

a

→ τ ′

2

τ1 + τ2

a

→ τ ′

2 (fork-l)

τ1

a

→ τ ′

1

τ1|τ2

a

→ τ ′

1|τ2 (fork-r)

τ2

a

→ τ ′

2

τ1|τ2

a

→ τ1|τ ′

2 (cat-l)

τ1

a

→ τ ′

1

τ1 · τ2

a

→ τ ′

1 · τ2 (cat-r)

τ2

a

→ τ ′

2

τ1 · τ2

a

→ τ ′

2 ǫ(τ1)

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 18 / 36

slide-19
SLIDE 19

Definition of ǫ( )

ǫ(τ) holds if and only if τ contains λ

(ǫ-seq)ǫ(λ) (ǫ-lchoice)

ǫ(τ1) ǫ(τ1 + τ2)

(ǫ-rchoice)

ǫ(τ2) ǫ(τ1 + τ2)

(ǫ-fork)ǫ(τ1)

ǫ(τ2) ǫ(τ1|τ2)

(ǫ-cat)ǫ(τ1)

ǫ(τ2) ǫ(τ1 · τ2)

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 19 / 36

slide-20
SLIDE 20

Interpretation of global types

Run

A run ρ for τ0 is a sequence τ0

a0

→ τ1

a1

→ . . .

an−1

→ τn

an

→ τn+1

an+1

→ . . . of valid transitions such that either the sequence is infinite,

  • r it terminates with the type τk (with k ≥ 0) s.t. ǫ(τk).

A(ρ) = sequence of sending actions a0a1 . . . an . . . contained in ρ.

Interpretation

τ0 = {A(ρ) | ρ is a run for τ0 }

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 20 / 36

slide-21
SLIDE 21

Results

Proposition 1

Let τ be a contractive type. Either ǫ(τ) holds or there exist a and τ ′ s.t. τ

a

→ τ ′.

Proposition 2

If τ is contractive and τ

a

→ τ ′ for some a, then τ ′ is contractive as well.

Corollary

If τ is contractive, then τ = ∅

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 21 / 36

slide-22
SLIDE 22

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 22 / 36

slide-23
SLIDE 23

Example 2: brokering protocol

tell(final) tell(result) parallel

s: Seller

tell(item) sd Brokering loop

b: Broker c: Client

tell(offer) tell(counter)

Brokering = item:(Negotiation + End) Negotiation = offer:counter:(Negotiation + End) End = final:λ | result:λ

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 23 / 36

slide-24
SLIDE 24

Example 3: extended ping-pong protocol

loop

alice: master

sd ExtPing-Pong

bob: slave

loop [n] tell(ping) loop [n] tell(pong) “n” can change at any external loop, but inside one loop the number of “b” sent by bob must be the same as the number of “a” sent by alice

Loop = PingPong · Loop PingPong = ping:(pong:λ + (PingPong · pong:λ))

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 24 / 36

slide-25
SLIDE 25

Example 4: alternating bit protocol

Proposed by Deni´ elou and Yoshida (ESOP 2012) Infinite sequences of the following sending action types: Alice sends msg1 to Bob Alice sends msg2 to Bob Bob sends ack1 to Alice Bob sends ack2 to Alice Constraints (for all n ≥ 0): msg1n ≤msg2n ≤msg1n+1 msg1n ≤ack1n ≤msg1n+1 msg2n ≤ack2n ≤msg2n+1 Where αn denotes the n-th occurrence of α in the sequence

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 25 / 36

slide-26
SLIDE 26

A global type for the alternating bit protocol

AltBitOne = msg1:M2 AltBitTwo = msg2:M1 M2 = (((msg2:λ) | (ack1:λ)) · M1) + (((msg2:ack2:λ) | (ack1:λ)) · AltBitOne) M1 = (((msg1:λ) | (ack2:λ)) · M2) + (((msg1:ack1:λ) | (ack2:λ)) · AltBitTwo) Problems: quite complex type, not intuitive the complexity of the type grows exponentially with the number of messages

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 26 / 36

slide-27
SLIDE 27

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 27 / 36

slide-28
SLIDE 28

Global types and constraints

Intuition: for every correct sequence s s restricted to msg1 and ack1 is M1A1 = msg1:ack1:M1A1 s restricted to msg2 and ack2 is M2A2 = msg2:ack2:M2A2 s restricted to msg1 and msg2 is M1M2 = msg1:msg2:M1M2 But neither M1A1 | M2A2 nor M1A1 | M2A2 | M1M2 are correct, since the shuffle is unconstrained

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 28 / 36

slide-29
SLIDE 29

Idea

Shuffle with a synchronization mechanism Producer sending action type: αn must be synchronized with n consumer types (n ≥ 0) Consumer sending action type: α An unconstrained global type is a particular case of constrained global type where all sending action types have shape α0

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 29 / 36

slide-30
SLIDE 30

Extended transition rules

n1, τ1

a

→ n2, τ2 input n1: sending action types to be consumed

  • utput n2: sending action types left to be consumed

top-level transition: 0, τ1

a

→ 0, τ2 New rules:

(seq-prod)

0, αn:τ

a

→ n, τ

a∈α (seq-cons1)

n, α:τ

a

→ n − 1, τ

n>0 a∈α (seq-cons2)

n, α:τ

a

→ n, α:τ

n>0 a∈α (empty)

n, λ a → n, λ

n>0 (fork-sync-l)n1, τ1 a

→ n2, τ ′

1

n2, τ2

a

→ n3, τ ′

2

n1, τ1|τ2

a

→ n3, τ ′

1|τ ′ 2 n2>0 (fork-sync-r)n1, τ2 a

→ n2, τ ′

2

n2, τ1

a

→ n3, τ ′

1

n1, τ1|τ2

a

→ n3, τ ′

1|τ ′ 2 n2>0

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 30 / 36

slide-31
SLIDE 31

Extended transition rules

Generalization of the previous rules:

(choice-l)

n1, τ1

a

→ n2, τ ′

1

n1, τ1 + τ2

a

→ n2, τ ′

1 (choice-r)

n1, τ2

a

→ n2, τ ′

2

n1, τ1 + τ2

a

→ n2, τ ′

2 (fork-l)

n1, τ1

a

→ 0, τ ′

1

n1, τ1|τ2

a

→ 0, τ ′

1|τ2 (fork-r)

n1, τ2

a

→ 0, τ ′

2

n1, τ1|τ2

a

→ 0, τ1|τ ′

2 (cat-l)

n1, τ1

a

→ n2, τ ′

1

n1, τ1 · τ2

a

→ n2, τ ′

1 · τ2 (cat-r)

n1, τ2

a

→ n2, τ ′

2

n1, τ1 · τ2

a

→ n2, τ ′

2 ǫ(τ1)

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 31 / 36

slide-32
SLIDE 32

Alternating bit protocol (revisited)

Dimension 2 AltBit2 = M1A1 | M2A2 | M1M2 M1A1 = msg11:ack10:M1A1 M2A2 = msg21:ack20:M2A2 M1M2 = msg1:msg2:M1M2 Dimension 3 AltBit3 = M1A1 | M2A2 | M3A3 | M1M2M3 M1A1 = msg11:ack10:M1A1 M2A2 = msg21:ack20:M2A2 M3A3 = msg31:ack30:M3A3 M1M2M3 = msg1:msg2:msg3:M1M2M3

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 32 / 36

slide-33
SLIDE 33

Outline

1

Background on multi-agent systems

2

Previous work (Declarative Agent Languages and Technologies - DALT 2012, Ancona, Drossopoulou, Mascardi)

3

Global types: formalization

4

Expressive power of global types (by examples)

5

An extension to enhance the expressive power (not in the paper)

6

Conclusion and future work

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 33 / 36

slide-34
SLIDE 34

Conclusion

global types as Prolog regular terms dynamic checking of protocol conformance formalization extension to “constrained shuffle”

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 34 / 36

slide-35
SLIDE 35

Future work

in depth comparison with other formalisms for protocol specification relations with ω-automata projecting global types from dynamic to static checking of protocol conformance

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 35 / 36

slide-36
SLIDE 36

Thank you for your attention... ...questions?

  • D. Ancona (Univ. of Genova)

Global Types for Multi-Agent Systems ICTCS12 36 / 36