1 #include "elementopt.h"
9 ElementOpt::ElementOpt(CSolver *_solver)
14 ElementOpt::~ElementOpt() {
17 void ElementOpt::doTransform() {
18 if (solver->getTuner()->getTunable(ELEMENTOPT, &onoff) == 0)
21 BooleanIterator bit(solver);
22 while (bit.hasNext()) {
23 Boolean *b = bit.next();
24 if (b->type == PREDICATEOP)
25 processPredicate((BooleanPredicate *)b);
29 void ElementOpt::processPredicate(BooleanPredicate * pred) {
30 uint numInputs = pred->inputs.getSize();
34 Predicate * p = pred->getPredicate();
35 if (p->type == TABLEPRED)
38 PredicateOperator * pop = (PredicateOperator *) p;
39 CompOp op = pop->getOp();
41 Element * left = pred->inputs.get(0);
42 Element * right = pred->inputs.get(1);
44 if (left->type == ELEMCONST) {
46 } else if (right->type == ELEMCONST) {