The compulsory joinder statute provides:
“(a) When the same conduct of a defendant may establish the commission of more than one offense, the defendant may be prosecuted for each such offense. (b) If the several offenses are known to the proper prosecuting officer at the time of commencing the prosecution and are within the jurisdiction of a single court, they must be prosecuted in a single prosecution *** if they are based on the same act.”
The General Assembly enacted the compulsory joinder statute “to prevent the prosecution of multiple offenses in a piecemeal fashion and to forestall, in effect, abuse of the prosecutorial process. A prosecutor might otherwise harass a defendant through successive prosecutions of multiple offenses and put a defendant through the expense of several trials until the prosecutor obtains a result that satisfies him.” People v. Quigley, 183 Ill. 2d 1, 7 (1998).