Lune

CAV2021Top-tier venue

An SMT Solver for Regular Expressions and Linear Arithmetic over String Length

Murphy Berzish, Mitja Kulczynski, Federico Mora, Florin Manea, Joel D. Day, Dirk Nowotka, Vijay Ganesh

Abstract

Abstract We present a novel length-aware solving algorithm for the quantifier-free first-order theory over regex membership predicate and linear arithmetic over string length. We implement and evaluate this algorithm and related heuristics in the Z3 theorem prover. A crucial insight that underpins our algorithm is that real-world regex and string formulas contain a wealth of information about upper and lower bounds on lengths of strings, and such information can be used very effectively to simplify operations on automata representing regular expressions. Additionally, we present a number of novel general heuristics, such as the prefix/suffix method, that can be used to make a variety of regex solving algorithms more efficient in practice. We showcase the power of our algorithm and heuristics via an extensive empirical evaluation over a large and diverse benchmark of 57256 regex-heavy instances, almost 75% of which are derived from industrial applications or contributed by other solver developers. Our solver outperforms five other state-of-the-art string solvers, namely, CVC4, OSTRICH, Z3seq, Z3str3, and Z3-Trau, over this benchmark, in particular achieving a speedup of 2.4 ×\times × over CVC4, 4.4 ×\times × over Z3seq, 6.4 ×\times × over Z3-Trau, 9.1 ×\times × over Z3str3, and 13 ×\times × over OSTRICH.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

12 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Symbolic Boolean derivatives for efficiently solving extended regular expression constraints cites Efficient handling of string-number conversion
  • Word Equations in Synergy with Regular Constraints cites Efficient handling of string-number conversion
  • Incremental Dead State Detection in Logarithmic Time cites Symbolic Boolean derivatives for efficiently solving extended regular expression constraints
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers12

  1. Word Equations in Synergy with Regular ConstraintsFrantisek Blahoudek, Yu-Fang Chen, David Chocholatý, Vojtech Havlena et al.FM 2023 · 16 citations
  2. Solving String Constraints Using SATKevin Lotz, Amit Goel, Bruno Dutertre, Benjamin Kiesl-Reiter et al.CAV 2023 · 11 citations
  3. Speeding up SMT Solving via Compiler OptimizationBenjamin Mikek, Qirun ZhangFSE 2023 · 11 citations
  4. Incremental Dead State Detection in Logarithmic TimeCaleb Stanford, Margus VeanesCAV 2023 · 4 citations
  5. Coinductive Proofs of Regular Expression Equivalence in Zero KnowledgeJohn C. Kolesar, Shan Ali, Timos Antonopoulos, Ruzica PiskacOOPSLA 2025 · 4 citations

Builds on2

  1. Symbolic Boolean derivatives for efficiently solving extended regular expression constraintsCaleb Stanford, Margus Veanes, Nikolaj S. BjørnerPLDI 2021 · 38 citations
  2. Efficient handling of string-number conversionParosh Aziz Abdulla, Mohamed Faouzi Atig, Yu-Fang Chen, Bui Phi Diep et al.PLDI 2020 · 25 citations

Related papers

  1. Inter-theory dependency analysis for SMT string solversMinh-Thai Trinh, Duc-Hiep Chu, Joxan JaffarOOPSLA 2020 · 5 citations
  2. String Solving with Stabilization and TransducersDavid Chocholatý, Vojtech Havlena, Lukás Holík, Juraj Síc et al.CAV 2026
  3. The Power of Regular Constraint PropagationMatthew Hague, Artur Jez, Anthony Widjaja Lin, Oliver Markgraf et al.OOPSLA 2025 · 2 citations
  4. A Constraint Solving Approach to Parikh Images of Regular LanguagesAmanda Stjerna, Philipp RümmerOOPSLA 2024 · 2 citations
  5. A Uniform Framework for Handling Position Constraints in String SolvingYu-Fang Chen, Vojtech Havlena, Michal Hecko, Lukás Holík et al.PLDI 2025
Dusk over the sea between two cliffs drawn in fine vertical lines