Download Deliverable 5.2 - Evaluation of Core Framework
Transcript
HATS Deliverable D5.2
Evaluation of Core Framework
class D(I i) implements J {
Bool l = True;
Unit run() {
Fut<Bool> c;
While (l) { c = i!getBool(); await c?; }
}
Unit finish() { l = False; }
Bool getBool() { return True; }
}
class W(J j) implements X {
Unit run() {
Fut<Bool> b; b = j!getBool(); await b?;
j.finish();
}
}
{ I c; J d; X w; c = new C(); d = new D(c); w = new W(d); }
This model is non-terminating because when the Maude engine simulates this model, it is possible for
the simulation to choose an execution path that never gives thread control to object w. Note that it
only affects model simulation. Other analysis techniques such as symbolic execution or model checking
are not affected as these techniques traverse all possible execution paths. In particular, the example
model above is finite state and therefore would be amenable to model checking.
• Syntactic Sugaring – To model communications between active objects in ABS we often define the
following sequence of statements in an active object to model invoking method async() of object obj
asynchronously, yielding the thread control of its object group and blocking its own execution until
the method call returns.
A val; Fut<A> f; f = obj!async(); await f?; val = f.get;
We believe the usability of the language could be improved by providing syntactic sugaring to this
kind of patterns of behaviours.
• Non-determinism – With socket-based communication, the order between two or more consecutive
asynchronous messages to the same socket is maintained. The order is maintained via the implementation of input and output stream buffers of the sockets. With the ABS semantics, however, scheduling
is non-deterministic. As a result, the order of asynchronous method invocation has to be maintained
explicitly. For example consider the following example ABS model.
interface I { Unit put(Int i); }
class C implements I {
List<Int> ints = Nil;
Unit put(Int i) { ints = Cons(i,ints); }
}
class D(I obj) {
Unit run() {
Int i = 1;
while (i < 100) { obj!put(i); i = i + 1; }
}
106