projects
/
satlib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Adding support for reading wrong assumptions
[satlib.git]
/
inc_solver.cc
diff --git
a/inc_solver.cc
b/inc_solver.cc
index 28444bcf6ff702368b24d38a7e6444fd05e4c1e5..ebc54447f3f98854de8607065124816192c6a220 100644
(file)
--- a/
inc_solver.cc
+++ b/
inc_solver.cc
@@
-48,9
+48,10
@@
int IncrementalSolver::solve() {
if (numVars > solutionsize) {
if (solution != NULL)
free(solution);
if (numVars > solutionsize) {
if (solution != NULL)
free(solution);
- solution = (int *) malloc(numVars*sizeof(int));
+ solution = (int *) malloc((numVars+1)*sizeof(int));
+ solution[0] = 0;
}
}
- readSolver(
solution
, numVars * sizeof(int));
+ readSolver(
&solution[1]
, numVars * sizeof(int));
}
return result;
}
}
return result;
}
@@
-99,7
+100,6
@@
void IncrementalSolver::createSolver() {
(dup2(from_pipe[1], IS_OUT_FD) == -1)) {
fprintf(stderr, "Error duplicating pipes\n");
}
(dup2(from_pipe[1], IS_OUT_FD) == -1)) {
fprintf(stderr, "Error duplicating pipes\n");
}
- setsid();
execlp(SATSOLVER, SATSOLVER, NULL);
fprintf(stderr, "execlp Failed\n");
} else {
execlp(SATSOLVER, SATSOLVER, NULL);
fprintf(stderr, "execlp Failed\n");
} else {
@@
-116,7
+116,7
@@
void IncrementalSolver::killSolver() {
close(from_solver_fd);
//Stop the solver
if (solver_pid > 0)
close(from_solver_fd);
//Stop the solver
if (solver_pid > 0)
- kill
pg
(solver_pid, SIGKILL);
+ kill(solver_pid, SIGKILL);
}
void IncrementalSolver::flushBuffer() {
}
void IncrementalSolver::flushBuffer() {