Modular invariant generation with instantiation.