Top Banner
Visual Modelling R J Walters
38

Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Visual Modelling

R J Walters

Page 2: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Introduction

Motivation The Language The tools An example Conclusion

Page 3: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Issues in threaded and distributed systems

Connecting the parts

Getting the result to make sense

Page 4: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RaDraw

A tool for generating RolEnact models

Page 5: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Background: RolEnact

A tool for investigating the behaviour of Role based models

First models built using “raw” Enact code

Now has – simplified language– 32 bit implementation

Page 6: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

A RolEnact model running

• Separate (named) window for each instance of a Role • First line inside window shows present state of Role• List of possible actions• Perform an action and all Roles re-evaluate their state

Page 7: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

“Raw” RolEnact code

class Control < Role.class Counter < Role.

Control.addEvent('New_counter).Control.New_counterReady():= self.inState('initial).

Control.New_counterDoit():= (self.setState('initial); self.Counter:= Counter.create(); self.Counter.Control:=self).

Counter.addEvent('Enquire).Counter.EnquireReady():= self.inState('initial) and Account_System.exists('initial).

Counter.EnquireDoit():= (self.setState('waiting ); aRole:=Account_System.choose('initial); aRole.setState('searching ); self.Account_System:=aRole; aRole.Counter:=self).

Page 8: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

New RolEnact code

Create Control.New_counterMe( initial -> initial= )New Counter

End

Selection Counter.EnquireMe( initial -> waiting )Account_System( initial -> searching )

End

Better, but still “too hard” for target users

Page 9: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RaDraw

A friendly front end Displays RE model as code or a

diagram Can build and edit a model Calls RolEnact to run a model

Page 10: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 11: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 12: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 13: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

But

Diagram and code are not equivalent Difficulty with what the diagram means

… I wanted to do something better

Page 14: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RDT

Draw your processes (components) Draw how they are connected Run the model in the execution tool Use a model checker on it - SPIN * Limitations are accepted in exchange

for ease of use

Page 15: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RDT: Processes

Process has state Displayed as a picture Built using system of dialogue boxes 3 types of event

– Receive– Send– Create

Page 16: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RDT: Events, Receive

State 1

State 2

ReceiveEvent Value Channel

Page 17: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RDT: Events, Send

State 1

State 2

SendEvent Value Channel

Page 18: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RDT: Events, Create

State 1

State 2

CreateEvent NewValue Channel

Page 19: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

An example process

Page 20: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

An example process

Page 21: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

RDT: Models

Add instances of processes to your model

Describe how these instances are (initially) connected

Page 22: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Models: Process Instances

Inst1: ProcTypeCh2

Ch1

Inst2: ProcTypeCh2

Ch1

Page 23: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Models: Connections

Inst1: ProcTypeCh2

Ch1

Inst2: ProcTypeCh2

Ch1

Page 24: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Example model

Page 25: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Example model

Page 26: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

What next?

Execute the model

Use a model checker on it

Page 27: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Channels:

Communication in RDT is based on that used in the pi-calculus

Similar identity between values and channels

RDT also permits asynchronous communication

– Need channels in the execution tool

Page 28: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Executing the model

Each Process instance has a window which shows:– Name and type– State– List of available actions– List of local channel names mapping these

to instances of channels

Page 29: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Executing the model

Each Channel (instance) has a window which shows:– Name– List of values held in the channel

Page 30: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

The Execution tool

Page 31: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

The Execution tool

Page 32: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.

Conclusion

Language, model construction tool, execution tool, translation tool

Builds formal models using “informal” methods

Page 33: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 34: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 35: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 36: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 37: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.
Page 38: Visual Modelling R J Walters. Introduction Motivation The Language The tools An example Conclusion.