Modelling Distributed Applications with Mixed-Choice Stateful Typestates

📅 2026-04-08
📈 Citations: 0
Influential: 0
📄 PDF

career value

187K/year
🤖 AI Summary
Traditional typestate systems struggle to capture quantitative constraints—such as quorum requirements—and concurrent I/O behaviors inherent in distributed protocols, and they lack resilience to runtime network failures. This work proposes a probabilistic runtime verification approach that integrates mutable internal state, hybrid session mechanisms, and expected action ratios into an extended typestate model. The resulting framework enables dynamic modeling and monitoring of critical properties like concurrent message exchange and quorum satisfaction. Evaluated on commit and voting-based consensus protocols, the method effectively detects runtime behavioral deviations, significantly enhancing the expressiveness and practical applicability of typestate reasoning in distributed systems.

Technology Category

Application Category

📝 Abstract
Distributed systems have become increasingly prevalent in the software industry. Due to their intrinsic complexity, much research has focused on the verification of their behaviour. An active research line is around behaviour models that capture these protocols - e.g., session types, or typestates - allowing their static verification. Correctly designing distributed protocols is not trivial. Their communication behaviour is typically implicitly defined via asynchronous message handlers, making errors harder to detect until execution. While typestates can ease the design process by explicitly defining correct sequences of operations, they struggle in two ways: they lack the expressiveness to define quantitative constraints that govern distributed protocols (i.e., number of acknowledgements for a quorum); and they assume strict sequencing of operations, failing to capture concurrent input/output actions in a state, typical of the distributed setting. Furthermore, runtime network failures cannot be statically verified. We present a probabilistic runtime solution extending typestates with: (i) an internal mutable state for the expression of quantitative constraints; (ii) mixed sessions to represent concurrent input and output actions; (iii) expected ratios for the number of actions in a state, with monitoring semantics to detect deviations from an expected behaviour at runtime. We demonstrate the suitability of our solution with two examples that motivated our approach: an acknowledgement protocol with a participant that sends several messages while waiting for a response, effectively modelling input and output operations in a state; and a voting protocol whose participants try to achieve consensus on a single bit using a quorum, thus, requiring an internal mutable state, while respecting a pre-defined distribution for the volume of exchanged messages.
Problem

Research questions and friction points this paper is trying to address.

distributed systems
typestates
concurrent I/O
quantitative constraints
runtime verification
Innovation

Methods, ideas, or system contributions that make the work stand out.

mixed-choice typestates
probabilistic runtime monitoring
quantitative constraints
concurrent I/O actions
distributed protocol verification
🔎 Similar Papers
No similar papers found.