Verifying Well-Typedness Preservation of Refactorings using Scope Graphs

Conference Paper (2023)
Author(s)

L. Miljak (TU Delft - Programming Languages)

Casper Bach Poulsen (TU Delft - Programming Languages)

Flip van Spaendonck (Eindhoven University of Technology)

Research Group
Programming Languages
Copyright
© 2023 L. Miljak, C.B. Poulsen, Flip van Spaendonck
DOI related publication
https://doi.org/10.1145/3605156.3606455
More Info
expand_more
Publication Year
2023
Language
English
Copyright
© 2023 L. Miljak, C.B. Poulsen, Flip van Spaendonck
Research Group
Programming Languages
Pages (from-to)
44-50
ISBN (electronic)
9798400702464
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

The goal of automated refactoring is to reduce maintenance effort. To realize this, programmers need to be able to trust or manually check that refactorings actually preserve behavior. To allow programmers to focus on such checks, automated refactorings should preserve program well-typedness. However, historically automated refactorings in popular IDEs could break well-typedness. The reason is that modern languages have complex name binding semantics which makes it hard to guarantee well-typedness in general. In recent work, scope graphs have been proposed as a uniform model for name binding. The model supports complex name binding patterns, and its uniformity makes it attractive to consider for verifying that refactorings preserve well-typedness. This paper explores how to prove that refactorings preserve well-typedness, using scope graphs. We consider a simple refactoring for merging modules in a toy module language, and prove that this refactoring preserves well-typedness. We give a generic template for proving well-typedness preservation using scope graphs, and discuss how this template relates to refactorings more generally.