Partial Order Reduction for Rewriting Semantics of Programming