Papaya: Global Typestate Analysis of Aliased Objects
Autor: | Mathias Jakobsen, Alice Ravier, Ornela Dardha |
---|---|
Rok vydání: | 2021 |
Předmět: |
Object-oriented programming
Finite-state machine Computer science Scala Programming language 020207 software engineering 02 engineering and technology typestate computer.software_genre Object (computer science) verifcation TheoryofComputation_LOGICSANDMEANINGSOFPROGRAMS 020204 information systems Typestate analysis 0202 electrical engineering electronic engineering information engineering Feature (machine learning) Scala programming language protocol Software system Aliasing (computing) computer computer.programming_language |
Zdroj: | PPDP |
DOI: | 10.1145/3479394.3479414 |
Popis: | 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. |
Databáze: | OpenAIRE |
Externí odkaz: |