{"type":"ScholarlyArticle","title":"Synthesizing Pattern Programs from Examples","authors":[{"name":"Sunbeom So","slug":"sunbeom-so","given":"Sunbeom","family":"So","affiliation":"Korea University; Hakjoo Oh"},{"name":"Hakjoo Oh","slug":"hakjoo-oh","given":"Hakjoo","family":"Oh","affiliation":""}],"abstract":"We describe a programming-by-example system that automatically generates pattern programs from examples. Writing pattern programs, which produce various patterns of characters, is one of the most popular programming exercises for entry-level students. However, students often find it difficult to write correct solutions by themselves. In this paper, we present a method for synthesizing pattern programs from examples, allowing students to improve their programming skills efficiently. To that end, we first design a domain-specific language that supports a large class of pattern programs that students struggle with. Next, we develop a synthesis algorithm that efficiently finds a desired program by combining enumerative search, constraint solving, and program analysis. We implemented the algorithm in a tool and evaluated it on 40 exercises gathered from online forums. The experimental results and user study show that our tool can synthesize instructive solutions from 1–3 example patterns in 1.2 seconds on average.","doi":"10.24963/ijcai.2018/224","url":"https://ijcai.org/proceedings/2018/224","pdf":"https://ijcai.org/proceedings/2018/0224.pdf","markdown":"https://ijcai.org/proceedings/2018/224.md","bibtex":"https://ijcai.org/proceedings/2018/bibtex/224","volume":{"slug":"2018","title":"Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence","short_title":"IJCAI 2018","url":"https://ijcai.org/proceedings/2018/","year":2018,"location":"Stockholm","dates":"13-19 July 2018","editors":"Jérôme Lang","isbn":"978-0-9992411-2-7","publisher":"International Joint Conferences on Artificial Intelligence Organization","doi_prefix":"10.24963/ijcai.2018"},"section":"Humans and AI","track":"Main track","number":224,"pages":{"first":1618,"last":1624},"keywords":["Humans and AI: Computer-Aided Education","Knowledge Representation and Reasoning: Automated Reasoning and Theorem Proving"],"videos":[],"references":[{"position":1,"raw":"[Ellis and Gulwani, 2017] Kevin Ellis and Sumit Gulwani. Learning to learn programs from examples: Going beyond program structure. In Proceedings of International Joint Conference on Artificial Intelligence, IJCAI, pages 1638- 1645, 2017.","title":"Learning to learn programs from examples: Going beyond program structure","authors":"Kevin Ellis, Sumit Gulwani","year":"2017","venue":"Proceedings of International Joint Conference on Artificial Intelligence, IJCAI","doi":null,"url":null,"internal_url":"/proceedings/2017/227"},{"position":2,"raw":"[Feng et al., 2017] Yu Feng, Ruben Martins, Jacob Van Gef- fen, Isil Dillig, and Swarat Chaudhuri. Component-based synthesis of table consolidation and transformation tasks from examples. In Proceedings of ACM SIGPLAN Confer- ence on Programming Language Design and Implementa- tion, PLDI, pages 422-436, 2017.","title":"Component-based synthesis of table consolidation and transformation tasks from examples","authors":"Yu Feng, Ruben Martins, Jacob Van Geffen, Isil Dillig, Swarat Chaudhuri","year":"2017","venue":"Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI","doi":null,"url":null,"internal_url":null},{"position":3,"raw":"[Feser et al., 2015] John K. Feser, Swarat Chaudhuri, and Isil Dillig. Synthesizing data structure transformations from input-output examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI, pages 229-239, 2015.","title":"Synthesizing data structure transformations from input-output examples","authors":"John K Feser, Swarat Chaudhuri, Isil Dillig","year":"2015","venue":"Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation","doi":null,"url":null,"internal_url":null},{"position":4,"raw":"[Gerdes et al., 2017] Alex Gerdes, Bastiaan Heeren, Johan Jeuring, and L. Thomas van Binsbergen. Ask-elle: an adaptable programming tutor for haskell giving auto- mated feedback. I. J. Artificial Intelligence in Education, 27(1):65-100, 2017.","title":"Ask-elle: an adaptable programming tutor for haskell giving automated feedback","authors":"Alex Gerdes, Bastiaan Heeren, Johan Jeuring, L Thomas Van Binsbergen","year":"2017","venue":"I. J. Artificial Intelligence in Education","doi":null,"url":null,"internal_url":null},{"position":5,"raw":"[Gulwani et al., 2014] Sumit Gulwani, Ivan Radiček, and Florian Zuleger. Feedback generation for performance problems in introductory programming assignments. In Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE, pages 41-51, 2014.","title":"Feedback generation for performance problems in introductory programming assignments","authors":"Sumit Gulwani, Ivan Radiček, Florian Zuleger","year":"2014","venue":"Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE","doi":null,"url":null,"internal_url":null},{"position":6,"raw":"[Gulwani et al., 2017] Sumit Gulwani, Oleksandr Polozov, and Rishabh Singh. Program synthesis. Foundations and Trends in Programming Languages, 4(1-2):1-119, 2017.","title":"Program synthesis","authors":"Sumit Gulwani, Oleksandr Polozov, Rishabh Singh","year":"2017","venue":"Foundations and Trends in Programming Languages","doi":null,"url":null,"internal_url":null},{"position":7,"raw":"[Gulwani, 2011] Sumit Gulwani. Automating string process- ing in spreadsheets using input-output examples. In Pro- ceedings of Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL, pages 317-330, 2011.","title":"Automating string processing in spreadsheets using input-output examples","authors":"Sumit Gulwani","year":"2011","venue":"Proceedings of Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages","doi":null,"url":null,"internal_url":null},{"position":8,"raw":"[Kaleeswaran et al., 2016] Shalini Kaleeswaran, Anirudh Santhiar, Aditya Kanade, and Sumit Gulwani. Semi- supervised verified feedback generation. In Proceedings of ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE, pages 739-750, 2016.","title":"Semisupervised verified feedback generation","authors":"Anirudh Shalini Kaleeswaran, Aditya Santhiar, Sumit Kanade, Gulwani","year":"2016","venue":"Proceedings of ACM SIGSOFT International Symposium on Foundations of Software Engineering, FSE","doi":null,"url":null,"internal_url":null},{"position":9,"raw":"[Kim et al., 2016] Dohyeong Kim, Yonghwi Kwon, Peng Liu, I. Luk Kim, David Mitchel Perry, Xiangyu Zhang, and Gustavo Rodriguez-Rivera. Apex: Automatic pro- gramming assignment error explanation. In Proceedings of ACM SIGPLAN International Conference on Object- Oriented Programming, Systems, Languages, and Appli- cations, OOPSLA, pages 311-327, 2016.","title":"Apex: Automatic programming assignment error explanation","authors":"Kim","year":"2016","venue":"Proceedings of ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications, OOPSLA","doi":null,"url":null,"internal_url":null},{"position":10,"raw":"[Kini and Gulwani, 2015] Dileep Kini and Sumit Gulwani. Flashnormalize: Programming by examples for text nor- malization. In Proceedings of International Conference on Artificial Intelligence, IJCAI, pages 776-783, 2015.","title":"Flashnormalize: Programming by examples for text normalization","authors":"Dileep Kini, Sumit Gulwani","year":"2015","venue":"Proceedings of International Conference on Artificial Intelligence, IJCAI","doi":null,"url":null,"internal_url":"/proceedings/2015/115"},{"position":11,"raw":"[Lee et al., 2016] Mina Lee, Sunbeom So, and Hakjoo Oh. Synthesizing regular expressions from examples for intro- ductory automata assignments. In Proceedings of ACM SIGPLAN International Conference on Generative Pro- gramming: Concepts and Experiences, GPCE, pages 70- 80, 2016.","title":"Hakjoo Oh. Synthesizing regular expressions from examples for introductory automata assignments","authors":"Lee","year":"2016","venue":"Proceedings of ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences, GPCE","doi":null,"url":null,"internal_url":null},{"position":12,"raw":"[Raza and Gulwani, 2017] Mohammad Raza and Sumit Gul- wani. Automated data extraction using predictive program synthesis. In Proceedings of AAAI Conference on Artificial Intelligence, pages 882-890, 2017.","title":"Automated data extraction using predictive program synthesis","authors":"Mohammad Raza, Sumit Gulwani","year":"2017","venue":"Proceedings of AAAI Conference on Artificial Intelligence","doi":null,"url":null,"internal_url":null},{"position":13,"raw":"[Raza et al., 2015] Mohammad Raza, Sumit Gulwani, and Natasa Milic-Frayling. Compositional program synthesis from natural language and examples. In Proceedings of International Conference on Artificial Intelligence, IJCAI, pages 792-800, 2015.","title":"Compositional program synthesis from natural language and examples","authors":"Mohammad Raza, Sumit Gulwani, Natasa Milic-Frayling","year":"2015","venue":"Proceedings of International Conference on Artificial Intelligence, IJCAI","doi":null,"url":null,"internal_url":"/proceedings/2015/117"},{"position":14,"raw":"[Rivers and Koedinger, 2017] Kelly Rivers and Kenneth R. Koedinger. Data-driven hint generation in vast solution spaces: a self-improving python programming tutor. I. J. Artificial Intelligence in Education, 27(1):37-64, 2017.","title":"Data-driven hint generation in vast solution spaces: a self-improving python programming tutor","authors":"Kelly Rivers, Kenneth R Koedinger","year":"2017","venue":"I. J. Artificial Intelligence in Education","doi":null,"url":null,"internal_url":null},{"position":15,"raw":"[Singh et al., 2013] Rishabh Singh, Sumit Gulwani, and Ar- mando Solar-Lezama. Automated feedback generation for introductory programming assignments. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI, pages 15-26, 2013.","title":"Automated feedback generation for introductory programming assignments","authors":"Rishabh Singh, Sumit Gulwani, Armando Solar-Lezama","year":"2013","venue":"Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation","doi":null,"url":null,"internal_url":null},{"position":16,"raw":"[So and Oh, 2017] Sunbeom So and Hakjoo Oh. Synthesiz- ing imperative programs from examples guided by static analysis. In Static Analysis -International Symposium, SAS, pages 364-381, 2017.","title":"Sunbeom So and Hakjoo Oh. Synthesizing imperative programs from examples guided by static analysis","authors":"Oh So","year":"2017","venue":"Static Analysis -International Symposium","doi":null,"url":null,"internal_url":null},{"position":17,"raw":"[Udupa et al., 2013] Abhishek Udupa, Arun Raghavan, Jy- otirmoy V. Deshmukh, Sela Mador-Haim, Milo M.K. Mar- tin, and Rajeev Alur. Transit: Specifying protocols with concolic snippets. In Proceedings of ACM SIGPLAN Con- ference on Programming Language Design and Implemen- tation, PLDI, pages 287-296, 2013.","title":"Transit: Specifying protocols with concolic snippets","authors":"Abhishek Udupa, Arun Raghavan, Jyotirmoy V Deshmukh, Sela Mador-Haim, Milo M K Martin, Rajeev Alur","year":"2013","venue":"Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI","doi":null,"url":null,"internal_url":null},{"position":18,"raw":"[Wang et al., 2017] Chenglong Wang, Alvin Cheung, and Rastislav Bodik. Synthesizing highly expressive sql queries from input-output examples. In Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI, pages 452-466, 2017.","title":"Synthesizing highly expressive sql queries from input-output examples","authors":"Chenglong Wang, Alvin Cheung, Rastislav Bodik","year":"2017","venue":"Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation","doi":null,"url":null,"internal_url":null},{"position":19,"raw":"[Wu and Knoblock, 2015] Bo Wu and Craig A. Knoblock. An iterative approach to synthesize data transformation programs. In Proceedings of International Conference on Artificial Intelligence, IJCAI, pages 1726-1732, 2015.","title":"An iterative approach to synthesize data transformation programs","authors":"Bo Wu, Craig A Knoblock","year":"2015","venue":"Proceedings of International Conference on Artificial Intelligence, IJCAI","doi":null,"url":null,"internal_url":"/proceedings/2015/246"},{"position":20,"raw":"[Yaghmazadeh et al., 2016] Navid Yaghmazadeh, Christian Klinger, Isil Dillig, and Swarat Chaudhuri. Synthesizing transformations on hierarchically structured data. In Pro- ceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI, pages 508- 521, 2016.","title":"Synthesizing transformations on hierarchically structured data","authors":"Navid Yaghmazadeh, Christian Klinger, Isil Dillig, Swarat Chaudhuri","year":"2016","venue":"Proceedings of ACM SIGPLAN Conference on Programming Language Design and Implementation","doi":null,"url":null,"internal_url":null}],"license_note":"Copyright International Joint Conferences on Artificial Intelligence."}