GNU PROLOG with UTF8 support
Macros | Functions | Variables
fd_inst.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include "engine_pl.h"
#include "engine_fd.h"
#include "bips_pl.h"
Include dependency graph for fd_inst.c:

Macros

#define FD_INST_FILE
 
#define OBJ_INIT   Fd_Inst_Initializer
 
#define MSG_VECTOR_TOO_SMALL   "Warning: Vector too small - maybe lost solutions (FD Var:_%ld)\n"
 
#define DATE_NEVER   0
 
#define DATE_ALWAYS   1
 
#define FD_Word_Needs_Trailing(adr)   ((adr) < CSB(B))
 
#define FD_Bind_OV(adr, word)
 
#define Trail_Fd_Int_Variable_If_Necessary(fdv_adr)
 
#define Trail_Range_If_Necessary(fdv_adr)
 
#define Trail_Chains_If_Necessary(fdv_adr)
 
#define Update_Range_From_Int(fdv_adr, n, propag)
 
#define Update_Interval_From_Interval(fdv_adr, nb_elem, min, max, propag)
 
#define Update_Range_From_Range(fdv_adr, nb_elem, range, propag)
 

Functions

static void All_Propagations (WamWord *fdv_adr, int propag)
 
static void Clear_Queue (void)
 
static void Fd_Inst_Initializer (void)
 
void Pl_Fd_Init_Solver0 (void)
 
void Pl_Fd_Reset_Solver0 (void)
 
WamWordPl_Fd_Prolog_To_Fd_Var (WamWord arg_word, Bool pl_var_ok)
 
RangePl_Fd_Prolog_To_Range (WamWord list_word)
 
int Pl_Fd_Prolog_To_Value (WamWord arg_word)
 
void Pl_Fd_List_Int_To_Range (Range *range, WamWord list_word)
 
WamWordPl_Fd_Prolog_To_Array_Int (WamWord list_word)
 
WamWordPl_Fd_Prolog_To_Array_Any (WamWord list_word)
 
WamWordPl_Fd_Prolog_To_Array_Fdv (WamWord list_word, Bool pl_var_ok)
 
WamWordPl_Fd_Create_C_Frame (PlLong(*cstr_fct)(), WamWord *AF, WamWord *fdv_adr, Bool optim2)
 
void Pl_Fd_Add_Dependency (WamWord *fdv_adr, int chain_nb, WamWord *CF)
 
void Pl_Fd_Add_List_Dependency (WamWord *array, int chain_nb, WamWord *CF)
 
WamWordPl_Fd_New_Variable_Interval (int min, int max)
 
WamWordPl_Fd_New_Variable (void)
 
WamWordPl_Fd_New_Variable_Range (Range *r)
 
WamWordPl_Fd_New_Int_Variable (int n)
 
void Pl_Fd_Before_Add_Cstr (void)
 
Bool Pl_Fd_Tell_Value (WamWord *fdv_adr, int n)
 
Bool Pl_Fd_Tell_Not_Value (WamWord *fdv_adr, int n)
 
Bool Pl_Fd_Tell_Int_Range (WamWord *fdv_adr, Range *range)
 
Bool Pl_Fd_Tell_Interv_Interv (WamWord *fdv_adr, int min, int max)
 
Bool Pl_Fd_Tell_Range_Range (WamWord *fdv_adr, Range *range)
 
Bool Pl_Fd_Tell_Interval (WamWord *fdv_adr, int min, int max)
 
Bool Pl_Fd_Tell_Range (WamWord *fdv_adr, Range *range)
 
Bool Pl_Fd_After_Add_Cstr (Bool result_of_tell)
 
void Pl_Fd_Stop_Constraint (WamWord *CF)
 
Bool Pl_Fd_In_Interval (WamWord *fdv_adr, int min, int max)
 
Bool Pl_Fd_In_Range (WamWord *fdv_adr, Range *range)
 
Bool Pl_Fd_Assign_Value_Fast (WamWord *fdv_adr, int n)
 
Bool Pl_Fd_Unify_With_Integer0 (WamWord *fdv_adr, int n)
 
Bool Pl_Fd_Remove_Value (WamWord *fdv_adr, int n)
 
Bool Pl_Fd_Unify_With_Fd_Var0 (WamWord *fdv_adr1, WamWord *fdv_adr2)
 
Bool Pl_Fd_Use_Vector (WamWord *fdv_adr)
 
Bool Pl_Fd_Check_For_Bool_Var (WamWord x_word)
 
int Pl_Fd_Variable_Size0 (WamWord *fdv_adr)
 
int Pl_Fd_Copy_Variable0 (WamWord *dst_adr, WamWord *fdv_adr)
 
char * Pl_Fd_Variable_To_String0 (WamWord *fdv_adr)
 
void Pl_Fd_Display_Extra_Cstr (WamWord *fdv_adr)
 

Variables

static WamWordTP
 
static WamWord dummy_fd_var [FD_VARIABLE_FRAME_SIZE]
 
static PlULong DATE
 
static PlULong optim2_date_never = DATE_NEVER
 
static PlULong optim2_date_always = DATE_ALWAYS
 
void(* pl_fd_init_solver )() = Pl_Fd_Init_Solver0
 
void(* pl_fd_reset_solver )() = Pl_Fd_Reset_Solver0
 

Macro Definition Documentation

#define DATE_ALWAYS   1
#define DATE_NEVER   0
#define FD_Bind_OV (   adr,
  word 
)
Value:
do \
{ \
Trail_OV(adr); \
*(adr) = (word); \
} \
while (0)
#define FD_Word_Needs_Trailing(adr)
Definition: fd_inst.c:198
#define Trail_OV(adr)
Definition: wam_inst.h:508
#define FD_INST_FILE
#define FD_Word_Needs_Trailing (   adr)    ((adr) < CSB(B))
#define MSG_VECTOR_TOO_SMALL   "Warning: Vector too small - maybe lost solutions (FD Var:_%ld)\n"
#define OBJ_INIT   Fd_Inst_Initializer
#define Trail_Chains_If_Necessary (   fdv_adr)
Value:
do \
{ \
if (Chains_Stamp(fdv_adr) != STAMP) \
{ \
Chains_Stamp(fdv_adr) = STAMP; \
} \
} \
while (0)
#define OFFSET_CHAINS
Definition: fd_inst.h:51
#define Trail_MV(adr, nb)
Definition: wam_inst.h:519
#define CHAINS_SIZE
Definition: fd_inst.h:52
#define Chains_Stamp(fdv_adr)
Definition: fd_inst.h:66
#define Trail_Fd_Int_Variable_If_Necessary (   fdv_adr)
Value:
do \
{ \
{ \
Trail_OV(&FD_INT_Date(fdv_adr)); \
} \
} \
while (0)
#define Trail_Range_If_Necessary(fdv_adr)
Definition: fd_inst.c:230
#define FD_INT_Date(fdv_adr)
Definition: fd_inst.h:57
#define FD_Word_Needs_Trailing(adr)
Definition: fd_inst.c:198
#define Trail_OV(adr)
Definition: wam_inst.h:508
#define FD_Tag_Value(fdv_adr)
Definition: fd_inst.h:56
#define Trail_Range_If_Necessary (   fdv_adr)
Value:
do \
{ \
if (Range_Stamp(fdv_adr) != STAMP) \
{ \
if (Is_Sparse(Range(fdv_adr))) \
Range_Stamp(fdv_adr) = STAMP; \
} \
} \
while (0)
#define Vec(fdv_adr)
Definition: fd_inst.h:92
#define Trail_MV(adr, nb)
Definition: wam_inst.h:519
#define RANGE_SIZE
Definition: fd_inst.h:49
#define OFFSET_RANGE
Definition: fd_inst.h:48
WamWord pl_vec_size
#define Is_Sparse(range)
Definition: fd_range.h:278
#define Range_Stamp(fdv_adr)
Definition: fd_inst.h:62
long WamWord
Definition: LINUX_SIGSEGV.c:4
#define Range(fdv_adr)
Definition: fd_inst.h:64
#define Update_Interval_From_Interval (   fdv_adr,
  nb_elem,
  min,
  max,
  propag 
)
Value:
do \
{ \
propag = MASK_EMPTY; \
\
if (Nb_Elem(fdv_adr) != nb_elem) \
{ \
Nb_Elem(fdv_adr) = nb_elem; \
Set_Dom_Mask(propag); \
\
if (Min(fdv_adr) != min) \
{ \
Min(fdv_adr) = min; \
Set_Min_Mask(propag); \
} \
\
if (Max(fdv_adr) != max) \
{ \
Max(fdv_adr) = max; \
Set_Max_Mask(propag); \
} \
} \
} \
while (0)
#define Trail_Range_If_Necessary(fdv_adr)
Definition: fd_inst.c:230
#define Min(fdv_adr)
Definition: fd_inst.h:90
#define MASK_EMPTY
Definition: math_supp.h:43
#define Set_Max_Mask(mask)
Definition: fd_inst.h:122
#define Set_Min_Mask(mask)
Definition: fd_inst.h:121
#define Max(fdv_adr)
Definition: fd_inst.h:91
#define Nb_Elem(fdv_adr)
Definition: fd_inst.h:63
#define Set_Dom_Mask(mask)
Definition: fd_inst.h:124
#define Set_Min_Max_Mask(mask)
Definition: fd_inst.h:123
#define Update_Range_From_Int (   fdv_adr,
  n,
  propag 
)
Value:
do \
{ \
propag = MASK_EMPTY; \
Nb_Elem(fdv_adr) = 1; \
Set_Dom_Mask(propag); \
Set_Val_Mask(propag); \
\
if (Min(fdv_adr) != n) \
{ \
Min(fdv_adr) = n; \
Set_Min_Mask(propag); \
} \
\
if (Max(fdv_adr) != n) \
{ \
Max(fdv_adr) = n; \
Set_Max_Mask(propag); \
} \
Vec(fdv_adr) = NULL; \
FD_Tag_Value(fdv_adr) = Tag_INT(n); \
FD_INT_Date(fdv_adr) = DATE; \
} \
while (0)
#define Trail_Fd_Int_Variable_If_Necessary(fdv_adr)
Definition: fd_inst.c:215
#define Vec(fdv_adr)
Definition: fd_inst.h:92
#define Min(fdv_adr)
Definition: fd_inst.h:90
#define MASK_EMPTY
Definition: math_supp.h:43
#define Set_Max_Mask(mask)
Definition: fd_inst.h:122
#define FD_INT_Date(fdv_adr)
Definition: fd_inst.h:57
#define Set_Min_Mask(mask)
Definition: fd_inst.h:121
#define Max(fdv_adr)
Definition: fd_inst.h:91
#define Set_Val_Mask(mask)
Definition: fd_inst.h:125
#define Nb_Elem(fdv_adr)
Definition: fd_inst.h:63
#define FD_Tag_Value(fdv_adr)
Definition: fd_inst.h:56
#define Set_Dom_Mask(mask)
Definition: fd_inst.h:124
static PlULong DATE
Definition: fd_inst.c:78
#define Set_Min_Max_Mask(mask)
Definition: fd_inst.h:123
#define Update_Range_From_Range (   fdv_adr,
  nb_elem,
  range,
  propag 
)

Function Documentation

static void All_Propagations ( WamWord fdv_adr,
int  propag 
)
static

Here is the caller graph for this function:

static void Clear_Queue ( void  )
static

Here is the caller graph for this function:

static void Fd_Inst_Initializer ( void  )
static

Here is the call graph for this function:

void Pl_Fd_Add_Dependency ( WamWord fdv_adr,
int  chain_nb,
WamWord CF 
)

Here is the caller graph for this function:

void Pl_Fd_Add_List_Dependency ( WamWord array,
int  chain_nb,
WamWord CF 
)

Here is the call graph for this function:

Bool Pl_Fd_After_Add_Cstr ( Bool  result_of_tell)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Assign_Value_Fast ( WamWord fdv_adr,
int  n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Fd_Before_Add_Cstr ( void  )

Here is the caller graph for this function:

Bool Pl_Fd_Check_For_Bool_Var ( WamWord  x_word)

Here is the call graph for this function:

Here is the caller graph for this function:

int Pl_Fd_Copy_Variable0 ( WamWord dst_adr,
WamWord fdv_adr 
)

Here is the call graph for this function:

Here is the caller graph for this function:

WamWord* Pl_Fd_Create_C_Frame ( PlLong(*)()  cstr_fct,
WamWord AF,
WamWord fdv_adr,
Bool  optim2 
)
void Pl_Fd_Display_Extra_Cstr ( WamWord fdv_adr)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_In_Interval ( WamWord fdv_adr,
int  min,
int  max 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_In_Range ( WamWord fdv_adr,
Range range 
)

Here is the call graph for this function:

void Pl_Fd_Init_Solver0 ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Fd_List_Int_To_Range ( Range range,
WamWord  list_word 
)

Here is the call graph for this function:

Here is the caller graph for this function:

WamWord* Pl_Fd_New_Int_Variable ( int  n)

Here is the caller graph for this function:

WamWord* Pl_Fd_New_Variable ( void  )

Here is the call graph for this function:

Here is the caller graph for this function:

WamWord* Pl_Fd_New_Variable_Interval ( int  min,
int  max 
)

Here is the caller graph for this function:

WamWord* Pl_Fd_New_Variable_Range ( Range r)

Here is the call graph for this function:

WamWord* Pl_Fd_Prolog_To_Array_Any ( WamWord  list_word)

Here is the call graph for this function:

WamWord* Pl_Fd_Prolog_To_Array_Fdv ( WamWord  list_word,
Bool  pl_var_ok 
)

Here is the call graph for this function:

WamWord* Pl_Fd_Prolog_To_Array_Int ( WamWord  list_word)

Here is the call graph for this function:

WamWord* Pl_Fd_Prolog_To_Fd_Var ( WamWord  arg_word,
Bool  pl_var_ok 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Range* Pl_Fd_Prolog_To_Range ( WamWord  list_word)

Here is the call graph for this function:

int Pl_Fd_Prolog_To_Value ( WamWord  arg_word)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Remove_Value ( WamWord fdv_adr,
int  n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

void Pl_Fd_Reset_Solver0 ( void  )

Here is the caller graph for this function:

void Pl_Fd_Stop_Constraint ( WamWord CF)

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Int_Range ( WamWord fdv_adr,
Range range 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Interv_Interv ( WamWord fdv_adr,
int  min,
int  max 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Interval ( WamWord fdv_adr,
int  min,
int  max 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Not_Value ( WamWord fdv_adr,
int  n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Range ( WamWord fdv_adr,
Range range 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Range_Range ( WamWord fdv_adr,
Range range 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Tell_Value ( WamWord fdv_adr,
int  n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Unify_With_Fd_Var0 ( WamWord fdv_adr1,
WamWord fdv_adr2 
)

Here is the caller graph for this function:

Bool Pl_Fd_Unify_With_Integer0 ( WamWord fdv_adr,
int  n 
)

Here is the call graph for this function:

Here is the caller graph for this function:

Bool Pl_Fd_Use_Vector ( WamWord fdv_adr)

Here is the call graph for this function:

Here is the caller graph for this function:

int Pl_Fd_Variable_Size0 ( WamWord fdv_adr)

Here is the caller graph for this function:

char* Pl_Fd_Variable_To_String0 ( WamWord fdv_adr)

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

PlULong DATE
static
WamWord dummy_fd_var[FD_VARIABLE_FRAME_SIZE]
static
PlULong optim2_date_always = DATE_ALWAYS
static
PlULong optim2_date_never = DATE_NEVER
static
void(* pl_fd_init_solver) () = Pl_Fd_Init_Solver0
void(* pl_fd_reset_solver) () = Pl_Fd_Reset_Solver0
WamWord* TP
static