Symbolic Register Automata

Loris D'Antoni, Tiago Ferreira, Matteo Sammartino, Alexandra Silva

Abstract

This paper introduces Symbolic Register Automata (SRA), a new computational model that merges the rich alphabet theories of Symbolic Finite Automata (SFA) with the memory capabilities of Register Automata (RA). SRAs efficiently process complex regular expressions with back-references over massive alphabets (like Unicode) where existing models often fail. We demonstrate that SRAs are decidable and significantly outperform standard regex engines in both scalability and performance.

Introduction

Standard finite automata are fundamental to pattern matching but struggle with large or infinite alphabets. Two primary extensions have historically addressed this: Symbolic Finite Automata (SFAs), which use logical predicates for transitions, and Register Automata (RAs), which use memory registers for symbol comparison. However, these models are orthogonal; SFAs lack memory, and RAs lack complex predicates. Real-world tasks, such as parsing regular expressions with back-references (e.g., (\d)[a-z]*\1), require both capabilities. This paper introduces Symbolic Register Automata (SRA) to bridge this gap.

The Challenge: Large Alphabets and Memory

Existing models face a "combinatorial explosion" when handling back-references over large alphabets like 16-bit Unicode. To simulate a single back-reference, an SFA would need to hardcode every possible character into its state space, leading to billions of states. Conversely, standard RAs cannot handle character classes or complex predicates (like "is a digit"). SRAs solve this by allowing transitions to carry both a predicate from an effective Boolean algebra and instructions to interact with registers.

Methodology: Symbolic Register Automata

In an SRA, transitions are guarded by predicates and can perform register operations such as storing the current input symbol or comparing it against a stored value.

Snippets of a symbolic register automaton $A_p$ illustrating the handling of back-references.

The primary technical contribution is the proof of decidability for SRA properties like emptiness and equivalence. The authors achieve this through Normalization. This process breaks down arbitrary predicates into minterms—minimal, mutually exclusive Boolean combinations. By translating an SRA into a "Normalized SRA," the infinite state space of register contents is abstracted into a finite form, enabling the use of standard graph reachability and bisimulation algorithms.

An example SRA showing transitions that combine predicates (e.g., divisibility) with register updates and checks.

Experimental Evaluation

The authors evaluated SRAs using 19 regular expressions with back-references from RegExLib, covering practical scenarios like XML tags and IP addresses. Performance was tested on inputs up to $10^8$ characters.

Key results include:

  • Succinctness: SRAs avoid state blowup. A regex that caused an SFA to balloon to over 3,000 states (or run out of memory) was represented by an SRA with fewer than 50 states.
  • Performance: The SRA implementation (part of the SVPALib library) scales linearly, processing $10^8$ characters in under 10 seconds.
  • Comparison to Java: The standard java.util.regex engine was found to be 50x slower on average. Furthermore, Java's engine frequently failed with Stack Overflow errors on inputs as small as 20,000 characters, whereas SRAs handled them effortlessly.

Conclusion

Symbolic Register Automata provide a mathematically sound and highly scalable alternative to traditional regex engines for complex patterns. While equivalence checking currently faces exponential complexity relative to the number of registers, the model's linear scaling for membership checks makes it ideal for high-performance applications. Future work includes optimizing bisimulation algorithms and exploring active automata learning for SRAs.

Summary updated

BibTeX
@inproceedings{dantoni2019symbolic,
  author = {Loris D'Antoni and Tiago Ferreira and Matteo Sammartino and Alexandra Silva},
  title = {{Symbolic Register Automata}},
  booktitle = {CAV},
  year = {2019},
  doi = {10.1007/978-3-030-25540-4\_1},
}
Figure