Context-free session types provide a typing discipline for recursive structured communication protocols on bidirectional channels. They overcome the restriction of regular session type systems to tail recursive protocols. This extension enables us to implement serialisation and deserialisation of tree structures in a fully type-safe manner. We present the theory underlying the language FreeST 2, which features context-free session types in an extension of System F with linear types and a kind system to distinguish message types and channel types. The system presents some metatheoretical challenges, which we address, contractivity in the presence of polymorphism, a non-trivial equational theory on types, and decidability of type equivalence. We also establish standard results on type preservation, progress, and a characterisation of erroneous processes.
翻译:无上下文会话类型为双向频道的循环结构通信协议提供了打字纪律,克服了定期会话类型系统对尾端递现协议的限制。这一扩展使我们能够以完全安全的方式对树结构进行序列化和脱序。我们提出了F系统扩展的F系统中无上下文会话类型的理论,包括线性类型和区分电文类型和频道类型的一种系统。这个系统提出了一些元理论挑战,我们在出现多种形态时处理这些挑战,在出现多种形态时采用合同性,在类型上采用非三边式等式理论,在类型等同性上降低等同性。我们还确定了关于类型保护、进步和错误过程特征的标准结果。