*/
public Constraint getTableForOccurence(Solver solverO, IntVar[] vs, IntVar occ, int val, int ub) {
Solver solver = new Solver();
IntVar[] vars = VariableFactory.enumeratedArray("e", vs.length + 1, 0, ub, solver);
Tuples tuples = new Tuples(true);
solver.set(IntStrategyFactory.lexico_LB(vars));
solver.findSolution();
do {
int[] tuple = new int[vars.length];
for (int i = 0; i < tuple.length; i++) {
tuple[i] = vars[i].getValue();
}
int checkocc = 0;
for (int i = 0; i < (tuple.length - 1); i++) {
if (tuple[i] == val) checkocc++;
}
if (checkocc == tuple[tuple.length - 1]) {
tuples.add(tuple);
}
} while (solver.nextSolution() == Boolean.TRUE);
IntVar[] newvs = new IntVar[vs.length + 1];
System.arraycopy(vs, 0, newvs, 0, vs.length);