一句话:提出基于速率的会话类型与速率兼容性,确保 IoT 消息传递速率一致,并在 Rust 中实现原型。
许多嵌入式与 IoT 系统需周期性重复计算和通信,传统二元会话类型无法刻画这类基于速率的交互。本文提出带周期性递归原语的定时进程演算来建模基于速率的计算与通信,定义基于速率的会话类型及新的速率兼容关系。该关系通过类型展开为不同周期的进程合成并检查公共超周期类型,使类型良好的程序除标准会话类型保证外,还具备速率无差错性。文章证明了类型保持与速率无差错性,给出基于超周期计算的判定性类型检查方法,并将类型系统原型嵌入 Rust,应用于 Android 传感器、可穿戴设备、声音处理及智能手表心率传感器等例子。
We develop a session types framework for implementing and validating rate-based message passing systems in Internet of Things (IoT) domains. To model the indefinite repetition present in many embedded and IoT systems, we introduce a timed process calculus with a periodic recursion primitive. This allows us to model rate-based computations and communications inherent to these application domains. We introduce a definition of rate-based session types in a binary session types setting and a new compatibility relationship, which we call rate compatibility . Programs which type-check enjoy the standard session types guarantees as well as rate error freedom—meaning processes which exchanges messages do so at the same rate . Rate compatibility is defined through a new notion of type expansion, a relation that allows communication between processes of differing periods by synthesizing and checking a common superperiod type. We prove type preservation and rate error freedom for our system and show a decidable method for type checking based on computing superperiods for a collection of processes. We implement a prototype of our type system including rate compatibility via an embedding into the native type system of Rust. We apply this framework to a range of examples from our target domain such as Android software sensors, wearable devices, and sound processing. Our framework is used to implement a heart rate sensor application that runs on a commercially available smartwatch.
@article{IraciCHZ25,
title = {Rate-Based Session Types for IoT Systems},
author = {Grant Iraci and Cheng-En Chuang and Raymond Hu and Lukasz Ziarek},
journal = {ACM Transactions on Programming Languages and Systems},
volume = {47},
number = {3},
year = {2025},
doi = {10.1145/3754449}
}