-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolver.h
More file actions
38 lines (33 loc) · 1.14 KB
/
solver.h
File metadata and controls
38 lines (33 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _SOLVER_H
#define _SOLVER_H
/***** TYPES & STRUCTS *****/
/*
* unifying solver structure
*
* Semantics of functions:
*
* - void add(lit): Adds a literal to a internal clause buffer, upon
* add(0), the currently buffered literals are added
* to the solver as a clause
* - sat_state sat(): Check satisfiability status of formula, return values:
* SAT, UNSAT, UNKNOWN
* - sat_state sat_assum(assumptions, #assumptions):
* Add assumptions and check satisfiability status
* - lit_value deref(lit):
* Get value of literal in current satisfying assignment
*/
typedef enum { ST_UNKNOWN=0, ST_SAT=10, ST_UNSAT=20 } sat_state;
typedef enum { L_FALSE=-1, L_UNKNOWN=0, L_TRUE=1 } lit_value;
typedef struct solver {
void (*add)(int lit);
sat_state (*sat)(void);
sat_state (*sat_assum)(int *, int);
lit_value (*lit_deref)(int);
void (*assume)(int);
} solver;
/***** DECLARATIONS *****/
void add_clause(solver *s, ...);
void print_add(int);
sat_state print_sat(void);
sat_state print_sat_assum(int *, int);
#endif /* _SOLVER_H */