Ys.push_back(solver->getElementVar(domainSet));
}
Set *d1[] = {domainSet, domainSet};
- Function *sub = solver->createFunctionOperator(SATC_SUB, d1, 2, rangeSet, SATC_NOOVERFLOW);
+ Function *sub = solver->createFunctionOperator(SATC_SUB, rangeSet, SATC_NOOVERFLOW);
//X shouldn't be equal
for(int i=0; i<N-1; i++){
for(int j=i+1; j<N; j++ ){
Element *e1x = Xs[i];
Element *e2x = Xs[j];
- Predicate *eq = solver->createPredicateOperator(SATC_EQUALS, d1, 2);
+ Predicate *eq = solver->createPredicateOperator(SATC_EQUALS);
Element *inputs2 [] = {e1x, e2x};
BooleanEdge equals = solver->applyPredicate(eq, inputs2, 2);
solver->addConstraint(solver->applyLogicalOperation(SATC_NOT, equals));
for(int j=i+1; j<N; j++ ){
Element *e1y = Ys[i];
Element *e2y = Ys[j];
- Predicate *eq = solver->createPredicateOperator(SATC_EQUALS, d1, 2);
+ Predicate *eq = solver->createPredicateOperator(SATC_EQUALS);
Element *inputs2 [] = {e1y, e2y};
BooleanEdge equals = solver->applyPredicate(eq, inputs2, 2);
solver->addConstraint(solver->applyLogicalOperation(SATC_NOT, equals));
Element *e2y = Ys[j];
Element *e1x = Xs[i];
Element *e2x = Xs[j];
- Function *f1 = solver->createFunctionOperator(SATC_SUB, d1, 2, rangeSet, SATC_IGNORE);
+ Function *f1 = solver->createFunctionOperator(SATC_SUB, rangeSet, SATC_IGNORE);
Element *in1[] = {e1x, e2x};
Element *subx = solver->applyFunction(f1, in1, 2, overflow);
Element *in2[] = {e1y, e2y};
Element *suby = solver->applyFunction(f1, in2, 2, overflow);
- Predicate *eq = solver->createPredicateOperator(SATC_EQUALS, d2, 2);
+ Predicate *eq = solver->createPredicateOperator(SATC_EQUALS);
Element *inputs2 [] = {subx, suby};
BooleanEdge equals = solver->applyPredicate(eq, inputs2, 2);
solver->addConstraint(solver->applyLogicalOperation(SATC_NOT, equals));
int main(int argc, char * argv[]){
if(argc < 2){
- printf("Two arguments are needed\n./nqueen <size>\n");
+ printf("Two arguments are needed\n./nqueen <size> [-csolver]\n");
exit(-1);
}
int N = atoi(argv[1]);
csolverNQueens(N);
}
return 0;
-}
\ No newline at end of file
+}