less verbose
[satlib.git] / inc_solver.h
1 #ifndef INC_SOLVER_H
2 #define INC_SOLVER_H
3 #include <sys/types.h>
4 #include <unistd.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <signal.h>
8 #include "solver_interface.h"
9
10 class IncrementalSolver {
11  public:
12   IncrementalSolver();
13   ~IncrementalSolver();
14   void addClauseLiteral(int literal);
15   void finishedClauses();
16   void freeze(int variable);
17   int solve();
18   bool getValue(int variable);
19   void reset();
20
21  private:
22   void createSolver();
23   void killSolver();
24   void flushBuffer();
25   int readIntSolver();
26   void readSolver(void * buffer, ssize_t size);
27   int * buffer;
28   int * solution;
29   int solutionsize;
30   int offset;
31   pid_t solver_pid;
32   int to_solver_fd;
33   int from_solver_fd;
34 };
35 #endif