What Is Decidable about String Constraints with the ReplaceAll Function

11/09/2017
by   Taolue Chen, et al.
0

Recently, it was shown that any theory of strings containing the string-replace function (even the most restricted version where pattern/replacement strings are both constant strings) becomes undecidable if we do not impose some kind of straight-line (aka acyclicity) restriction on the formulas. Despite this, the straight-line restriction is still practically sensible since this condition is typically met by string constraints that are generated by symbolic execution. In this paper, we provide the first systematic study of straight-line string constraints with the string-replace function and the regular constraints as the basic operations. We show that a large class of such constraints (i.e. when only a constant string or a regular expression is permitted in the pattern) is decidable. We note that the string-replace function, even under this restriction, is sufficiently powerful for expressing the concatenation operator and much more (e.g. extensions of regular expressions with string variables). This gives us the most expressive decidable logic containing concatenation, replace, and regular constraints under the same umbrella. Our decision procedure for the straight-line fragment follows an automata-theoretic approach, and is modular in the sense that the string-replace terms are removed one by one to generate more and more regular constraints, which can then be discharged by the state-of-the-art string constraint solvers. We also show that this fragment is, in a way, a maximal decidable subclass of the straight-line fragment with string-replace and regular constraints. To this end, we show undecidability results for the following two extensions: (1) variables are permitted in the pattern parameter of the replace function, (2) length constraints are permitted.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
06/26/2023

Semënov Arithmetic, Affine VASS, and String Constraints

We study extensions of Semënov arithmetic, the first-order theory of the...
research
11/08/2021

Solving String Constraints With Regex-Dependent Functions Through Transducers With Priorities And Variables

Regular expressions are a classical concept in formal language theory. R...
research
12/14/2020

A New Approach to Regular Indeterminate Strings

In this paper we propose a new, more appropriate definition of regular a...
research
10/29/2020

String Constraints with Concatenation and Transducers Solved Efficiently (Technical Report)

String analysis is the problem of reasoning about how strings are manipu...
research
05/18/2020

On the Separability Problem of String Constraints

We address the separability problem for straight-line string constraints...
research
03/02/2023

A Symbolic Algorithm for the Case-Split Rule in Solving Word Constraints with Extensions (Technical Report)

Case split is a core proof rule in current decision procedures for the t...
research
07/14/2020

A Decision Procedure for Path Feasibility of String Manipulating Programs with Integer Data Type

Strings are widely used in programs, especially in web applications. Int...

Please sign up or login with your details

Forgot password? Click here to reset