• No results found

Components and Connections between them

N/A
N/A
Protected

Academic year: 2022

Share "Components and Connections between them"

Copied!
26
0
0

Loading.... (view fulltext now)

Full text

(1)

Architecture modeling in Calculus of Communicating Systems (CCS)

Structure and Interactions

Rushikesh K Joshi

Department of Computer Science and Engineering Indian Institute of Technology Bombay

(2)

Outline

1 About the CCS Approach

2 The calculus

3 Semantics

4 Readings

(3)

Outline

1 About the CCS Approach

2 The calculus

3 Semantics

4 Readings

(4)

Components and Connections between them

Components are seen as Agents in CCS

No separate abstraction is provided for connections

If connections need to have behavior of their own, they are modeled as agents.

A send of an agent and a corresponding receive act

together as an indivisible (Atomic) action.. there is no delay or separation between them.

(5)

Abilities of CCS

Agent are expressed through agent expressions Agents have input and output ports

Agents perform input and output actions on ports Agent Expressions can be sequences of these actions Agent Expressions make use of non-determinism

Agents can be composed together to form bigger systems and so on

Before composing a system with another, some ports can be hidden

Before composing a system with another, some ports can be renamed

(6)

Outline

1 About the CCS Approach

2 The calculus

3 Semantics

4 Readings

(7)

Agent expressions: actions, sequences and connections

Client=req.rep.Client Server =req.rep.Server System=Client|Server

A non-terminating system of client and server rep, req areinput actionson input ports rep,reqareoutput actionson output ports dot operator calledprefix combinatormakes a sequences of actions

|operator calledcomposition combinatormakes a composition of two agents, connecting the corresponding input and output ports

(8)

Agent expressions: Non-determinism

Client1=req1.rep1.Client1 Client2=req2.rep2.Client2

Server = (req1.rep1+req2.rep2).Server System=Client1|Client2|Server

A non-terminating system of 2 clients and a server The server may pick up any of its inputs

+ is thesummation combinatorwhich represents a non-deterministic choice between two agent

sub-expressions. Once a choice is made, the expression must be completely executed.

(9)

Outline

1 About the CCS Approach

2 The calculus

3 Semantics

4 Readings

(10)

The state machine (transition diagram) of the client

Client=req.rep.Client

req→rep→req→rep→...

(11)

The state machine of the server

Server =req.rep.Server

req→rep→req→rep→...

(12)

The state machine of the composition

Client=req.rep.Client Server =req.rep.Server System=Client|Server

Client and Server may proceed independently or communicate via corresponding actions

(13)

Transitions including τ actions

A=p.A0 A0 =q.A B=q.B0 B0 =r.B System= (A|B)

We know thatA→p A0,B→q B0,A0q A, andB0r B, SoA|B→p A0|B. Similarly,A|B→q A|B0

AlsoA0|B→q A|B. Similarly,A0|B→q A0|B0

We also have aτ action, due to which,A0|B→τ A|B0 Similarly, work out other possible transitions?

(14)

τ actions

τ action represents a handshake It’s a perfect (completed) action

It is not visible like the other actions that are visible Visible actions can be used in a subsequent composition with another agent

τ action is also calledunobservable action

Whenever a pair of complementary actions(a,a)is possible in a composite agent, aτ action is possible

(15)

The Restriction Operator ’\’

Client=req.rep.Client Server =req.rep.Server System= (Client|Server)\{req,rep}

Independent actionsreq,req,rep,repare restricted (prohibited), only theτ actions occur inside the composition.

The restricted ports are also not available for further composition with other agents

Both input and output ports corresponding to names in restriction set are restricted

(16)

Exercise

UI=input.rpc_request.rpc_reply.print_result.0

BL=rpc_request.log_request.rpc_reply.0

System= (UI|BL)\{rpc_request,rpc_reply}

Build the transition diagram (state machine) for agent ’System’?

(17)

Exercise

Build CCS agent expressions which result in the above State transition diagram. ?

(18)

Exercise

Build CCS agent expressions which result in the above State transition diagram. ?

(19)

Exercises

Build CCS expressions representing the following architectural patterns: (1) OR split (2) OR join (2) AND split (3) AND join (4) MVC (5) 3-tiered architecture (6) Semaphore Synchronization

(20)

Exercise: Semaphore Synchronization- fill in the blanks?

Sem=...??

Client_1=p.start_print.end_print.v.Client_1

Client_2=...??

System= (Client_1|Client_2|Sem)\{...??}

(21)

Value passing CCS

Client1=req(1).rep1.Client1 Client2=req(2).rep2.Client2

Server =req(v).if(v =1)rep1.Server else rep2.Server System=Client1|Client2|Server

we can eliminate some ports

(22)

Relabeling of Agents

Client1=req1.rep1.Client1

Client2=Client1[req2/req1,rep2/rep1]

Server =req1.rep1.Server+req2.rep2.Server System=Client1|Client2|Server

we can reuse agent expressions

(23)

Agent that diverts the odds from the evens

Diverter=req(v).if (v%2)req1.Diverter else req2.Diverter

(24)

Abstracting the Diverter by removing value passing

Diverter=req(v).Diverter0

Diverter0 =req1.Diverter+req2.Diverter

In the architectural abstraction, we bring in all possibilities and remove computation (as much as possible).

Abstract out conditional interactions as possibilities through non-determinism

(25)

Outline

1 About the CCS Approach

2 The calculus

3 Semantics

4 Readings

(26)

Readings

Robin Milner, Communication and Concurrency, Prentice Hall, 1989.

David Walker, Introduction to Calculus of Communicating Systems, Technical Report, University of Edinburgh, 1987.

References

Related documents

The recurrent connections in the LSTM layer are directly from the cell output units to the cell input units, input gates, output gates and forget gates. The cell output units are

As this network has one or more layers between the input and the output layer, it is called hidden layers..

• Physical components of a computer, such as CPU, Memory, Input and Output devices, Auxiliary storage devices.. • The hardware components include devices that perform the functions

If there is a difference between the dc bias currents for the same applied input, then this also causes an output offset voltage:. • The effect on the output can be calculated

 With Early effect, the impedance seen at the collector is equal to the intrinsic output impedance of the transistor (if emitter is grounded)..

The synchro transmitter – control transformer pair thus acts as an error detector giving a voltage signal at the rotor terminals of the control transformer proportional to the

A closed loop control system compares the output with the expected result or command status, then it takes appropriate control actions to adjust the input signal.. Therefore, a

In this model, a system was established between the output data, speed (S) and input data such as various highway geometric elements i.e., radius of