A Uniform Framework for Handling Position Constraints in String Solving (Technical Report)

📅 2025-04-09
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
This work addresses the long-standing inefficiency in handling positional string constraints—such as `str.at`, `not-prefixof`, `not-suffixof`, and `not-contains`—in string constraint solving. We propose the first unified decision framework based on Parikh images, circumventing the exponential space overhead of traditional word-equation encodings. Our method translates positional constraints into counting and integer constraints over polynomial-size automata, achieving NP-complete (and even PTIME) complexity for several subclasses—the first such result. Notably, it decides large-scale `not-contains` constraints within NExpTime, marking a breakthrough in decidability. By integrating automaton construction, Parikh analysis, positional conflict detection, and tight coupling with Z3-Noodler, our approach retains completeness while significantly improving solving efficiency. It effectively bridges a critical gap in mainstream automaton-based string solvers, which historically lack robust support for positional constraints.

Technology Category

Application Category

📝 Abstract
We introduce a novel decision procedure for solving the class of position string constraints, which includes string disequalities, not-prefixof, not-suffixof, str.at, and not-str.at. These constraints are generated frequently in almost any application of string constraint solving. Our procedure avoids expensive encoding of the constraints to word equations and, instead, reduces the problem to checking conflicts on positions satisfying an integer constraint obtained from the Parikh image of a polynomial-sized finite automaton with a special structure. By the reduction to counting, solving position constraints becomes NP-complete and for some cases even falls into PTime. This is much cheaper than the previously used techniques, which either used reductions generating word equations and length constraints (for which modern string solvers use exponential-space algorithms) or incomplete techniques. Our method is relevant especially for automata-based string solvers, which have recently achieved the best results in terms of practical efficiency, generality, and completeness guarantees. This work allows them to excel also on position constraints, which used to be their weakness. Besides the efficiency gains, we show that our framework may be extended to solve a large fragment of not-contains (in NExpTime), for which decidability has been long open, and gives a hope to solve the general problem. Our implementation of the technique within the Z3-Noodler solver significantly improves its performance on position constraints.
Problem

Research questions and friction points this paper is trying to address.

Handling position constraints in string solving efficiently
Reducing position constraints to integer conflict checking
Extending framework to solve not-contains constraints
Innovation

Methods, ideas, or system contributions that make the work stand out.

Reduces position constraints to integer conflicts
Uses Parikh image of finite automaton
Extends to solve not-contains constraints
🔎 Similar Papers
No similar papers found.
Yu-Fang Chen
Yu-Fang Chen
Research Fellow/Professor, Academia Sinica
Program VerificationFormal MethodModel CheckingTheory of Computation
V
Vojtěch Havlena
Brno University of Technology, Czech Republic
M
Michal Hečko
Brno University of Technology, Czech Republic
L
Lukáš Holík
Brno University of Technology, Czech Republic and Aalborg University, Denmark
Ondřej Lengál
Ondřej Lengál
Brno University of Technology
Formal VerificationTheoretical Computer Science