Checks if an algebraic structure is commutative.