-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.h
More file actions
58 lines (30 loc) · 1.07 KB
/
query.h
File metadata and controls
58 lines (30 loc) · 1.07 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <vector>
#include <math.h>
#include "globals.h"
using namespace std;
class Query {
private:
vector<int> var; // default var[i] = -1
short int state; // 0: initialized 1 : Query ok. 2 : collapse, 3 : converge,
// 4: for find_con, if is rejected from some cons and accepted from other
// 5: Prematurely Converged
public:
Query();
// set --------------------------------
void set_state(short int s);
void set_var(int v, int i); // v: variable value, i: variable indicator
// get -------------------------------
short int get_state() const;
int get_var(int i) const;
int get_size();
vector<int> get_vars() const;
// other ----------------------------
void print();
void write(ofstream *fout);
void initialize();
bool ask(); // ask a query to the user
Query partial(vector<short int> vars); // return partial query with variable vars
bool subqueryof(Query query); // return true if this query is a sub-query of the query given. Return false otherwise
bool operator !=(Query const &query);
bool operator ==(Query const &query);
};