OrderType type;
Set *set;
OrderGraph *graph;
+ OrderEncoding encoding;
Order *clone(CSolver *solver, CloneMap *map);
void serialize(Serializer *serializer );
void print();
- Vector<BooleanOrder *> constraints;
- OrderEncoding encoding;
-
- void setOrderResolver(OrderResolver *_resolver) { ASSERT(encoding.resolver == NULL); encoding.resolver = _resolver;};
+ void setOrderResolver(OrderResolver *_resolver) { ASSERT(encoding.resolver == NULL); encoding.resolver = _resolver;}
void initializeOrderElementsHashtable();
void addOrderConstraint(BooleanOrder *constraint);
void setOrderEncodingType(OrderEncodingType type);
HashtableOrderPair *getOrderPairTable();
CMEMALLOC;
+private:
+ Hashset64Int useditems;
+ Vector<BooleanOrder *> constraints;
+public:
+ Vector<BooleanOrder *> *getConstraints() {return &constraints;}
};
#endif
OrderGraph *buildOrderGraph(Order *order) {
ASSERT(order->graph == NULL);
OrderGraph *orderGraph = new OrderGraph(order);
- uint constrSize = order->constraints.getSize();
+ Vector<BooleanOrder *> *constraints = order->getConstraints();
+ uint constrSize = constraints->getSize();
for (uint j = 0; j < constrSize; j++) {
- orderGraph->addOrderConstraintToOrderGraph(order->constraints.get(j));
+ orderGraph->addOrderConstraintToOrderGraph(constraints->get(j));
}
return orderGraph;
}
OrderGraph *buildMustOrderGraph(Order *order) {
ASSERT(order->graph == NULL);
OrderGraph *orderGraph = new OrderGraph(order);
- uint constrSize = order->constraints.getSize();
+ Vector<BooleanOrder *> *constraints = order->getConstraints();
+ uint constrSize = constraints->getSize();
for (uint j = 0; j < constrSize; j++) {
- orderGraph->addMustOrderConstraintToOrderGraph(order->constraints.get(j));
+ orderGraph->addMustOrderConstraintToOrderGraph(constraints->get(j));
}
return orderGraph;
}
void DecomposeOrderTransform::decomposeOrder(Order *currOrder, OrderGraph *currGraph, DecomposeOrderResolver *dor) {
Vector<Order *> partialcandidatevec;
- uint size = currOrder->constraints.getSize();
+ Vector<BooleanOrder *> *constraints = currOrder->getConstraints();
+ uint size = constraints->getSize();
for (uint i = 0; i < size; i++) {
- BooleanOrder *orderconstraint = currOrder->constraints.get(i);
+ BooleanOrder *orderconstraint = constraints->get(i);
OrderNode *from = currGraph->getOrderNodeFromOrderGraph(orderconstraint->first);
OrderNode *to = currGraph->getOrderNodeFromOrderGraph(orderconstraint->second);
OrderEdge *edge = currGraph->lookupOrderEdgeFromOrderGraph(from, to);
IntegerEncodingRecord *encodingRecord = new IntegerEncodingRecord(
solver->createRangeSet(currOrder->set->getType(), 0, (uint64_t) currOrder->set->getSize() - 1));
currOrder->setOrderEncodingType( INTEGERENCODING );
- uint size = currOrder->constraints.getSize();
+
+ Vector<BooleanOrder *> *constraints = currOrder->getConstraints();
+ uint size = constraints->getSize();
for (uint i = 0; i < size; i++) {
- orderIntegerEncodingSATEncoder(currOrder->constraints.get(i), encodingRecord);
+ orderIntegerEncodingSATEncoder(constraints->get(i), encodingRecord);
}
currOrder->setOrderResolver(new IntegerEncOrderResolver(solver, encodingRecord));
solver->getActiveOrders()->remove(currOrder);