Formal Reasoning in Software-defined Networks