Skip to content
Tape‑n‑Trace
PracticeSearch 26 tools

← All case studies

Log file analysis

CO2BTL 4 – AnalyzeSDG 9 — Industry, Innovation & InfrastructureModule 2

A log is a sequence of lines, each INFO, WARN or ERROR; this accepts a log containing at least one error. Abstracting a whole line to one symbol is the move that makes it finite-state — and shows why real log analysis reaches for keyword search over the raw characters instead, which is the next case along.

The expression

(E+W+I)*E(E+W+I)*

The machine below is its minimal DFA — 2 states over {E, I, W}. Open it in the playground to see the parse tree and the ε-NFA it came from.

EI, WE, I, W{{q0,q2,q3,q4,q5,q6,q8,q9,q11,q12},{q0,q2,q4,q6,q7,q8,q9,q11,q12},{q10}}{{q0,q1,q2,q4,q5,q6,q8,q9,q11,q12,q13,q14,q15,q16,q18,q19,q20,q22,q23,q24,q25},{q0,q1,q2,q4,q5,q6,q8,q9,q11,q12,q13,q14,q16,q18,q20,q22,q24,q25},{q0,q2,q3,q4,q5,q6,q8,q9,q11,q12,q14,q16,q17,q18,q19,q20,q22,q23,q25},{q0,q2,q4,q6,q7,q8,q9,q11,q12,q14,q16,q18,q20,q21,q22,q23,q25}}
Try
EI, WE, I, W{{q0,q2,q3,q4,q5,q6,q8,q9,q11,q12},{q0,q2,q4,q6,q7,q8,q9,q11,q12},{q10}}{{q0,q1,q2,q4,q5,q6,q8,q9,q11,q12,q13,q14,q15,q16,q18,q19,q20,q22,q23,q24,q25},{q0,q1,q2,q4,q5,q6,q8,q9,q11,q12,q13,q14,q16,q18,q20,q22,q24,q25},{q0,q2,q3,q4,q5,q6,q8,q9,q11,q12,q14,q16,q17,q18,q19,q20,q22,q23,q25},{q0,q2,q4,q6,q7,q8,q9,q11,q12,q14,q16,q18,q20,q21,q22,q23,q25}}

Input

0 of 3 read

Narration

{{q0,q2,q3,q4,q5,q6,q8,q9,q11,q12},{q0,q2,q4,q6,q7,q8,q9,q11,q12},{q10}}

Start in state {{q0,q2,q3,q4,q5,q6,q8,q9,q11,q12},{q0,q2,q4,q6,q7,q8,q9,q11,q12},{q10}} with "IIE" still to read.

Hopcroft 2e, §2.2.4

Accepted

Run many strings

One string per line. A blank line means the empty string.