protected boolean handleConstr(String line, IVecInt literals)
throws ContradictionException {
boolean added = true;
assert literals.size() == 0;
Scanner scan = new Scanner(line);
GateTranslator gater = (GateTranslator)solver;
while (scan.hasNext()) {
int gateType = scan.nextInt();
assert gateType > 0;
int nbparam = scan.nextInt();
assert nbparam != 0;
assert nbparam == -1 || gateType >= ATLEAST;
for (int i = 0; i < nbparam; i++) {
scan.nextInt();
}
// readI/O until reaching ending 0
int y = scan.nextInt();
int x;
while ((x = scan.nextInt()) != 0) {
literals.push(x);
}
switch (gateType) {
case FALSE:
assert literals.size()==0;
gater.gateFalse(y);
break;
case TRUE:
assert literals.size()==0;
gater.gateTrue(y);
break;
case OR:
gater.or(y, literals);
break;
case NOT:
assert literals.size()==1;
gater.not(y, literals.get(0));
break;
case AND:
gater.and(y, literals);
break;
case XOR:
gater.xor(y, literals);
break;
case IFF:
gater.iff(y, literals);
break;
case IFTHENELSE:
assert literals.size()==3;
gater.ite(y, literals.get(0),literals.get(1),literals.get(2));
break;
default:
throw new UnsupportedOperationException("Gate type " + gateType
+ " not handled yet");
}