Dynamically creating objects and sequencing operations
Download
1 / 20

dynamically creating objects and sequencing operations - PowerPoint PPT Presentation


  • 188 Views
  • Updated On :

Dynamically creating objects and sequencing operations. Cliff Jones University of Newcastle 2005-06-06. On the expectation of a WG2.3 topic. in the tradition of 2.3, this is something I’m trying to sort out for myself but …

Related searches for dynamically creating objects and sequencing operations

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'dynamically creating objects and sequencing operations' - Faraday


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Dynamically creating objects and sequencing operations l.jpg

Dynamically creating objects and sequencing operations

Cliff Jones

University of Newcastle

2005-06-06

WG2.3 Niagara 2005-06-06


On the expectation of a wg2 3 topic l.jpg
On the expectation of a WG2.3 topic

  • in the tradition of 2.3, this is something I’m trying to sort out for myself

  • but …

  •  apparently it is now expected to work up from the (legacy) code 

WG2.3 Niagara 2005-06-06


Pool example l.jpg

class stack

var …

method push(i: item) …

method pop() : item …

body

%% initialize

do %% forever

if … then answer(push)

else answer(pop, push)

fi

od

POOL example

WG2.3 Niagara 2005-06-06


Oo like structuring in specifications l.jpg
OO-like structuring in specifications

  • I’d like to look at two issues

    • how to sequence “operations”

    • how to “create objects”

  • first some background

WG2.3 Niagara 2005-06-06


A dichotomy l.jpg
A dichotomy

  • state based specification techniques

    • VDM, Z, B, agent-B

    • good for big systems; understand from data

      • one can “see” (or design) a system from Σ

  • process algebras

    • CSP, CCS, -calculus

    • states as process indices (but another notion below)

    • good for intricate sequencing (e.g. deadlocks)

WG2.3 Niagara 2005-06-06


My interest specification and development l.jpg
My interest:(specification and) development

  • can be done in, say, CSP

    • CCS etc goes more for bi-simulation

  • but it has always felt more natural to

    • get an abstract state-based spec

    • reify data

    • decompose operations

    • and next: “splitting atoms”

      • cf. CBJ’s Prato talk

WG2.3 Niagara 2005-06-06


Modularising state based specs l.jpg
Modularising state based specs

  • VDM

    • initially none

    • “operation quotation”

    • VVSL (as in CDIS)

    • VDM++ (as in VDM ToolSet)

  • Z

    • everything is a schema

    • no pre-conditions!

  • B

    • machines/operations

WG2.3 Niagara 2005-06-06


Sequencing operations l.jpg
Sequencing operations

  • VDM

    • all, always available

    • pre-conditions are to be respected

      • one proves this!

    • but there is a procedural language as well!

  • B

    • originally “operations” (pre P then S end)

  • “action systems”/ Event-B

    • “when conditions” define firing

WG2.3 Niagara 2005-06-06


Oo is a goodthing in design l.jpg
OO is a GoodThing (in design)

  • sometimes as essence of system

    • come back to how modelled?

  • sometimes as an implementation idea

    • CBJ used several times as “reification”

  • modularisation (better than many specification languages)

  • control of interference

    • local instance variables

    • unique references create “islands” of computation

    • shared references when interference necessary

  • option to control sequencing

WG2.3 Niagara 2005-06-06


Look at combining processes states l.jpg
Look at combining processes/states

  • done in Ada

    • by Abrial!!

  • POOL

  • 

    • dropped (after MIW’s observation)

WG2.3 Niagara 2005-06-06


So two ways of sequencing l.jpg
So, two ways of sequencing

  • process descriptions

    • in the style of POOL

  • guards

    • “when” in Event-B

    • possible to “hack” at this level – abstract PC

  • I’d like to view them as refinements

    • in either direction

    • would combinations be useful?

  • … but I want to achieve even more …

WG2.3 Niagara 2005-06-06


Slide12 l.jpg
obl

  • language itself

    • typed references

    • recognise “unique” references

    • no inheritance (yet)

  • see as design notation (cf. VDM sequential)

    • use with implemented OOLs (e.g. Eiffel)

  • semantics (as basis of “meta” proofs)

    • SOS

    • map to -calculus

WG2.3 Niagara 2005-06-06


Slide13 l.jpg
obl

Sortclass

vars v: nat  nil; l: unique ref(Sort)  nil

insert(x: nat) method

return;

if is-nil(v) then (v  x; l new Sort)

elif v  x then l.insert(x)

else (l.insert(v); v  x)

fi

test(x: nat) method: Bool

if is-nil(l)  x  v then return false

elif x = v then return true

else delegate l.test(x)

fi

.

.

.

endSort

WG2.3 Niagara 2005-06-06


Mapping i l.jpg
Mapping (i)

[[Q]] = !IQ

IQ = qu.BQ

thus

[[new Q]] = q(u). …

WG2.3 Niagara 2005-06-06


Mapping ii l.jpg
Mapping (ii)

IQ =

\New{\widetilde{s}\widetilde{a}}

(v\sb{nil} | l\sb{nil} |

\outp{q}{u}. B\sb{Q})

WG2.3 Niagara 2005-06-06


We have l.jpg
We have

  • a nice mapping  to -calculus

  • new C maps to a reference to replication

    • strictly, a communication with a name inside a replicator which cause a new instance to exist

  • we can therefore have dynamic creation of objects/machines/…

WG2.3 Niagara 2005-06-06


Contrast l.jpg
Contrast …

  • Michael Butler’s paper

    • tokens  Cust  {0..sx} in the “specification”

    • a strange (twin) SOS

  • cbj’s SOS of COOL

    • map Oid to ObjInfo

      • is a semantic object

      • the SOS rules create this mapping

  • so my semantics of POOL

    • would look rather different from Michael’s

    • might have a “program counter” into process expression!!

WG2.3 Niagara 2005-06-06


Technical issue s l.jpg
Technical issue(s)

  • failure(s)

    • in two senses

  • internal choice (vs. external)

    • divergence(s)

WG2.3 Niagara 2005-06-06


Implementation questions l.jpg
Implementation questions

  • CSP handshake is non-trivial

  • Event-B’s “when” clause looks less efficient than CARH’s “monitors”

    • assuming …

WG2.3 Niagara 2005-06-06


So sequencing operations vdm oo calculus held together by reification l.jpg
So, sequencing operationsVDM + OO + -calculus(held together by reification)

WG2.3 Niagara 2005-06-06


ad