Presentation is loading. Please wait.

Presentation is loading. Please wait.

Automated Software Engineering with Concurrent Class Machines Radu Grosu SUNY at Stony Brook joint work with Y. Liu, S. Smolka, S.Stoller, J. Yan SUNY.

Similar presentations


Presentation on theme: "Automated Software Engineering with Concurrent Class Machines Radu Grosu SUNY at Stony Brook joint work with Y. Liu, S. Smolka, S.Stoller, J. Yan SUNY."— Presentation transcript:

1 Automated Software Engineering with Concurrent Class Machines Radu Grosu SUNY at Stony Brook joint work with Y. Liu, S. Smolka, S.Stoller, J. Yan SUNY at Stony Brook

2 Motivation (ASE) Automated OO software development method: OO language for req.specification/modeling/implem, transition semantics capturing OO constructs, trace semantics supporting compositional refinement, analysis exploiting OO structure, generation of optimized (and monitored) code. Close the gap between: object oriented methods (UML,OMT,…), formal methods (Model Checking, Static Analysis,…).

3 Concurrent Class Machines (CCM) 1.Modeling language for concurrent OO systems classes, inheritance, objects, object creation methods, exceptions, multithreading, abstract collection types, nondeterminism. 2. Observational trace semantics class machine refinement, modular reasoning. 3. Code generation and analysis prototype code generation. exploits the hierarchy information (in progress),

4 Readers/Writers Problem Resource Monitor ClientWrCap Thread RdCap m m 1 * res 1 * Class Diagram

5 Classes +Monitor(r:Resource) + acqRd (): void res: Resource; -free: boolean; ar: int; +acqWr(): void + relRd (): void +relWr(): void attributes Call entry point Method signature methods return exit point Monitor

6 Transitions +Monitor(r:Resource) + acqRd () free | ar > 0 -> free := false; ar := ar+1 res: Resource; -free: boolean; ar: int; +acqWr() + relRd () +relWr() transition (atomic) assignments (parallel) guard (blocking) Monitor method can be declared atomic

7 Call Hierarchy (Boxes) +RdCap(m:Monitor) -m: Monitor; -inCS: boolean; +acq():void throws MonExc +rel():void throws MonExc new MonExc ! inCSe +read():int throws MonExc v: int; e:MonExc inCs m.res.read() v e v choice point (nondeterminism) object creation box return variable method invocation box return expression exception exit point local variables RdCap

8 Concurrency +main(): void r: Resource; c: Client -m: Monitor +run(): void Client extends Thread new Resource r new Monitor(r) m new Client(m) c.start new Client(m)c.start c thread start box thread run method c

9 Operational Semantics Transition system A* = (S, s 0,  ) b 0k 0 … b 01 n0n0 f 0k 0 -1 … f 00 f 0k 0 Ctrl Stack Frame Stack t 0 :Thread Attr t0 Object Pool b ik i … b i1 nini f ik i -1 … f i0 f ik i Ctrl Stack Frame Stack … t i :Thread Attr ti … … b 0k 0 … b 01 n’ 0 f 0k 0 -1 … f 00 f’ 0k 0 Ctrl Stack Frame Stack t 0 :Thread Attr’ t0 Object Pool b ik i … b i1 nini f ik i -1 … f i0 f ik i Ctrl Stack Frame Stack … t i :Thread Attr ti … …  t0

10 Method Invocation Box +run(): int r: Resource; i: int -m: Monitor Client r.read() i + read (): int Resource + read (): int RResource v v b b.c … f … Ctrl Stack Frame Stack

11 Method Invocation Box (Call) +run(): int r: Resource; i: int -m: Monitor Client r.read() i + read (): int Resource + read (): int RResource v v b b.c … f … Ctrl Stack Frame Stack b … f … Ctrl Stack Frame Stack cfbfb 

12 Method Invocation Box (Return) +run(): int r: Resource; i: int -m: Monitor Client r.read() i + read (): int Resource + read (): int RResource v v b b.r … f[v/i] … Ctrl Stack Frame Stack b … f … Ctrl Stack Frame Stack rfbfb 

13 Environment (Interface) Objects b.r … f[v/i] … Ctrl Stack Frame Stack Their body is not known and not part of  Allow any update of public objects. The latter are determined via an escape analysis. Allow compositional modeling & reasoning: Static vars, streams… +run(): int r: Resource; i: int -m: Monitor Client r.read() i + read (): int Resource v b

14 Denotational Semantics Execution of CCM m s 0 -> s 1 -> s 2 ->… -> s n s i -> s i+1 is a CCM transition in  or s i -> s i+1 is an environment transition. Set of Traces L m of m Projection of executions on global variables. Object escape analysis is necessary. Refinement m < n Inclusion of the sets of traces L m  L n Compositional w.r.t. beh/arch hierarchies.

15 Modular Reasoning N N’ < N M M < Sub-CCM refinement N M < N M’ Super-CCM refinement M M’ < N N N < M < N M = lfp Fixpoint induction M

16 Wrap Up 1.Modeling language for concurrent OO systems classes, inheritance, objects, object creation methods, exceptions, multithreading, abstract collection types, nondeterminism. 2. Observational trace semantics class machine refinement, modular reasoning. 3. Code generation and analysis prototype code generation. exploits the hierarchy information (in progress),


Download ppt "Automated Software Engineering with Concurrent Class Machines Radu Grosu SUNY at Stony Brook joint work with Y. Liu, S. Smolka, S.Stoller, J. Yan SUNY."

Similar presentations


Ads by Google