void buildEXK ( final EncodingResult result , final Variable [ ] vars , int rhs ) { final LNGVector < Variable > cardinalityOutvars = this . initializeConstraint ( result , vars ) ; this . toCNF ( cardinalityOutvars , rhs , Bound . BOTH ) ; assert this . cardinalityInvars . size ( ) == 0 ; for ( int i = 0 ; i < rhs ; i ++ ) this . result . addClause ( cardinalityOutvars . get ( i ) ) ; for ( int i = rhs ; i < cardinalityOutvars . size ( ) ; i ++ ) this . result . addClause ( cardinalityOutvars . get ( i ) . negate ( ) ) ; }
Builds an exactly - k constraint .