Language-Parametric Reference Synthesis (Extended)

📅 2025-02-26
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
Modern IDEs’ automated refactoring frequently introduces name-binding errors due to the difficulty of precisely resolving reference targets under complex language binding semantics. To address this, we propose a type-system-driven approach for automatically generating inverse name-lookup functions. Our method models language type specifications using the Statix meta-DSL and leverages scope graphs to infer the syntactic structure and scoping relationships of valid references—yielding, for the first time, a language-parametric reference synthesis framework. It replaces concrete references in refactorings with semantically locked abstract references and generates equivalent concrete references on demand. We validate correctness and cross-language generality on 2,528 Java, 196 ChocoPy, and 49 Featherweight Generic Java programs. Results demonstrate significant improvements in refactoring safety and tool portability across diverse type systems.

Technology Category

Natural Language Processing: Code Generation / Program Synthesis from Natural LanguageConstraint Satisfaction and Optimization: Satisfiability Modulo TheoriesCognitive Modeling & Cognitive Systems: Conceptual Inference and Reasoning

Application Category

Graph Algorithms and Modeling for the Web: Efficient manipulation of static and dynamic Web-related graphsSemantics and Knowledge: Scalable techniques for the creation, curation, publication, maintenance, and consumption of large, Web-based, structured, reusable, knowledge graphs and ontologiesSystems and Infrastructure for Web, Mobile and WoT: Applied ML and AI for Web-based mobile applications
📝 Abstract
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""afer 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.
Problem

Research questions and friction points this paper is trying to address.

Automated refactorings in IDEs introduce name-binding errors
Manual inverse lookup functions are complex and error-prone
Automatic derivation of inverse lookup from type specifications
Innovation

Methods, ideas, or system contributions that make the work stand out.

Automated refactorings in IDEs
Locked references for binding preservation
Scope graphs for reference synthesis
🔎 Similar Papers
No similar papers found.