Saved in:
Bibliographic Details
Main Authors: Pelsmaeker, Daniel A. A., Zwaan, Aron, Bach, Casper, Mooij, Arjan J.
Format: Preprint
Published: 2025
Subjects:
Online Access:https://arxiv.org/abs/2502.19143
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866910846013145088
author Pelsmaeker, Daniel A. A.
Zwaan, Aron
Bach, Casper
Mooij, Arjan J.
author_facet Pelsmaeker, Daniel A. A.
Zwaan, Aron
Bach, Casper
Mooij, Arjan J.
contents Modern Integrated Development Environments (IDEs) offer automated refactorings to aid programmers in developing and maintaining software. However, implementing sound automated refactorings is challenging, as refactorings may inadvertently introduce name-binding errors or cause references to resolve to incorrect declarations. To address these issues, previous work by Schäfer et al. proposed replacing concrete references with locked references to separate binding preservation from transformation. Locked references vacuously resolve to a specific declaration, and after transformation must be replaced with concrete references that also resolve to that declaration. Synthesizing these references requires a faithful inverse of the name lookup functions of the underlying language. Manually implementing such inverse lookup functions is challenging due to the complex name-binding features in modern programming languages. Instead, we propose to automatically derive this function from type system specifications written in the Statix meta-DSL. To guide the synthesis of qualified references we use scope graphs, which represent the binding structure of a program, to infer their names and discover their syntactic structure. We evaluate our approach by synthesizing concrete references for locked references in 2528 Java, 196 ChocoPy, and 49 Featherweight Generic Java test programs. Our approach yields a principled language-parametric method for synthesizing references.
format Preprint
id arxiv_https___arxiv_org_abs_2502_19143
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Language-Parametric Reference Synthesis (Extended)
Pelsmaeker, Daniel A. A.
Zwaan, Aron
Bach, Casper
Mooij, Arjan J.
Programming Languages
Modern Integrated Development Environments (IDEs) offer automated refactorings to aid programmers in developing and maintaining software. However, implementing sound automated refactorings is challenging, as refactorings may inadvertently introduce name-binding errors or cause references to resolve to incorrect declarations. To address these issues, previous work by Schäfer et al. proposed replacing concrete references with locked references to separate binding preservation from transformation. Locked references vacuously resolve to a specific declaration, and after transformation must be replaced with concrete references that also resolve to that declaration. Synthesizing these references requires a faithful inverse of the name lookup functions of the underlying language. Manually implementing such inverse lookup functions is challenging due to the complex name-binding features in modern programming languages. Instead, we propose to automatically derive this function from type system specifications written in the Statix meta-DSL. To guide the synthesis of qualified references we use scope graphs, which represent the binding structure of a program, to infer their names and discover their syntactic structure. We evaluate our approach by synthesizing concrete references for locked references in 2528 Java, 196 ChocoPy, and 49 Featherweight Generic Java test programs. Our approach yields a principled language-parametric method for synthesizing references.
title Language-Parametric Reference Synthesis (Extended)
topic Programming Languages
url https://arxiv.org/abs/2502.19143