/* C file generated for /home/bruxelles/diaz/GNU-Prolog/src/BipsFD/fd_symbolic_fd.fd */

#include "fd_to_c.h"

/* line:8 begin included code */

Bool Fd_Element_V_To_Xi(int i,WamWord *array,Range *v);
Bool Fd_Atmost(int n,WamWord *array,int v);
Bool Fd_Atleast(int n,WamWord *array,int v);
Bool Fd_Exactly(int n,WamWord *array,int v);

/* line:13 end   included code */

	/*-----------------------------*/
	/* User constraint: fd_element */
	/*-----------------------------*/


	/* Bloc #1 */

fd_begin_internal(fd_element_bloc_1)

   fd_local_fdv_adr
   fd_local_l_int_var(l_intL)
   fd_local_range_var(0)

   fd_allocate
   fd_load_l_int(l_intL,1)
   fd_range_fct(Fd_Element_I,0,arg_1(l_intL))
   fd_deallocate
   fd_tell_range(0,0)
 fd_exit_point
   fd_return

fd_end_internal


	/* Bloc #2 */

fd_begin_internal(fd_element_bloc_2)

   fd_local_fdv_adr
   fd_local_l_int_var(l_intL)
   fd_local_range_var(0)
   fd_local_range_var(1)

   fd_allocate
   fd_load_dom(0,0)
   fd_load_l_int(l_intL,1)
   fd_range_copy(1,0)
   fd_range_fct(Fd_Element_I_To_V,0,arg_2(range_arg(1),l_intL))
   fd_deallocate
   fd_tell_range(2,0)
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_element_bloc_2_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_element_bloc_2,2,1)
   fd_add_dependency(0,dom)
   fd_call_internal(fd_element_bloc_2)
 fd_exit_point
   fd_return

fd_end_internal


	/* Bloc #3 */

fd_begin_internal(fd_element_bloc_3)

   fd_local_fdv_adr
   fd_local_l_int_var(l_intL)
   fd_local_range_var(0)
   fd_local_range_var(1)

   fd_allocate
   fd_load_dom(0,2)
   fd_load_l_int(l_intL,1)
   fd_range_copy(1,0)
   fd_range_fct(Fd_Element_V_To_I,0,arg_2(range_arg(1),l_intL))
   fd_deallocate
   fd_tell_range(0,0)
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_element_bloc_3_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_element_bloc_3,0,1)
   fd_add_dependency(2,dom)
   fd_call_internal(fd_element_bloc_3)
 fd_exit_point
   fd_return

fd_end_internal


	/* Entry point for fd_element */

fd_begin_user_constraint(fd_element(FdArg(I),FdArg(L),FdArg(V)))

   fd_create_a_frame(3)
   fd_fdv_in_a_frame(I,0)
   fd_l_int_in_a_frame(L,1)
   fd_fdv_in_a_frame(V,2)

   fd_before_add_constraint
   fd_call_internal(fd_element_bloc_1)
   fd_call_internal(fd_element_bloc_2_inst)
   fd_call_internal(fd_element_bloc_3_inst)
   fd_after_add_constraint
 fd_exit_point
   fd_return

fd_end_user_constraint


	/*---------------------------------*/
	/* User constraint: fd_element_var */
	/*---------------------------------*/


	/* Bloc #1 */

fd_begin_internal(fd_element_var_bloc_1)

   fd_local_fdv_adr
   fd_local_l_fdv_var(l_fdvL)
   fd_local_range_var(0)

   fd_allocate
   fd_load_l_fdv(l_fdvL,1)
   fd_range_fct(Fd_Element_Var_I,0,arg_1(l_fdvL))
   fd_deallocate
   fd_tell_range(0,0)
 fd_exit_point
   fd_return

fd_end_internal


	/* Bloc #2 */

fd_begin_internal(fd_element_var_bloc_2)

   fd_local_fdv_adr
   fd_local_l_fdv_var(l_fdvL)
   fd_local_range_var(0)
   fd_local_range_var(1)

   fd_allocate
   fd_load_dom(0,0)
   fd_load_l_fdv(l_fdvL,1)
   fd_range_copy(1,0)
   fd_range_fct(Fd_Element_Var_I_To_V,0,arg_2(range_arg(1),l_fdvL))
   fd_deallocate
   fd_tell_range(2,0)
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_element_var_bloc_2_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_element_var_bloc_2,2,1)
   fd_add_list_dependency(1,dom)
   fd_add_dependency(0,dom)
   fd_call_internal(fd_element_var_bloc_2)
 fd_exit_point
   fd_return

fd_end_internal


	/* Bloc #3 */

fd_begin_internal(fd_element_var_bloc_3)

   fd_local_fdv_adr
   fd_local_l_fdv_var(l_fdvL)
   fd_local_range_var(0)
   fd_local_range_var(1)

   fd_allocate
   fd_load_dom(0,2)
   fd_load_l_fdv(l_fdvL,1)
   fd_range_copy(1,0)
   fd_range_fct(Fd_Element_Var_V_To_I,0,arg_2(range_arg(1),l_fdvL))
   fd_deallocate
   fd_tell_range(0,0)
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_element_var_bloc_3_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_element_var_bloc_3,0,1)
   fd_add_list_dependency(1,dom)
   fd_add_dependency(2,dom)
   fd_call_internal(fd_element_var_bloc_3)
 fd_exit_point
   fd_return

fd_end_internal


	/* Bloc #4 */

fd_begin_internal(fd_element_var_bloc_4)

   fd_local_fdv_adr
   fd_local_value_var(valI)
   fd_local_l_fdv_var(l_fdvL)
   fd_local_range_var(0)
   fd_local_range_var(1)

   fd_allocate
   fd_load_val(valI,0)
   fd_load_l_fdv(l_fdvL,1)
   fd_load_dom(1,2)
   fd_range_copy(0,1)
   fd_deallocate
   fd_check_fct(Fd_Element_V_To_Xi(valI,l_fdvL,range_arg(0)))
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_element_var_bloc_4_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_element_var_bloc_4,-1,1)
   fd_add_dependency(0,val)
   fd_add_dependency(2,dom)
   fd_call_internal(fd_element_var_bloc_4)
 fd_exit_point
   fd_return

fd_end_internal


	/* Entry point for fd_element_var */

fd_begin_user_constraint(fd_element_var(FdArg(I),FdArg(L),FdArg(V)))

   fd_create_a_frame(3)
   fd_fdv_in_a_frame(I,0)
   fd_l_fdv_in_a_frame(L,1)
   fd_fdv_in_a_frame(V,2)

   fd_before_add_constraint
   fd_call_internal(fd_element_var_bloc_1)
   fd_call_internal(fd_element_var_bloc_2_inst)
   fd_call_internal(fd_element_var_bloc_3_inst)
   fd_call_internal(fd_element_var_bloc_4_inst)
   fd_after_add_constraint
 fd_exit_point
   fd_return

fd_end_user_constraint


	/*----------------------------*/
	/* User constraint: fd_atmost */
	/*----------------------------*/


	/* Bloc #1 */

fd_begin_internal(fd_atmost_bloc_1)

   fd_local_fdv_adr
   fd_local_value_var(intN)
   fd_local_l_fdv_var(l_fdvL)
   fd_local_value_var(intV)

   fd_load_int(intN,0)
   fd_load_l_fdv(l_fdvL,1)
   fd_load_int(intV,2)
   fd_check_fct(Fd_Atmost(intN,l_fdvL,intV))
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_atmost_bloc_1_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_atmost_bloc_1,-1,0)
   fd_add_list_dependency(1,dom)
   fd_call_internal(fd_atmost_bloc_1)
 fd_exit_point
   fd_return

fd_end_internal


	/* Entry point for fd_atmost */

fd_begin_user_constraint(fd_atmost(FdArg(N),FdArg(L),FdArg(V)))

   fd_create_a_frame(3)
   fd_int_in_a_frame(N,0)
   fd_l_fdv_in_a_frame(L,1)
   fd_int_in_a_frame(V,2)

   fd_before_add_constraint
   fd_call_internal(fd_atmost_bloc_1_inst)
   fd_after_add_constraint
 fd_exit_point
   fd_return

fd_end_user_constraint


	/*-----------------------------*/
	/* User constraint: fd_atleast */
	/*-----------------------------*/


	/* Bloc #1 */

fd_begin_internal(fd_atleast_bloc_1)

   fd_local_fdv_adr
   fd_local_value_var(intN)
   fd_local_l_fdv_var(l_fdvL)
   fd_local_value_var(intV)

   fd_load_int(intN,0)
   fd_load_l_fdv(l_fdvL,1)
   fd_load_int(intV,2)
   fd_check_fct(Fd_Atleast(intN,l_fdvL,intV))
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_atleast_bloc_1_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_atleast_bloc_1,-1,0)
   fd_add_list_dependency(1,dom)
   fd_call_internal(fd_atleast_bloc_1)
 fd_exit_point
   fd_return

fd_end_internal


	/* Entry point for fd_atleast */

fd_begin_user_constraint(fd_atleast(FdArg(N),FdArg(L),FdArg(V)))

   fd_create_a_frame(3)
   fd_int_in_a_frame(N,0)
   fd_l_fdv_in_a_frame(L,1)
   fd_int_in_a_frame(V,2)

   fd_before_add_constraint
   fd_call_internal(fd_atleast_bloc_1_inst)
   fd_after_add_constraint
 fd_exit_point
   fd_return

fd_end_user_constraint


	/*-----------------------------*/
	/* User constraint: fd_exactly */
	/*-----------------------------*/


	/* Bloc #1 */

fd_begin_internal(fd_exactly_bloc_1)

   fd_local_fdv_adr
   fd_local_value_var(intN)
   fd_local_l_fdv_var(l_fdvL)
   fd_local_value_var(intV)

   fd_load_int(intN,0)
   fd_load_l_fdv(l_fdvL,1)
   fd_load_int(intV,2)
   fd_check_fct(Fd_Exactly(intN,l_fdvL,intV))
 fd_exit_point
   fd_return

fd_end_internal

fd_begin_internal(fd_exactly_bloc_1_inst)

   fd_local_cf_pointer
   fd_create_c_frame(fd_exactly_bloc_1,-1,0)
   fd_add_list_dependency(1,dom)
   fd_call_internal(fd_exactly_bloc_1)
 fd_exit_point
   fd_return

fd_end_internal


	/* Entry point for fd_exactly */

fd_begin_user_constraint(fd_exactly(FdArg(N),FdArg(L),FdArg(V)))

   fd_create_a_frame(3)
   fd_int_in_a_frame(N,0)
   fd_l_fdv_in_a_frame(L,1)
   fd_int_in_a_frame(V,2)

   fd_before_add_constraint
   fd_call_internal(fd_exactly_bloc_1_inst)
   fd_after_add_constraint
 fd_exit_point
   fd_return

fd_end_user_constraint

