kirancodes.me
To Proof Maintenance & Beyond!

ScooPy: Enhancing Program Synthesis with Nested Example Specifications

Tomer Katz, Hila Peleg

Abstract

Current IDE-integrated program synthesis leaves no indication of what code was auto-generated, let alone an explanation of why. This makes both identifying and understanding machine-generated code hard. We therefore add example scopes, comments enclosing synthesized code that document the input-output examples that created it. This also allows programmers to manually edit examples and re-launch the synthesizer without tediously re-entering the examples. Scopes are simply text, and so can be created anywhere, including inside other scopes. However, synthesizers can only reason about one flat example set. To address this, we introduce ScooPy, IDE-integrated program synthesis for nested example specifications. ScooPy lets programmers edit example scopes, see live information based on the examples, and call the synthesizer on nested scopes. In two user studies with 6 and 16 participants we see that example scopes increase users’ engagement with the code and that ScooPy improves users’ ability to synthesize for some types of tasks.

Related papers