check whether two constraints are equivalent.