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 \(\lambda ^2\) with Smyth-style live bidirectional 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 \(\lambda ^2\) and Myth. Scrybe is able to synthesize most of the combined benchmark tasks.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
Notes
- 1.
In this example, as well as in the rest of this paper, we leave type constraints implicit.
- 2.
Note that function calls within the branches of a stuck pattern match are not inlined.
- 3.
- 4.
- 5.
References
Claessen, K., Smallbone, N., Hughes, J.: QuickSpec: guessing formal specifications using testing. In: Fraser, G., Gargantini, A. (eds.) TAP 2010. LNCS, vol. 6143, pp. 6–21. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-13977-2_3
Danvy, O., Spivey, M.: On Barron and Strachey’s cartesian product function. In: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, pp. 41–46. Association for Computing Machinery, New York (2007). https://doi.org/10.1145/1291151.1291161
Feser, J.K., Chaudhuri, S., Dillig, I.: Synthesizing data structure transformations from input-output examples. ACM SIGPLAN Not. 50(6), 229–239 (2015). https://doi.org/10.1145/2813885.2737977
Frankle, J., Osera, P.M., Walker, D., Zdancewic, S.: Example-directed synthesis: a type-theoretic interpretation. SIGPLAN Not. 51(1), 802–815 (2016). https://doi.org/10.1145/2914770.2837629
Guo, Z., et al.: Program synthesis by type-guided abstraction refinement. Proc. ACM Program. Lang. 4(POPL) (2019). https://doi.org/10.1145/3371080
Katayama, S.: Efficient exhaustive generation of functional programs using Monte-Carlo search with iterative deepening. In: Ho, T.-B., Zhou, Z.-H. (eds.) PRICAI 2008. LNCS (LNAI), vol. 5351, pp. 199–210. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-89197-0_21
Koppel, J., Guo, Z., de Vries, E., Solar-Lezama, A., Polikarpova, N.: Searching entangled program spaces. Proc. ACM Program. Lang. 6(ICFP) (2022). https://doi.org/10.1145/3547622
Lubin, J., Collins, N., Omar, C., Chugh, R.: Program sketching with live bidirectional evaluation. Proc. ACM Program. Lang. 4(ICFP) (2020). https://doi.org/10.1145/3408991
Omar, C., Voysey, I., Chugh, R., Hammer, M.A.: Live functional programming with typed holes. Proc. ACM Program. Lang. 3(POPL) (2019). https://doi.org/10.1145/3290327
Osera, P.M., Zdancewic, S.: Type-and-example-directed program synthesis. ACM SIGPLAN Not. 50(6), 619–630 (2015). https://doi.org/10.1145/2813885.2738007
Peleg, H., Gabay, R., Itzhaky, S., Yahav, E.: Programming with a read-eval-synth loop. Proc. ACM Program. Lang. 4(OOPSLA) (2020). https://doi.org/10.1145/3428227
Smith, C., Albarghouthi, A.: Program synthesis with equivalence reduction. In: Enea, C., Piskac, R. (eds.) VMCAI 2019. LNCS, vol. 11388, pp. 24–47. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-11245-5_2
Solar-Lezama, A.: Program synthesis by sketching. Ph.D. thesis, Berkeley (2008)
Solar-Lezama, A.: The sketching approach to program synthesis. In: Hu, Z. (ed.) APLAS 2009. LNCS, vol. 5904, pp. 4–13. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-10672-9_3
Acknowledgements
We would like to thank Alex Gerdes, Koen Claessen, and the anonymous reviewers of HATRA 2022 and PADL 2023 for their supportive comments and constructive feedback.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this paper
Cite this paper
Mulleners, N., Jeuring, J., Heeren, B. (2023). Program Synthesis Using Example Propagation. In: Hanus, M., Inclezan, D. (eds) Practical Aspects of Declarative Languages. PADL 2023. Lecture Notes in Computer Science, vol 13880. Springer, Cham. https://doi.org/10.1007/978-3-031-24841-2_2
Download citation
DOI: https://doi.org/10.1007/978-3-031-24841-2_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-24840-5
Online ISBN: 978-3-031-24841-2
eBook Packages: Computer ScienceComputer Science (R0)