Defining Name Accessibility Using Scope Graphs

Aron Zwaan*, Casper Bach Poulsen*

*Corresponding author for this work

Research output: Chapter in Book/Conference proceedings/Edited volumeConference contributionScientificpeer-review

1 Citation (SciVal)
18 Downloads (Pure)

Abstract

Many programming languages allow programmers to regulate accessibility; i.e., annotating a declaration with keywords such as export and private to indicate where it can be accessed. Despite the importance of name accessibility for, e.g., compilers, editor auto-completion and tooling, and automated refactorings, few existing type systems provide a formal account of name accessibility. We present a declarative, executable, and language-parametric model for name accessibility, which provides a formal specification of name accessibility in Java, C#, C++, Rust, and Eiffel. We achieve this by defining name accessibility as a predicate on resolution paths through scope graphs. Since scope graphs are a language-independent model of name resolution, our model provides a uniform approach to defining different accessibility policies for different languages. Our model is implemented in Statix, a logic language for executable type system specification using scope graphs. We evaluate its correctness on a test suite that compares it with the C#, Java, and Rust compilers, and show we can synthesize access modifiers in programs with holes accurately.
Original languageEnglish
Title of host publication38th European Conference on Object-Oriented Programming (ECOOP 2024)
EditorsJonathan Aldrich, Guido Salvaneschi
Place of PublicationWadern
PublisherSchloss Dagstuhl- Leibniz-Zentrum fur Informatik GmbH, Dagstuhl Publishing
Number of pages29
ISBN (Electronic)978-3-95977-341-6
DOIs
Publication statusPublished - 2024
Event38th European Conference on Object-Oriented Programming - Vienna University of Technology, Vienna, Austria
Duration: 16 Sept 202420 Sept 2024
https://2024.ecoop.org/

Publication series

NameLeibniz International Proceedings in Informatics, LIPIcs
Volume313
ISSN (Print)1868-8969

Conference

Conference38th European Conference on Object-Oriented Programming
Abbreviated titleECOOP 2024
Country/TerritoryAustria
CityVienna
Period16/09/2420/09/24
Internet address

Keywords

  • access modifier
  • name resolution
  • scope graph
  • visibility

Fingerprint

Dive into the research topics of 'Defining Name Accessibility Using Scope Graphs'. Together they form a unique fingerprint.

Cite this