Program Synthesis From Partial Traces

📅 2025-04-20
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the problem of automatically synthesizing complete, functionally correct programs that reproduce a target behavior from partial execution traces containing only side-effecting function calls—requiring joint modeling of side-effecting functions, pure functions, and control flow, with positive-only examples and no negative ones. To solve it, we propose the first hierarchical framework integrating syntax-guided program synthesis (SyGuS) with optimization-based rewriting: (1) side-effect-aware modeling and trace abstraction ensure semantic-preserving generalization; (2) a lightweight cost metric mitigates overgeneralization; and (3) rewriting rules combined with syntactic constraints guarantee correctness-by-construction. Evaluated on real-world API and system-call benchmarks, our approach efficiently generates functionally complete programs, significantly advancing synthesis capability for scenarios involving mixed side effects, pure functions, and complex control flow.

Technology Category

Application Category

📝 Abstract
We present the first technique to synthesize programs that compose side-effecting functions, pure functions, and control flow, from partial traces containing records of only the side-effecting functions. This technique can be applied to synthesize API composing scripts from logs of calls made to those APIs, or a script from traces of system calls made by a workload, for example. All of the provided traces are positive examples, meaning that they describe desired behavior. Our approach does not require negative examples. Instead, it generalizes over the examples and uses cost metrics to prevent over-generalization. Because the problem is too complex for traditional monolithic program synthesis techniques, we propose a new combination of optimizing rewrites and syntax-guided program synthesis. The resulting program is correct by construction, so its output will always be able to reproduce the input traces. We evaluate the quality of the programs synthesized when considering various optimization metrics and the synthesizer's efficiency on real-world benchmarks. The results show that our approach can generate useful real-world programs.
Problem

Research questions and friction points this paper is trying to address.

Synthesize programs from partial side-effect traces
Generalize without negative examples using cost metrics
Combine rewrites and syntax-guided synthesis for correctness
Innovation

Methods, ideas, or system contributions that make the work stand out.

Synthesizes programs from partial side-effect traces
Uses optimizing rewrites and syntax-guided synthesis
Ensures correctness by construction without negative examples
🔎 Similar Papers
No similar papers found.