Typestates are state machines used in object-oriented programming to specify and verify correct order of method calls on an object. To avoid inconsistent object states, typestates enforce linear typing, which eliminates - or at best limits - aliasing. However, aliasing is an important feature in programming, and the state-of-the-art on typestates is too restrictive if we want typestates to be adopted in real-world software systems. In this paper, we present a type system for an object-oriented language with typestate annotations, which allows for unrestricted aliasing, and as opposed to previous approaches it does not require linearity constraints. The typestate analysis is global and tracks objects throughout the entire program graph, which ensures that well-typed programs conform and complete the declared protocols. We implement our framework in the Scala programming language and illustrate our approach using a running example that shows the interplay between typestates and aliases.


翻译:类型是用于目标导向程序以具体和核实对对象进行正确方法顺序的国有机器。 为了避免对象状态不一致, 类型状态强制进行线性打字, 从而消除( 或充其量消除)别名。 但是, 化名是编程中的一个重要特征, 而关于类型状态的最新工艺太严格, 如果我们想要在现实世界软件系统中采用类型状态, 我们就会在格式化软件系统中使用。 在本文中, 我们为对象导向语言提供了一种类型化语言的类型系统, 带有类型化说明, 允许不受限制的别名, 与以前的方法相比, 它不需要线性限制 。 类型状态分析是全球性的, 在整个程序图中跟踪对象, 以确保正确类型的程序符合和完成所宣布的协议。 我们用 Scala 程序语言执行我们的框架, 并用显示类型和别名之间相互作用的运行示例来说明我们的方法 。

0
下载
关闭预览

相关内容

Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
强化学习最新教程,17页pdf
专知会员服务
171+阅读 · 2019年10月11日
【新书】Python编程基础,669页pdf
专知会员服务
187+阅读 · 2019年10月10日
机器学习相关资源(框架、库、软件)大列表
专知会员服务
38+阅读 · 2019年10月9日
【哈佛大学商学院课程Fall 2019】机器学习可解释性
专知会员服务
100+阅读 · 2019年10月9日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
已删除
将门创投
10+阅读 · 2019年3月6日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
推荐|Andrew Ng计算机视觉教程总结
全球人工智能
3+阅读 · 2017年11月23日
Arxiv
6+阅读 · 2016年1月15日
VIP会员
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
已删除
将门创投
10+阅读 · 2019年3月6日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
计算机视觉近一年进展综述
机器学习研究会
8+阅读 · 2017年11月25日
推荐|Andrew Ng计算机视觉教程总结
全球人工智能
3+阅读 · 2017年11月23日
Top
微信扫码咨询专知VIP会员