Grove: A Bidirectionally Typed Collaborative Structure Editor Calculus
Michael D. Adams, Eric Griffis, Thomas Porter, Sundara Vishnu Satish, Eric Zhao, Cyrus Omar
Abstract
Version control systems typically rely on a patch language, heuristic patch synthesis algorithms like diff, and three-way merge algorithms. Standard patch languages and merge algorithms often fail to identify conflicts correctly when there are multiple edits to one line of code or code is relocated. This paper introduces Grove, a collaborative structure editor calculus that eliminates patch synthesis and three-way merge algorithms entirely. Instead, patches are derived directly from the log of the developer's edit actions and all edits commute, i.e. the repository state forms a commutative replicated data type (CmRDT). To handle conflicts that can arise due to code relocation, the core datatype in Grove is a labeled directed multi-graph with uniquely identified vertices and edges. All edits amount to edge insertion and deletion, with deletion being permanent. To support tree-based editing, we define a decomposition from graphs into groves, which are a set of syntax trees with conflicts-including local, relocation, and unicyclic relocation conflicts-represented explicitly using holes and references between trees. Finally, we define a type error localization system for groves that enjoys a totality property, i.e. all editor states in Grove are statically meaningful, so developers can use standard editor services while working to resolve these explicitly represented conflicts. The static semantics is defined as a bidirectional marking system in line with recent work, with gradual typing employed to handle situations where errors and conflicts prevent type determination. We then layer on a unification-based type inference system to opportunistically fill type holes and fail gracefully when no solution exists. We mechanize the metatheory of Grove using the Agda theorem prover. We implement these ideas as the Grove Workbench, which generates the necessary data structures and algorithms in OCaml given a syntax tree specification.
CCS Concepts: • Software and its engineering Ñ General programming languages; Syntax; Software configuration management and version control systems.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 71a67768-b13c-4a6d-b52a-ac7f249f00b3Cited by top-tier papers3
- Denicek: Computational Substrate for Document-Oriented End-User ProgrammingTomas Petricek, Jonathan EdwardsUIST 2025 · 2 citations
- Direct Manipulation and Natural Language Programming, Together at Last?Parker Ziegler, David Minh-Duy Cao, Justin Lubin, Sarah E. ChasinsOOPSLA 2026
- Interactive Data Analysis with Lively Typed TablesAlexander Bandukwala, Cyrus OmarOOPSLA 2026
Builds on2
Related papers
- Type-Checking CRDT ConvergenceGeorge Zakhour, Pascal Weisenburger, Guido SalvaneschiPLDI 2023 · 16 citations
- Grove: a Separation-Logic Library for Verifying Distributed SystemsUpamanyu Sharma, Ralf Jung, Joseph Tassarotti, M. Frans Kaashoek et al.SOSP 2023 · 18 citations
- On the Correctness of Software MergeAkira Mori, Masatomo HashimotoASE 2025
- Composing CRDTs Convergent by ConstructionAlexander Städing Dominguez, George Zakhour, Pascal Weisenburger, Guido SalvaneschiOOPSLA 2026
- Merge Conflict Resolution: Classification or Generation?Jinhao Dong, Qihao Zhu, Zeyu Sun, Yiling Lou et al.ASE 2023 · 8 citations
