面向定时消息传递协议的语义逻辑关系(扩展版)
Semantic Logical Relations for Timed Message-Passing Protocols (Extended Version)
AI总结:
本文提出一种完全语义的逻辑关系来验证异构消息传递系统是否遵守定时协议,并开发细化类型系统及Rust类型检查器,通过智能家居案例展示了任意良好类型程序的一次性验证和特定外部代码的逐实例验证两种模式。
摘要:
当今的许多消息传递系统不仅要求消息以特定顺序交换,还要求消息在特定时间或特定时间窗口内发生。这类正确性条件在物联网(IoT)和实时系统应用中尤为突出,这些应用与具有固有时间约束的硬件设备进行交互。验证此类系统是否符合预期的定时协议,面临着系统异构性的挑战——这排除了任何依赖系统以某种通用语言实现、更不用说以高级类型化编程语言实现的验证方法。为应对这一挑战,本文提出了一种逻辑关系,用于验证其成员(待证明正确的应用程序和硬件设备)是否遵守给定的定时协议。为了适应系统的异构性,该逻辑关系完全是语义性的,从而不再要求其成员在语法上具有良好的类型。语义方法使得该逻辑关系可用于程序验证的两种模式:(i)在给定类型系统的情况下,对任意良好类型的应用程序进行一次性验证;(ii)对特定应用程序或硬件设备(即外部代码)进行逐实例验证。为支持模式(i),本文开发了一种细化类型系统,用于表达定时消息传递协议,并证明了任何良好类型的程序都满足该逻辑关系(基本定理)。该细化类型系统的类型检查器已在Rust中实现,并使用SMT求解器检查时间约束的可满足性。随后,本文基于一个监测空气质量的小型智能家居系统案例研究,展示了这两种使用模式,该系统由一个控制器应用程序和多个环境传感器组成。
英文摘要:
Many of today's message-passing systems not only require messages to be exchanged in a certain order but also to happen at a certain \emph{time} or within a certain \emph{time window}. Such correctness conditions are particularly prominent in Internet of Things (IoT) and real-time systems applications, which interface with hardware devices that come with inherent timing constraints. Verifying compliance of such systems with the intended \emph{timed protocol} is challenged by their \emph{heterogeneity} -- ruling out any verification method that relies on the system to be implemented in one common language, let alone in a high-level and typed programming language. To address this challenge, this paper contributes a \emph{logical relation} to verify that its inhabitants (the applications and hardware devices to be proved correct) comply with the given timed protocol. To cater to the systems' heterogeneity, the logical relation is entirely \emph{semantic}, lifting the requirement that its inhabitants are syntactically well-typed. A semantic approach enables two modes of use of the logical relation for program verification: (i) \emph{once-and-for-all} verification of an \emph{arbitrary} well-typed application, given a type system, and (ii) \emph{per-instance} verification of a specific application / hardware device (a.k.a. foreign code). To facilitate mode (i), the paper develops a refinement type system for expressing timed message-passing protocols and proves that any well-typed program inhabits the logical relation (fundamental theorem). A type checker for the refinement type system has been implemented in Rust, using an SMT solver to check satisfiability of timing constraints. Then, the paper demonstrates both modes of use based on a small case study of a smart home system for monitoring air quality, consisting of a controller application and various environment sensors.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。