Finite Automaton via Regular Expression Derivatives for Backtracking Simulation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Backtracking engines used for string-searching algorithms face performance issues due to exponential worst-case matching time, leading to unpredictable performance and potential denial of service attacks, while conventional automaton-based matching techniques may not match the same substrings as backtracking engines.

Innovation Solution

Constructing a finite automaton using regular expression derivatives to simulate the behavior of a backtracking engine, allowing for the creation of a graph with prioritized nodes and transitions that mimic the evaluation order of a backtracking engine, ensuring linear-time matching and matching the same substrings.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If backtracking engine is used for string-searching, then ease of implementation and wide feature set are achieved, but worst-case matching time increases exponentially

Engineering Contradiction:
Improveease of implementationVSAvoidmatching time
Core Design Contradiction:
Ease of manufactureVSLoss of time

Solution Approach 1:

The patent segments the backtracking engine's evaluation process into prioritized paths represented in the finite automaton. Each path corresponds to a specific evaluation order, allowing the system to divide the search space into manageable segments that can be processed efficiently without exponential time complexity.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates a finite automaton that copies and simulates the behavior of the backtracking engine. This automaton replica preserves the evaluation order and matching logic of the original backtracking engine while executing in linear time, effectively creating an efficient copy that eliminates the time complexity issue.

Inventive Principle:
Principle #26Copying

2Loss of time

If conventional automaton-based matching technique is used, then linear-time matching is guaranteed, but same substrings as backtracking engine are not matched

Engineering Contradiction:
Improvematching timeVSAvoidsubstring matching consistency
Core Design Contradiction:
Loss of timeVSReliability

Solution Approach 1:

The patent introduces dynamic prioritization into the finite automaton by assigning different priorities to transitions based on the backtracking engine's evaluation order. This dynamic assignment of priorities allows the automaton to adapt its behavior to match the backtracking engine's substring selection, ensuring reliability while maintaining linear-time performance.

Inventive Principle:
Principle #15Dynamics

Solution Approach 2:

The patent changes the parameter of transition priorities in the finite automaton to match the evaluation order of the backtracking engine. By adjusting these priority parameters, the automaton's matching behavior is tuned to produce the same substrings as the backtracking engine, resolving the reliability issue while preserving the linear-time advantage.

Inventive Principle:
Principle #35Parameter changes

3Loss of time

If finite automaton is constructed to match backtracking behavior, then linear-time matching and consistent substring matching are achieved, but device complexity increases

Engineering Contradiction:
Improvematching timeVSAvoidautomaton construction complexity
Core Design Contradiction:
Loss of timeVSDevice complexity

Solution Approach 1:

The patent performs preliminary action by pre-computing the prioritized paths and evaluation order during the automaton construction phase. This upfront work captures the backtracking engine's behavior characteristics, allowing the resulting finite automaton to execute efficiently in linear time without requiring complex runtime decisions, thus managing complexity through advance preparation.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS11983223B2Finite automaton construction using regular expression derivatives to simulate behavior of a backtracking engine
Publication Date: 2024.05.14 MICROSOFT TECHNOLOGY LICENSING LLC
  • US11983223B2 patent drawing
  • US11983223B2 patent drawing
  • US11983223B2 patent drawing

AI summary

Techniques are described herein that are capable of constructing a finite automaton using regular expression derivatives to simulate behavior of a backtracking engine. The behavior indicates an order in which paths in an input regular expression are to be evaluated by the backtracking engine. The finite automaton is constructed to include a graph that includes a root node that represents the input regular expression. Regular expressions are derived such that each derived regular expression is a regular expression derivative of the input regular expression or of another derived regular expression. Priorities are assigned to alternations in the derived regular expressions to correspond to priorities indicated by the behavior. Nodes that represent the respective derived regular expressions and transitions between respective pairs of nodes are caused to be included in the graph. Priorities, which correspond to the order, are assigned to respective branches of the graph.