dynamically creating objects and sequencing operations
Download
Skip this Video
Download Presentation
Dynamically creating objects and sequencing operations

Loading in 2 Seconds...

play fullscreen
1 / 20

dynamically creating objects and sequencing operations - PowerPoint PPT Presentation


  • 188 Views
  • Uploaded 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 …

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

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
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
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
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
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
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
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
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
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
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
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
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
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
Mapping (i)

[[Q]] = !IQ

IQ = qu.BQ

thus

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

WG2.3 Niagara 2005-06-06

mapping ii
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
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
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
Technical issue(s)
  • failure(s)
    • in two senses
  • internal choice (vs. external)
    • divergence(s)

WG2.3 Niagara 2005-06-06

implementation questions
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
So, sequencing operationsVDM + OO + -calculus(held together by reification)

WG2.3 Niagara 2005-06-06

ad