HackerPapers

arXiv:1908.03316cs.PL

Multi-modal Synthesis of Regular Expressions

Qiaochu Chen, Xinyu Wang, Xi Ye, Greg Durrett, Isil Dillig

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

Abstract

In this paper, we propose a multi-modal synthesis technique for automatically constructing regular expressions (regexes) from a combination of examples and natural language. Using multiple modalities is useful in this context because natural language alone is often highly ambiguous, whereas examples in isolation are often not sufficient for conveying user intent. Our proposed technique first parses the English description into a so-called hierarchical sketch that guides our programming-by-example (PBE) engine. Since the hierarchical sketch captures crucial hints, the PBE engine can leverage this information to both prioritize the search as well as make useful deductions for pruning the search space. We have implemented the proposed technique in a tool called Regel and evaluate it on over three hundred regexes. Our evaluation shows that Regel achieves 80% accuracy whereas the NLP-only and PBE-only baselines achieve 43% and 26% respectively. We also compare our proposed PBE engine against an adaptation of AlphaRegex, a state-of-the-art regex synthesis tool, and show that our proposed PBE engine is an order of magnitude faster, even if we adapt the search algorithm of AlphaRegex to leverage the sketch. Finally, we conduct a user study involving 20 participants and show that users are twice as likely to successfully come up with the desired regex using Regel compared to without it.

arXiv comments
36 pages
Journal reference
DOI
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Mar 2023 to Mar 2023.

Comments linking this paper, per year.

Discussed in comments1 thread

    • Just so that you know, your problem is called "regular expression synthesis", there's vast literature on it and a LLM is by no means necessary. https://arts.units.it/retrieve/handle/11368/2758954/57751/20... https://arxiv.org/pdf/1908.03316…

      qsortView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.