Pattern Matching Machine with Conditional Mappings for Wildcards
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
The Aho-Corasick pattern matching algorithm is limited in handling indeterminate search patterns due to its dependence on determinate suffixes, making it inefficient for patterns with wildcard symbols or iterative metacharacters, which requires pre- and post-processing steps, increasing resource and time constraints.
Innovation Solution
A pattern matching machine is developed that includes conditional mappings and a dictionary of patterns to handle wildcard symbols, allowing for efficient identification of matches in input symbols by generating a second state machine that can execute at runtime to identify applicable mappings based on input symbols, thereby accommodating indeterminate features like wildcards and iterative metacharacters.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If the Aho-Corasick algorithm is used for pattern matching, then single-pass matching efficiency is improved, but the algorithm cannot handle indeterminate symbols (wildcards) without pre- and post-processing steps
Solution Approach 1:
The pattern is segmented into determinate parts (fixed symbols) and indeterminate parts (wildcards). The determinate parts are used to construct the finite-state automaton states and transitions, while the indeterminate parts are handled through conditional mappings that are evaluated at runtime. This segmentation allows the algorithm to maintain single-pass efficiency for the determinate portions while accommodating wildcards through conditional logic.
Solution Approach 2:
The failure function is transformed from a static mapping (as in traditional Aho-Corasick) to a dynamic conditional mapping system. Instead of pre-defining fixed failure transitions, the system uses conditional mappings that are evaluated at runtime based on the actual input symbols encountered. This dynamic approach allows the algorithm to adapt to wildcard symbols while maintaining the single-pass matching capability.
2Adaptability or versatility
If pre- and post-processing steps are added to handle wildcards in Aho-Corasick, then wildcard pattern matching capability is improved, but resource and time constraints increase
Solution Approach 1:
The automaton is pre-constructed with states and transitions based on the determinate portions of the pattern, including placeholder transitions for wildcard positions. Conditional mappings are pre-computed for each state to identify potential failure targets. This preliminary setup enables the system to handle wildcards during the single pass without requiring separate pre- or post-processing steps, thus avoiding additional time overhead.
3Measurement precision
If the failure function maps to proper suffixes in Aho-Corasick, then state mapping accuracy is improved, but the approach fails when patterns include wildcard symbols
Solution Approach 1:
Conditional mappings serve as an intermediary mechanism between the deterministic state transitions and the indeterminate wildcard symbols. When a wildcard is encountered in the pattern, the conditional mapping system identifies potential failure states based on the context and the specific wildcard symbol value, rather than relying on fixed suffix-based mappings. This intermediary layer preserves mapping accuracy by using context-aware logic while enabling wildcard handling.
Data Source
AI summary
A computer implemented method to generate a pattern matching machine to identify matches of a plurality of symbol patterns in a sequence of input symbols, wherein one or more of the symbol patterns includes a plurality of wildcard symbols.


