Added proper equals and hashCode for epistemic formula and implemented visitor pattern to extract subformula and simple formulas.