serializer->mywrite(&set, sizeof(Set*));
}
+void ElementSet::print(){
+ model_println("{ElementSet:");
+ set->print();
+ model_println("}\n");
+}
+
void ElementConst::serialize(Serializer* serializer){
if(serializer->isSerialized(this))
return;
serializer->mywrite(&value, sizeof(uint64_t));
}
+void ElementConst::print(){
+ model_println("{ElementConst: %lu}", value);
+}
+
void ElementFunction::serialize(Serializer* serializer){
if(serializer->isSerialized(this))
return;
serializer->mywrite(&overflowstat, sizeof(Boolean*));
}
+void ElementFunction::print(){
+ model_println("{ElementFunction:");
+ function->print();
+ model_println("Elements:");
+ uint size = inputs.getSize();
+ for(uint i=0; i<size; i++){
+ Element *input = inputs.get(i);
+ input->print();
+ }
+ model_println("}\n");
+}
}
+void FunctionTable::print(){
+ model_println("{FunctionTable:");
+ table->print();
+ model_println("}\n");
+
+}
+
void FunctionOperator::serialize(Serializer* serializer){
if(serializer->isSerialized(this))
return;
}
serializer->mywrite(&range, sizeof(Set *));
serializer->mywrite(&overflowbehavior, sizeof(OverFlowBehavior));
+}
+
+void FunctionOperator::print(){
+ model_println("{FunctionOperator: %s}", op == SATC_ADD? "ADD": "SUB" );
}
\ No newline at end of file
serializer->mywrite(&type, sizeof(OrderType));
serializer->mywrite(&set, sizeof(Set *));
}
+
+void Order::print(){
+ model_println("{Order on Set:");
+ set->print();
+ model_println("}\n");
+}
OrderGraph *graph;
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;};
serializer->mywrite(&undefinedbehavior, sizeof(UndefinedBehavior));
}
+void PredicateTable::print(){
+ model_println("{PredicateTable:");
+ table->print();
+ model_println("}\n");
+}
+
void PredicateOperator::serialize(Serializer* serializer){
if(serializer->isSerialized(this))
return;
virtual ~Predicate() {}
virtual Predicate *clone(CSolver *solver, CloneMap *map) {ASSERT(0); return NULL;}
virtual void serialize(Serializer* serializer) = 0;
+ virtual void print() =0;
PredicateType type;
CMEMALLOC;
};
bool evalPredicateOperator(uint64_t *inputs);
Predicate *clone(CSolver *solver, CloneMap *map);
virtual void serialize(Serializer* serializer);
+ virtual void print();
Array<Set *> domains;
CompOp getOp() {return op;}
CMEMALLOC;
PredicateTable(Table *table, UndefinedBehavior undefBehavior);
Predicate *clone(CSolver *solver, CloneMap *map);
virtual void serialize(Serializer* serializer);
+ virtual void print();
Table *table;
UndefinedBehavior undefinedbehavior;
CMEMALLOC;
serializer->mywrite(&mem, sizeof(uint64_t));
}
}
+
+void Set::print(){
+ model_print("{Set:");
+ if(isRange){
+ model_print("Range: low=%lu, high=%lu}\n\n", low, high);
+ } else {
+ uint size = members->getSize();
+ model_print("Members: ");
+ for(uint i=0; i<size; i++){
+ uint64_t mem = members->get(i);
+ model_print("%lu, ", mem);
+ }
+ model_println("}\n");
+ }
+}
virtual bool isMutableSet() {return false;}
virtual Set *clone(CSolver *solver, CloneMap *map);
virtual void serialize(Serializer* serializer);
+ virtual void print();
CMEMALLOC;
protected:
VarType type;
}
+void Table::print(){
+ model_println("{Table:");
+ SetIteratorTableEntry* iterator = getEntries();
+ while(iterator->hasNext()){
+ TableEntry* entry = iterator->next();
+ model_print("<");
+ for(uint i=0; i<entry->inputSize; i++){
+ model_print("%lu, ", entry->inputs[i]);
+ }
+ model_print(" == %lu>", entry->output);
+ }
+ model_println("}\n");
+ delete iterator;
+}
TableEntry *getTableEntry(uint64_t *inputs, uint inputSize);
Table *clone(CSolver *solver, CloneMap *map);
void serialize(Serializer *serializer);
+ void print();
~Table();
Set * getRange() {return range;}
SetIteratorBooleanEdge *iterator = csolver->getConstraints();
while (iterator->hasNext()) {
BooleanEdge constraint = iterator->next();
+ constraint.getBoolean()->print();
Edge c = encodeConstraintSATEncoder(constraint);
addConstraintCNF(cnf, c);
}
#include "config.h"
#include "time.h"
-/*
+
extern int model_out;
extern int model_err;
extern int switch_alloc;
#define model_dprintf(fd, fmt, ...) do { switch_alloc = 1; dprintf(fd, fmt, ## __VA_ARGS__); switch_alloc = 0; } while (0)
#define model_print(fmt, ...) do { model_dprintf(model_out, fmt, ## __VA_ARGS__); } while (0)
-
+#define model_println(fmt, ...) do { model_print(fmt, ## __VA_ARGS__); model_print("\n");} while(0)
#define model_print_err(fmt, ...) do { model_dprintf(model_err, fmt, ## __VA_ARGS__); } while (0)
- */
-#define model_print printf
+
+//#define model_print printf
#define NEXTPOW2(x) ((x == 1) ? 1 : (1 << (sizeof(uint) * 8 - __builtin_clz(x - 1))))
#define NUMBITS(x) ((x == 0) ? 0 : 8 * sizeof(x) - __builtin_clz(x))