public static IConjunct refactor ( IConjunct conjunct ) { // Is there a single assertion term? Iterator < IDisjunct > disjuncts = conjunct . getDisjuncts ( ) ; IAssertion assertion = null ; while ( disjuncts . hasNext ( ) && ( assertion = toAssertion ( disjuncts . next ( ) ) ) == null ) ; return assertion == null // No, return original conjunction ? conjunct // Yes, return refactored conjunction : simplify ( new Conjunction ( assertion ) . append ( refactor ( remainder ( conjunct , assertion ) ) ) ) ; }
Return refactored conjunction formed by removing superfluous terms .