PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
April 10, 2026Electronic Proceedings in Theoretical Computer Science0 citationsOpen Access

Modelling Distributed Applications with Mixed-Choice Stateful Typestates

FPFrancisco ParrinhaUniversidade Nova de LisboaJMJoão MotaUniversidade Nova de LisboaARAntónio RavaraUniversidade Nova de Lisboa

Key Points

  • The aim is to improve the verification of distributed protocols by extending traditional typestates.
  • Introduced a probabilistic runtime solution that extends typestates.
  • Implemented internal mutable states to express quantitative constraints.
  • Developed mixed sessions for concurrent input and output actions.
  • Monitored expected ratios for actions and detected deviations at runtime.
  • Demonstrated the method with an acknowledgment protocol modeling concurrent actions.
  • Showed effectiveness in a voting protocol for achieving consensus while managing message volumes.

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.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Parrinha et al. (2026) studied this question.

synapsesocial.com/papers/69d895486c1944d70ce062f7https://doi.org/10.4204/eptcs.444.3
Ask AI
Helpful
Bookmark
Share
View Full Paper