Regex Splitting Between DFA and NFA to Limit Graph Growth

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing regular expression compilers face challenges in generating efficient deterministic finite automaton (DFA) graphs that grow large quickly, even for simple patterns, while non-deterministic finite automaton (NFA) offers flexibility at the cost of performance predictability.

Innovation Solution

A method is introduced to split regular expression patterns into different sets of tokens using specific criteria, employing a first splitting process for single path expressions and a second process for others, optimizing the generation of DFA and NFA graphs.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Speed

If DFA is used for processing regular expressions, then search speed is improved, but graph size grows very large quickly

Engineering Contradiction:
Improvesearch speedVSAvoidDFA graph size
Core Design Contradiction:
SpeedVSVolume of stationary object

Solution Approach 1:

The patent divides regular expression patterns into two categories: single-path patterns (processed by DFA) and multi-path patterns (processed by NFA). This segmentation allows the system to use DFA's fast search capability for simple patterns while avoiding its graph size explosion problem for complex patterns, and use NFA for patterns requiring flexibility without incurring DFA's overhead.

Inventive Principle:
Principle #1Segmentation

2Adaptability or versatility

If NFA is used for processing regular expressions, then flexibility is improved, but performance predictability deteriorates

Engineering Contradiction:
Improveprocessing flexibilityVSAvoidperformance predictability
Core Design Contradiction:
Adaptability or versatilityVSReliability

Solution Approach 1:

The patent applies different processing qualities to different parts of the regular expression workload: DFA is used for single-path patterns where predictable performance is sufficient, while NFA is used for multi-path patterns where flexibility is required. This local differentiation allows each processing engine to operate in its optimal performance zone.

Inventive Principle:
Principle #3Local quality

3Volume of stationary object

If DFA graph size is reduced, then memory usage is improved, but processing capability deteriorates

Engineering Contradiction:
ImproveDFA graph sizeVSAvoidpattern processing capability
Core Design Contradiction:
Volume of stationary objectVSAdaptability or versatility

Solution Approach 1:

The patent merges DFA and NFA processing engines into a unified regular expression processing system. By combining the strengths of both approaches and routing patterns to the appropriate engine based on their characteristics, the system maintains comprehensive pattern processing capability while avoiding DFA's graph size explosion for unsuitable patterns.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS20250348678A1Splitting regular expressions between non-deterministic finite automaton and deterministic finite automaton
Publication Date: 2025.11.13 MICROSOFT TECHNOLOGY LICENSING LLC
  • US20250348678A1 patent drawing
  • US20250348678A1 patent drawing
  • US20250348678A1 patent drawing

AI summary

Systems, methods, and computer-readable medium for splitting regular expressions between non-deterministic finite automaton and deterministic finite automaton are provided. A method includes parsing a set of regular expression patterns to generate an output. The method further includes processing the output to determine whether any of the set of regular expression patterns meets a specified criteria including whether a regular expression pattern is a single path regular expression. The method further includes using a first splitting process, splitting any of the set of regular expression patterns that meet the specified criteria into a first set of tokens. The method further includes using a second splitting process, different from the first splitting process, splitting any of the set of regular expression patterns that fail to meet the specified criteria into a second set of tokens.