#include "csolver.h"
#include "predicate.h"
#include "element.h"
+#include "rewriter.h"
void orderIntegerEncodingSATEncoder(SATEncoder *This, BooleanOrder *boolOrder){
Order* order = boolOrder->order;
This->solver->allElements.push(elem2);
This->solver->constraints.add(boolean);
}
+ replaceBooleanWithBoolean(This->solver, boolOrder, boolean);
}
#include "orderelement.h"
Edge encodeOrderSATEncoder(SATEncoder *This, BooleanOrder *constraint) {
- switch (constraint->order->order.type){
- case PAIRWISE:
- switch ( constraint->order->type) {
- case PARTIAL:
- return encodePartialOrderSATEncoder(This, constraint);
- case TOTAL:
- return encodeTotalOrderSATEncoder(This, constraint);
- default:
- ASSERT(0);
- }
- case INTEGERENCODING:{
- //Infer the value from graph ...
- Order* order = constraint->order;
- Edge gvalue = inferOrderConstraintFromGraph(order, constraint->first, constraint->second);
- if(!edgeIsNull(gvalue))
- return gvalue;
- //If we couldn't infer the value from graph, we have already generated a predicate for that ...
- // So, we should do nothing
- return E_BOGUS;
- }
+ switch ( constraint->order->type) {
+ case PARTIAL:
+ return encodePartialOrderSATEncoder(This, constraint);
+ case TOTAL:
+ return encodeTotalOrderSATEncoder(This, constraint);
default:
ASSERT(0);
}
+ default:
+ ASSERT(0);
return E_BOGUS;
}