Cargando…

FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions

Form validators based on regular expressions are often used on digital forms to prevent users from inserting data in the wrong format. However, writing these validators can pose a challenge to some users. We present Forest, a regular expression synthesizer for digital form validations. Forest produc...

Descripción completa

Detalles Bibliográficos
Autores principales: Ferreira, Margarida, Terra-Neves, Miguel, Ventura, Miguel, Lynce, Inês, Martins, Ruben
Formato: Online Artículo Texto
Lenguaje:English
Publicado: 2021
Materias:
Acceso en línea:https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7979175/
http://dx.doi.org/10.1007/978-3-030-72016-2_9
_version_ 1783667239037173760
author Ferreira, Margarida
Terra-Neves, Miguel
Ventura, Miguel
Lynce, Inês
Martins, Ruben
author_facet Ferreira, Margarida
Terra-Neves, Miguel
Ventura, Miguel
Lynce, Inês
Martins, Ruben
author_sort Ferreira, Margarida
collection PubMed
description Form validators based on regular expressions are often used on digital forms to prevent users from inserting data in the wrong format. However, writing these validators can pose a challenge to some users. We present Forest, a regular expression synthesizer for digital form validations. Forest produces a regular expression that matches the desired pattern for the input values and a set of conditions over capturing groups that ensure the validity of integer values in the input. Our synthesis procedure is based on enumerative search and uses a Satisfiability Modulo Theories (SMT) solver to explore and prune the search space. We propose a novel representation for regular expressions synthesis, multi-tree, which induces patterns in the examples and uses them to split the problem through a divide-and-conquer approach. We also present a new SMT encoding to synthesize capture conditions for a given regular expression. To increase confidence in the synthesized regular expression, we implement user interaction based on distinguishing inputs. We evaluated Forest on real-world form-validation instances using regular expressions. Experimental results show that Forest successfully returns the desired regular expression in 70% of the instances and outperforms Regel, a state-of-the-art regular expression synthesizer.
format Online
Article
Text
id pubmed-7979175
institution National Center for Biotechnology Information
language English
publishDate 2021
record_format MEDLINE/PubMed
spelling pubmed-79791752021-03-23 FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions Ferreira, Margarida Terra-Neves, Miguel Ventura, Miguel Lynce, Inês Martins, Ruben Tools and Algorithms for the Construction and Analysis of Systems Article Form validators based on regular expressions are often used on digital forms to prevent users from inserting data in the wrong format. However, writing these validators can pose a challenge to some users. We present Forest, a regular expression synthesizer for digital form validations. Forest produces a regular expression that matches the desired pattern for the input values and a set of conditions over capturing groups that ensure the validity of integer values in the input. Our synthesis procedure is based on enumerative search and uses a Satisfiability Modulo Theories (SMT) solver to explore and prune the search space. We propose a novel representation for regular expressions synthesis, multi-tree, which induces patterns in the examples and uses them to split the problem through a divide-and-conquer approach. We also present a new SMT encoding to synthesize capture conditions for a given regular expression. To increase confidence in the synthesized regular expression, we implement user interaction based on distinguishing inputs. We evaluated Forest on real-world form-validation instances using regular expressions. Experimental results show that Forest successfully returns the desired regular expression in 70% of the instances and outperforms Regel, a state-of-the-art regular expression synthesizer. 2021-03-01 /pmc/articles/PMC7979175/ http://dx.doi.org/10.1007/978-3-030-72016-2_9 Text en © The Author(s) 2021 Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made. The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
spellingShingle Article
Ferreira, Margarida
Terra-Neves, Miguel
Ventura, Miguel
Lynce, Inês
Martins, Ruben
FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions
title FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions
title_full FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions
title_fullStr FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions
title_full_unstemmed FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions
title_short FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions
title_sort forest: an interactive multi-tree synthesizer for regular expressions
topic Article
url https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7979175/
http://dx.doi.org/10.1007/978-3-030-72016-2_9
work_keys_str_mv AT ferreiramargarida forestaninteractivemultitreesynthesizerforregularexpressions
AT terranevesmiguel forestaninteractivemultitreesynthesizerforregularexpressions
AT venturamiguel forestaninteractivemultitreesynthesizerforregularexpressions
AT lynceines forestaninteractivemultitreesynthesizerforregularexpressions
AT martinsruben forestaninteractivemultitreesynthesizerforregularexpressions