一句话:提出词法追踪为差分执行步骤提供稳定标识,并在Rocq中验证带缓存的差分执行语义,实现渐进高效。
增量计算旨在输入微小修改后大幅加速,但多数方法仅跳过未变工作并重算其余子计算;差分执行通过传播数据增量避免重算,然而现有差分大步语义每步仍需重放原计算,且缺乏可靠高效的缓存机制。本文提出词法追踪,用大步语义推导树中的路径唯一标识执行步骤,并保证在前序控制流变化时标识仍稳定;进而将词法追踪与缓存扩展到差分执行,给出首个经形式验证且渐进高效的命令式语言差分执行方案。作者在Rocq中机械化证明词法追踪的缓存稳定性及差分缓存语义的正确性与完备性。
Incremental computing promises large speed-ups after small input edits. Yet, most incrementality approaches merely skip unchanged work and recompute the remaining sub-computations, even when the inputs change only slightly. Differential execution avoids this by propagating data changes (i.e., deltas), and prior work has shown how to develop a provably correct differential big-step semantics. Unfortunately, that semantics must still replay the original computation at every step, squandering much of the potential gain of incrementalization. While the semantics clearly needs caching to avoid recomputations, a sound and efficient caching discipline is challenging. First, each execution step must be uniquely identified; second, the identifier must remain stable even when the preceding control flow changes. To this end, we develop lexical tracing , which identifies execution steps through their path in the derivation tree of the big-step semantics. We then extend differential execution with lexical tracing and caching to deliver, for the first time, a formally verified, asymptotically efficient account of differential execution for imperative languages. In particular, we developed a novel mechanized theory of cache stability for lexical traces and their semantic rules, which was essential in proving the differential caching semantics correct and complete in Rocq.
@article{paperbot3843,
title = {Differential Execution with Lexical Tracing},
author = {Sebastian Erdweg and Runqing Xu and Mo Bitar},
journal = {Proceedings of the ACM on Programming Languages},
volume = {10},
number = {OOPSLA1},
year = {2026},
doi = {10.1145/3798261}
}