Boolean *parent = getVectorBoolean(&oldb->parents, i);
BooleanLogic *logicop = (BooleanLogic *) parent;
- uint parentsize = getSizeArrayBoolean(&logicop->inputs);
+ uint parentsize = logicop->inputs.getSize();
for (uint j = 0; j < parentsize; j++) {
- Boolean *b = getArrayBoolean(&logicop->inputs, i);
+ Boolean *b = logicop->inputs.get(i);
if (b == oldb) {
- setArrayBoolean(&logicop->inputs, i, newb);
+ logicop->inputs.set(i, newb);
pushVectorBoolean(&newb->parents, parent);
}
}
}
void handleXORTrue(BooleanLogic *bexpr, Boolean *child) {
- uint size = getSizeArrayBoolean(&bexpr->inputs);
- Boolean *b = getArrayBoolean(&bexpr->inputs, 0);
+ uint size = bexpr->inputs.getSize();
+ Boolean *b = bexpr->inputs.get(0);
uint childindex = (b == child) ? 0 : 1;
- removeElementArrayBoolean(&bexpr->inputs, childindex);
+ bexpr->inputs.remove(childindex);
bexpr->op = L_NOT;
}
void handleXORFalse(CSolver * This, BooleanLogic *bexpr, Boolean *child) {
- uint size = getSizeArrayBoolean(&bexpr->inputs);
- Boolean *b = getArrayBoolean(&bexpr->inputs, 0);
+ uint size = bexpr->inputs.getSize();
+ Boolean *b = bexpr->inputs.get(0);
uint otherindex = (b == child) ? 1 : 0;
- replaceBooleanWithBoolean(This, (Boolean *)bexpr, getArrayBoolean(&bexpr->inputs, otherindex));
+ replaceBooleanWithBoolean(This, (Boolean *)bexpr, bexpr->inputs.get(otherindex));
}
void handleIMPLIESTrue(CSolver * This, BooleanLogic *bexpr, Boolean *child) {
- uint size = getSizeArrayBoolean(&bexpr->inputs);
- Boolean *b = getArrayBoolean(&bexpr->inputs, 0);
+ uint size = bexpr->inputs.getSize();
+ Boolean *b = bexpr->inputs.get(0);
if (b == child) {
//Replace with other term
- replaceBooleanWithBoolean(This, (Boolean *)bexpr, getArrayBoolean(&bexpr->inputs, 1));
+ replaceBooleanWithBoolean(This, (Boolean *)bexpr, bexpr->inputs.get(1));
} else {
//Statement is true...
replaceBooleanWithTrue(This, (Boolean *)bexpr);
}
void handleIMPLIESFalse(CSolver * This, BooleanLogic *bexpr, Boolean *child) {
- uint size = getSizeArrayBoolean(&bexpr->inputs);
- Boolean *b = getArrayBoolean(&bexpr->inputs, 0);
+ uint size = bexpr->inputs.getSize();
+ Boolean *b = bexpr->inputs.get(0);
if (b == child) {
//Statement is true...
replaceBooleanWithTrue(This, (Boolean *)bexpr);
} else {
//Make into negation of first term
- removeElementArrayBoolean(&bexpr->inputs, 1);
+ bexpr->inputs.get(1);
bexpr->op = L_NOT;
}
}
void handleANDTrue(CSolver * This, BooleanLogic *bexpr, Boolean *child) {
- uint size = getSizeArrayBoolean(&bexpr->inputs);
+ uint size = bexpr->inputs.getSize();
if (size == 1) {
replaceBooleanWithTrue(This, (Boolean *)bexpr);
}
for (uint i = 0; i < size; i++) {
- Boolean *b = getArrayBoolean(&bexpr->inputs, i);
+ Boolean *b = bexpr->inputs.get(i);
if (b == child) {
- removeElementArrayBoolean(&bexpr->inputs, i);
+ bexpr->inputs.remove(i);
}
}
if (size == 2) {
- replaceBooleanWithBoolean(This, (Boolean *)bexpr, getArrayBoolean(&bexpr->inputs, 0));
+ replaceBooleanWithBoolean(This, (Boolean *)bexpr, bexpr->inputs.get(0));
}
}
void handleORFalse(CSolver * This, BooleanLogic *bexpr, Boolean *child) {
- uint size = getSizeArrayBoolean(&bexpr->inputs);
+ uint size = bexpr->inputs.getSize();
if (size == 1) {
replaceBooleanWithFalse(This, (Boolean *) bexpr);
}
for (uint i = 0; i < size; i++) {
- Boolean *b = getArrayBoolean(&bexpr->inputs, i);
+ Boolean *b = bexpr->inputs.get(i);
if (b == child) {
- removeElementArrayBoolean(&bexpr->inputs, i);
+ bexpr->inputs.remove(i);
}
}
if (size == 2) {
- replaceBooleanWithBoolean(This, (Boolean *)bexpr, getArrayBoolean(&bexpr->inputs, 0));
+ replaceBooleanWithBoolean(This, (Boolean *)bexpr, bexpr->inputs.get(0));
}
}