Text this: An algebraic normal form for regular events.