ReGiS: Regular Expression Simplification via Rewrite-Guided Synthesis

04/24/2021
by   Jordan Schmerge, et al.
0

Expression simplification is an important task necessary in a variety of domains, e.g., compilers, digital logic design, etc. Syntax-guided synthesis (SyGuS) with a cost function can be used for this purpose, but ordered enumeration through a large space of candidate expressions can be expensive. Equality saturation is an alternative approach which allows efficient construction and maintenance of expression equivalence classes generated by rewrite rules, but the procedure may not reach saturation, meaning global minimality cannot be confirmed. We present a new approach called rewrite-guided synthesis (ReGiS), in which a unique interplay between SyGuS and equality saturation-based rewriting helps to overcome these problems, resulting in an efficient, scalable framework for expression simplification. We demonstrate the flexibility and practicality of our approach by applying ReGiS to regular expression denial of service (ReDoS) attack prevention. Many real-world regular expression matching engines are vulnerable to these complexity-based attacks, and while much research has focused on detecting vulnerable regular expressions, we provide a way for developers to go further, by automatically transforming their regular expressions to remove vulnerabilities.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/23/2020

Automatic Repair of Vulnerable Regular Expressions

A regular expression is called vulnerable if there exist input strings o...
research
12/28/2020

FOREST: An Interactive Multi-tree Synthesizer for Regular Expressions

Form validators based on regular expressions are often used on digital f...
research
09/17/2021

Games for Succinctness of Regular Expressions

We present a version of so called formula size games for regular express...
research
08/15/2023

The Regular Expression Inference Challenge

We propose regular expression inference (REI) as a challenge for code/la...
research
08/11/2022

SSLEM: A Simplifier for MBA Expressions based on Semi-linear MBA Expressions and Program Synthesis

MBA (mixed boolean and arithmetic) expressions are hard to simplify, so ...
research
02/19/2020

SPORES: Sum-Product Optimization via Relational Equality Saturation for Large Scale Linear Algebra

Machine learning algorithms are commonly specified in linear algebra (LA...
research
02/06/2019

Neural-Network Guided Expression Transformation

Optimizing compilers, as well as other translator systems, often work by...

Please sign up or login with your details

Forgot password? Click here to reset