-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathabstract_constraint.h
67 lines (57 loc) · 1.46 KB
/
abstract_constraint.h
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
58
59
60
61
62
63
64
65
66
67
#pragma once
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <pblib/pb2cnf.h>
namespace abstract_constraint {
class constraint {
private:
protected:
std::string name;
std::vector< int32_t > variables;
public:
constraint();
constraint(std::vector< int32_t >& variables);
void add_variable(int32_t);
const std::vector< int32_t >& get_variables();
virtual void to_sat(std::vector< std::vector< int32_t > >& formula,
int& first_free);
};
class at_most_k : public constraint {
private:
int k;
public:
at_most_k() {}
at_most_k(int k, std::vector< int32_t >& variables);
int get_k();
void to_sat(std::vector< std::vector< int32_t > >& formula,
int& first_free);
};
class exactly_k : public constraint {
private:
int k;
public:
exactly_k() {}
exactly_k(int k, std::vector< int32_t >& variables);
int get_k();
void to_sat(std::vector< std::vector< int32_t > >& formula,
int& first_free);
};
class not_exactly_one : public constraint {
private:
public:
not_exactly_one() {}
not_exactly_one(std::vector< int32_t >& variables);
void to_sat(std::vector< std::vector< int32_t > >& formula,
int& first_free);
};
class cnfclause : public constraint {
private:
public:
cnfclause() {}
cnfclause(std::vector< int32_t >& variables);
void to_sat(std::vector< std::vector< int32_t > >& formula,
int& first_free);
};
};