SATEncoder::SATEncoder(CSolver *_solver) :
cnf(createCNF()),
- solver(_solver) {
+ solver(_solver),
+ vector(allocDefVectorEdge()) {
}
SATEncoder::~SATEncoder() {
deleteCNF(cnf);
+ deleteVectorEdge(vector);
}
void SATEncoder::resetSATEncoder() {
Element *elem = constraint->inputs.get(i);
encodeElementSATEncoder(elem);
}
- VectorEdge *clauses = allocDefVectorEdge(); // Setup array of clauses
+ VectorEdge *clauses = vector;
uint indices[numDomains]; //setup indices
bzero(indices, sizeof(uint) * numDomains);
}
}
if (getSizeVectorEdge(clauses) == 0) {
- deleteVectorEdge(clauses);
+ clearVectorEdge(clauses);
return E_False;
}
Edge cor = constraintOR(cnf, getSizeVectorEdge(clauses), exposeArrayEdge(clauses));
- deleteVectorEdge(clauses);
+ clearVectorEdge(clauses);
return generateNegation ? constraintNegate(cor) : cor;
}