private Formula constructCNF ( final LinkedHashSet < ? extends Formula > clauses ) { if ( clauses . isEmpty ( ) ) return this . verum ( ) ; if ( clauses . size ( ) == 1 ) return clauses . iterator ( ) . next ( ) ; Map < LinkedHashSet < ? extends Formula > , And > opAndMap = this . andsN ; switch ( clauses . size ( ) ) { case 2 : opAndMap = this . ands2 ; break ; case 3 : opAndMap = this . ands3 ; break ; case 4 : opAndMap = this . ands4 ; break ; default : break ; } And tempAnd = opAndMap . get ( clauses ) ; if ( tempAnd != null ) return tempAnd ; tempAnd = new And ( clauses , this , true ) ; opAndMap . put ( clauses , tempAnd ) ; return tempAnd ; }
Creates a new CNF .