Programming-by-example (PBE) systems aim to alleviate the burden of programming. However, user-specified examples are often ambiguous, leaving multiple programs to satisfy the specification. Consequently, in most prior work, users have had to provide additional examples, particularly negative ones, to further constrain the search over compatible programs. Recent work resolves additional ambiguity by modeling program synthesis tasks as pragmatic communication, showing promising results on a graphics domain using a rudimentary user-study. We adapt pragmatic reasoning to a sub-domain of regular expressions and rigorously study its usability as a means of communication both with and without the ability to provide negative examples. Our user study (N=30) demonstrates that, with a pragmatic synthesizer, end-users can more successfully communicate a target regex using positive examples alone (95%) compared to using a non-pragmatic synthesizer (51%). Further, users can communicate more efficiently (57% fewer examples) with a pragmatic synthesizer compared to a non-pragmatic one.
翻译:示例驱动编程(PBE)系统旨在减轻编程负担。然而,用户指定的示例往往具有歧义性,导致存在多个程序满足规范。因此,在以往的大多数研究中,用户必须提供额外示例(尤其是反例)以进一步约束对兼容程序的搜索。近期研究通过将程序合成任务建模为实用通信来解决额外歧义,并在图形领域通过初步用户研究展现出令人鼓舞的结果。我们将实用推理适配到正则表达式的子领域,并严格研究了其作为通信手段在有无提供反例能力下的可用性。我们的用户研究(N=30)表明,与非实用合成器(51%)相比,使用实用合成器的最终用户仅通过正例就能更成功地传达目标正则表达式(成功率95%)。此外,用户使用实用合成器时通信效率更高(示例数量减少57%)。