Composite sequence compaction for finite-state machines using block entropy and high-order Markov models