arXiv:2210.13873v1 [cs.PL] 25 Oct 2022 Program Synthesis Using Example Propagation Niek Mulleners 1[0000000279346834] , Johan Jeuring 1[0000000156457681] , and Bastiaan Heeren 2[0000000166476130] 1 Utrecht University, The Netherlands, {n.mulleners,j.t.jeuring}@uu.nl 2 Open University of The Netherlands, The Netherlands, bastiaan.heeren@ou.nl Abstract. We present Scrybe, an example-based synthesis tool for a statically-typed functional programming language, which combines top- down deductive reasoning in the style of λ 2 with Smyth-style live bidirec- tional evaluation. During synthesis, example constraints are propagated through sketches to prune and guide the search. This enables Scrybe to make more effective use of functions provided in the context. To evaluate our tool, it is run on the combined, largely disjoint, benchmarks of λ 2 and Myth. Scrybe is able to synthesize most of the combined benchmark tasks. Keywords: Program Synthesis · Constraint Propagation · Input-Output Examples · Functional Programming 1 Introduction Type-and-example driven program synthesis is the process of automatically gen- erating a program that adheres to a type and a set of input-output examples. The general idea is that the space of type-correct programs is enumerated, evalu- ating each program against the input-output examples, until a program is found that does not result in a counterexample. Recent work in this field has aimed to make the enumeration of programs more efficient, using various pruning tech- niques and other optimizations. Hoogle+ [4] and Hectare [6] explore efficient data structures to represent the search space. Smith and Albarghouthi [12] de- scribe how synthesis procedures can be adapted to only consider programs in normal form. MagicHaskeller [5] and RESL [11] filter out programs that evaluate to the same result. Instead of only using input-output examples for the verification of generated programs, Myth [10,9], Smyth [7], and λ 2 [3] use input-output examples during pruning, by eagerly checking incomplete programs for counterexamples using constraint propagation. Constraint Propagation Top-down synthesis incrementally builds up a sketch, a program which may contain holes (denoted by ). Holes may be annotated with constraints, e.g. type constraints. During synthesis, holes are filled with new sketches (possibly containing more holes) until no holes are left. For example, for type-directed synthesis, let us start from a single hole 0 annotated with a type constraint: 0 :: List Nat List Nat