mlsanityData to 14 Oct 2026

Beyond Text Editing: Algebraic Manipulation of Source Code

arXiv 2607.18742 ↗First posted 21 Jul 2026cs.SEcited by 0

On the map: LLM agents and tool use → Software engineering coding agents

Abstract (arXiv)

Source code is almost universally edited as plain text. However, the mismatch between the syntactic and semantic requirements of valid and correct code, and the unconstrained text editing process trying to produce it, introduces friction that degrades the programming task. It is also increasingly costly in the era of LLM-based coding agents, which must materialize their high-level plan of intended changes as low-level text edits dispersed throughout the codebase, often requiring them to re-read large portions of code. We propose the novel alternative approach of source code algebra, where the codebase is modified by applying to it a sequence of logical algebraic operations. Each operation makes the full set of changes necessary for a single semantic change, analogous to mathematical equation rewriting. We sketch initial properties of such operations - including composition, nullipotency, and commutativity - that distinguish this approach from text editing, and make it well-suited as a substrate for agentic code editing. A feasibility probe with our proof-of-concept implementation (SCAS) suggests that LLM agents can use source code algebra to complete a non-local, cross-file code change with both higher success rates and one to two orders of magnitude fewer tokens, relative to text-based baselines. While preliminary, this is consistent with the hypothesis that having LLMs emit algebraic operations, rather than rewritten code, is a promising direction for code editing - and motivates broader future research into source code algebra, such as comprehensive operator libraries, formal properties, and human-facing tooling.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. First posted on arXiv 21 Jul 2026.

Builds on

No reference list yet.

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2026CODESTRUCT: Code Agents over Structured Action Spaces
  2. 2026SWE-Edit: Rethinking Code Editing for Efficient SWE-Agent
  3. 2025SEW: Self-Evolving Agentic Workflows for Automated Code Generation
  4. 2025Guided Code Generation with LLMs: A Multi-Agent Framework for Complex Code Tasks
  5. 2026Frontier Coding Agents Use Metaprogramming to Adapt to Unfamiliar Programming Languages
  6. 2026A Jagged Frontier: Evaluating Robustness of Code Agents to Semantics-Preserving Transformations
  7. 2025LLM-based Multi-Agent System for Intelligent Refactoring of Haskell Code
  8. 2026AdaptAgent: A Multi-agent, Domain-Guided Reasoning Framework for Code Adaptation