adding fucntion's fields
[satune.git] / src / inc_solver.h
1 /*      Copyright (c) 2015 Regents of the University of California
2  *
3  *      Author: Brian Demsky <bdemsky@uci.edu>
4  *
5  *      This program is free software; you can redistribute it and/or
6  *      modify it under the terms of the GNU General Public License
7  *      version 2 as published by the Free Software Foundation.
8  */
9
10 #ifndef INC_SOLVER_H
11 #define INC_SOLVER_H
12 #include <sys/types.h>
13 #include <sys/wait.h>
14 #include <unistd.h>
15 #include <stdio.h>
16 #include <stdlib.h>
17 #include <signal.h>
18 #include "solver_interface.h"
19 #include "classlist.h"
20
21 struct IncrementalSolver {
22         int * buffer;
23         int * solution;
24         int solutionsize;
25         int offset;
26         pid_t solver_pid;
27         int to_solver_fd;
28         int from_solver_fd;
29 };
30
31 IncrementalSolver * allocIncrementalSolver();
32 void deleteIncrementalSolver(IncrementalSolver * this);
33 void addClauseLiteral(IncrementalSolver * this, int literal);
34 void finishedClauses(IncrementalSolver * this);
35 void freeze(IncrementalSolver * this, int variable);
36 int solve(IncrementalSolver * this);
37 void startSolve(IncrementalSolver * this);
38 int getSolution(IncrementalSolver * this);
39 bool getValueSolver(IncrementalSolver * this, int variable);
40 void resetSolver(IncrementalSolver * this);
41 void createSolver(IncrementalSolver * this);
42 void killSolver(IncrementalSolver * this);
43 void flushBufferSolver(IncrementalSolver * this);
44 int readIntSolver(IncrementalSolver * this);
45 void readSolver(IncrementalSolver * this, void * buffer, ssize_t size);
46 #endif