计算机科学 > 程序设计语言
[提交于 2021年7月27日]
标题:Papaya: Global Typestate Analysis of Aliased Objects Extended Version
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Mathias Jakobsen[v1] 2021年7月27日 星期二 23:04:55 UTC