Thompson's algorithm for regular expression matching
E162093
Thompson's algorithm for regular expression matching is a classic method that converts regular expressions into nondeterministic finite automata (NFAs) to enable efficient pattern matching in text processing.
All labels observed (4)
| Label | Occurrences |
|---|---|
| Thompson NFA construction | 1 |
| Thompson construction for NFAs | 1 |
| Thompson's algorithm for regular expression matching canonical | 1 |
| Thompson's construction | 1 |
How this entity was disambiguated
This entity first appeared as the object of triple T1413055 — resolving that mention is where its identity was fixed. The disambiguator weighed these candidate entities and picked the highlighted one (or “None”, minting a new entity). This is how homonymy is resolved: the same surface form can point to different entities.
Target entity: Thompson's algorithm for regular expression matching Context triple: [Ken Thompson, knownFor, Thompson's algorithm for regular expression matching]
-
A.
Knuth–Morris–Pratt algorithm
The Knuth–Morris–Pratt algorithm is a classic linear-time string-searching algorithm that efficiently finds occurrences of a pattern within a text by precomputing a prefix function to avoid redundant comparisons.
-
B.
Introduction to the Theory of Computation
Introduction to the Theory of Computation is a widely used textbook in theoretical computer science that covers formal languages, automata, computability, and complexity theory.
-
C.
Compilers: Principles, Techniques, and Tools
Compilers: Principles, Techniques, and Tools is a foundational computer science textbook that systematically covers the theory and practice of compiler design and implementation.
-
D.
Knuth–Bendix completion algorithm
The Knuth–Bendix completion algorithm is a procedure in term rewriting and automated theorem proving that transforms a set of equations into a confluent rewriting system, enabling decision of word problems in algebraic structures.
-
E.
DFA
DFA is an online advertising management and ad-serving platform originally developed by DoubleClick and later integrated into Google's marketing and ad technology stack.
- F. None of above. chosen
- G. Unsure - the case is ambiguous/there is not enough information to decide.
Target entity: Thompson's algorithm for regular expression matching Target entity description: Thompson's algorithm for regular expression matching is a classic method that converts regular expressions into nondeterministic finite automata (NFAs) to enable efficient pattern matching in text processing.
-
A.
Knuth–Morris–Pratt algorithm
The Knuth–Morris–Pratt algorithm is a classic linear-time string-searching algorithm that efficiently finds occurrences of a pattern within a text by precomputing a prefix function to avoid redundant comparisons.
-
B.
Introduction to the Theory of Computation
Introduction to the Theory of Computation is a widely used textbook in theoretical computer science that covers formal languages, automata, computability, and complexity theory.
-
C.
Compilers: Principles, Techniques, and Tools
Compilers: Principles, Techniques, and Tools is a foundational computer science textbook that systematically covers the theory and practice of compiler design and implementation.
-
D.
Knuth–Bendix completion algorithm
The Knuth–Bendix completion algorithm is a procedure in term rewriting and automated theorem proving that transforms a set of equations into a confluent rewriting system, enabling decision of word problems in algebraic structures.
-
E.
DFA
DFA is an online advertising management and ad-serving platform originally developed by DoubleClick and later integrated into Google's marketing and ad technology stack.
- F. None of above. chosen
Statements (48)
| Predicate | Object |
|---|---|
| instanceOf |
NFA construction algorithm
ⓘ
algorithm ⓘ regular expression matching algorithm ⓘ |
| advantage |
avoids exponential blowup of DFA construction in many cases
ⓘ
linear-time NFA construction in the size of the regular expression ⓘ simple and systematic construction rules ⓘ |
| alsoKnownAs |
Thompson's algorithm for regular expression matching
ⓘ
surface form:
Thompson construction for NFAs
Thompson's algorithm for regular expression matching ⓘ
surface form:
Thompson's construction
|
| basedOn | regular expressions ⓘ |
| constructionRule |
for Kleene star, add epsilon transitions to allow zero or more repetitions of the operand NFA
ⓘ
for a literal symbol, create an NFA with one transition labeled by that symbol ⓘ for alternation, create new start and accept states with epsilon transitions to and from the operand NFAs ⓘ for concatenation, connect accept state of first NFA to start state of second NFA with epsilon ⓘ |
| contrastWith | backtracking-based regex matching algorithms ⓘ |
| coreIdea |
construct an NFA whose size is linear in the length of the regular expression
ⓘ
simulate the constructed NFA to perform matching ⓘ |
| creator | Ken Thompson ⓘ |
| field |
automata theory
ⓘ
computer science ⓘ formal language theory ⓘ text processing ⓘ |
| input | regular expression ⓘ |
| output | NFA ⓘ |
| produces | nondeterministic finite automata ⓘ |
| property |
construction is compositional over the structure of the regular expression
ⓘ
constructs NFAs with a single start state and a single accept state ⓘ does not suffer from catastrophic backtracking ⓘ matching time is guaranteed polynomial in input size ⓘ |
| publishedIn | Communications of the ACM ⓘ |
| purpose |
implementation of regular expression engines
ⓘ
pattern matching in strings ⓘ |
| relatedTo |
Glushkov construction
ⓘ
backtracking regular expression engines ⓘ deterministic finite automata ⓘ position automaton ⓘ powerset construction ⓘ |
| simulationMethod |
epsilon-closure computation of NFA states
ⓘ
subset simulation of active NFA states ⓘ |
| spaceComplexity | O(m) for NFA simulation ⓘ |
| timeComplexity | O(n·m) for matching, where n is input length and m is NFA size ⓘ |
| usedIn |
Unix text processing tools
ⓘ
early Unix regular expression implementations ⓘ many NFA-based regex engines ⓘ |
| usesOperation |
Kleene star
ⓘ
alternation ⓘ concatenation ⓘ epsilon transitions ⓘ |
| yearIntroduced | 1968 ⓘ |
How these facts were elicited
The pipeline generated the facts above by prompting gpt-5.1 with this entity's name + description and the instruction below.
You are a knowledge base construction expert. Given a subject entity and a description of it, return factual statements that you know for the subject as a JSON list of dictionaries(triples), where keys must be "subject", "predicate" and "object". The number of facts may be very high, between 25 to 50 or more, for very popular subjects. For less popular subjects, the number of facts can be very low, like 5 or 10. # Requirements - If you don't know the subject at all, return an empty list. - If the subject is not a named entity, return an empty list. - Include at least one triple where predicate is "instanceOf". - Do not get too wordy. - Separate several objects into multiple triples with one object.
Subject: Thompson's algorithm for regular expression matching Description of subject: Thompson's algorithm for regular expression matching is a classic method that converts regular expressions into nondeterministic finite automata (NFAs) to enable efficient pattern matching in text processing.
Referenced by (4)
Full triples — surface form annotated when it differs from this entity's canonical label.