Program Synthesis from Partial Traces

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Ferreira, Margarida, Nicolet, Victor, Dodds, Joey, Kroening, Daniel
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866915334819151872
author Ferreira, Margarida
Nicolet, Victor
Dodds, Joey
Kroening, Daniel
author_facet Ferreira, Margarida
Nicolet, Victor
Dodds, Joey
Kroening, Daniel
contents 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.
format Preprint
id arxiv_https___arxiv_org_abs_2504_14480
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Program Synthesis from Partial Traces
Ferreira, Margarida
Nicolet, Victor
Dodds, Joey
Kroening, Daniel
Programming Languages
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.
title Program Synthesis from Partial Traces
topic Programming Languages
url https://arxiv.org/abs/2504.14480