reverting unnecessary changes in clone
authorHamed Gorjiara <hgorjiar@uci.edu>
Tue, 1 May 2018 23:28:58 +0000 (16:28 -0700)
committerHamed Gorjiara <hgorjiar@uci.edu>
Tue, 1 May 2018 23:28:58 +0000 (16:28 -0700)
src/AST/boolean.cc
src/AST/element.cc

index 46e277a390a5ec8ca35ab5fec34147d775e25af8..c576268058f3b5203687a2d6cef9e496a90bcf2e 100644 (file)
@@ -71,32 +71,19 @@ Boolean *BooleanVar::clone(CSolver *solver, CloneMap *map) {
 }
 
 Boolean *BooleanOrder::clone(CSolver *solver, CloneMap *map) {
-        Boolean *b = (Boolean *) map->get(this);
-       if (b != NULL)
-               return b;
        Order *ordercopy = order->clone(solver, map);
-       b= solver->orderConstraint(ordercopy, first, second).getRaw();
-        map->put(this, b);
-        return b;
+       return solver->orderConstraint(ordercopy, first, second).getRaw();
 }
 
 Boolean *BooleanLogic::clone(CSolver *solver, CloneMap *map) {
-        Boolean *b = (Boolean *) map->get(this);
-       if (b != NULL)
-               return b;
        BooleanEdge array[inputs.getSize()];
        for (uint i = 0; i < inputs.getSize(); i++) {
                array[i] = cloneEdge(solver, map, inputs.get(i));
        }
-       b= solver->applyLogicalOperation(op, array, inputs.getSize()).getRaw();
-        map->put(this, b);
-        return b;
+       return solver->applyLogicalOperation(op, array, inputs.getSize()).getRaw();
 }
 
 Boolean *BooleanPredicate::clone(CSolver *solver, CloneMap *map) {
-        Boolean *b = (Boolean *) map->get(this);
-       if (b != NULL)
-               return b;
        Element *array[inputs.getSize()];
        for (uint i = 0; i < inputs.getSize(); i++) {
                array[i] = inputs.get(i)->clone(solver, map);
@@ -104,9 +91,7 @@ Boolean *BooleanPredicate::clone(CSolver *solver, CloneMap *map) {
        Predicate *pred = predicate->clone(solver, map);
        BooleanEdge defstatus = undefStatus ? cloneEdge(solver, map, undefStatus) : BooleanEdge();
 
-       b= solver->applyPredicateTable(pred, array, inputs.getSize(), defstatus).getRaw();
-        map->put(this, b);
-        return b;
+       return solver->applyPredicateTable(pred, array, inputs.getSize(), defstatus).getRaw();
 }
 
 void BooleanPredicate::updateParents() {
index 54a5c4163780eb56a435d95f3aeb511f2476d83d..d09db20631e9a56e4ca8162ce4fbcf690025b513 100644 (file)
@@ -35,12 +35,7 @@ ElementConst::ElementConst(uint64_t _value, Set *_set) :
 }
 
 Element *ElementConst::clone(CSolver *solver, CloneMap *map) {
-        Element *e = (Element *) map->get(this);
-       if (e != NULL)
-               return e;
-       e= solver->getElementConst(type, value);
-        map->put(this,e);
-        return e;
+       return solver->getElementConst(type, value);
 }
 
 Element *ElementSet::clone(CSolver *solver, CloneMap *map) {
@@ -53,15 +48,11 @@ Element *ElementSet::clone(CSolver *solver, CloneMap *map) {
 }
 
 Element *ElementFunction::clone(CSolver *solver, CloneMap *map) {
-        Element *e = (Element *) map->get(this);
-       if (e != NULL)
-               return e;
        Element *array[inputs.getSize()];
        for (uint i = 0; i < inputs.getSize(); i++) {
                array[i] = inputs.get(i)->clone(solver, map);
        }
-       e = solver->applyFunction(function->clone(solver, map), array, inputs.getSize(), overflowstatus->clone(solver, map));
-        map->put(this,e);
+       Element *e = solver->applyFunction(function->clone(solver, map), array, inputs.getSize(), overflowstatus->clone(solver, map));
        return e;
 }