at_most_one.h 1.58 KB
/*
 * at_most_one.h
 *
 *  Created on: 26/03/2017
 *      Author: pedro
 */

#ifndef SRC_CONSTRAINTS_AT_MOST_ONE_H_
#define SRC_CONSTRAINTS_AT_MOST_ONE_H_


#include <stdbool.h>
#include <sys/types.h>

#include "../config.h"
#include "../constraints.h"
#include "../kernels/cl_aux_functions.h"
#include "../kernels/cl_constraints.h"
#include "../kernels/cl_ttl.h"

unsigned int c_at_most_one(unsigned int* S_ids, int* S_n_vs, unsigned int n_sets);
unsigned int c_at_most_one_reif(unsigned int* S_ids, int* N_vs, unsigned int n_sets, int reif_v_id);
bool at_most_one_check(constr* c, bool explored);

#if CS_AT_MOST_ONE == 1
void at_most_one_prop(CL_INTS_MEM int* vs_per_c_idx, CL_INTS_MEM int* c_consts, CL_MEMORY VARS_PROP* vs_prop_, unsigned int prop_v_id, CL_CS_MEM cl_constr* current_cs,
		CL_MEMORY unsigned short* vs_id_to_prop_, bool* prop_ok TTL_CTR);
#if CS_R_AT_MOST_ONE == 1
void at_most_one_reif( CL_INTS_MEM int* vs_per_c_idx, CL_INTS_MEM int* c_consts, CL_MEMORY VARS_PROP* vs_prop_, unsigned int prop_v_id, CL_CS_MEM cl_constr* current_cs,
		CL_MEMORY unsigned short* vs_id_to_prop_ TTL_CTR);
void at_most_one_prop_opposite(CL_INTS_MEM int* vs_per_c_idx, CL_INTS_MEM int* c_consts, CL_MEMORY VARS_PROP* vs_prop_, unsigned int prop_v_id
		, CL_CS_MEM cl_constr* current_cs TTL_CTR);
#endif
void at_most_one_propagate(CL_INTS_MEM int* vs_per_c_idx, CL_INTS_MEM int* c_consts, CL_MEMORY VARS_PROP* vs_prop_, unsigned int prop_v_id, CL_CS_MEM cl_constr* current_cs,
		CL_MEMORY unsigned short* vs_id_to_prop_, bool* prop_ok PROPAGATED_FUNC TTL_CTR);
#endif

#endif /* SRC_CONSTRAINTS_AT_MOST_ONE_H_ */