Back to search

Digital Repository at the University of Maryland

Web-based Flow-directed Transformations

Abstract

dc:description.abstract

Webs are the collections of producers and consumers (e.g., functions and calls) in a program that are semantically constrained: in higher-order languages, multiple functions can flow to the same call, all of which must agree on an interface (e.g., calling convention). We argue that webs are fundamentally the unit of transformation: a change to one member requires changes across the entire web. We introduce a web-centric intermediate language that exposes webs as annotations, and describe web-based (flow-directed) transformations guided by these annotations. As they affect all members of a web, these transformations are interprocedural, operating over entire modules. Through the lens of webs we reframe and generalize a collection of transformations from the literature, including dead-parameter elimination, uncurrying, and defunctionalization, as well as describe novel transformations. We contrast this approach with rewriting strategies that rely on inlining and cascading rewrites. Then, we generalize this approach by defining a flow-directed worker-wrapper transformation, which can simulate all other web-based transformations. This generalized worker-wrapper method provides a systematic recipe for designing flow-directed optimizations. Webs are an over-approximation of the semantic function-call relationship produced by control-flow analyses (CFA). This information is inherently independent from the transformations; more precise analyses permit more transformations. A limitation of precise analyses is that the transformations may not maintain well-typedness, as the type system is a less-precise static analysis. Our solution is a simple and lightweight typed-based analysis that causes the flow-directed transformations to preserve well-typedness, making flow-directed, type-preserving transformations easily accessible in many compilers. This analysis builds on unification, distinguishing types that look the same from types that have to be the same. Our experiments show that while our analysis is theoretically less precise, in practice its precision is similar to CFAs. We then explore the compositional correctness of web-directed transformations, a la CertiRocq. To do so, we must define a notion of ``exposed'' webs, which consist of all values that are not local to a compilation unit: these program elements cannot change their observable behavior due to an optimization. We describe three case studies of web-directed transformations: dead parameter elimination, constant propagation, and defunctionalization, which, along with our general framework, have been mechanized in the Rocq theorem prover. Finally, we describe a novel application of webs: better random program generation for the purpose of property-based testing of compilers. By using the flow analysis to guide expansive program transformations, we obtain a high likelihood that every intermediate value contributes to the final result of the program; a property with which previous work struggles. We demonstrate that our method finds bugs more effectively in the experiments of the prior work.

Degree

thesis:*
Department dc:contributor.department
Computer Science
Grantor dc:publisher
Digital Repository at the University of Maryland
Year dc:date.issued
2026

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Quiring, Benjamin Glover
Advisor dc:contributor.advisor
  • Van Horn, David

Rights

Language dc:language.iso
en

Identifiers

dc:identifier.*

Chain of custody

source
Harvested from
University of Maryland
Base URL
api.drum.lib.umd.edu/server/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
related terms
citation

Quiring, Benjamin Glover. Web-based Flow-directed Transformations. Digital Repository at the University of Maryland, 2026. http://hdl.handle.net/1903/36330