Program Regularization in Memory Consistency Verification