Blame view

src/paccs.h 1.7 KB
965dadaa   Salvador Abreu   initial commit fr...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* Types */

typedef void *fd_int;
typedef void *fd_constraint;

/* Constants */

#define FD_OK 0
#define FD_NOSOLUTION 1

/* Functions */

void fd_init(int *argc, char **argv[]);
void fd_end(void);
int fd_solve(void);

eef94371   Vasco Pedro   Update to PaCCS v...
17
fd_int fd_new(int min, int max);
965dadaa   Salvador Abreu   initial commit fr...
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

void fd_label(fd_int vars[], int nvars);
int fd_var_single(fd_int var, int *val);
int fd_var_value(fd_int var);
void fd_print(fd_int var);
void fd_println(fd_int var);

/* Constraints */

/* Arithmetic constraints */

fd_constraint fd_eq(fd_int x, fd_int y);
fd_constraint fd_ne(fd_int x, fd_int y);
fd_constraint fd_lt(fd_int x, fd_int y);
fd_constraint fd_le(fd_int x, fd_int y);
fd_constraint fd_gt(fd_int x, fd_int y);
fd_constraint fd_ge(fd_int x, fd_int y);
fd_constraint fd_minus_eq(fd_int x, fd_int y, int k);
fd_constraint fd_minus_ne(fd_int x, fd_int y, int k);
fd_constraint fd_var_eq_minus(fd_int x, fd_int y, fd_int z);
fd_constraint fd_var_eq_times(fd_int x, fd_int y, fd_int z);

/* Global constraints */

fd_constraint fd_all_different(fd_int X[], int n);

eef94371   Vasco Pedro   Update to PaCCS v...
44
fd_constraint fd_element(fd_int X[], int n, fd_int y, int k);
965dadaa   Salvador Abreu   initial commit fr...
45
46
47
48
49
50
51
52
53
54
fd_constraint fd_element_var(fd_int X[], int n, fd_int y, fd_int z);

fd_constraint fd_sum(fd_int X[], int n, int k);
fd_constraint fd_sum2(fd_int X[], int n, fd_int y);

fd_constraint fd_sum_prod(fd_int X[], fd_int Y[], int n, int k);

fd_constraint fd_poly_eq(int C[], fd_int Y[], int n, fd_int z);
fd_constraint fd_knapsack2(fd_int X[], fd_int Y[], int n, fd_int z);

77e20af3   Vasco Pedro   added new constra...
55
fd_constraint fd_exactly(fd_int X[], int n, int c, int k);
eef94371   Vasco Pedro   Update to PaCCS v...
56
fd_constraint fd_exactly_var(fd_int X[], int n, fd_int y, int k);
77e20af3   Vasco Pedro   added new constra...
57
58
fd_constraint fd_exactly_vars(fd_int X[], int n, fd_int y, fd_int z);

965dadaa   Salvador Abreu   initial commit fr...
59
60
61
62
/* Optimisation */

fd_constraint fd_min(fd_int x);
fd_constraint fd_max(fd_int x);