Manuscript Offprint
arXiv:2608.25032Fuzzy Pattern Matching in Ordered Structures
Armen Kostanyan
American University of Armenia
Yerevan, Armenia
Arevik Harmandayan
American University of Armenia
Yerevan, Armenia
Abstract. The problem of pattern matching, that is, finding all occurrences of a given pattern in a string, is one of the fundamental problems in computer science that has applications in many areas.
In this paper, we consider fuzzy patterns, defined as sequences of fuzzy properties over the basic alphabet. We first consider fuzzy pattern matching for sequences of elements of the basic alphabet and then extend the problem to partially ordered sets of nodes labeled by elements of the basic alphabet. For sequences, we seek segments that match the pattern, whereas for partially ordered structures, we seek saturated chains of nodes that match the pattern.
The key concept underlying the solutions to these problems is the notion of a trajectory, which generalizes the concept of the prefix function used in the Knuth–Morris–Pratt (KMP) algorithm. A trajectory is processed together with the corresponding data structure, allowing the proposed algorithms to be represented as transition systems whose states are trajectories for sequences and trajectories associated with nodes for partially ordered structures. The trajectory-based approach provides a unified framework for fuzzy pattern matching in various data structures.
Keywords: Fuzzy pattern matching, Approximate string matching, KMP-string matching
Corresponding author
1. Introduction
String matching, also referred to as pattern matching, is a fundamental problem in computer science. Given a pattern P and a text T, the exact string-matching problem consists of finding all occurrences of P in T. Efficient algorithms for string matching are widely used in applications such as plagiarism detection, cybersecurity, natural language processing, and bioinformatics [1].
In many practical situations, however, exact matching is too restrictive. A pattern may occur in a text with a small number of errors caused by misspellings, mutations, or other variations. This motivates approximate string matching, in which a text segment is considered an occurrence of a pattern if the distance between the two strings does not exceed a given threshold. Two classical models are Hamming-distance matching, which allows a bounded number of character substitutions, and edit-distance matching, which additionally allows insertions and deletions [2].
A related notion is fuzzy string matching, which generally refers to matching techniques that allow a degree of similarity or uncertainty in determining whether two strings correspond. Unlike exact matching and, in some formulations, distance-based approximate matching, fuzzy matching may represent the degree to which a matching condition is satisfied rather than relying solely on a binary match/mismatch criterion or a fixed number of editing operations. Fuzzy string matching has applications in entity resolution, search and information retrieval, and the automatic classification of noisy textual data [3, 4]. Fuzzy approaches have also been investigated in bioinformatics, where uncertainty and variability in biological sequences can make rigid character-by-character comparison inadequate [5].
The distinction between approximate and fuzzy matching is not always made consistently in the literature, and the two terms are sometimes used interchangeably. In this paper, we use the term fuzzy matching in a more specific sense. We consider fuzzy patterns to be sequences of fuzzy properties associated with pattern symbols. Thus, a pattern does not necessarily specify an exact character for each pattern symbol; instead, each pattern symbol specifies a property that the corresponding text character is required to satisfy to a prescribed degree. The matching problem is therefore to find all text segments whose characters satisfy the corresponding fuzzy properties to the specified degree.
Our previous works have addressed several problems in exact and fuzzy string matching. In [6], pattern periodicity was exploited to improve the efficiency of the preprocessing phase of the finite-automaton method and the Knuth–Morris–Pratt (KMP) algorithm. In [7], a nondeterministic transition system was constructed to describe the possible ways of processing a given text in order to find all occurrences of a fuzzy pattern. In [8], an efficient algorithm was proposed for finding all occurrences of a fuzzy pattern in a text, following the principles of the KMP algorithm and using a two-dimensional prefix table. In [9, 10], a different formulation of fuzzy patterns was considered, in which fuzzy properties were associated with text segments. The corresponding problem of finding segmentations of the text—i.e., decompositions into adjacent segments—such that the resulting segments match a fuzzy pattern to a specified degree was investigated.
This paper considers the fuzzy pattern matching problem in two settings.
The first setting extends classical pattern matching to fuzzy pattern matching, where a text segment is the search object. The second generalizes this setting by extending the search space to a finite partially ordered set of nodes, where a saturated chain of nodes serves as the search object. The solutions to both problems are based on the notion of a trajectory, which generalizes the prefix function used in the KMP algorithm by maintaining information about the compatibility of suffixes of the processed sequence with prefixes of the fuzzy pattern.
The paper is organized as follows. Section 2 introduces the basic concepts and definitions. Section 3 presents a solution to the fuzzy pattern matching problem for linear structures. The solution takes the form of an algorithm whose control component follows the structure of the KMP algorithm, while its operational component processes a trajectory object. Section 4 presents a solution to the fuzzy pattern matching problem for hierarchical structures represented by finite ordered rooted trees. The control component of the algorithm traverses the tree in preorder, while its operational component computes the trajectory object at each visited node. Finally, Section 5 concludes the paper and summarizes the main results.
2.1. Lists and strings
A list is a sequence of elements from a given set, defined recursively as follows. The empty sequence is a list. A nonempty list consists of a distinguished element called the head and a list called the tail, formed by the remaining elements.
The following standard operations are defined for lists:
• cons(elem, list): given elem and list, creates and returns a new list whose head is elem and whose tail is list;
• head(list): given a nonempty list, returns its head;
• tail(list): given a nonempty list, returns its tail.
In what follows, we denote a list by a sequence of its elements enclosed in square brackets.
Let be a finite alphabet of characters. Following standard notation [11], we denote the set of all strings over the alphabet , including the empty string , by . The length of a string is denoted by . In particular, .
Given strings , we say that is a suffix of , denoted by , if for some . We say that is a proper suffix of , denoted by , if and .
2.2. Fuzzy symbols and fuzzy patterns
Suppose is a linearly ordered set with the smallest element 0 and the largest element 1. A fuzzy subset of a set [12] is defined by a membership function that associates with each element a value , called the degree of membership of in .
A fuzzy subset A of U is usually represented in additive form as
We say that an element certainly belongs to if , and that it certainly does not belong to if . If , we say that belongs to with degree .
We define a fuzzy symbol over alphabet as a fuzzy subset of that assigns a degree of membership to each character in . Given a character and a fuzzy symbol with membership function , we say that matches with degree . In the complexity analysis that follows, we assume, without further mention, that can be computed in time.
Let denote the set of all fuzzy symbols over . We define a fuzzy pattern as a non-empty finite sequence of elements from and assume that it is represented as an array of components.
Given a threshold , a character , and a fuzzy symbol , we say that -matches , denoted by , if . This definition naturally extends to strings of equal length consisting of characters and fuzzy symbols, respectively. Namely, given a threshold , a string of characters from , and an array of fuzzy symbols from , we say that -matches , denoted by , if
2.3. Borders and trajectories
Let be a fuzzy pattern, let be a non-empty string with a length of no more than , and let .
A string is called a border of if and . In other words, the last characters of -match the first fuzzy symbols of . Given the parameters and , we denote the longest border of by , without explicitly mentioning these parameters.
For every string , the trajectory is a list of strings defined by the following recursive rules:
• If , then ;
• If and , then ;
• If and , then .
In addition to the standard list operations, we define the following operations on trajectories.
• length( ): given a trajectory , returns the number of strings contained in ;
• width( ): given a trajectory , returns the value .
We have
In the subsequent analysis, we assume that these operations run in time by keeping track of the corresponding values.
We call the trajectory empty and denote it by . Note that , .
Example 2.1. Let us choose
and define the fuzzy symbols S (small), M (medium), and L (large) as follows:
For the fuzzy pattern , the string , and the threshold , we obtain
3. Fuzzy pattern matching in linear structures
In this section, we consider the problem of fuzzy pattern matching in a string of characters from the basic alphabet. We say that a fuzzy pattern occurs in such a string if there is a segment of the same length as the pattern that -matches the pattern.
The problem of finding all occurrences of a fuzzy pattern in a string generalizes the classical string-matching problem and was solved in [8] using a dynamic programming method based on a two-dimensional prefix table, which generalizes the prefix-function array used in the KMP algorithm. In this section, we propose a new algorithm for solving this problem based on the trajectory algebra, with the same asymptotic time complexity and a lower asymptotic space complexity.
3.1. Fuzzy L-matching problem
Let be a string of length over the alphabet , let be a fuzzy pattern of length , and let be a threshold.
We define a -occurrence of the fuzzy pattern in as a segment , such that
Accordingly, we define the problem of fuzzy pattern matching as finding all -occurrences of P in X, which are identified by their end positions in X.
We call this problem the fuzzy L-matching problem.
3.2. Trajectory algebra
We define the following operations on trajectories. Below, we assume that is a trajectory with .
- isPromoted( ), . Given that and , checks whether -matches the corresponding prefix of , i.e.,
This check reduces to testing and thus has complexity .
• promote( ), . Given that the precondition of the isPromoted operation is satisfied and isPromoted( ) = true, the operation returns the trajectory formed by the strings in the following set, ordered by decreasing length:
Note that satisfies the trajectory requirements; that is, each subsequent element is the longest border of its preceding element, and . The returned trajectory satisfies
The operation has complexity .
• rollback( ). Given that , returns the trajectory . The returned trajectory satisfies
The operation has complexity .
We call the set of trajectories, together with their basic operations extended by the operations in the set {isPromoted, promote, rollback}, the trajectory algebra, and denote it by . In this section, we associate the following meanings with the elements of : If , then consists of those suffixes of the portion of the text processed so far for which . As the text is processed, the trajectory changes accordingly. When , a -occurrence of the fuzzy pattern is detected, and the trajectory is reset.
The notion of a trajectory generalizes the role of the prefix function used in the KMP algorithm. In the classical KMP algorithm for exact pattern matching [13, 14], the prefix function array of length m is computed during the preprocessing phase based solely on the pattern. In the case of a fuzzy pattern, the text is processed together with the pattern, and the matching history is continuously maintained and updated in a trajectory of length at most m.
3.3. Fuzzy L-matching algorithm
Figure 1 presents a solution to the fuzzy pattern matching problem for linear structures based on the trajectory algebra.
Algorithm 1: FL – Matching// Prints all valid shifts
Input: Fuzzy pattern , string , and threshold
Output: All -occurrences of in
1 // current trajectory
2 for to do
3 while length( ) > 1 and not isPromoted( , ) do
4
5 end
6 if isPromoted( , ) then
7
8 end
9 if width( ) == m // entire pattern matched then
10 Print(i)
11
12 end
13 end
Figure 1. The FL – Matching algorithm.
3.4. Fuzzy linear matching in terms of a transition system
The FL – Matching algorithm can be viewed as a process in the trajectory algebra driven by the successive characters of the input sequence .
More precisely, consider the labeled transition system
constructed for the fuzzy pattern P as follows:
■ is the set of states;
■ is the initial state;
■ is the set of final states, consisting of trajectories of width . Upon reaching a final state, an occurrence of the fuzzy pattern in the text is detected;
■ is the input alphabet;
■ is the transition function defined by the following rules. In what follows, denotes an -transition that consumes no input symbol, whereas , as defined above, denotes the empty string.
L1. Trajectory reduction:
L2. Trajectory update:
L3. Trajectory reset:
Example 3.1. Let us represent the execution of the FL-Matching algorithm in the transition system , assuming that
and that the fuzzy symbols S, M, and L are defined as in Example 2.1.
The execution is as follows:
Thus, we have found two occurrences of the fuzzy pattern in X, namely, the segments 2314 and 1425.
3.5. Justification and analysis
Let us call the point immediately before the if statement in line 9 of the FL – Matching algorithm an inflection point. At this point, the algorithm checks whether ; if so, a -occurrence of the pattern is detected and the trajectory is rolled back.
Lemma 3.2. (Trajectory inflection lemma)
Let be the trajectory at the inflection point in the -th iteration of the FL – Matching algorithm, . Then consists of all borders of the string .
Proof:
We prove the lemma by induction on . The base case is immediate. Assume that the assertion holds for , where , and prove that it also holds for .
First, note that is obtained from by applying the rollback operation several times, followed by the promote operation at most once. After all rollback operations have been applied, we obtain a trajectory whose elements are all borders of the string . The subsequent execution of the promote operation in line 7 constructs a trajectory whose elements are borders of . Hence, every element of is a border of .
To prove the converse, suppose that there exists a non-empty border y of that is not an element of .
Then, , where is a border of and . By the induction hypothesis, is an element of . It cannot be removed from this trajectory when executing the rollback operation in line 11 of the -th iteration, since , nor when executing the rollback operation in line 4 of the -th iteration, since
As a result, must have been added to after the execution of the promote operation in line 7, which yields a contradiction.
Corollary 3.3. Let be the trajectory at the inflection point in the -th iteration of the FL-Matching algorithm, . Then
Remark 3.4. Note that Lemma 3.2 can be viewed as stating that is an invariant of the algorithm at the inflection point.
Theorem 3.5. The FL-Matching algorithm finds all and only the -occurrences of the fuzzy pattern P in the string X.
Proof:
Note that whenever at the inflection point, the algorithm detects a -occurrence of P in X. Thus, the algorithm reports only -occurrences of P in X.
Conversely, suppose that
is a -occurrence of P in X. Since is a suffix of of length m that -matches P, it is the longest border of . By Corollary 3.3,
and hence at the inflection point of the -th iteration of the algorithm. Therefore, the algorithm prints the specified -occurrence in line 10.
ANALYSIS
Let us use the potential method [15] to estimate the complexity of the for loop in lines 2–13. Define the potential at the beginning of each iteration as . Initially, the potential is 0, and it never becomes negative.
Note that the while loop in lines 3–5 has amortized complexity: its actual cost is compensated by a decrease in the potential.
The first if statement in lines 6–8 has amortized complexity: its actual cost is , while the potential increases by at most 1.
The second if statement in lines 9–12 has amortized complexity: its actual cost is , and the potential decreases by at least 1.
Therefore, the amortized cost of one execution of the body of the for loop is . Since the loop is executed times, the total time complexity of the FL-Matching algorithm is .
The space complexity of the algorithm is bounded by the maximum capacity of a trajectory , which is at most
4. Fuzzy pattern matching in hierarchical structures
In this section, we consider the problem of fuzzy pattern matching in a hierarchical structure represented as an ordered rooted tree whose nodes are labeled with characters from the basic alphabet. We say that a fuzzy pattern occurs in such a structure if there is a descending chain of adjacent nodes of the same length as the pattern whose sequence of labels -matches the fuzzy pattern.
We propose an algorithm for finding all occurrences of a fuzzy pattern in a tree by traversing it in preorder and tracking trajectories at the visited nodes.
4.1. Fuzzy H-matching problem
Let G be a finite partially ordered set of nodes with a smallest element , which is isomorphic to a tree whose root node is . We assume that this tree is equipped with an ordering and refer to G as an ordered rooted tree. For the tree G, the terms "parent" and "child" are used in their usual sense.
We denote the set of child nodes of a node by ; this set is empty for leaf nodes. We define a descending chain of nodes as a sequence of of nodes such that
, and call the length of the chain. We represent a chain of length as an array of nodes. A descending chain in the derived tree corresponds to a saturated chain in the underlying partially ordered set. Accordingly, we use the terms descending chain in the tree and saturated chain in the partially ordered set interchangeably to refer to the same sequence of nodes.
Let be the basic alphabet. A mapping that assigns a character from to each node of is called a labeling of . We call the triple a hierarchical structure over .
Given a fuzzy pattern , a chain of length in a hierarchical structure , and a threshold , we say that -matches , denoted by , if
We define the problem of finding a fuzzy pattern in a hierarchical structure as the problem of finding all descending chains in that -match , with each occurrence identified by its end node in . We call this problem the fuzzy -matching problem.
Note that the fuzzy L-matching problem is a special case of the fuzzy H-matching problem if the string is viewed as a hierarchical structure whose underlying tree consists of a single descending chain of length n.
4.2. Fuzzy H-matching algorithm
We represent our solution to the fuzzy H-matching problem as a discrete converter. Its control component, represented by the FH-Matching algorithm, traverses the tree G in preorder using a stack that stores nodes together with trajectories of the parent nodes. Its operational component, represented by the visitNode subroutine, promotes the trajectory associated with the parent node to the current node.
Detailed descriptions of these algorithms are presented in Figures 2 and 3.
Algorithm 2: FH – Matching// Control component
Input: Fuzzy pattern , hierarchical structure , threshold
Output: All -occurrences of in
1 stack.push( ) // stack initialization
2 while stack is non-empty do
3
4
5 let
6 for downto 1 do
7
8 end
9 end
Figure 2. The FH – Matching algorithm.
Algorithm 3: visitNode// Operational component
Input: Current node labeled by , trajectory for the parent of node
Output: Trajectory for node
1 while length( ) > 1 and not isPromoted( , c) do
2
3 end
4 if isPromoted( , c) then
5
6 end
7 if width( ) == m then
8 Print(g) // an occurrence of P in is found
9
10 end
11 return
Figure 3. The visitNode procedure.
4.3. Events
When working with hierarchical structures, it is necessary to complement the concept of a trajectory by associating it with a node. We call such a pair an event. Processing an event involves two cases: the trajectory stored in the event may be that associated with the parent node or that associated with the node of the event. In the first case, we say that the event is unrealized, and in the second, that it is realized.
Formally, an event is defined as a pair , where and . However, during the execution of the FH-Matching algorithm, there are two possibilities for the trajectory associated with a given node . To clarify this point, assume that
• is a node,
• path(g) = g₁ ⋯ gₖ, where g₁ = Λ and gₖ = g, is the unique path from the root to g,
• is the string of labels along this path,
• is the trajectory of .
Then, an event associated with node contains either , in which case it is called realized, or rollback(), provided that length() > 1, in which case it is called unrealized.
We denote by the set of all unrealized events, by the set of all realized events, and by
the set of all events. We distinguish the initial event
and the set
of final events.
The execution of the FH-Matching algorithm consists of sequentially extracting the next event from the stack of unrealized events, realizing it using the visitNode procedure, and adding the resulting unrealized events corresponding to the child nodes, if any, to the stack.
For convenience, we represent the visitNode procedure as a mapping
which maps an unrealized event to the realized event .
4.4. Fuzzy hierarchical matching in terms of a pushdown transition system
From a theoretical point of view, the execution of the FH – Matching algorithm can be represented as a process in the space of events, using a stack of unrealized events and driven by the sequence of node labels encountered during the traversal.
Using standard notation for pushdown automata [11], let us consider the labeled pushdown transition system
where
■ is the set of states, consisting of the set of events supplemented by a dummy state nil;
■ is the initial state;
■ F is the set of final states and coincides with the set of final events;
■ is the input alphabet;
■ is the stack alphabet;
■ is the initial stack symbol;
■ is the transition function defined by the following rules:
H1. Event realization:
H2. Pushing successors into the stack:
H3. Popping the next unrealized event from the stack:
We define a configuration of our transition system as a pair
where and stack denotes the contents of the stack, listed from top to bottom, at the time is processed. Among the configurations, we distinguish the initial configuration and the final configurations, whose events are final events.
A sequence of configurations starting from the initial configuration and following the transition function is called a process in the transition system. Such a process outputs a node whenever it visits a final state. We call a process terminated if its last configuration is .
Example 4.1. We represent the execution of the FH-Matching algorithm for the fuzzy pattern , where and are defined as in Example 2.1, with matching parameter , on the hierarchical structure shown in Figure 4, as a terminated process in the transition system . In the figure, slash notation is used to denote a node together with its label.

Figure 4. A hierarchical structure.
The execution is as follows:
This process outputs the node upon reaching state and the node upon reaching state . Thus, the hierarchical structure contains two occurrences of the fuzzy pattern , ending at nodes and , respectively. These occurrences correspond to the following node chains:
4.5. Justification and analysis
Theorem 4.2. The FH-Matching algorithm finds all and only the -occurrences of the fuzzy pattern P in the hierarchical structure .
Proof:
The result is consistent with the corresponding result for linear structures (Theorem 3.5). Since the preorder traversal of visits every node exactly once, every possible end node of a -occurrence is considered by the algorithm. Moreover, after a node is visited by the visitNode procedure, the head of the resulting trajectory is exactly the longest suffix of that -matches the corresponding prefix of . In particular, when the trajectory has width , the corresponding chain is a -occurrence of , and every such occurrence is detected when its end node is visited.
ANALYSIS
During the preorder traversal of the tree G, every node is visited exactly once, and processing each node takes time. Therefore, the time complexity of the FH-Matching algorithm is , where N is the number of nodes in G.
The space complexity of the algorithm is determined by the maximum size of the stack. Since the stack contains elements, where is the height of the tree, and each stack element requires space, the space complexity of the FH-Matching algorithm is .
5. Conclusion
The paper considers the problem of fuzzy pattern matching in linear and hierarchical structures. A fuzzy pattern is defined as a finite sequence of fuzzy properties associated with pattern symbols. A segment of the text over the basic alphabet matches a fuzzy pattern if they are of the same length and each character in the segment satisfies the fuzzy property associated with the corresponding pattern symbol to at least a prescribed degree.
The following items summarize our main contributions to the fuzzy pattern matching problem in linear and hierarchical structures.
• Matching in linear structures. The problem of finding a fuzzy pattern in a linear structure is solved by an algorithm whose control structure is similar to that of the KMP algorithm but which processes trajectories rather than integers. The notion of a trajectory generalizes the role of the prefix-function array underlying the KMP algorithm in the following sense. The prefix-function array is determined solely by the pattern and can therefore be constructed during the preprocessing stage. In contrast, a trajectory depends on both the pattern and the text being processed and is constructed dynamically during the execution of the algorithm. The algorithm is represented as a labeled transition system [16] whose states are trajectories.
The time complexity of the algorithm is , and its space complexity is , where m and n denote the lengths of the pattern and the sequence, respectively.
• Matching in hierarchical structures. The fuzzy matching problem is extended to hierarchical structures represented by finite ordered rooted trees. In this setting, finding a fuzzy pattern amounts to finding all descending chains of nodes whose sequences of labels match the fuzzy pattern. The problem is solved by traversing the tree in preorder and tracking trajectories associated with the visited nodes. The algorithm is represented as a labeled pushdown transition system [16] whose states are events, each consisting of a tree node together with its associated trajectory.
The time complexity of the algorithm is , and its space complexity is , where m denotes the length of the pattern, and N and H denote the number of nodes and the height of the tree, respectively.
References
[1] Hakak S, Kamsin A, Shivakumara P, Gilkar G, Khan W, Imran M. Exact String Matching Algorithms: Survey, Issues, and Future Research Directions. IEEE Access, 2019. 7:69614 – 69637. doi:1:56PM8/11/202610.1109/access.2019.2914071.
[2] Charalampopoulos P, Kociumaka T, Wellnitz P. Faster Approximate Pattern Matching: A Unified Approach. 2020. 2004.08350, URL https://arxiv.org/abs/2004.08350.
[3] Yu M, Li G, Deng D, Feng J. String similarity search and join: a survey. Frontiers of Computer Science, 2016. 10:399–417.
[4] Pikies M, Ali J. Analysis and safety engineering of fuzzy string matching algorithms. ISA Transactions, 2021. 113:1–8. doi:https://doi.org/10.1016/j.isatra.2020.10.014. URL https://www.sciencedirect.com/science/article/pii/S0019057820304092.
[5] Zekâi, Şen. Fuzzy String Matching Procedure. The Open Bioinformatics Journal, 2020. 13:50–56. URL https://doi.org/10.2174/187503620201301005012:15PM8/11/2026.
[6] Kostanyan A, Karapetyan A. String Matching in Case of Periodicity in the Pattern. Recent Research in Control Engineering and Decision Making, 2019. 199:61–66. doi:10.1007/978-3-030-12072-6_6.
[7] Kostanyan A. Fuzzy string matching with finite automat. Computer Science and Information Technologies, 2017 IEEE Conference, 2017. pp. 9–11. doi:10.1109/CSITechnol.2017.8312128.
[8] Kostanyan A. Fuzzy String Matching Using a Prefix Table. Mathematical Problems of Computer Science, 2020. 54:116–121.
[9] Kostanyan A, Harmandayan A. Mapping a Fuzzy Pattern onto a String. Computer Science and Information Technologies, 2019 IEEE Conference, 2019. pp. 5–8. doi:10.1109/CSITechnol.2019.8895245.
[10] Kostanyan A, Harmandayan A. An Approach to Fuzzy Clustering of Strings. Computer Science and Information Technologies, 2025. pp. 225–228. doi:10.51408/csit2025_55.
[11] Hopcroft JE, Motwani R, Ullman JD. Introduction to Automata Theory, Languages, and Computation. Pearson Education, 3 edition, 2007.
[12] Wu H. Mathematical Theory of Fuzzy Sets. CRC Press LLC, 2024. ISBN 9781032905846. URL https://books.google.am/books?id=8WDTOAEACAAJ.
[13] Knuth DE, Jr JHM, Pratt VR. Fast Pattern Matching in Strings. SIAM Journal on Computing, 1977. 6:323–350.
[14] Dehghani H, Mhaskar N, Smyth WF. Practical KMP/BM Style Pattern-Matching on Indeterminate Strings. 2024. 2204.08331, URL https://arxiv.org/abs/2204.08331.
[15] Cormen TH, Leiserson CE, Rivest RL, Stein C. Introduction to Algorithms. MIT Press, 4 edition, 2022. ISBN 978-0-262-04630-5.
[16] Schlichtkrull A, Schou MK, Srba J, Traytel D. Labeled Transition Systems. Archive of Formal Proofs, 2023. https://isa-afp.org/entries/Labeled_Transition_Systems.html, Formal proof development.