Session types express and enforce safe communication in concurrent message-passing systems by statically capturing the interaction protocols between processes in the type. Recent works extend session types with arithmetic refinements, which enable additional fine-grained description of communication, but impose additional annotation burden on the programmer. To alleviate this burden, we propose a type inference algorithm for a session type system with arithmetic refinements. We develop a theory of subtyping for session types, including an algorithm which we prove sound with respect to a semantic definition based on type simulation. We also provide a formal inference algorithm that generates type and arithmetic constraints, which are then solved using the Z3 SMT solver. The algorithm has been implemented on top of the Rast language, and includes 3 key optimizations that make inference feasible and practical. We evaluate the efficacy of our inference engine by evaluating it on 6 challenging benchmarks, ranging from unary and binary natural numbers to linear $λ$-calculus. We show the performance benefits provided by our optimizations in coercing Z3 into solving the arithmetic constraints in reasonable time.


翻译:会话类型通过在类型中静态捕获进程间的交互协议,表达并强制并发消息传递系统中的安全通信。近期研究将算术精化扩展至会话类型,使得通信能够进行更细粒度的描述,但同时也给程序员带来了额外的标注负担。为减轻此负担,我们提出了一种支持算术精化的会话类型系统的类型推断算法。我们发展了会话类型的子类型理论,包括一种算法,并证明了该算法相对于基于类型模拟的语义定义是可靠的。我们还提供了一种形式化的推断算法,该算法生成类型与算术约束,随后通过Z3 SMT求解器进行求解。该算法已在Rast语言基础上实现,并包含3项关键优化,使得推断变得可行且实用。我们通过在6个具有挑战性的基准测试(从一元和二元自然数到线性$λ$-演算)上评估我们的推断引擎,验证了其有效性。我们展示了所提出的优化在促使Z3在合理时间内求解算术约束方面带来的性能优势。

0
下载
关闭预览

相关内容

【博士论文】扩展可扩展会话推荐的边界
专知会员服务
13+阅读 · 2025年8月5日
《基于分类方法的自动人机对话》
专知会员服务
25+阅读 · 2023年7月18日
基于会话的推荐方法综述
专知会员服务
29+阅读 · 2023年5月20日
推荐召回算法之深度召回模型串讲
AINLP
22+阅读 · 2019年6月14日
对话系统近期进展
专知
37+阅读 · 2019年3月23日
NLP实践:对话系统技术原理和应用
AI100
34+阅读 · 2019年3月20日
知识在检索式对话系统的应用
微信AI
32+阅读 · 2018年9月20日
最新人机对话系统简略综述
专知
26+阅读 · 2018年3月10日
推荐中的序列化建模:Session-based neural recommendation
机器学习研究会
18+阅读 · 2017年11月5日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Goal Inference from Open-Ended Dialog
Arxiv
0+阅读 · 2月19日
Arxiv
0+阅读 · 1月13日
VIP会员
相关VIP内容
【博士论文】扩展可扩展会话推荐的边界
专知会员服务
13+阅读 · 2025年8月5日
《基于分类方法的自动人机对话》
专知会员服务
25+阅读 · 2023年7月18日
基于会话的推荐方法综述
专知会员服务
29+阅读 · 2023年5月20日
相关资讯
推荐召回算法之深度召回模型串讲
AINLP
22+阅读 · 2019年6月14日
对话系统近期进展
专知
37+阅读 · 2019年3月23日
NLP实践:对话系统技术原理和应用
AI100
34+阅读 · 2019年3月20日
知识在检索式对话系统的应用
微信AI
32+阅读 · 2018年9月20日
最新人机对话系统简略综述
专知
26+阅读 · 2018年3月10日
推荐中的序列化建模:Session-based neural recommendation
机器学习研究会
18+阅读 · 2017年11月5日
相关基金
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
10+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员