38
Faculty Of Computer Science Simon Fraser University Cmpt 880 presentation An Abstract Communication Model Uwe Glasser, Yuri Gurevich and Margus Veanes Presented by: Xianghua Jiang

Faculty Of Computer Science Simon Fraser University Cmpt 880 presentation

  • Upload
    gwidon

  • View
    32

  • Download
    0

Embed Size (px)

DESCRIPTION

Faculty Of Computer Science Simon Fraser University Cmpt 880 presentation An Abstract Communication Model Uwe Glasser, Yuri Gurevich and Margus Veanes  Presented by: Xianghua Jiang. Agenda. Origin of the Abstract Communication Model (ACM) - PowerPoint PPT Presentation

Citation preview

Page 1: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

Faculty Of Computer Science Simon Fraser University

Cmpt 880 presentation

 

 

An Abstract Communication Model 

Uwe Glasser, Yuri Gurevich and Margus Veanes

 

  Presented by:

Xianghua Jiang

Page 2: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

Agenda Origin of the Abstract Communication Model (ACM) Basic Abstract State Machine (ASM) Parallel ASM Distributed ASM ASML Simulation of Agents ACM Reuse of ACM Summary

Page 3: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

ORIGIN OF ACM The model was developed in the

process of specifying UPnP architecture. UPnP is an industrial standard for dynamic

peer to peer networking. The model is based on distributed

abstract state machine (DASM). The model is implemented in the

specification language Asml.

Page 4: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

BASIC ASMs

A basic ASM consists of a basic ASM program together with a collection states (the legal states of the ASM) and subcollection of initial states.

Basic ASMs are sequential algorithm.

Page 5: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

ASM STATES

States of ASM are first-order structures.

Syntax of the state

Semantic of the state

Page 6: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SYNTAX OF THE STATE Vocabulary is a collection of function

symbols and relation symbols (or predicates).

Every vocabulary contains: Equality Sign “=“; Logic symbols true, false, undef; Standard propositional connetives.

Page 7: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SEMANTICS OF STATE A state X of a given vocabulary Y is a

nonempty set S (base set of X), together with interpretations of the function symbols and relation symbols in Y over S.

Page 8: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SEMANTICS OF STATE A state X of a given vocabulary Y is a

nonempty set S (base set of X), together with interpretations of the function symbols and relation symbols in Y over S.

Function: f(x1, ……, xn) Function F: Sx…xS S Relation: p(x1, ……, xn) Relation P Sx…xS

Page 9: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

ASM STATES UPDATE

State is a kind of memory. A location of a state A is a pair (f, a) The content of the location is y = f(a). An update of state A is a pair (l, y’) To fire the update (l, y’), replace the

old value y at location l with the new value y’.

Page 10: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SEQUENCIAL ALGORITHM Let A be a sequential algorithm

A set S(A) whose elements will be called states of A

A subset L(A) of S(A) whose elements will be called initial states of A

A Map TA: S(A) -> S(A) that will be called the one-step transformation of A

Page 11: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SEQUENCIAL ALGORITHM Let A be a sequential algorithm

A set S(A) whose elements will be called states of A

A subset L(A) of S(A) whose elements will be called initial states of A

A Map TA: S(A) -> S(A) that will be called the one-step transformation of A

A run (or computation) of A is a sequenceX0, X1, X2,……. Where X0 is an initial stateand every Xi+1 = TA (Xi)

Page 12: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SEQUENCIAL ALGORITHM IN BASIC ASM

The run of a machine is a series of states and state transitions that results from applying operations to each state in succession.

Page 13: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

THE RUN OF ASM

Vocabulary: mode, orders, balance 3 states: S1, S2, S3 2 transitions: Initialize,Process All Orders

S1

mode = "Initial"orders = 0

balance = $0

S2

mode = "Active"orders = 2

balance = $200

S3

mode = "Final"orders = 0

balance = $500

Initialize ProcessAll

Orders

Page 14: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

THE RUN OF ASM

balance

orders

mode

$0

0

"Initial"

The Machine'sControl Logic

balance

orders

mode

$200

2

"Active"

input

output

...if mode = "Initial"then mode := "Active"...

Page 15: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

BASIC ASM PROGRAMS

An ASM program: entire definition of a machine, including the names of its state variables.

Control logic is the portion of program made up of

the rules governing the state transitions. A update rule R: f(e1,….ej) := e0 A conditional rule R: if e then R1 else R2 A do-in-parallel rule R:

do in – parallel

R1

R2

Page 16: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

PARALLEL ASMS

Parallel ASMs are parallel algorithms.

Example: the ages of Alice, Bob and Ted are incremented on a yearly basis from the year 2000 to 2009.

S1 S2 S3

. . .Alice.age = 20Bob.age = 16Ted.age = 40

Alice.age = 21Bob.age = 17Ted.age = 41

Alice.age = 22Bob.age = 18Ted.age = 42

Page 17: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

DISTRIBUTED ASMS

A distributed ASM (DASM) involves a collection of agents. Global states Move

A single computation step of an individual agent

Partially ordered runs

Page 18: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

FROM ASM TO ASML

Block structure Type Class Structure Method Variable

Page 19: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

FROM ASM TO ASML Block structure

indentation to indicate block structure Type

Class, structure, etc. Class

Inheritance, Overloading Method

name( parameter1 as Type, ...parametern as Type ) as Type

Variable Set and Map

Page 20: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SET AND MAP VARIABLE Set

A set is an unordered collection of distinct values that are of the same type

Map Like arrays, maps have a set of unique keys and a

set of values associated with those keys

Page 21: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SET AND MAP VARIABLE Set

A set is an unordered collection of distinct values that are of the same type

Set with enumerated elements var s = {1, 2, 3, 4}

Map Like arrays, maps have a set of unique keys and a

set of values associated with those keys Map declaration var phoneNumber as Map of String to Integer

Page 22: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SIMULATION OF AGENTS

Agents declaration Class Agent Var Agents as Set of Agent = {}

Page 23: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SIMULATION OF AGENTS Agents declaration

Class Agent Var Agents as Set of Agent = {}

Mailbox and InsertMessage Method type Message

Class Agentprogram ()

Var mailbox as Set of Message = {} InsertMessage( m as Message) mailbox(m) := true

Page 24: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SIMULATION OF AGENTS Agents declaration

Class Agent Var Agents as Set of Agent = {}

Mailbox and InsertMessage Method type Message

Class Agentprogram ()

Var mailbox as Set of Message = {} InsertMessage( m as Message) mailbox(m) := true

RunAgents forall a in chooseSubset(Agents) program(a)

Page 25: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

ABSTRACT COMMUNICATION MODEL

Class COMMUNICATOR extends Agent Class APPLICATION extends Agent

Page 26: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

ABSTRACT COMMUNICATION MODEL

Message Transformation Message Routing Delivery Condition Message Delivery

Page 27: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE TRANSFORMATION

Method: ResolveMessage

Variable: addressTable

Page 28: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE TRANSFORMATION

Method: ResolveMessage type Message

Class COMMUNICATORResoveMessage (m as MESSAGE) as Set of

MESSAGE

Variable: addressTable type Address

Class COMMUNICATOR Var addressTable as Map of ADDRESS to Set of

Address

Page 29: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE TRANSFORMATION

Message transformation

destination (m as MESSAGE) as ADDRESS

Class COMMUNICATOR

Transform (m as MESSAGE, dest as ADDRESS) as MESSAGE

ResolveMessage (m as MESSAGE) as Set of MESSAGE

Return {Transform(m, a) | a in addressTable(destination(m))}

Page 30: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE ROUTING

Recipient method

routingTable variable

Page 31: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE ROUTING

Recipient method Class COMMUNICATOR

Recipient (m as MESSAGE) as Agent?

routingTable variable Class COMMUNICATOR

var routingTable as Map of Address to Agent

Page 32: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE ROUTING Recipient method

Class COMMUNICATORRecipient (m as MESSAGE) as Agent?

return routingTable (destination(m))

routingTable variable Class COMMUNICATOR

var routingTable as Map of Address to Agent

Page 33: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

DELIVER CONDITIONS

Predicate ReadyToDeliver

Network latency, security parameters and resource limitations, etc.

Class COMMUNICATORexternal ReadyToDeliver(m as MESSAGE) as

Boolean

Page 34: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

MESSAGE DELIVERY Class COMMUNICATOR

Program() = Let availableMsgs = { m | m in me.mailbox where ReadyToDeliver(m)} Let selectedMsgs = chooseSubset (availableMsgs)

forall msg in selectedMsgs me.mailbox(msg) := false //delete the message //resolve the message

let resolvedMesgs = ResolveMessage (msg) forall m in resolveMesgs let a = Recipient(m) if a <> undef then //if recipient found InsertMessage(a, m) //forward the message else skip

. In order to minimize the number of colors needed for a coloring of paths for

pairs of vertices in ,we can divide the path-types in groups such that the total length of the paths for path-types in a group is at most 2D and we have as few groups as possible.

Here we only deal with path-types (h, v) with h > v. This implies that for any path-length L there are (L-1)/2 items to pack.

Page 35: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

REUSE OF THE ACM Reuse of the ACM

XLANG is a real-life application of distributed abstract machines

XLANG is an XML based formal language that can be used to define the data and networking protocols of automated business process.

Page 36: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

SUMMARY ASM are able to simulate every sequential

algorithms in the step for step manner. DASM involves a collection of agents. Agents

may perform their computation steps concurrently with the partially ordered runs.

ASML is an industrial strength language to represent ASMs in industrial environment.

Abstract communication model is based on DASM, implemented in ASML.

The generality of the model has been confirmed by its reuse for different architectures.

Page 37: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation

Thank You!

Page 38: Faculty Of Computer Science Simon Fraser University  Cmpt 880 presentation