Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model
Elements form a linear queue where head points to the front, next to the subsequent element, and tail to the back of the queue Figure 1: Type graph for CPM’s configurations as class diagram with constraints, where we assume disjoint finite sets of variable names (p1, . . . ,x1 . . . ), and reference names (r1, . . . ); let Meth be a finite set of method names, and Z be the set of integer numbers, B of Booleans; the cardinality of association edges is if not noted otherwise; the different regions highlight the different modules of the model each local processor advances as far as possible. Note that the walking of the control-flow graph and the scheduler are generic, i.e. represented by a set of GTS rules independent of the SCOOP program. We refer to [26] for the full formal model directly represented as GTS (that can be browsed and simulated with GROOVE). Modularity of CPM Configurations of CPM, i.e. global states of the system, can be partitioned into four main parts, which are also visible in Figure 1: (i) a representation of the underlying SCOOP program in the form of a control-flow graph; (ii) a system of concurrently running processors, each one possibly handling a request; these processors represent the system state; (iii) a waiting queue for each processor that stores pending requests; (iv) local memory state for each processor. The control flow component can be derived directly from the original CoreSCOOP program’s control flow graph (at a pre-compilation step) and its structure does not dynamically change, contrary to the state of the run-time environment (processors, queues, data). This partitioning is also mirrored by the GTS’s underlying rules that treat the walking of the control flow graph separately from the queue’s policies, the management of the memory, and global scheduling. The fixed simple interfaces (in form of the model components’ loose coupling due to the typed associations queue, handler, currentState, and requestType) between these modules allow us to plug in different behaviours for each module, e.g. different queueing semantics. Thus we can either adapt different existing SCOOP semantics (e.g. FIFO queues versus queues of queues [29]) or directly apply abstraction mechanisms in the context of verification (e.g. a counting abstraction of the queue’s content, or predicate abstraction for the data) by small modular changes to the underlying rules. Furthermore, the global abstract scheduling rules can be parameterised in this way, e.g. to include different kinds of garbage collection in the global scheduler or different rule prioritisations that keep the state space small, such as always preferring to terminate processors that are currently in a final state. i : ti l i it t i t , i j i t it t i l , . . . , . . . , , . . . ; l t t it t t , t t i t , l ; t i lit i ti i i t t t i ; t i t i i li t t i t l t l 38 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model 4 Simulating CPM in GROOVE We realised CPM—our run-time model for CoreSCOOP—in GROOVE, an established tool for simulating and analysing GTS-based semantics. This section describes how we approached and achieved this task. First, we justify our choice of GROOVE, and then show (by example) how CPM configurations, rules, and rule applications are represented in the tool. Finally, we discuss the issue of CPM’s soundness. The GTS Tool GROOVE We chose GRaphs for Object-Oriented VErification (GROOVE) [14, 13] as our platform to implement and analyse the CPM models. Most existing GTS tools are in theory expressive enough to cover CPM. GROOVE however was already applied for the analysis of (non-concurrent) object-oriented programs in Java [24]. Furthermore, GROOVE contains a (finite-state) model checker that has proven sufficient for the analysis and verification of dynamic state systems [7, 18]. As reported in [31], GROOVE can typically handle systems with up to 4 million states, which should leave enough room for our first experiments. Finally, GROOVE convinced us with a gentle learning curve, its ease of adaption and extension to our needs, as well as its active development community. Representing CPM Configurations in GROOVE CPM configurations are represented in GROOVE quite straightforwardly, with control-flow, system state, waiting queue(s), and memory state (as in the type graph of Figure 1) all encoded in the same graph. 8 Towards Practical Graph-Based Verification for an Object-Oriented Concurrency Model A. Heusner, C.M. Poskitt, C. Corrodi, and B. Morandi 9 Data_Var name = v_3 value = 1 State Ref_Var name = r_1 Action assign var = v_1 State Data_Var name = v_1 value = 1
Read more