Collaborative State Machines is a distributed programming model for the computing continuum1. It represents distributed applications as state machines that can be deployed across resources throughout the continuum. The model is designed for reactive, stateful, and highly dynamic applications that must operate in heterogeneous environments.
While CSM defines the abstract programming model, its applications are expressed in the associated language, CSML. Like the model itself, CSML is abstract and can be realized in different ways, for example through serialization formats or domain-specific languages. In these specifications, we describe CSML and the CSM concepts using the Pkl-based implementation of CSML employed by the official runtime system, Cirrina.
Within CSML a description consists of constructs, such as those describing a collaborative state machine, state machine and state. A construct consists of one or multiple keywords.
CSM Description
Figure 1: An example of a CSM description. Components can have data represented by {...}.
CSML is used to create CSM descriptions. A description represents the static structure of an application that is executable by a CSM runtime system.
A CSM description takes the form of a tree structure. At its root is a collaborative state machine, encompassing one or more state machines. A state machine contains one or more states. These fundamental entities, collaborative state machine, state machines, and states, are called components. Every component can declare local and persistent (globally accessible) data.
Figure 1 above illustrates a CSM tree structure. The presented collaborative state machine has two state machines, $SM_1$ and $SM_2$, along with a nested state machine denoted as $SM_{21}$. Every state machine has two atomic states. The data variables of all components are represented by $a, \ldots, h$.
-
We refer to the computing continuum as the infrastructure spanning cloud, edge, and IoT layers. ↩