Making MPM a prefilter library. Step2: Detecting sub patterns.