Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3

This commit is contained in:
Ubuntu32 2011-12-07 06:40:48 -08:00
commit 291486af3d
86 changed files with 34696 additions and 1191 deletions

View File

@ -637,7 +637,7 @@ CreateStaticArray(AtomEntry *ae, Int dim, static_array_types type, CODEADDR star
p->ArrayEArity = -dim;
p->ArrayType = type;
if (start_addr == NULL) {
int i;
Int i;
AllocateStaticArraySpace(p, type, dim PASS_REGS);
if (p->ValueOfVE.ints == NULL) {
@ -790,7 +790,7 @@ ClearStaticArray(StaticArrayEntry *pp)
WRITE_LOCK(pp->ArRWLock);
switch(type) {
case array_of_ints:
memset((void *)pp->ValueOfVE.ints,0,sizeof(int)*dim);
memset((void *)pp->ValueOfVE.ints,0,sizeof(Int)*dim);
break;
case array_of_chars:
memset((void *)pp->ValueOfVE.chars,0,sizeof(char)*dim);

View File

@ -992,7 +992,7 @@ YAP_MkListFromTerms(Term *ta, Int sz)
if (sz == 0)
return TermNil;
BACKUP_H();
if (H+sz*2 > ASP-1024) {
while (H+sz*2 > ASP-1024) {
Int sl1 = Yap_InitSlot((CELL)ta PASS_REGS);
RECOVER_H();
if (!dogc( PASS_REGS1 )) {

View File

@ -1392,8 +1392,10 @@ Yap_clean_tokenizer(TokEntry *tokstart, VarEntry *vartable, VarEntry *anonvartab
}
LOCAL_Comments = TermNil;
LOCAL_CommentsNextChar = LOCAL_CommentsTail = NULL;
free(LOCAL_CommentsBuff);
LOCAL_CommentsBuff = NULL;
if (LOCAL_CommentsBuff) {
free(LOCAL_CommentsBuff);
LOCAL_CommentsBuff = NULL;
}
LOCAL_CommentsBuffLim = 0;
}

View File

@ -114,6 +114,14 @@ store_specs(int new_worker_id, UInt ssize, UInt tsize, UInt sysize, Term *tpgoal
REMOTE_ThreadHandle(new_worker_id).texit_mod = tmod;
REMOTE_ThreadHandle(new_worker_id).texit =
Yap_StoreTermInDB(tgoal,7);
REMOTE_ThreadHandle(new_worker_id).local_preds =
NULL;
REMOTE_ThreadHandle(new_worker_id).start_of_timesp =
NULL;
REMOTE_ThreadHandle(new_worker_id).last_timep =
NULL;
REMOTE_ScratchPad(new_worker_id).ptr =
NULL;
return TRUE;
}
@ -121,12 +129,11 @@ store_specs(int new_worker_id, UInt ssize, UInt tsize, UInt sysize, Term *tpgoal
static void
kill_thread_engine (int wid, int always_die)
{
CACHE_REGS
Prop p0 = AbsPredProp(REMOTE_ThreadHandle(wid).local_preds);
GlobalEntry *gl = LOCAL_GlobalVariables;
GlobalEntry *gl = REMOTE_GlobalVariables(wid);
REMOTE_ThreadHandle(wid).local_preds = NIL;
LOCAL_GlobalVariables = NULL;
REMOTE_GlobalVariables(wid) = NULL;
/* kill all thread local preds */
while(p0) {
PredEntry *ap = RepPredProp(p0);
@ -140,12 +147,19 @@ kill_thread_engine (int wid, int always_die)
}
Yap_KillStacks(wid);
REMOTE_ActiveSignals(wid) = 0L;
free(REMOTE_ScratchPad(wid).ptr);
free(REMOTE_ThreadHandle(wid).default_yaam_regs);
if (REMOTE_ScratchPad(wid).ptr)
free(REMOTE_ScratchPad(wid).ptr);
REMOTE_ThreadHandle(wid).current_yaam_regs = NULL;
free(REMOTE_ThreadHandle(wid).start_of_timesp);
free(REMOTE_ThreadHandle(wid).last_timep);
Yap_FreeCodeSpace((ADDR)REMOTE_ThreadHandle(wid).texit);
if (REMOTE_ThreadHandle(wid).start_of_timesp)
free(REMOTE_ThreadHandle(wid).start_of_timesp);
if (REMOTE_ThreadHandle(wid).last_timep)
free(REMOTE_ThreadHandle(wid).last_timep);
if (REMOTE_ThreadHandle(wid).texit) {
Yap_FreeCodeSpace((ADDR)REMOTE_ThreadHandle(wid).texit);
}
/* FreeCodeSpace requires LOCAL requires yaam_regs */
free(REMOTE_ThreadHandle(wid).default_yaam_regs);
REMOTE_ThreadHandle(wid).default_yaam_regs = NULL;
LOCK(GLOBAL_ThreadHandlesLock);
if (REMOTE_ThreadHandle(wid).tdetach == MkAtomTerm(AtomTrue) ||
always_die) {
@ -167,13 +181,15 @@ thread_die(int wid, int always_die)
kill_thread_engine(wid, always_die);
}
static void
static int
setup_engine(int myworker_id, int init_thread)
{
CACHE_REGS
REGSTORE *standard_regs;
standard_regs = (REGSTORE *)calloc(1,sizeof(REGSTORE));
if (!standard_regs)
return FALSE;
regcache = standard_regs;
/* create the YAAM descriptor */
REMOTE_ThreadHandle(myworker_id).default_yaam_regs = standard_regs;
@ -194,6 +210,7 @@ setup_engine(int myworker_id, int init_thread)
#ifdef TABLING
DepFr_cons_cp(LOCAL_top_dep_fr) = B; /* same as in Yap_init_root_frames() */
#endif /* TABLING */
return TRUE;
}
static void
@ -418,7 +435,8 @@ Yap_thread_create_engine(thread_attr *ops)
REMOTE_ThreadHandle(new_id).pthread_handle = 0L;
REMOTE_ThreadHandle(new_id).id = new_id;
REMOTE_ThreadHandle(new_id).ref_count = 0;
setup_engine(new_id, FALSE);
if (!setup_engine(new_id, FALSE))
return -1;
if (pthread_self() != GLOBAL_master_thread) {
pthread_setspecific(Yap_yaamregs_key, NULL);
pthread_mutex_unlock(&(REMOTE_ThreadHandle(0).tlock));

View File

@ -152,7 +152,6 @@ clrsb(Int i)
inline static Term
do_sll(Int i, Int j) /* j > 0 */
{
Int k;
#ifdef USE_GMP
if (
#ifdef __GNUC__X

View File

@ -13,107 +13,45 @@
/************************************************************************
** General Configuration Parameters **
************************************************************************/
/******************************************************************************************
** use shared pages memory alloc scheme for OPTYap data structures? (optional) **
******************************************************************************************/
/* #define USE_PAGES_MALLOC 1 */
/************************************************************************
** Tabling Configuration Parameters **
************************************************************************/
/****************************
** default sizes **
****************************/
#define MAX_TABLE_VARS 1000
/**********************************************************
** trail freeze scheme (mandatory, define one) **
**********************************************************/
#define BFZ_TRAIL_SCHEME 1
/* #define BBREG_TRAIL_SCHEME 1 */
/*********************************************************
** support mode directed tabling ? (optional) **
*********************************************************/
#define MODE_DIRECTED_TABLING 1
/****************************************************
** support early completion ? (optional) **
****************************************************/
#define TABLING_EARLY_COMPLETION 1
/******************************************************
** support trie compact pairs ? (optional) **
******************************************************/
#define TRIE_COMPACT_PAIRS 1
/************************************************************
** support global trie for subterms ? (optional) **
************************************************************/
/* #define GLOBAL_TRIE_FOR_SUBTERMS 1 */
/******************************************************
** support incomplete tabling ? (optional) **
******************************************************/
/* #define INCOMPLETE_TABLING 1 */
/******************************************************
** limit the table space size ? (optional) **
******************************************************/
/* #define LIMIT_TABLING 1 */
/*********************************************************
** support deterministic tabling ? (optional) **
*********************************************************/
/* #define DETERMINISTIC_TABLING 1 */
/*************************************************
** enable error checking ? (optional) **
*************************************************/
/* #define DEBUG_TABLING 1 */
/************************************************************************
** YapOr Configuration Parameters **
************************************************************************/
/****************************************************************
** Configuration Parameters **
****************************************************************/
/****************************
** default sizes **
****************************/
#define MAX_TABLE_VARS 1000
#define TRIE_LOCK_BUCKETS 512
#define THREADS_FIRST_LEVEL_BUCKETS 16
#define THREADS_SECOND_LEVEL_BUCKETS (MAX_THREADS / THREADS_FIRST_LEVEL_BUCKETS) /* 64 (1024/16) */
#define TG_ANSWER_SLOTS 20
#define MAX_LENGTH_ANSWER 1000
#define MAX_BRANCH_DEPTH 1000
#define MAX_BEST_TIMES 21
/************************************************************
** memory mapping scheme (mandatory, define one) **
************************************************************/
/**********************************************************************
** memory mapping scheme for YapOr (mandatory, define one) **
**********************************************************************/
#define MMAP_MEMORY_MAPPING_SCHEME 1
/* #define SHM_MEMORY_MAPPING_SCHEME 1 */
/*************************************************
** enable error checking ? (optional) **
*************************************************/
/* #define DEBUG_YAPOR 1 */
/****************************************************************
** use shared pages memory alloc scheme ? (optional) **
****************************************************************/
/* #define USE_PAGES_MALLOC 1 */
/**********************************************************************
** trail freeze scheme for tabling (mandatory, define one) **
**********************************************************************/
#define BFZ_TRAIL_SCHEME 1
/* #define BBREG_TRAIL_SCHEME 1 */
/************************************************************************
** OPTYap Configuration Parameters **
** multithreading design for tabling (mandatory, define one) **
************************************************************************/
/****************************
** default sizes **
****************************/
#define TG_ANSWER_SLOTS 20
#define TRIE_LOCK_BUCKETS 512
#define THREADS_NO_SHARING 1
/* #define THREADS_SUBGOAL_SHARING 1 */
/* #define THREADS_FULL_SHARING 1 */
/* #define THREADS_CONSUMER_SHARING 1 */
/*************************************************************************
** tries locking scheme (mandatory, define one per trie type) **
@ -154,26 +92,86 @@
#define TRIE_LOCK_USING_NODE_FIELD 1
/* #define TRIE_LOCK_USING_GLOBAL_ARRAY 1 */
/*********************************************************
** support mode directed tabling ? (optional) **
*********************************************************/
#define MODE_DIRECTED_TABLING 1
/****************************************************************
** support early completion for tabling ? (optional) **
*****************************************************************/
#define TABLING_EARLY_COMPLETION 1
/******************************************************
** support tabling inner cuts ? (optional) **
** support trie compact pairs ? (optional) **
******************************************************/
#define TABLING_INNER_CUTS 1
#define TRIE_COMPACT_PAIRS 1
/************************************************************
** support global trie for subterms ? (optional) **
************************************************************/
/* #define GLOBAL_TRIE_FOR_SUBTERMS 1 */
/******************************************************
** support incomplete tabling ? (optional) **
******************************************************/
/* #define INCOMPLETE_TABLING 1 */
/******************************************************
** limit the table space size ? (optional) **
******************************************************/
/* #define LIMIT_TABLING 1 */
/*********************************************************
** use timestamps for suspension ? (optional) **
** support deterministic tabling ? (optional) **
*********************************************************/
/* #define DETERMINISTIC_TABLING 1 */
/******************************************************************
** support tabling inner cuts with OPTYap ? (optional) **
******************************************************************/
#define TABLING_INNER_CUTS 1
/*********************************************************************
** use timestamps for suspension with OPTYap ? (optional) **
*********************************************************************/
#define TIMESTAMP_CHECK 1
/*************************************************
** enable error checking ? (optional) **
*************************************************/
/* #define DEBUG_TABLING 1 */
/* #define DEBUG_YAPOR 1 */
/**************************************************
** enable output checking ? (optional) **
**************************************************/
/* #define OUTPUT_THREADS_TABLING 1 */
/************************************************************************
** Parameter Checks **
************************************************************************/
#ifndef USE_PAGES_MALLOC
#undef LIMIT_TABLING
#endif /* ! USE_PAGES_MALLOC */
#ifdef YAPOR
#ifdef i386 /* For i386 machines we use shared memory segments */
#undef MMAP_MEMORY_MAPPING_SCHEME
#define SHM_MEMORY_MAPPING_SCHEME
#endif
#if !defined(MMAP_MEMORY_MAPPING_SCHEME) && !defined(SHM_MEMORY_MAPPING_SCHEME)
#error Define a memory mapping scheme
#endif
#if defined(MMAP_MEMORY_MAPPING_SCHEME) && defined(SHM_MEMORY_MAPPING_SCHEME)
#error Do not define multiple memory mapping schemes
#endif
#else /* ! YAPOR */
#undef MMAP_MEMORY_MAPPING_SCHEME
#undef SHM_MEMORY_MAPPING_SCHEME
#undef DEBUG_YAPOR
#endif /* YAPOR */
#ifdef TABLING
#if !defined(BFZ_TRAIL_SCHEME) && !defined(BBREG_TRAIL_SCHEME)
@ -195,27 +193,7 @@
#undef DEBUG_TABLING
#endif /* TABLING */
#ifdef YAPOR
#ifdef i386 /* For i386 machines we use shared memory segments */
#undef MMAP_MEMORY_MAPPING_SCHEME
#define SHM_MEMORY_MAPPING_SCHEME
#endif
#if !defined(MMAP_MEMORY_MAPPING_SCHEME) && !defined(SHM_MEMORY_MAPPING_SCHEME)
#error Define a memory mapping scheme
#endif
#if defined(MMAP_MEMORY_MAPPING_SCHEME) && defined(SHM_MEMORY_MAPPING_SCHEME)
#error Do not define multiple memory mapping schemes
#endif
#undef LIMIT_TABLING
#else /* ! YAPOR */
#undef MMAP_MEMORY_MAPPING_SCHEME
#undef SHM_MEMORY_MAPPING_SCHEME
#undef DEBUG_YAPOR
#endif /* YAPOR */
#if defined(YAPOR) && defined(TABLING)
#if defined(TABLING) && (defined(YAPOR) || defined(THREADS))
/* SUBGOAL_TRIE_LOCK_LEVEL */
#if !defined(SUBGOAL_TRIE_LOCK_AT_ENTRY_LEVEL) && !defined(SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL) && !defined(SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL)
#error Define a subgoal trie lock scheme
@ -258,35 +236,14 @@
#ifndef GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL
#undef GLOBAL_TRIE_ALLOC_BEFORE_CHECK
#endif
/* TRIE_LOCK_USING_NODE_FIELD / TRIE_LOCK_USING_GLOBAL_ARRAY */
/* TRIE_LOCK_USING */
#if !defined(TRIE_LOCK_USING_NODE_FIELD) && !defined(TRIE_LOCK_USING_GLOBAL_ARRAY)
#error Define a trie lock data structure
#endif
#if defined(TRIE_LOCK_USING_NODE_FIELD) && defined(TRIE_LOCK_USING_GLOBAL_ARRAY)
#error Do not define multiple trie lock data structures
#endif
#ifdef TRIE_LOCK_USING_NODE_FIELD
#if defined(SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define SUBGOAL_TRIE_LOCK_USING_NODE_FIELD 1
#endif
#if defined(ANSWER_TRIE_LOCK_AT_NODE_LEVEL) || defined(ANSWER_TRIE_LOCK_AT_WRITE_LEVEL)
#define ANSWER_TRIE_LOCK_USING_NODE_FIELD 1
#endif
#if defined(GLOBAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define GLOBAL_TRIE_LOCK_USING_NODE_FIELD 1
#endif
#elif TRIE_LOCK_USING_GLOBAL_ARRAY
#if defined(SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define SUBGOAL_TRIE_LOCK_USING_GLOBAL_ARRAY 1
#endif
#if defined(ANSWER_TRIE_LOCK_AT_NODE_LEVEL) || defined(ANSWER_TRIE_LOCK_AT_WRITE_LEVEL)
#define ANSWER_TRIE_LOCK_USING_GLOBAL_ARRAY 1
#endif
#if defined(GLOBAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define GLOBAL_TRIE_LOCK_USING_GLOBAL_ARRAY 1
#endif
#endif
#else /* ! TABLING || ! YAPOR */
#else /* ! TABLING || (! YAPOR && ! THREADS) */
#undef SUBGOAL_TRIE_LOCK_AT_ENTRY_LEVEL
#undef SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL
#undef SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL
@ -300,11 +257,98 @@
#undef GLOBAL_TRIE_ALLOC_BEFORE_CHECK
#undef TRIE_LOCK_USING_NODE_FIELD
#undef TRIE_LOCK_USING_GLOBAL_ARRAY
#endif /* TABLING && (YAPOR || THREADS) */
#if defined(TABLING) && defined(THREADS)
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
#error Define a multithreading table design
#endif
#if defined(THREADS_NO_SHARING) && defined(THREADS_SUBGOAL_SHARING)
#error Do not define multiple multithreading table designs
#endif
#if defined(THREADS_NO_SHARING) && defined(THREADS_FULL_SHARING)
#error Do not define multiple multithreading table designs
#endif
#if defined(THREADS_NO_SHARING) && defined(THREADS_CONSUMER_SHARING)
#error Do not define multiple multithreading table designs
#endif
#if defined(THREADS_SUBGOAL_SHARING) && defined(THREADS_FULL_SHARING)
#error Do not define multiple multithreading table designs
#endif
#if defined(THREADS_SUBGOAL_SHARING) && defined(THREADS_CONSUMER_SHARING)
#error Do not define multiple multithreading table designs
#endif
#if defined(THREADS_FULL_SHARING) && defined(THREADS_CONSUMER_SHARING)
#error Do not define multiple multithreading table designs
#endif
#ifdef THREADS_NO_SHARING
#undef SUBGOAL_TRIE_LOCK_AT_ENTRY_LEVEL
#undef SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL
#undef SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL
#undef SUBGOAL_TRIE_ALLOC_BEFORE_CHECK
#endif
#if defined(THREADS_NO_SHARING) || defined(THREADS_SUBGOAL_SHARING)
#undef ANSWER_TRIE_LOCK_AT_ENTRY_LEVEL
#undef ANSWER_TRIE_LOCK_AT_NODE_LEVEL
#undef ANSWER_TRIE_LOCK_AT_WRITE_LEVEL
#undef ANSWER_TRIE_ALLOC_BEFORE_CHECK
#endif
#else /* ! TABLING || ! THREADS */
#undef THREADS_NO_SHARING
#undef THREADS_SUBGOAL_SHARING
#undef THREADS_FULL_SHARING
#undef THREADS_CONSUMER_SHARING
#endif /* TABLING && THREADS */
#ifdef TRIE_LOCK_USING_NODE_FIELD
#if defined(SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define SUBGOAL_TRIE_LOCK_USING_NODE_FIELD 1
#endif
#if defined(ANSWER_TRIE_LOCK_AT_NODE_LEVEL) || defined(ANSWER_TRIE_LOCK_AT_WRITE_LEVEL)
#define ANSWER_TRIE_LOCK_USING_NODE_FIELD 1
#endif
#if defined(GLOBAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define GLOBAL_TRIE_LOCK_USING_NODE_FIELD 1
#endif
#elif defined(TRIE_LOCK_USING_GLOBAL_ARRAY)
#if defined(SUBGOAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(SUBGOAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define SUBGOAL_TRIE_LOCK_USING_GLOBAL_ARRAY 1
#endif
#if defined(ANSWER_TRIE_LOCK_AT_NODE_LEVEL) || defined(ANSWER_TRIE_LOCK_AT_WRITE_LEVEL)
#define ANSWER_TRIE_LOCK_USING_GLOBAL_ARRAY 1
#endif
#if defined(GLOBAL_TRIE_LOCK_AT_NODE_LEVEL) || defined(GLOBAL_TRIE_LOCK_AT_WRITE_LEVEL)
#define GLOBAL_TRIE_LOCK_USING_GLOBAL_ARRAY 1
#endif
#endif
#if !defined(TABLING) || !defined(YAPOR)
#undef TABLING_INNER_CUTS
#undef TIMESTAMP_CHECK
#endif /* YAPOR && TABLING */
#endif
#if defined(TABLING) && defined(THREADS)
#if THREADS_FIRST_LEVEL_BUCKETS > THREADS_SECOND_LEVEL_BUCKETS
#error THREADS_FIRST_LEVEL_BUCKETS cannot exceed THREADS_SECOND_LEVEL_BUCKETS
#endif
#else
#undef OUTPUT_THREADS_TABLING
#endif
#if defined(DEBUG_YAPOR) && defined(DEBUG_TABLING)
#define DEBUG_OPTYAP
#endif /* DEBUG_YAPOR && DEBUG_TABLING */
#endif
#if defined(LIMIT_TABLING) && !defined(USE_PAGES_MALLOC)
#error LIMIT_TABLING requires USE_PAGES_MALLOC
#endif
#if defined(YAPOR) || defined(THREADS)
#undef MODE_DIRECTED_TABLING
#undef TABLING_EARLY_COMPLETION
#undef INCOMPLETE_TABLING
#undef LIMIT_TABLING
#undef DETERMINISTIC_TABLING
#endif

View File

@ -63,36 +63,39 @@ void Yap_init_global_optyap_data(int max_table_size, int n_workers, int sch_loop
int i;
/* global data related to memory management */
#ifdef LIMIT_TABLING
if (max_table_size)
GLOBAL_max_pages = ((max_table_size - 1) * 1024 * 1024 / SHMMAX + 1) * SHMMAX / Yap_page_size;
else
GLOBAL_max_pages = -1;
#endif /* LIMIT_TABLING */
INIT_PAGES(GLOBAL_pages_void, void *);
INIT_PAGES(GLOBAL_pages_void, void *);
#ifdef TABLING
INIT_PAGES(GLOBAL_pages_tab_ent, struct table_entry);
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
INIT_PAGES(GLOBAL_pages_sg_ent, struct subgoal_entry);
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
INIT_PAGES(GLOBAL_pages_sg_fr, struct subgoal_frame);
INIT_PAGES(GLOBAL_pages_dep_fr, struct dependency_frame);
#endif
#if !defined(THREADS_NO_SHARING)
INIT_PAGES(GLOBAL_pages_sg_node, struct subgoal_trie_node);
INIT_PAGES(GLOBAL_pages_sg_hash, struct subgoal_trie_hash);
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
INIT_PAGES(GLOBAL_pages_ans_node, struct answer_trie_node);
INIT_PAGES(GLOBAL_pages_ans_hash, struct answer_trie_hash);
#endif
INIT_PAGES(GLOBAL_pages_gt_node, struct global_trie_node);
INIT_PAGES(GLOBAL_pages_gt_hash, struct global_trie_hash);
#endif /* TABLING */
#ifdef YAPOR
INIT_PAGES(GLOBAL_pages_or_fr, struct or_frame);
INIT_PAGES(GLOBAL_pages_qg_sol_fr, struct query_goal_solution_frame);
INIT_PAGES(GLOBAL_pages_qg_ans_fr, struct query_goal_answer_frame);
#endif /* YAPOR */
#if defined(YAPOR) && defined(TABLING)
INIT_PAGES(GLOBAL_pages_susp_fr, struct suspension_frame);
#endif /* YAPOR && TABLING */
#ifdef TABLING_INNER_CUTS
INIT_PAGES(GLOBAL_pages_tg_sol_fr, struct table_subgoal_solution_frame);
INIT_PAGES(GLOBAL_pages_tg_ans_fr, struct table_subgoal_answer_frame);
#endif /* TABLING_INNER_CUTS */
#ifdef TABLING
INIT_PAGES(GLOBAL_pages_tab_ent, struct table_entry);
INIT_PAGES(GLOBAL_pages_sg_fr, struct subgoal_frame);
INIT_PAGES(GLOBAL_pages_dep_fr, struct dependency_frame);
INIT_PAGES(GLOBAL_pages_sg_node, struct subgoal_trie_node);
INIT_PAGES(GLOBAL_pages_ans_node, struct answer_trie_node);
INIT_PAGES(GLOBAL_pages_gt_node, struct global_trie_node);
INIT_PAGES(GLOBAL_pages_sg_hash, struct subgoal_trie_hash);
INIT_PAGES(GLOBAL_pages_ans_hash, struct answer_trie_hash);
INIT_PAGES(GLOBAL_pages_gt_hash, struct global_trie_hash);
#endif /* TABLING */
#if defined(YAPOR) && defined(TABLING)
INIT_PAGES(GLOBAL_pages_susp_fr, struct suspension_frame);
#endif /* YAPOR && TABLING */
#ifdef YAPOR
/* global static data */
@ -136,6 +139,10 @@ void Yap_init_global_optyap_data(int max_table_size, int n_workers, int sch_loop
new_global_trie_node(GLOBAL_root_gt, 0, NULL, NULL, NULL);
GLOBAL_root_tab_ent = NULL;
#ifdef LIMIT_TABLING
if (max_table_size)
GLOBAL_max_pages = ((max_table_size - 1) * 1024 * 1024 / SHMMAX + 1) * SHMMAX / Yap_page_size;
else
GLOBAL_max_pages = -1;
GLOBAL_first_sg_fr = NULL;
GLOBAL_last_sg_fr = NULL;
GLOBAL_check_sg_fr = NULL;
@ -158,8 +165,37 @@ void Yap_init_global_optyap_data(int max_table_size, int n_workers, int sch_loop
void Yap_init_local_optyap_data(int wid) {
#ifdef YAPOR
CACHE_REGS
#if defined(TABLING) && (defined(YAPOR) || defined(THREADS))
/* local data related to memory management */
#if defined(YAPOR)
REMOTE_next_free_ans_node(wid) = NULL;
#elif defined(THREADS)
INIT_PAGES(REMOTE_pages_void(wid), void *);
INIT_PAGES(REMOTE_pages_sg_fr(wid), struct subgoal_frame);
INIT_PAGES(REMOTE_pages_dep_fr(wid), struct dependency_frame);
#if defined(THREADS_NO_SHARING)
INIT_PAGES(REMOTE_pages_sg_node(wid), struct subgoal_trie_node);
INIT_PAGES(REMOTE_pages_sg_hash(wid), struct subgoal_trie_hash);
#elif defined(THREADS_SUBGOAL_SHARING) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
REMOTE_next_free_sg_node(wid) = NULL;
REMOTE_next_free_sg_hash(wid) = NULL;
#endif
#if defined(THREADS_NO_SHARING) || defined(THREADS_SUBGOAL_SHARING)
INIT_PAGES(REMOTE_pages_ans_node(wid), struct answer_trie_node);
INIT_PAGES(REMOTE_pages_ans_hash(wid), struct answer_trie_hash);
#elif defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
REMOTE_next_free_ans_node(wid) = NULL;
REMOTE_next_free_ans_hash(wid) = NULL;
#endif
#if defined(THREADS_FULL_SHARING)
INIT_PAGES(REMOTE_pages_ans_ref_node(wid), struct answer_ref_node);
#endif
#endif /* YAPOR - THREADS */
#endif /* TABLING && (YAPOR || THREADS) */
#ifdef YAPOR
/* local data related to or-parallelism */
Set_REMOTE_top_cp(wid, (choiceptr) LOCAL_LocalBase);
REMOTE_top_or_fr(wid) = GLOBAL_root_or_fr;
@ -175,7 +211,6 @@ void Yap_init_local_optyap_data(int wid) {
#ifdef TABLING
/* local data related to tabling */
REMOTE_next_free_ans_node(wid) = NULL;
REMOTE_top_sg_fr(wid) = NULL;
#ifdef YAPOR
REMOTE_top_dep_fr(wid) = GLOBAL_root_dep_fr;
@ -219,7 +254,7 @@ void Yap_init_root_frames(void) {
#ifdef TABLING
/* root dependency frame */
#ifdef YAPOR
DepFr_cons_cp(GLOBAL_root_dep_fr) = B;
DepFr_cons_cp(GLOBAL_root_dep_fr) = B; /* with YAPOR, at that point, LOCAL_top_dep_fr shouldn't be the same as GLOBAL_root_dep_fr ? */
#else
DepFr_cons_cp(LOCAL_top_dep_fr) = B;
#endif /* YAPOR */

View File

@ -280,55 +280,104 @@ extern int Yap_page_size;
}
#endif /******************************************************************************/
#define ALLOC_OR_FRAME(STR) ALLOC_STRUCT(STR, struct or_frame, GLOBAL_pages_or_fr, GLOBAL_pages_void)
#define FREE_OR_FRAME(STR) FREE_STRUCT(STR, struct or_frame, GLOBAL_pages_or_fr, GLOBAL_pages_void)
#define ALLOC_QG_SOLUTION_FRAME(STR) ALLOC_STRUCT(STR, struct query_goal_solution_frame, GLOBAL_pages_qg_sol_fr, GLOBAL_pages_void)
#define FREE_QG_SOLUTION_FRAME(STR) FREE_STRUCT(STR, struct query_goal_solution_frame, GLOBAL_pages_qg_sol_fr, GLOBAL_pages_void)
#define ALLOC_QG_ANSWER_FRAME(STR) ALLOC_STRUCT(STR, struct query_goal_answer_frame, GLOBAL_pages_qg_ans_fr, GLOBAL_pages_void)
#define FREE_QG_ANSWER_FRAME(STR) FREE_STRUCT(STR, struct query_goal_answer_frame, GLOBAL_pages_qg_ans_fr, GLOBAL_pages_void)
#define ALLOC_TG_SOLUTION_FRAME(STR) ALLOC_STRUCT(STR, struct table_subgoal_solution_frame, GLOBAL_pages_tg_sol_fr, GLOBAL_pages_void)
#define FREE_TG_SOLUTION_FRAME(STR) FREE_STRUCT(STR, struct table_subgoal_solution_frame, GLOBAL_pages_tg_sol_fr, GLOBAL_pages_void)
#define ALLOC_TG_ANSWER_FRAME(STR) ALLOC_STRUCT(STR, struct table_subgoal_answer_frame, GLOBAL_pages_tg_ans_fr, GLOBAL_pages_void)
#define FREE_TG_ANSWER_FRAME(STR) FREE_STRUCT(STR, struct table_subgoal_answer_frame, GLOBAL_pages_tg_ans_fr, GLOBAL_pages_void)
#define ALLOC_TABLE_ENTRY(STR) ALLOC_STRUCT(STR, struct table_entry, GLOBAL_pages_tab_ent, GLOBAL_pages_void)
#define FREE_TABLE_ENTRY(STR) FREE_STRUCT(STR, struct table_entry, GLOBAL_pages_tab_ent, GLOBAL_pages_void)
#define FREE_TABLE_ENTRY(STR) FREE_STRUCT(STR, struct table_entry, GLOBAL_pages_tab_ent, GLOBAL_pages_void)
#define ALLOC_SUBGOAL_ENTRY(STR) ALLOC_STRUCT(STR, struct subgoal_entry, GLOBAL_pages_sg_ent, GLOBAL_pages_void)
#define FREE_SUBGOAL_ENTRY(STR) FREE_STRUCT(STR, struct subgoal_entry, GLOBAL_pages_sg_ent, GLOBAL_pages_void)
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
#define ALLOC_SUBGOAL_FRAME(STR) ALLOC_STRUCT(STR, struct subgoal_frame, GLOBAL_pages_sg_fr, GLOBAL_pages_void)
#define FREE_SUBGOAL_FRAME(STR) FREE_STRUCT(STR, struct subgoal_frame, GLOBAL_pages_sg_fr, GLOBAL_pages_void)
#define FREE_SUBGOAL_FRAME(STR) FREE_STRUCT(STR, struct subgoal_frame, GLOBAL_pages_sg_fr, GLOBAL_pages_void)
#else
#define ALLOC_SUBGOAL_FRAME(STR) ALLOC_STRUCT(STR, struct subgoal_frame, LOCAL_pages_sg_fr, LOCAL_pages_void)
#define FREE_SUBGOAL_FRAME(STR) FREE_STRUCT(STR, struct subgoal_frame, LOCAL_pages_sg_fr, LOCAL_pages_void)
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
#define ALLOC_DEPENDENCY_FRAME(STR) ALLOC_STRUCT(STR, struct dependency_frame, GLOBAL_pages_dep_fr, GLOBAL_pages_void)
#define FREE_DEPENDENCY_FRAME(STR) FREE_STRUCT(STR, struct dependency_frame, GLOBAL_pages_dep_fr, GLOBAL_pages_void)
#define FREE_DEPENDENCY_FRAME(STR) FREE_STRUCT(STR, struct dependency_frame, GLOBAL_pages_dep_fr, GLOBAL_pages_void)
#else
#define ALLOC_DEPENDENCY_FRAME(STR) ALLOC_STRUCT(STR, struct dependency_frame, LOCAL_pages_dep_fr, LOCAL_pages_void)
#define FREE_DEPENDENCY_FRAME(STR) FREE_STRUCT(STR, struct dependency_frame, LOCAL_pages_dep_fr, LOCAL_pages_void)
#endif
#define ALLOC_SUSPENSION_FRAME(STR) ALLOC_STRUCT(STR, struct suspension_frame, GLOBAL_pages_susp_fr, GLOBAL_pages_void)
#define FREE_SUSPENSION_FRAME(STR) FREE_BLOCK(SuspFr_global_start(STR)); \
FREE_STRUCT(STR, struct suspension_frame, GLOBAL_pages_susp_fr, GLOBAL_pages_void)
#if !defined(THREADS_NO_SHARING)
#if defined(THREADS_SUBGOAL_SHARING) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
#define ALLOC_SUBGOAL_TRIE_NODE(STR) LOCAL_NEXT_ALLOC_STRUCT(STR, LOCAL_next_free_sg_node, struct subgoal_trie_node, GLOBAL_pages_sg_node, GLOBAL_pages_void)
#else
#define ALLOC_SUBGOAL_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct subgoal_trie_node, GLOBAL_pages_sg_node, GLOBAL_pages_void)
#endif
#define FREE_SUBGOAL_TRIE_NODE(STR) FREE_STRUCT(STR, struct subgoal_trie_node, GLOBAL_pages_sg_node, GLOBAL_pages_void)
#else
#define ALLOC_SUBGOAL_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct subgoal_trie_node, LOCAL_pages_sg_node, LOCAL_pages_void)
#define FREE_SUBGOAL_TRIE_NODE(STR) FREE_STRUCT(STR, struct subgoal_trie_node, LOCAL_pages_sg_node, LOCAL_pages_void)
#endif
#if !defined(THREADS_NO_SHARING)
#if defined(THREADS_SUBGOAL_SHARING) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
#define ALLOC_SUBGOAL_TRIE_HASH(STR) LOCAL_NEXT_ALLOC_STRUCT(STR, LOCAL_next_free_sg_hash, struct subgoal_trie_hash, GLOBAL_pages_sg_hash, GLOBAL_pages_void)
#else
#define ALLOC_SUBGOAL_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct subgoal_trie_hash, GLOBAL_pages_sg_hash, GLOBAL_pages_void)
#endif
#define FREE_SUBGOAL_TRIE_HASH(STR) FREE_STRUCT(STR, struct subgoal_trie_hash, GLOBAL_pages_sg_hash, GLOBAL_pages_void)
#else
#define ALLOC_SUBGOAL_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct subgoal_trie_hash, LOCAL_pages_sg_hash, LOCAL_pages_void)
#define FREE_SUBGOAL_TRIE_HASH(STR) FREE_STRUCT(STR, struct subgoal_trie_hash, LOCAL_pages_sg_hash, LOCAL_pages_void)
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
#if defined(YAPOR) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
#define ALLOC_ANSWER_TRIE_NODE(STR) LOCAL_NEXT_ALLOC_STRUCT(STR, LOCAL_next_free_ans_node, struct answer_trie_node, GLOBAL_pages_ans_node, GLOBAL_pages_void)
#else
#define ALLOC_ANSWER_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct answer_trie_node, GLOBAL_pages_ans_node, GLOBAL_pages_void)
#endif
#define FREE_ANSWER_TRIE_NODE(STR) FREE_STRUCT(STR, struct answer_trie_node, GLOBAL_pages_ans_node, GLOBAL_pages_void)
#else
#define ALLOC_ANSWER_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct answer_trie_node, LOCAL_pages_ans_node, LOCAL_pages_void)
#define FREE_ANSWER_TRIE_NODE(STR) FREE_STRUCT(STR, struct answer_trie_node, LOCAL_pages_ans_node, LOCAL_pages_void)
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
#define ALLOC_ANSWER_TRIE_HASH(STR) LOCAL_NEXT_ALLOC_STRUCT(STR, LOCAL_next_free_ans_hash, struct answer_trie_hash, GLOBAL_pages_ans_hash, GLOBAL_pages_void)
#else
#define ALLOC_ANSWER_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct answer_trie_hash, GLOBAL_pages_ans_hash, GLOBAL_pages_void)
#endif
#define FREE_ANSWER_TRIE_HASH(STR) FREE_STRUCT(STR, struct answer_trie_hash, GLOBAL_pages_ans_hash, GLOBAL_pages_void)
#else
#define ALLOC_ANSWER_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct answer_trie_hash, LOCAL_pages_ans_hash, LOCAL_pages_void)
#define FREE_ANSWER_TRIE_HASH(STR) FREE_STRUCT(STR, struct answer_trie_hash, LOCAL_pages_ans_hash, LOCAL_pages_void)
#endif
#define ALLOC_ANSWER_REF_NODE(STR) ALLOC_STRUCT(STR, struct answer_ref_node, LOCAL_pages_ans_ref_node, LOCAL_pages_void)
#define FREE_ANSWER_REF_NODE(STR) FREE_STRUCT(STR, struct answer_ref_node, LOCAL_pages_ans_ref_node, LOCAL_pages_void)
#define ALLOC_GLOBAL_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct global_trie_node, GLOBAL_pages_gt_node, GLOBAL_pages_void)
#define FREE_GLOBAL_TRIE_NODE(STR) FREE_STRUCT(STR, struct global_trie_node, GLOBAL_pages_gt_node, GLOBAL_pages_void)
#define ALLOC_SUBGOAL_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct subgoal_trie_node, GLOBAL_pages_sg_node, GLOBAL_pages_void)
#define FREE_SUBGOAL_TRIE_NODE(STR) FREE_STRUCT(STR, struct subgoal_trie_node, GLOBAL_pages_sg_node, GLOBAL_pages_void)
#ifdef YAPOR
#define ALLOC_ANSWER_TRIE_NODE(STR) LOCAL_NEXT_ALLOC_STRUCT(STR, LOCAL_next_free_ans_node, struct answer_trie_node, GLOBAL_pages_ans_node, GLOBAL_pages_void)
#else /* TABLING */
#define ALLOC_ANSWER_TRIE_NODE(STR) ALLOC_STRUCT(STR, struct answer_trie_node, GLOBAL_pages_ans_node, GLOBAL_pages_void)
#endif /* YAPOR - TABLING */
#define FREE_ANSWER_TRIE_NODE(STR) FREE_STRUCT(STR, struct answer_trie_node, GLOBAL_pages_ans_node, GLOBAL_pages_void)
#define FREE_GLOBAL_TRIE_NODE(STR) FREE_STRUCT(STR, struct global_trie_node, GLOBAL_pages_gt_node, GLOBAL_pages_void)
#define ALLOC_GLOBAL_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct global_trie_hash, GLOBAL_pages_gt_hash, GLOBAL_pages_void)
#define FREE_GLOBAL_TRIE_HASH(STR) FREE_STRUCT(STR, struct global_trie_hash, GLOBAL_pages_gt_hash, GLOBAL_pages_void)
#define FREE_GLOBAL_TRIE_HASH(STR) FREE_STRUCT(STR, struct global_trie_hash, GLOBAL_pages_gt_hash, GLOBAL_pages_void)
#define ALLOC_SUBGOAL_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct subgoal_trie_hash, GLOBAL_pages_sg_hash, GLOBAL_pages_void)
#define FREE_SUBGOAL_TRIE_HASH(STR) FREE_STRUCT(STR, struct subgoal_trie_hash, GLOBAL_pages_sg_hash, GLOBAL_pages_void)
#define ALLOC_OR_FRAME(STR) ALLOC_STRUCT(STR, struct or_frame, GLOBAL_pages_or_fr, GLOBAL_pages_void)
#define FREE_OR_FRAME(STR) FREE_STRUCT(STR, struct or_frame, GLOBAL_pages_or_fr, GLOBAL_pages_void)
#define ALLOC_ANSWER_TRIE_HASH(STR) ALLOC_STRUCT(STR, struct answer_trie_hash, GLOBAL_pages_ans_hash, GLOBAL_pages_void)
#define FREE_ANSWER_TRIE_HASH(STR) FREE_STRUCT(STR, struct answer_trie_hash, GLOBAL_pages_ans_hash, GLOBAL_pages_void)
#define ALLOC_QG_SOLUTION_FRAME(STR) ALLOC_STRUCT(STR, struct query_goal_solution_frame, GLOBAL_pages_qg_sol_fr, GLOBAL_pages_void)
#define FREE_QG_SOLUTION_FRAME(STR) FREE_STRUCT(STR, struct query_goal_solution_frame, GLOBAL_pages_qg_sol_fr, GLOBAL_pages_void)
#define ALLOC_QG_ANSWER_FRAME(STR) ALLOC_STRUCT(STR, struct query_goal_answer_frame, GLOBAL_pages_qg_ans_fr, GLOBAL_pages_void)
#define FREE_QG_ANSWER_FRAME(STR) FREE_STRUCT(STR, struct query_goal_answer_frame, GLOBAL_pages_qg_ans_fr, GLOBAL_pages_void)
#define ALLOC_SUSPENSION_FRAME(STR) ALLOC_STRUCT(STR, struct suspension_frame, GLOBAL_pages_susp_fr, GLOBAL_pages_void)
#define FREE_SUSPENSION_FRAME(STR) FREE_BLOCK(SuspFr_global_start(STR)); \
FREE_STRUCT(STR, struct suspension_frame, GLOBAL_pages_susp_fr, GLOBAL_pages_void)
#define ALLOC_TG_SOLUTION_FRAME(STR) ALLOC_STRUCT(STR, struct table_subgoal_solution_frame, GLOBAL_pages_tg_sol_fr, GLOBAL_pages_void)
#define FREE_TG_SOLUTION_FRAME(STR) FREE_STRUCT(STR, struct table_subgoal_solution_frame, GLOBAL_pages_tg_sol_fr, GLOBAL_pages_void)
#define ALLOC_TG_ANSWER_FRAME(STR) ALLOC_STRUCT(STR, struct table_subgoal_answer_frame, GLOBAL_pages_tg_ans_fr, GLOBAL_pages_void)
#define FREE_TG_ANSWER_FRAME(STR) FREE_STRUCT(STR, struct table_subgoal_answer_frame, GLOBAL_pages_tg_ans_fr, GLOBAL_pages_void)

View File

@ -78,8 +78,8 @@ static inline long show_statistics_table_entries(IOSTREAM *out);
static inline long show_statistics_subgoal_frames(IOSTREAM *out);
static inline long show_statistics_dependency_frames(IOSTREAM *out);
static inline long show_statistics_subgoal_trie_nodes(IOSTREAM *out);
static inline long show_statistics_answer_trie_nodes(IOSTREAM *out);
static inline long show_statistics_subgoal_trie_hashes(IOSTREAM *out);
static inline long show_statistics_answer_trie_nodes(IOSTREAM *out);
static inline long show_statistics_answer_trie_hashes(IOSTREAM *out);
static inline long show_statistics_global_trie_nodes(IOSTREAM *out);
static inline long show_statistics_global_trie_hashes(IOSTREAM *out);
@ -109,6 +109,83 @@ static int length_answer;
static qg_ans_fr_ptr actual_answer;
#endif /* YAPOR */
struct page_statistics {
#ifdef USE_PAGES_MALLOC
long pages_allocated; /* same as struct pages (opt.structs.h) */
#endif /* USE_PAGES_MALLOC */
long structs_in_use; /* same as struct pages (opt.structs.h) */
};
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
#define CHECK_PAGE_FREE_STRUCTS(STR_TYPE, STR_PAGES) \
{ pg_hd_ptr pg_hd; \
STR_TYPE *aux_ptr; \
long cont = 0; \
pg_hd = Pg_free_pg(STR_PAGES); \
while (pg_hd) { \
aux_ptr = PgHd_free_str(pg_hd); \
while (aux_ptr) { \
cont++; \
aux_ptr = aux_ptr->next; \
} \
pg_hd = PgHd_next(pg_hd); \
} \
if(Pg_str_free(STR_PAGES) != cont)printf("ERRRO!!!!!!!!\n");\
TABLING_ERROR_CHECKING(CHECK_PAGE_FREE_STRUCTS, Pg_str_free(STR_PAGES) != cont); \
}
#else
#define CHECK_PAGE_FREE_STRUCTS(STR_TYPE,STR_PAGES)
#endif /* DEBUG_TABLING */
#define INIT_PAGE_STATS(STATS) \
Pg_pg_alloc(STATS) = 0; \
Pg_str_in_use(STATS) = 0
#define INCREMENT_PAGE_STATS(STATS,PAGE) \
Pg_pg_alloc(STATS) += Pg_pg_alloc(PAGE); \
Pg_str_in_use(STATS) += Pg_str_in_use(PAGE)
#define SHOW_PAGE_STATS_MSG(STR_NAME) " " STR_NAME " %10ld bytes (%ld pages and %ld structs in use)\n"
#define SHOW_PAGE_STATS_ARGS(STATS,STR_TYPE) Pg_str_in_use(STATS) * sizeof(STR_TYPE), Pg_pg_alloc(STATS), Pg_str_in_use(STATS)
#else /* !USE_PAGES_MALLOC */
#define INIT_PAGE_STATS(STATS) \
Pg_str_in_use(STATS) = 0
#define INCREMENT_PAGE_STATS(STATS,PAGE) \
Pg_str_in_use(STATS) += Pg_str_in_use(PAGE)
#define CHECK_PAGE_FREE_STRUCTS(STR_TYPE,STR_PAGES)
#define SHOW_PAGE_STATS_MSG(STR_NAME) " " STR_NAME " %10ld bytes (%ld structs in use)\n"
#define SHOW_PAGE_STATS_ARGS(STATS,STR_TYPE) Pg_str_in_use(STATS) * sizeof(STR_TYPE), Pg_str_in_use(STATS)
#endif
#define GET_GLOBAL_PAGE_STATS(STATS,STR_PAGES) \
INIT_PAGE_STATS(STATS); \
CHECK_PAGE_FREE_STRUCTS(STR_TYPE,STR_PAGES); \
INCREMENT_PAGE_STATS(STATS,STR_PAGES)
#define GET_REMOTE_PAGE_STATS(STATS,STR_PAGES) \
INIT_PAGE_STATS(STATS); \
LOCK(GLOBAL_ThreadHandlesLock); \
{ int wid; \
for (wid = 0; wid < MAX_THREADS; wid++) { \
if (!Yap_local[wid]) \
break; \
if (REMOTE_ThreadHandle(wid).in_use) { \
CHECK_PAGE_FREE_STRUCTS(STR_TYPE,STR_PAGES); \
INCREMENT_PAGE_STATS(STATS,STR_PAGES(wid)); \
} \
} \
} \
UNLOCK(GLOBAL_ThreadHandlesLock)
#define SHOW_GLOBAL_PAGE_STATS(OUT_STREAM,STR_TYPE,STR_PAGES,STR_NAME) \
{ struct page_statistics stats; \
GET_GLOBAL_PAGE_STATS(stats,STR_PAGES); \
Sfprintf(OUT_STREAM,SHOW_PAGE_STATS_MSG(STR_NAME),SHOW_PAGE_STATS_ARGS(stats,STR_TYPE)); \
return Pg_str_in_use(stats) * sizeof(STR_TYPE); \
}
#define SHOW_REMOTE_PAGE_STATS(OUT_STREAM,STR_TYPE,STR_PAGES,STR_NAME) \
{ struct page_statistics stats; \
GET_REMOTE_PAGE_STATS(stats,STR_PAGES); \
Sfprintf(OUT_STREAM,SHOW_PAGE_STATS_MSG(STR_NAME),SHOW_PAGE_STATS_ARGS(stats,STR_TYPE)); \
return Pg_str_in_use(stats) * sizeof(STR_TYPE); \
}
/*******************************
@ -412,7 +489,7 @@ static Int p_abolish_all_tables( USES_REGS1 ) {
sg_node_ptr sg_node;
tab_ent = GLOBAL_root_tab_ent;
while(tab_ent) {
while (tab_ent) {
hash = TabEnt_hash_chain(tab_ent);
TabEnt_hash_chain(tab_ent) = NULL;
free_subgoal_hash_chain(hash);
@ -438,7 +515,7 @@ static Int p_abolish_all_tables( USES_REGS1 ) {
static Int p_abolish_all_local_tables( USES_REGS1 ) {
#ifdef THREADS
p_abolish_all_tables( PASS_REGS1 );
#else
p_abolish_all_tables();
#endif /* THREADS */
@ -792,110 +869,141 @@ static Int p_show_statistics_opt( USES_REGS1 ) {
static Int p_get_optyap_statistics( USES_REGS1 ) {
struct page_statistics stats;
Int value, bytes = 0, structs = -1;
Term tbytes, tstructs;
Int value, bytes = -1, structs = -1;
value = IntOfTerm(Deref(ARG1));
if (value == 0) { /* total_memory */
bytes = 0;
#ifdef TABLING
bytes += Pg_str_in_use(GLOBAL_pages_tab_ent) * sizeof(struct table_entry);
bytes += Pg_str_in_use(GLOBAL_pages_sg_fr) * sizeof(struct subgoal_frame);
bytes += Pg_str_in_use(GLOBAL_pages_dep_fr) * sizeof(struct dependency_frame);
bytes += Pg_str_in_use(GLOBAL_pages_sg_node) * sizeof(struct subgoal_trie_node);
bytes += Pg_str_in_use(GLOBAL_pages_ans_node) * sizeof(struct answer_trie_node);
bytes += Pg_str_in_use(GLOBAL_pages_sg_hash) * sizeof(struct subgoal_trie_hash);
bytes += Pg_str_in_use(GLOBAL_pages_ans_hash) * sizeof(struct answer_trie_hash);
bytes += Pg_str_in_use(GLOBAL_pages_gt_node) * sizeof(struct global_trie_node);
bytes += Pg_str_in_use(GLOBAL_pages_gt_hash) * sizeof(struct global_trie_hash);
if (value == 0 || value == 1) { /* table_entries */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_tab_ent);
bytes += Pg_str_in_use(stats) * sizeof(struct table_entry);
if (value != 0) structs = Pg_str_in_use(stats);
}
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
if (value == 0 || value == 16) { /* subgoal_entries */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_sg_entry);
bytes += Pg_str_in_use(stats) * sizeof(struct subgoal_entry);
if (value != 0) structs = Pg_str_in_use(stats);
}
#endif /* THREADS_FULL_SHARING || THREADS_CONSUMER_SHARING */
if (value == 0 || value == 2) { /* subgoal_frames */
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_sg_fr);
#else
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_sg_fr);
#endif
bytes += Pg_str_in_use(stats) * sizeof(struct subgoal_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 3) { /* dependency_frames */
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_dep_fr);
#else
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_dep_fr);
#endif
bytes += Pg_str_in_use(stats) * sizeof(struct dependency_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 6) { /* subgoal_trie_nodes */
#if !defined(THREADS_NO_SHARING)
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_sg_node);
#else
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_sg_node);
#endif
bytes += Pg_str_in_use(stats) * sizeof(struct subgoal_trie_node);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 8) { /* subgoal_trie_hashes */
#if !defined(THREADS_NO_SHARING)
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_sg_hash);
#else
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_sg_hash);
#endif
bytes += Pg_str_in_use(stats) * sizeof(struct subgoal_trie_hash);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 7) { /* answer_trie_nodes */
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_ans_node);
#else
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_ans_node);
#endif
bytes += Pg_str_in_use(stats) * sizeof(struct answer_trie_node);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 9) { /* answer_trie_hashes */
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_ans_hash);
#else
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_ans_hash);
#endif
bytes += Pg_str_in_use(stats) * sizeof(struct answer_trie_hash);
if (value != 0) structs = Pg_str_in_use(stats);
}
#if defined(THREADS_FULL_SHARING)
if (value == 0 || value == 17) { /* answer_ref_nodes */
GET_REMOTE_PAGE_STATS(stats, REMOTE_pages_ans_ref_node);
bytes += Pg_str_in_use(stats) * sizeof(struct answer_ref_node);
if (value != 0) structs = Pg_str_in_use(stats);
}
#endif /* THREADS_FULL_SHARING */
if (value == 0 || value == 10) { /* global_trie_nodes */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_gt_node);
bytes += Pg_str_in_use(stats) * sizeof(struct global_trie_node);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 11) { /* global_trie_hashes */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_gt_hash);
bytes += Pg_str_in_use(stats) * sizeof(struct global_trie_hash);
if (value != 0) structs = Pg_str_in_use(stats);
}
#endif /* TABLING */
#ifdef YAPOR
bytes += Pg_str_in_use(GLOBAL_pages_or_fr ) * sizeof(struct or_frame);
bytes += Pg_str_in_use(GLOBAL_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame);
bytes += Pg_str_in_use(GLOBAL_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
if (value == 0 || value == 4) { /* or_frames */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_or_fr);
bytes += Pg_str_in_use(stats) * sizeof(struct or_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 12) { /* query_goal_solution_frames */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_qg_sol_fr);
bytes += Pg_str_in_use(stats) * sizeof(struct query_goal_solution_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 13) { /* query_goal_answer_frames */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_qg_ans_fr);
bytes += Pg_str_in_use(stats) * sizeof(struct query_goal_answer_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
#endif /* YAPOR */
#if defined(YAPOR) && defined(TABLING)
bytes += Pg_str_in_use(GLOBAL_pages_susp_fr) * sizeof(struct suspension_frame);
if (value == 0 || value == 5) { /* suspension_frames */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_susp_fr);
bytes += Pg_str_in_use(stats) * sizeof(struct suspension_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
#ifdef TABLING_INNER_CUTS
bytes += Pg_str_in_use(GLOBAL_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
bytes += Pg_str_in_use(GLOBAL_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
if (value == 0 || value == 14) { /* table_subgoal_solution_frames */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_tg_sol_fr);
bytes += Pg_str_in_use(stats) * sizeof(struct table_subgoal_solution_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
if (value == 0 || value == 15) { /* table_subgoal_answer_frames */
GET_GLOBAL_PAGE_STATS(stats, GLOBAL_pages_tg_ans_fr);
bytes += Pg_str_in_use(stats) * sizeof(struct table_subgoal_answer_frame);
if (value != 0) structs = Pg_str_in_use(stats);
}
#endif /* TABLING_INNER_CUTS */
#endif /* YAPOR && TABLING */
if (value == 0) { /* total_memory */
#ifdef USE_PAGES_MALLOC
structs = Pg_pg_alloc(GLOBAL_pages_void) * Yap_page_size;
#else
structs = bytes;
#endif /* USE_PAGES_MALLOC */
}
#ifdef TABLING
if (value == 1) { /* table_entries */
bytes = Pg_str_in_use(GLOBAL_pages_tab_ent) * sizeof(struct table_entry);
structs = Pg_str_in_use(GLOBAL_pages_tab_ent);
}
if (value == 2) { /* subgoal_frames */
bytes = Pg_str_in_use(GLOBAL_pages_sg_fr) * sizeof(struct subgoal_frame);
structs = Pg_str_in_use(GLOBAL_pages_sg_fr);
}
if (value == 3) { /* dependency_frames */
bytes = Pg_str_in_use(GLOBAL_pages_dep_fr) * sizeof(struct dependency_frame);
structs = Pg_str_in_use(GLOBAL_pages_dep_fr);
}
if (value == 6) { /* subgoal_trie_nodes */
bytes = Pg_str_in_use(GLOBAL_pages_sg_node) * sizeof(struct subgoal_trie_node);
structs = Pg_str_in_use(GLOBAL_pages_sg_node);
}
if (value == 7) { /* answer_trie_nodes */
bytes = Pg_str_in_use(GLOBAL_pages_ans_node) * sizeof(struct answer_trie_node);
structs = Pg_str_in_use(GLOBAL_pages_ans_node);
}
if (value == 8) { /* subgoal_trie_hashes */
bytes = Pg_str_in_use(GLOBAL_pages_sg_hash) * sizeof(struct subgoal_trie_hash);
structs = Pg_str_in_use(GLOBAL_pages_sg_hash);
}
if (value == 9) { /* answer_trie_hashes */
bytes = Pg_str_in_use(GLOBAL_pages_ans_hash) * sizeof(struct answer_trie_hash);
structs = Pg_str_in_use(GLOBAL_pages_ans_hash);
}
if (value == 10) { /* global_trie_nodes */
bytes = Pg_str_in_use(GLOBAL_pages_gt_node) * sizeof(struct global_trie_node);
structs = Pg_str_in_use(GLOBAL_pages_gt_node);
}
if (value == 11) { /* global_trie_hashes */
bytes = Pg_str_in_use(GLOBAL_pages_gt_hash) * sizeof(struct global_trie_hash);
structs = Pg_str_in_use(GLOBAL_pages_gt_hash);
}
#endif /* TABLING */
#ifdef YAPOR
if (value == 4) { /* or_frames */
bytes = Pg_str_in_use(GLOBAL_pages_or_fr ) * sizeof(struct or_frame);
structs = Pg_str_in_use(GLOBAL_pages_or_fr );
}
if (value == 12) { /* query_goal_solution_frames */
bytes = Pg_str_in_use(GLOBAL_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame);
structs = Pg_str_in_use(GLOBAL_pages_qg_sol_fr );
}
if (value == 13) { /* query_goal_answer_frames */
bytes = Pg_str_in_use(GLOBAL_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
structs = Pg_str_in_use(GLOBAL_pages_qg_ans_fr);
}
#endif /* YAPOR */
#if defined(YAPOR) && defined(TABLING)
if (value == 5) { /* suspension_frames */
bytes = Pg_str_in_use(GLOBAL_pages_susp_fr) * sizeof(struct suspension_frame);
structs = Pg_str_in_use(GLOBAL_pages_susp_fr);
}
#ifdef TABLING_INNER_CUTS
if (value == 14) { /* table_subgoal_solution_frames */
bytes = Pg_str_in_use(GLOBAL_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
structs = Pg_str_in_use(GLOBAL_pages_tg_sol_fr);
}
if (value == 15) { /* table_subgoal_answer_frames */
bytes = Pg_str_in_use(GLOBAL_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
structs = Pg_str_in_use(GLOBAL_pages_tg_ans_fr);
}
#endif /* TABLING_INNER_CUTS */
#endif /* YAPOR && TABLING */
if (bytes == -1)
if (structs == -1)
return (FALSE);
tbytes = Deref(ARG2);
tstructs = Deref(ARG3);
@ -1013,429 +1121,94 @@ static inline void answer_to_stdout(char *answer) {
#ifdef TABLING
static inline long show_statistics_table_entries(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
tab_ent_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_tab_ent);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = TabEnt_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_table_entries, Pg_str_free(GLOBAL_pages_tab_ent) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Table entries: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_tab_ent) * sizeof(struct table_entry), Pg_pg_alloc(GLOBAL_pages_tab_ent), Pg_str_in_use(GLOBAL_pages_tab_ent));
#else
Sfprintf(out, " Table entries: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_tab_ent) * sizeof(struct table_entry), Pg_str_in_use(GLOBAL_pages_tab_ent));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_tab_ent) * sizeof(struct table_entry);
SHOW_GLOBAL_PAGE_STATS(out, struct table_entry, GLOBAL_pages_tab_ent, "Table entries: ");
}
static inline long show_statistics_subgoal_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
sg_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_sg_fr);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = SgFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_subgoal_frames, Pg_str_free(GLOBAL_pages_sg_fr) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Subgoal frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_sg_fr) * sizeof(struct subgoal_frame), Pg_pg_alloc(GLOBAL_pages_sg_fr), Pg_str_in_use(GLOBAL_pages_sg_fr));
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
SHOW_GLOBAL_PAGE_STATS(out, struct subgoal_frame, GLOBAL_pages_sg_fr, "Subgoal frames: ");
#else
Sfprintf(out, " Subgoal frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_sg_fr) * sizeof(struct subgoal_frame), Pg_str_in_use(GLOBAL_pages_sg_fr));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_sg_fr) * sizeof(struct subgoal_frame);
SHOW_REMOTE_PAGE_STATS(out, struct subgoal_frame, REMOTE_pages_sg_fr, "Subgoal frames: ");
#endif
}
static inline long show_statistics_dependency_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
dep_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_dep_fr);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = DepFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_dependency_frames, Pg_str_free(GLOBAL_pages_dep_fr) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Dependency frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_dep_fr) * sizeof(struct dependency_frame), Pg_pg_alloc(GLOBAL_pages_dep_fr), Pg_str_in_use(GLOBAL_pages_dep_fr));
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
SHOW_GLOBAL_PAGE_STATS(out, struct dependency_frame, GLOBAL_pages_dep_fr, "Dependency frames: ");
#else
Sfprintf(out, " Dependency frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_dep_fr) * sizeof(struct dependency_frame), Pg_str_in_use(GLOBAL_pages_dep_fr));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_dep_fr) * sizeof(struct dependency_frame);
SHOW_REMOTE_PAGE_STATS(out, struct dependency_frame, REMOTE_pages_dep_fr, "Dependency frames: ");
#endif
}
static inline long show_statistics_subgoal_trie_nodes(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
sg_node_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_sg_node);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = TrNode_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_subgoal_trie_nodes, Pg_str_free(GLOBAL_pages_sg_node) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Subgoal trie nodes: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_sg_node) * sizeof(struct subgoal_trie_node), Pg_pg_alloc(GLOBAL_pages_sg_node), Pg_str_in_use(GLOBAL_pages_sg_node));
#if !defined(THREADS_NO_SHARING)
SHOW_GLOBAL_PAGE_STATS(out, struct subgoal_trie_node, GLOBAL_pages_sg_node, "Subgoal trie nodes: ");
#else
Sfprintf(out, " Subgoal trie nodes: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_sg_node) * sizeof(struct subgoal_trie_node), Pg_str_in_use(GLOBAL_pages_sg_node));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_sg_node) * sizeof(struct subgoal_trie_node);
SHOW_REMOTE_PAGE_STATS(out, struct subgoal_trie_node, REMOTE_pages_sg_node, "Subgoal trie nodes: ");
#endif
}
static inline long show_statistics_answer_trie_nodes(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
ans_node_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_ans_node);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = TrNode_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_answer_trie_nodes, Pg_str_free(GLOBAL_pages_ans_node) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Answer trie nodes: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_ans_node) * sizeof(struct answer_trie_node), Pg_pg_alloc(GLOBAL_pages_ans_node), Pg_str_in_use(GLOBAL_pages_ans_node));
#else
Sfprintf(out, " Answer trie nodes: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_ans_node) * sizeof(struct answer_trie_node), Pg_str_in_use(GLOBAL_pages_ans_node));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_ans_node) * sizeof(struct answer_trie_node);
}
static inline long show_statistics_subgoal_trie_hashes(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
sg_hash_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_sg_hash);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = Hash_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_subgoal_trie_hashes, Pg_str_free(GLOBAL_pages_sg_hash) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Subgoal trie hashes: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_sg_hash) * sizeof(struct subgoal_trie_hash), Pg_pg_alloc(GLOBAL_pages_sg_hash), Pg_str_in_use(GLOBAL_pages_sg_hash));
#if !defined(THREADS_NO_SHARING)
SHOW_GLOBAL_PAGE_STATS(out, struct subgoal_trie_hash, GLOBAL_pages_sg_hash, "Subgoal trie hashes: ");
#else
Sfprintf(out, " Subgoal trie hashes: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_sg_hash) * sizeof(struct subgoal_trie_hash), Pg_str_in_use(GLOBAL_pages_sg_hash));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_sg_hash) * sizeof(struct subgoal_trie_hash);
SHOW_REMOTE_PAGE_STATS(out, struct subgoal_trie_hash, REMOTE_pages_sg_hash, "Subgoal trie hashes: ");
#endif
}
static inline long show_statistics_answer_trie_nodes(IOSTREAM *out) {
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
SHOW_GLOBAL_PAGE_STATS(out, struct answer_trie_node, GLOBAL_pages_ans_node, "Answer trie nodes: ");
#else
SHOW_REMOTE_PAGE_STATS(out, struct answer_trie_node, REMOTE_pages_ans_node, "Answer trie nodes: ");
#endif
}
static inline long show_statistics_answer_trie_hashes(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
ans_hash_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_ans_hash);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = Hash_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_answer_trie_hashes, Pg_str_free(GLOBAL_pages_ans_hash) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Answer trie hashes: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_ans_hash) * sizeof(struct answer_trie_hash), Pg_pg_alloc(GLOBAL_pages_ans_hash), Pg_str_in_use(GLOBAL_pages_ans_hash));
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
SHOW_GLOBAL_PAGE_STATS(out, struct answer_trie_hash, GLOBAL_pages_ans_hash, "Answer trie hashes: ");
#else
Sfprintf(out, " Answer trie hashes: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_ans_hash) * sizeof(struct answer_trie_hash), Pg_str_in_use(GLOBAL_pages_ans_hash));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_ans_hash) * sizeof(struct answer_trie_hash);
SHOW_REMOTE_PAGE_STATS(out, struct answer_trie_hash, REMOTE_pages_ans_hash, "Answer trie hashes: ");
#endif
}
static inline long show_statistics_global_trie_nodes(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
pg_hd_ptr pg_hd;
gt_node_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_gt_node);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = TrNode_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_global_trie_nodes, Pg_str_free(GLOBAL_pages_gt_node) != cont);
#endif /* DEBUG_TABLING */
Sfprintf(out, " Global trie nodes: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_gt_node) * sizeof(struct global_trie_node), Pg_pg_alloc(GLOBAL_pages_gt_node), Pg_str_in_use(GLOBAL_pages_gt_node));
#else
Sfprintf(out, " Global trie nodes: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_gt_node) * sizeof(struct global_trie_node), Pg_str_in_use(GLOBAL_pages_gt_node));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_gt_node) * sizeof(struct global_trie_node);
SHOW_GLOBAL_PAGE_STATS(out, struct global_trie_node, GLOBAL_pages_gt_node, "Global trie nodes: ");
}
static inline long show_statistics_global_trie_hashes(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_TABLING
/* suport not yet implemented :(
pg_hd_ptr pg_hd;
gt_hash_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_gt_hash);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = Hash_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
TABLING_ERROR_CHECKING(statistics_global_trie_hashes, Pg_str_free(GLOBAL_pages_gt_hash) != cont);
*/
#endif /* DEBUG_TABLING */
Sfprintf(out, " Global trie hashes: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_gt_hash) * sizeof(struct global_trie_hash), Pg_pg_alloc(GLOBAL_pages_gt_hash), Pg_str_in_use(GLOBAL_pages_gt_hash));
#else
Sfprintf(out, " Global trie hashes: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_gt_hash) * sizeof(struct global_trie_hash), Pg_str_in_use(GLOBAL_pages_gt_hash));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_gt_hash) * sizeof(struct global_trie_hash);
SHOW_GLOBAL_PAGE_STATS(out, struct global_trie_hash, GLOBAL_pages_gt_hash, "Global trie hashes: ");
}
#endif /* TABLING */
#ifdef YAPOR
static inline long show_statistics_or_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_YAPOR
pg_hd_ptr pg_hd;
or_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_or_fr );
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = OrFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
YAPOR_ERROR_CHECKING(statistics_or_frames, Pg_str_free(GLOBAL_pages_or_fr ) != cont);
#endif /* DEBUG_YAPOR */
Sfprintf(out, " Or-frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_or_fr ) * sizeof(struct or_frame), Pg_pg_alloc(GLOBAL_pages_or_fr ), Pg_str_in_use(GLOBAL_pages_or_fr ));
#else
Sfprintf(out, " Or-frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_or_fr ) * sizeof(struct or_frame), Pg_str_in_use(GLOBAL_pages_or_fr ));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_or_fr ) * sizeof(struct or_frame);
SHOW_GLOBAL_PAGE_STATS(out, struct or_frame, GLOBAL_pages_or_fr, "Or-frames: ");
}
static inline long show_statistics_query_goal_solution_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_YAPOR
pg_hd_ptr pg_hd;
qg_sol_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_qg_sol_fr );
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = SolFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
YAPOR_ERROR_CHECKING(statistics_query_goal_solution_frames, Pg_str_free(GLOBAL_pages_qg_sol_fr ) != cont);
#endif /* DEBUG_YAPOR */
Sfprintf(out, " Query goal solution frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame), Pg_pg_alloc(GLOBAL_pages_qg_sol_fr ), Pg_str_in_use(GLOBAL_pages_qg_sol_fr ));
#else
Sfprintf(out, " Query goal solution frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame), Pg_str_in_use(GLOBAL_pages_qg_sol_fr ));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_qg_sol_fr ) * sizeof(struct query_goal_solution_frame);
SHOW_GLOBAL_PAGE_STATS(out, struct query_goal_solution_frame, GLOBAL_pages_qg_sol_fr, "Query goal solution frames: ");
}
static inline long show_statistics_query_goal_answer_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_YAPOR
pg_hd_ptr pg_hd;
qg_ans_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_qg_ans_fr);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = AnsFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
YAPOR_ERROR_CHECKING(statistics_query_goal_answer_frames, Pg_str_free(GLOBAL_pages_qg_ans_fr) != cont);
#endif /* DEBUG_YAPOR */
Sfprintf(out, " Query goal answer frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame), Pg_pg_alloc(GLOBAL_pages_qg_ans_fr), Pg_str_in_use(GLOBAL_pages_qg_ans_fr));
#else
Sfprintf(out, " Query goal answer frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame), Pg_str_in_use(GLOBAL_pages_qg_ans_fr));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_qg_ans_fr) * sizeof(struct query_goal_answer_frame);
SHOW_GLOBAL_PAGE_STATS(out, struct query_goal_answer_frame, GLOBAL_pages_qg_ans_fr, "Query goal answer frames: ");
}
#endif /* YAPOR */
#if defined(YAPOR) && defined(TABLING)
static inline long show_statistics_suspension_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_OPTYAP
pg_hd_ptr pg_hd;
susp_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_susp_fr);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = SuspFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
OPTYAP_ERROR_CHECKING(statistics_suspension_frames, Pg_str_free(GLOBAL_pages_susp_fr) != cont);
#endif /* DEBUG_OPTYAP */
Sfprintf(out, " Suspension frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_susp_fr) * sizeof(struct suspension_frame), Pg_pg_alloc(GLOBAL_pages_susp_fr), Pg_str_in_use(GLOBAL_pages_susp_fr));
#else
Sfprintf(out, " Suspension frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_susp_fr) * sizeof(struct suspension_frame), Pg_str_in_use(GLOBAL_pages_susp_fr));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_susp_fr) * sizeof(struct suspension_frame);
SHOW_GLOBAL_PAGE_STATS(out, struct suspension_frame, GLOBAL_pages_susp_fr, "Suspension frames: ");
}
#ifdef TABLING_INNER_CUTS
static inline long show_statistics_table_subgoal_solution_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_OPTYAP
pg_hd_ptr pg_hd;
tg_sol_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_tg_sol_fr);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = SolFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
OPTYAP_ERROR_CHECKING(statistics_table_subgoal_solution_frames, Pg_str_free(GLOBAL_pages_tg_sol_fr) != cont);
#endif /* DEBUG_OPTYAP */
Sfprintf(out, " Table subgoal solution frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame), Pg_pg_alloc(GLOBAL_pages_tg_sol_fr), Pg_str_in_use(GLOBAL_pages_tg_sol_fr));
#else
Sfprintf(out, " Table subgoal solution frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame), Pg_str_in_use(GLOBAL_pages_tg_sol_fr));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_tg_sol_fr) * sizeof(struct table_subgoal_solution_frame);
SHOW_GLOBAL_PAGE_STATS(out, struct table_subgoal_solution_frame, GLOBAL_pages_tg_sol_fr, "Table subgoal solution frames:");
}
static inline long show_statistics_table_subgoal_answer_frames(IOSTREAM *out) {
#ifdef USE_PAGES_MALLOC
#ifdef DEBUG_OPTYAP
pg_hd_ptr pg_hd;
tg_ans_fr_ptr aux_ptr;
long cont = 0;
pg_hd = Pg_free_pg(GLOBAL_pages_tg_ans_fr);
while (pg_hd) {
aux_ptr = PgHd_free_str(pg_hd);
while (aux_ptr) {
cont++;
aux_ptr = AnsFr_next(aux_ptr);
}
pg_hd = PgHd_next(pg_hd);
}
OPTYAP_ERROR_CHECKING(statistics_table_subgoal_answer_frames, Pg_str_free(GLOBAL_pages_tg_ans_fr) != cont);
#endif /* DEBUG_OPTYAP */
Sfprintf(out, " Table subgoal answer frames: %10ld bytes (%ld pages and %ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame), Pg_pg_alloc(GLOBAL_pages_tg_ans_fr), Pg_str_in_use(GLOBAL_pages_tg_ans_fr));
#else
Sfprintf(out, " Table subgoal answer frames: %10ld bytes (%ld structs in use)\n",
Pg_str_in_use(GLOBAL_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame), Pg_str_in_use(GLOBAL_pages_tg_ans_fr));
#endif /* USE_PAGES_MALLOC */
return Pg_str_in_use(GLOBAL_pages_tg_ans_fr) * sizeof(struct table_subgoal_answer_frame);
SHOW_GLOBAL_PAGE_STATS(out, struct table_subgoal_answer_frame, GLOBAL_pages_tg_ans_fr, "Table subgoal answer frames: ");
}
#endif /* TABLING_INNER_CUTS */
#endif /* YAPOR && TABLING */

View File

@ -53,6 +53,50 @@ cptr_to_offset_with_null(choiceptr node)
/**********************************************************
** Structs ma_h_inner_struct and ma_hash_entry **
**********************************************************/
#if (defined(TABLING) || !defined(YAPOR_COW)) && defined(MULTI_ASSIGNMENT_VARIABLES)
#define MAVARS_HASH_SIZE 512
typedef struct ma_h_entry {
CELL* addr;
struct ma_h_entry *next;
} ma_h_inner_struct;
typedef struct {
UInt timestmp;
struct ma_h_entry val;
} ma_hash_entry;
#endif /* (TABLING || !YAPOR_COW) && MULTI_ASSIGNMENT_VARIABLES */
/***************************************
** threads_dependency_frame **
***************************************/
#ifdef THREADS_CONSUMER_SHARING
struct threads_dependency_frame {
lockvar lock;
enum {
working,
idle,
completing
} state;
int terminator;
int next;
};
#endif /* THREADS_CONSUMER_SHARING */
#define ThDepFr_lock(X) ((X).lock)
#define ThDepFr_state(X) ((X).state)
#define ThDepFr_terminator(X) ((X).terminator)
#define ThDepFr_next(X) ((X).next)
/*********************************
** Struct page_header **
*********************************/
@ -64,12 +108,12 @@ typedef struct page_header {
struct page_header *previous;
struct page_header *next;
} *pg_hd_ptr;
#endif /* USE_PAGES_MALLOC */
#define PgHd_str_in_use(X) ((X)->structs_in_use)
#define PgHd_free_str(X) ((X)->first_free_struct)
#define PgHd_previous(X) ((X)->previous)
#define PgHd_next(X) ((X)->next)
#endif /* USE_PAGES_MALLOC */
@ -78,10 +122,10 @@ typedef struct page_header {
***************************/
struct pages {
#ifdef USE_PAGES_MALLOC
#ifdef YAPOR
#if defined(YAPOR) || defined(THREADS)
lockvar lock;
#endif /* YAPOR */
#endif /* YAPOR || THREADS */
#ifdef USE_PAGES_MALLOC
int structs_per_page;
struct page_header *first_free_page;
volatile long pages_allocated;
@ -103,34 +147,75 @@ struct pages {
**********************************/
struct global_pages {
#ifdef LIMIT_TABLING
int max_pages;
#endif /* LIMIT_TABLING */
struct pages void_pages;
#ifdef TABLING
struct pages table_entry_pages;
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
struct pages subgoal_entry_pages;
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING) && !defined(THREADS_FULL_SHARING) && !defined(THREADS_CONSUMER_SHARING)
struct pages subgoal_frame_pages;
struct pages dependency_frame_pages;
#endif
#if !defined(THREADS_NO_SHARING)
struct pages subgoal_trie_node_pages;
struct pages subgoal_trie_hash_pages;
#endif
#if !defined(THREADS_NO_SHARING) && !defined(THREADS_SUBGOAL_SHARING)
struct pages answer_trie_node_pages;
struct pages answer_trie_hash_pages;
#endif
struct pages global_trie_node_pages;
struct pages global_trie_hash_pages;
#endif /* TABLING */
#ifdef YAPOR
struct pages or_frame_pages;
struct pages query_goal_solution_frame_pages;
struct pages query_goal_answer_frame_pages;
#endif /* YAPOR */
#if defined(YAPOR) && defined(TABLING)
struct pages suspension_frame_pages;
#endif /* YAPOR && TABLING */
#ifdef TABLING_INNER_CUTS
struct pages table_subgoal_solution_frame_pages;
struct pages table_subgoal_answer_frame_pages;
#endif /* TABLING_INNER_CUTS */
#ifdef TABLING
struct pages table_entry_pages;
};
/*********************************
** Struct local_pages **
*********************************/
#if defined(TABLING) && (defined(YAPOR) || defined(THREADS))
struct local_pages {
#if defined(YAPOR)
struct answer_trie_node *next_free_answer_trie_node;
#elif defined(THREADS)
struct pages void_pages;
struct pages subgoal_frame_pages;
struct pages dependency_frame_pages;
#if defined(THREADS_NO_SHARING)
struct pages subgoal_trie_node_pages;
struct pages answer_trie_node_pages;
struct pages global_trie_node_pages;
struct pages subgoal_trie_hash_pages;
#elif defined(THREADS_SUBGOAL_SHARING) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
struct subgoal_trie_node *next_free_subgoal_trie_node;
struct subgoal_trie_hash *next_free_subgoal_trie_hash;
#endif
#if defined(THREADS_NO_SHARING) || defined(THREADS_SUBGOAL_SHARING)
struct pages answer_trie_node_pages;
struct pages answer_trie_hash_pages;
struct pages global_trie_hash_pages;
#endif /* TABLING */
#if defined(YAPOR) && defined(TABLING)
struct pages suspension_frame_pages;
#endif /* YAPOR && TABLING */
#elif defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
struct answer_trie_node *next_free_answer_trie_node;
struct answer_trie_hash *next_free_answer_trie_hash;
#endif
#if defined(THREADS_FULL_SHARING)
struct pages answer_ref_node_pages;
#endif
#endif /* YAPOR - THREADS */
};
#endif /* TABLING && (YAPOR || THREADS) */
@ -158,6 +243,34 @@ struct global_optyap_locks {
/******************************************
** Struct local_optyap_signals **
******************************************/
#ifdef YAPOR
struct local_optyap_signals {
#if defined(YAPOR_COPY) || defined(YAPOR_THREADS)
lockvar lock;
volatile enum {
Q_idle = 0,
trail = 1,
global = 2,
local = 3,
P_idle = 4
} P_fase, Q_fase;
#endif /* YAPOR_COPY || YAPOR_THREADS */
volatile enum {
no_sharing = 0,
sharing = 1,
nodes_shared = 2,
copy_done = 3,
worker_ready = 4
} reply_signal;
};
#endif /* YAPOR */
/*********************************
* Struct global_optyap_data **
*********************************/
@ -205,6 +318,7 @@ struct global_optyap_data {
struct global_trie_node *root_global_trie;
struct table_entry *root_table_entry;
#ifdef LIMIT_TABLING
int max_pages;
struct subgoal_frame *first_subgoal_frame;
struct subgoal_frame *last_subgoal_frame;
struct subgoal_frame *check_subgoal_frame;
@ -212,6 +326,9 @@ struct global_optyap_data {
#ifdef YAPOR
struct dependency_frame *root_dependency_frame;
#endif /* YAPOR */
#ifdef THREADS_CONSUMER_SHARING
struct threads_dependency_frame threads_dependency_frame[MAX_THREADS];
#endif /*THREADS_CONSUMER_SHARING*/
CELL table_var_enumerator[MAX_TABLE_VARS];
#ifdef TRIE_LOCK_USING_GLOBAL_ARRAY
lockvar trie_locks[TRIE_LOCK_BUCKETS];
@ -222,23 +339,23 @@ struct global_optyap_data {
#endif /* TABLING */
};
#define GLOBAL_max_pages (GLOBAL_optyap_data.pages.max_pages)
#define GLOBAL_pages_void (GLOBAL_optyap_data.pages.void_pages)
#define GLOBAL_pages_or_fr (GLOBAL_optyap_data.pages.or_frame_pages)
#define GLOBAL_pages_qg_sol_fr (GLOBAL_optyap_data.pages.query_goal_solution_frame_pages)
#define GLOBAL_pages_qg_ans_fr (GLOBAL_optyap_data.pages.query_goal_answer_frame_pages)
#define GLOBAL_pages_tg_sol_fr (GLOBAL_optyap_data.pages.table_subgoal_solution_frame_pages)
#define GLOBAL_pages_tg_ans_fr (GLOBAL_optyap_data.pages.table_subgoal_answer_frame_pages)
#define GLOBAL_pages_tab_ent (GLOBAL_optyap_data.pages.table_entry_pages)
#define GLOBAL_pages_sg_ent (GLOBAL_optyap_data.pages.subgoal_entry_pages)
#define GLOBAL_pages_sg_fr (GLOBAL_optyap_data.pages.subgoal_frame_pages)
#define GLOBAL_pages_dep_fr (GLOBAL_optyap_data.pages.dependency_frame_pages)
#define GLOBAL_pages_sg_node (GLOBAL_optyap_data.pages.subgoal_trie_node_pages)
#define GLOBAL_pages_ans_node (GLOBAL_optyap_data.pages.answer_trie_node_pages)
#define GLOBAL_pages_gt_node (GLOBAL_optyap_data.pages.global_trie_node_pages)
#define GLOBAL_pages_sg_hash (GLOBAL_optyap_data.pages.subgoal_trie_hash_pages)
#define GLOBAL_pages_ans_node (GLOBAL_optyap_data.pages.answer_trie_node_pages)
#define GLOBAL_pages_ans_hash (GLOBAL_optyap_data.pages.answer_trie_hash_pages)
#define GLOBAL_pages_gt_node (GLOBAL_optyap_data.pages.global_trie_node_pages)
#define GLOBAL_pages_gt_hash (GLOBAL_optyap_data.pages.global_trie_hash_pages)
#define GLOBAL_pages_or_fr (GLOBAL_optyap_data.pages.or_frame_pages)
#define GLOBAL_pages_qg_sol_fr (GLOBAL_optyap_data.pages.query_goal_solution_frame_pages)
#define GLOBAL_pages_qg_ans_fr (GLOBAL_optyap_data.pages.query_goal_answer_frame_pages)
#define GLOBAL_pages_susp_fr (GLOBAL_optyap_data.pages.suspension_frame_pages)
#define GLOBAL_pages_tg_sol_fr (GLOBAL_optyap_data.pages.table_subgoal_solution_frame_pages)
#define GLOBAL_pages_tg_ans_fr (GLOBAL_optyap_data.pages.table_subgoal_answer_frame_pages)
#define GLOBAL_scheduler_loop (GLOBAL_optyap_data.scheduler_loop)
#define GLOBAL_delayed_release_load (GLOBAL_optyap_data.delayed_release_load)
#define GLOBAL_number_workers (GLOBAL_optyap_data.number_workers)
@ -246,7 +363,7 @@ struct global_optyap_data {
#define GLOBAL_master_worker (GLOBAL_optyap_data.master_worker)
#define GLOBAL_execution_time (GLOBAL_optyap_data.execution_time)
#ifdef YAPOR_THREADS
#define Get_GLOBAL_root_cp() offset_to_cptr(GLOBAL_optyap_data.root_choice_point_offset)
#define Get_GLOBAL_root_cp() offset_to_cptr(GLOBAL_optyap_data.root_choice_point_offset)
#define Set_GLOBAL_root_cp(bptr) (GLOBAL_optyap_data.root_choice_point_offset = cptr_to_offset(bptr))
#else
#define GLOBAL_root_cp (GLOBAL_optyap_data.root_choice_point)
@ -276,10 +393,12 @@ struct global_optyap_data {
#define GLOBAL_parallel_mode (GLOBAL_optyap_data.parallel_mode)
#define GLOBAL_root_gt (GLOBAL_optyap_data.root_global_trie)
#define GLOBAL_root_tab_ent (GLOBAL_optyap_data.root_table_entry)
#define GLOBAL_max_pages (GLOBAL_optyap_data.max_pages)
#define GLOBAL_first_sg_fr (GLOBAL_optyap_data.first_subgoal_frame)
#define GLOBAL_last_sg_fr (GLOBAL_optyap_data.last_subgoal_frame)
#define GLOBAL_check_sg_fr (GLOBAL_optyap_data.check_subgoal_frame)
#define GLOBAL_root_dep_fr (GLOBAL_optyap_data.root_dependency_frame)
#define GLOBAL_th_dep_fr(wid) (GLOBAL_optyap_data.threads_dependency_frame[wid])
#define GLOBAL_table_var_enumerator(index) (GLOBAL_optyap_data.table_var_enumerator[index])
#define GLOBAL_table_var_enumerator_addr(index) (GLOBAL_optyap_data.table_var_enumerator + (index))
#define GLOBAL_trie_locks(index) (GLOBAL_optyap_data.trie_locks[index])
@ -287,59 +406,16 @@ struct global_optyap_data {
/******************************************
** Struct local_optyap_signals **
******************************************/
#ifdef YAPOR
struct local_optyap_signals{
#if defined(YAPOR_COPY) || defined(YAPOR_THREADS)
lockvar lock;
volatile enum {
Q_idle = 0,
trail = 1,
global = 2,
local = 3,
P_idle = 4
} P_fase, Q_fase;
#endif /* YAPOR_COPY || YAPOR_THREADS */
volatile enum {
no_sharing = 0,
sharing = 1,
nodes_shared = 2,
copy_done = 3,
worker_ready = 4
} reply_signal;
};
#endif /* YAPOR */
/**********************************************************
** Structs ma_h_inner_struct and ma_hash_entry **
**********************************************************/
#if (defined(TABLING) || !defined(YAPOR_COW)) && defined(MULTI_ASSIGNMENT_VARIABLES)
#define MAVARS_HASH_SIZE 512
typedef struct ma_h_entry {
CELL* addr;
struct ma_h_entry *next;
} ma_h_inner_struct;
typedef struct {
UInt timestmp;
struct ma_h_entry val;
} ma_hash_entry;
#endif /* (TABLING || !YAPOR_COW) && MULTI_ASSIGNMENT_VARIABLES */
/***************************************
** Struct local_optyap_data **
***************************************/
struct local_optyap_data {
#if defined(TABLING) && (defined(YAPOR) || defined(THREADS))
/* local data related to memory management */
struct local_pages pages;
#endif /* TABLING && (YAPOR || THREADS) */
#ifdef YAPOR
lockvar lock;
/* local data related to or-parallelism */
@ -348,13 +424,13 @@ struct local_optyap_data {
Int top_choice_point_offset;
#else
choiceptr top_choice_point;
#endif
#endif /* YAPOR_THREADS */
struct or_frame *top_or_frame;
#ifdef YAPOR_THREADS
Int prune_request_offset;
#else
choiceptr prune_request;
#endif
#endif /* YAPOR_THREADS */
volatile int share_request;
struct local_optyap_signals share_signals;
volatile struct {
@ -365,7 +441,6 @@ struct local_optyap_data {
#ifdef TABLING
/* local data related to tabling */
struct answer_trie_node *next_free_answer_trie_node;
struct subgoal_frame *top_subgoal_frame;
struct dependency_frame *top_dependency_frame;
#ifdef TABLING_INNER_CUTS
@ -376,7 +451,7 @@ struct local_optyap_data {
Int top_choice_point_on_stack_offset;
#else
choiceptr top_choice_point_on_stack;
#endif
#endif /* YAPOR_THREADS */
struct or_frame *top_or_frame_with_suspensions;
#endif /* YAPOR */
#endif /* TABLING */
@ -388,6 +463,18 @@ struct local_optyap_data {
#endif /* (TABLING || !YAPOR_COW) && MULTI_ASSIGNMENT_VARIABLES */
};
#define LOCAL_pages_void (LOCAL_optyap_data.pages.void_pages)
#define LOCAL_pages_sg_fr (LOCAL_optyap_data.pages.subgoal_frame_pages)
#define LOCAL_pages_dep_fr (LOCAL_optyap_data.pages.dependency_frame_pages)
#define LOCAL_pages_sg_node (LOCAL_optyap_data.pages.subgoal_trie_node_pages)
#define LOCAL_pages_sg_hash (LOCAL_optyap_data.pages.subgoal_trie_hash_pages)
#define LOCAL_pages_ans_node (LOCAL_optyap_data.pages.answer_trie_node_pages)
#define LOCAL_pages_ans_hash (LOCAL_optyap_data.pages.answer_trie_hash_pages)
#define LOCAL_pages_ans_ref_node (LOCAL_optyap_data.pages.answer_ref_node_pages)
#define LOCAL_next_free_sg_node (LOCAL_optyap_data.pages.next_free_subgoal_trie_node)
#define LOCAL_next_free_sg_hash (LOCAL_optyap_data.pages.next_free_subgoal_trie_hash)
#define LOCAL_next_free_ans_node (LOCAL_optyap_data.pages.next_free_answer_trie_node)
#define LOCAL_next_free_ans_hash (LOCAL_optyap_data.pages.next_free_answer_trie_hash)
#define LOCAL_lock (LOCAL_optyap_data.lock)
#define LOCAL_load (LOCAL_optyap_data.load)
#ifdef YAPOR_THREADS
@ -418,7 +505,6 @@ struct local_optyap_data {
#define LOCAL_end_local_copy (LOCAL_optyap_data.local_copy.end)
#define LOCAL_start_trail_copy (LOCAL_optyap_data.trail_copy.start)
#define LOCAL_end_trail_copy (LOCAL_optyap_data.trail_copy.end)
#define LOCAL_next_free_ans_node (LOCAL_optyap_data.next_free_answer_trie_node)
#define LOCAL_top_sg_fr (LOCAL_optyap_data.top_subgoal_frame)
#define LOCAL_top_dep_fr (LOCAL_optyap_data.top_dependency_frame)
#define LOCAL_pruning_scope (LOCAL_optyap_data.bottom_pruning_scope)
@ -434,8 +520,19 @@ struct local_optyap_data {
#define LOCAL_ma_timestamp (LOCAL_optyap_data.ma_timestamp)
#define LOCAL_ma_h_top (LOCAL_optyap_data.ma_h_top)
#define LOCAL_ma_hash_table (LOCAL_optyap_data.ma_hash_table)
#define REMOTE_pages_void(wid) (REMOTE(wid)->optyap_data_.pages.void_pages)
#define REMOTE_pages_sg_fr(wid) (REMOTE(wid)->optyap_data_.pages.subgoal_frame_pages)
#define REMOTE_pages_dep_fr(wid) (REMOTE(wid)->optyap_data_.pages.dependency_frame_pages)
#define REMOTE_pages_sg_node(wid) (REMOTE(wid)->optyap_data_.pages.subgoal_trie_node_pages)
#define REMOTE_pages_sg_hash(wid) (REMOTE(wid)->optyap_data_.pages.subgoal_trie_hash_pages)
#define REMOTE_pages_ans_node(wid) (REMOTE(wid)->optyap_data_.pages.answer_trie_node_pages)
#define REMOTE_pages_ans_hash(wid) (REMOTE(wid)->optyap_data_.pages.answer_trie_hash_pages)
#define REMOTE_pages_ans_ref_node(wid) (REMOTE(wid)->optyap_data_.pages.answer_ref_node_pages)
#define REMOTE_next_free_sg_node(wid) (REMOTE(wid)->optyap_data_.pages.next_free_subgoal_trie_node)
#define REMOTE_next_free_sg_hash(wid) (REMOTE(wid)->optyap_data_.pages.next_free_subgoal_trie_hash)
#define REMOTE_next_free_ans_node(wid) (REMOTE(wid)->optyap_data_.pages.next_free_answer_trie_node)
#define REMOTE_next_free_ans_hash(wid) (REMOTE(wid)->optyap_data_.pages.next_free_answer_trie_hash)
#define REMOTE_lock(wid) (REMOTE(wid)->optyap_data_.lock)
#define REMOTE_load(wid) (REMOTE(wid)->optyap_data_.load)
#ifdef YAPOR_THREADS
@ -465,7 +562,6 @@ struct local_optyap_data {
#define REMOTE_end_local_copy(wid) (REMOTE(wid)->optyap_data_.local_copy.end)
#define REMOTE_start_trail_copy(wid) (REMOTE(wid)->optyap_data_.trail_copy.start)
#define REMOTE_end_trail_copy(wid) (REMOTE(wid)->optyap_data_.trail_copy.end)
#define REMOTE_next_free_ans_node(wid) (REMOTE(wid)->optyap_data_.next_free_answer_trie_node)
#define REMOTE_top_sg_fr(wid) (REMOTE(wid)->optyap_data_.top_subgoal_frame)
#define REMOTE_top_dep_fr(wid) (REMOTE(wid)->optyap_data_.top_dependency_frame)
#define REMOTE_pruning_scope(wid) (REMOTE(wid)->optyap_data_.bottom_pruning_scope)

View File

@ -38,7 +38,7 @@
#ifdef MMAP_MEMORY_MAPPING_SCHEME
#define PATH_MAX 1000
char mapfile_path[PATH_MAX];
#elif SHM_MEMORY_MAPPING_SCHEME
#elif defined(SHM_MEMORY_MAPPING_SCHEME)
int shm_mapid[MAX_WORKERS + 2];
#endif /* MEMORY_MAPPING_SCHEME */
@ -82,7 +82,7 @@ void Yap_init_yapor_global_local_memory(void) {
if (close(fd_mapfile) == -1)
Yap_Error(FATAL_ERROR, TermNil, "close error (Yap_init_yapor_global_local_memory)");
}
#elif SHM_MEMORY_MAPPING_SCHEME
#elif defined(SHM_MEMORY_MAPPING_SCHEME)
/* place as segment MAX_WORKERS (0..MAX_WORKERS-1 reserved for worker areas) */
shm_map_memory(MAX_WORKERS, GLOBAL_LOCAL_STRUCTS_AREA, (void *) Yap_local);
#endif /* MEMORY_MAPPING_SCHEME */
@ -121,7 +121,7 @@ void Yap_init_yapor_stacks_memory(UInt TrailStackArea, UInt HeapStackArea, UInt
if (close(fd_mapfile) == -1)
Yap_Error(FATAL_ERROR, TermNil, "close error (Yap_init_yapor_stacks_memory)");
}
#elif SHM_MEMORY_MAPPING_SCHEME
#elif defined(SHM_MEMORY_MAPPING_SCHEME)
/* place heap stack segment as MAX_WORKERS+1 */
shm_map_memory(MAX_WORKERS + 1, HeapStackArea, (void *) Yap_HeapBase);
#if defined(YAPOR_COPY) || defined(YAPOR_SBA)
@ -225,7 +225,7 @@ void Yap_unmap_yapor_memory (void) {
INFORMATION_MESSAGE("Removing mapfile \"%s\"", mapfile_path);
else
INFORMATION_MESSAGE("Can't remove mapfile \"%s\"", mapfile_path);
#elif SHM_MEMORY_MAPPING_SCHEME
#elif defined(SHM_MEMORY_MAPPING_SCHEME)
#if defined(YAPOR_COPY) || defined(YAPOR_SBA)
shm_unmap_memory(MAX_WORKERS);
shm_unmap_memory(MAX_WORKERS + 1);

View File

@ -60,10 +60,10 @@ static void complete_suspension_branch(susp_fr_ptr susp_fr, choiceptr top_cp, or
}
/* chain dependency frames to release (using DepFr_next) */
while (IS_UNLOCKED(DepFr_lock(aux_dep_fr)) &&
while (IS_UNLOCKED_DEP_FR(aux_dep_fr) &&
YOUNGER_CP(DepFr_cons_cp(aux_dep_fr), top_cp)) {
dep_fr_ptr next_dep_fr;
LOCK(DepFr_lock(aux_dep_fr));
LOCK_DEP_FR(aux_dep_fr);
next_dep_fr = DepFr_next(aux_dep_fr);
DepFr_next(aux_dep_fr) = *chain_dep_fr;
*chain_dep_fr = aux_dep_fr;
@ -192,7 +192,7 @@ void public_completion(void) {
/* chain dependency frames to release */
chain_dep_fr = NULL;
while (YOUNGER_CP(DepFr_cons_cp(LOCAL_top_dep_fr), Get_LOCAL_top_cp())) {
LOCK(DepFr_lock(LOCAL_top_dep_fr));
LOCK_DEP_FR(LOCAL_top_dep_fr);
next_dep_fr = DepFr_next(LOCAL_top_dep_fr);
DepFr_next(LOCAL_top_dep_fr) = chain_dep_fr;
chain_dep_fr = LOCAL_top_dep_fr;

View File

@ -401,11 +401,11 @@
YENV2MEM;
sg_fr = subgoal_search(PREG, YENV_ADDRESS);
MEM2YENV;
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
if (SgFr_state(sg_fr) == ready) {
/* subgoal new */
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
#ifdef DETERMINISTIC_TABLING
if (IsMode_Batched(TabEnt_mode(tab_ent))) {
store_deterministic_generator_node(tab_ent, sg_fr);
@ -424,7 +424,7 @@
ans_node_ptr ans_node = SgFr_first_answer(sg_fr);
CELL *subs_ptr = YENV;
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
SgFr_try_answer(sg_fr) = ans_node;
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER);
PREG = (yamop *) CPREG;
@ -438,7 +438,7 @@
choiceptr leader_cp;
int leader_dep_on_stack;
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
find_leader_node(leader_cp, leader_dep_on_stack);
store_consumer_node(tab_ent, sg_fr, leader_cp, leader_dep_on_stack);
#ifdef DEBUG_OPTYAP
@ -460,11 +460,11 @@
ans_node_ptr ans_node = SgFr_first_answer(sg_fr);
if (ans_node == NULL) {
/* no answers --> fail */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
goto fail;
} else if (ans_node == SgFr_answer_trie(sg_fr)) {
/* yes answer --> procceed */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) CPREG;
PREFETCH_OP(PREG);
YENV = ENV;
@ -480,7 +480,7 @@
#endif /* LIMIT_TABLING */
if (IsMode_LoadAnswers(TabEnt_mode(tab_ent))) {
/* load answers from the trie */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
if(TrNode_child(ans_node) != NULL) {
store_loader_node(tab_ent, ans_node);
}
@ -493,7 +493,7 @@
/* execute compiled code from the trie */
if (SgFr_state(sg_fr) < compiled)
update_answer_trie(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
PREFETCH_OP(PREG);
*--YENV = 0; /* vars_arity */
@ -519,11 +519,11 @@
YENV2MEM;
sg_fr = subgoal_search(PREG, YENV_ADDRESS);
MEM2YENV;
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
if (SgFr_state(sg_fr) == ready) {
/* subgoal new */
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, PREG->u.Otapl.d);
PREG = NEXTOP(PREG, Otapl);
PREFETCH_OP(PREG);
@ -535,7 +535,7 @@
ans_node_ptr ans_node = SgFr_first_answer(sg_fr);
CELL *subs_ptr = YENV;
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
SgFr_try_answer(sg_fr) = ans_node;
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER);
PREG = (yamop *) CPREG;
@ -549,7 +549,7 @@
choiceptr leader_cp;
int leader_dep_on_stack;
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
find_leader_node(leader_cp, leader_dep_on_stack);
store_consumer_node(tab_ent, sg_fr, leader_cp, leader_dep_on_stack);
#ifdef DEBUG_OPTYAP
@ -571,11 +571,11 @@
ans_node_ptr ans_node = SgFr_first_answer(sg_fr);
if (ans_node == NULL) {
/* no answers --> fail */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
goto fail;
} else if (ans_node == SgFr_answer_trie(sg_fr)) {
/* yes answer --> procceed */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) CPREG;
PREFETCH_OP(PREG);
YENV = ENV;
@ -591,7 +591,7 @@
#endif /* LIMIT_TABLING */
if (IsMode_LoadAnswers(TabEnt_mode(tab_ent))) {
/* load answers from the trie */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
if(TrNode_child(ans_node) != NULL) {
store_loader_node(tab_ent, ans_node);
}
@ -604,7 +604,7 @@
/* execute compiled code from the trie */
if (SgFr_state(sg_fr) < compiled)
update_answer_trie(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
PREFETCH_OP(PREG);
*--YENV = 0; /* vars_arity */
@ -630,11 +630,11 @@
YENV2MEM;
sg_fr = subgoal_search(PREG, YENV_ADDRESS);
MEM2YENV;
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
if (SgFr_state(sg_fr) == ready) {
/* subgoal new */
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, NEXTOP(PREG,Otapl));
PREG = PREG->u.Otapl.d;
PREFETCH_OP(PREG);
@ -646,7 +646,7 @@
ans_node_ptr ans_node = SgFr_first_answer(sg_fr);
CELL *subs_ptr = YENV;
init_subgoal_frame(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
SgFr_try_answer(sg_fr) = ans_node;
store_generator_node(tab_ent, sg_fr, PREG->u.Otapl.s, TRY_ANSWER);
PREG = (yamop *) CPREG;
@ -660,7 +660,7 @@
choiceptr leader_cp;
int leader_dep_on_stack;
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
find_leader_node(leader_cp, leader_dep_on_stack);
store_consumer_node(tab_ent, sg_fr, leader_cp, leader_dep_on_stack);
#ifdef DEBUG_OPTYAP
@ -682,11 +682,11 @@
ans_node_ptr ans_node = SgFr_first_answer(sg_fr);
if (ans_node == NULL) {
/* no answers --> fail */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
goto fail;
} else if (ans_node == SgFr_answer_trie(sg_fr)) {
/* yes answer --> procceed */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) CPREG;
PREFETCH_OP(PREG);
YENV = ENV;
@ -702,7 +702,7 @@
#endif /* LIMIT_TABLING */
if (IsMode_LoadAnswers(TabEnt_mode(tab_ent))) {
/* load answers from the trie */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
if(TrNode_child(ans_node) != NULL) {
store_loader_node(tab_ent, ans_node);
}
@ -715,7 +715,7 @@
/* execute compiled code from the trie */
if (SgFr_state(sg_fr) < compiled)
update_answer_trie(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
PREFETCH_OP(PREG);
*--YENV = 0; /* vars_arity */
@ -999,7 +999,7 @@
TAG_AS_ANSWER_LEAF_NODE(ans_node);
UNLOCK_ANSWER_NODE(ans_node);
#ifndef ANSWER_TRIE_LOCK_AT_ENTRY_LEVEL
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
#endif /* ! ANSWER_TRIE_LOCK_AT_ENTRY_LEVEL */
if (SgFr_first_answer(sg_fr) == NULL)
SgFr_first_answer(sg_fr) = ans_node;
@ -1015,7 +1015,7 @@
}
}
#endif /* DEBUG_TABLING */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
if (IS_BATCHED_GEN_CP(gcp)) {
#ifdef TABLING_EARLY_COMPLETION
if (gcp == PROTECT_FROZEN_B(B) && (*subs_ptr == 0 || gcp->cp_ap == COMPLETION)) {
@ -1087,7 +1087,7 @@
OPTYAP_ERROR_CHECKING(answer_resolution, SCH_top_shared_cp(B) && B->cp_or_fr->alternative != ANSWER_RESOLUTION);
OPTYAP_ERROR_CHECKING(answer_resolution, !SCH_top_shared_cp(B) && B->cp_ap != ANSWER_RESOLUTION);
dep_fr = CONS_CP(B)->cp_dep_fr;
LOCK(DepFr_lock(dep_fr));
LOCK_DEP_FR(dep_fr);
ans_node = DepFr_last_answer(dep_fr);
if (TrNode_child(ans_node)) {
/* unconsumed answers */
@ -1104,10 +1104,10 @@
#endif /* MODE_DIRECTED_TABLING */
ans_node = TrNode_child(ans_node);
DepFr_last_answer(dep_fr) = ans_node;
UNLOCK(DepFr_lock(dep_fr));
UNLOCK_DEP_FR(dep_fr);
consume_answer_and_procceed(dep_fr, ans_node);
}
UNLOCK(DepFr_lock(dep_fr));
UNLOCK_DEP_FR(dep_fr);
#ifdef YAPOR
if (B == DepFr_leader_cp(LOCAL_top_dep_fr)) {
@ -1146,7 +1146,7 @@
/* check for dependency frames with unconsumed answers */
dep_fr = DepFr_next(dep_fr);
while (YOUNGER_CP(DepFr_cons_cp(dep_fr), chain_cp)) {
LOCK(DepFr_lock(dep_fr));
LOCK_DEP_FR(dep_fr);
ans_node = DepFr_last_answer(dep_fr);
if (TrNode_child(ans_node)) {
/* dependency frame with unconsumed answers */
@ -1167,7 +1167,7 @@
if (YOUNGER_CP(DepFr_backchain_cp(dep_fr), top_chain_cp))
#endif /* YAPOR */
DepFr_backchain_cp(dep_fr) = top_chain_cp;
UNLOCK(DepFr_lock(dep_fr));
UNLOCK_DEP_FR(dep_fr);
chain_cp = DepFr_cons_cp(dep_fr);
#ifdef YAPOR
@ -1243,7 +1243,7 @@
TRAIL_LINK(B->cp_tr);
consume_answer_and_procceed(dep_fr, ans_node);
}
UNLOCK(DepFr_lock(dep_fr));
UNLOCK_DEP_FR(dep_fr);
dep_fr = DepFr_next(dep_fr);
}
@ -1400,7 +1400,7 @@
/* check for dependency frames with unconsumed answers */
dep_fr = LOCAL_top_dep_fr;
while (YOUNGER_CP(DepFr_cons_cp(dep_fr), B)) {
LOCK(DepFr_lock(dep_fr));
LOCK_DEP_FR(dep_fr);
ans_node = DepFr_last_answer(dep_fr);
if (TrNode_child(ans_node)) {
/* dependency frame with unconsumed answers */
@ -1428,7 +1428,7 @@
#endif /* YAPOR */
DepFr_backchain_cp(dep_fr) = B->cp_b;
}
UNLOCK(DepFr_lock(dep_fr));
UNLOCK_DEP_FR(dep_fr);
#ifdef DEBUG_OPTYAP
if (GLOBAL_parallel_mode == PARALLEL_MODE_RUNNING) {
@ -1479,7 +1479,7 @@
TRAIL_LINK(B->cp_tr);
consume_answer_and_procceed(dep_fr, ans_node);
}
UNLOCK(DepFr_lock(dep_fr));
UNLOCK_DEP_FR(dep_fr);
#ifdef TIMESTAMP_CHECK
DepFr_timestamp(dep_fr) = timestamp;
#endif /* TIMESTAMP_CHECK */
@ -1569,7 +1569,7 @@
TR = B->cp_tr;
SET_BB(B);
LOCK_OR_FRAME(LOCAL_top_or_fr);
LOCK(DepFr_lock(LOCAL_top_dep_fr));
LOCK_DEP_FR(LOCAL_top_dep_fr);
ans_node = DepFr_last_answer(LOCAL_top_dep_fr);
if (TrNode_child(ans_node)) {
/* unconsumed answers */
@ -1587,11 +1587,11 @@
#endif /* MODE_DIRECTED_TABLING */
ans_node = TrNode_child(ans_node);
DepFr_last_answer(LOCAL_top_dep_fr) = ans_node;
UNLOCK(DepFr_lock(LOCAL_top_dep_fr));
UNLOCK_DEP_FR(LOCAL_top_dep_fr);
consume_answer_and_procceed(LOCAL_top_dep_fr, ans_node);
}
/* no unconsumed answers */
UNLOCK(DepFr_lock(LOCAL_top_dep_fr));
UNLOCK_DEP_FR(LOCAL_top_dep_fr);
if (OrFr_owners(LOCAL_top_or_fr) > 1) {
/* more owners -> move up one node */
Set_LOCAL_top_cp_on_stack( GetOrFr_node(OrFr_next_on_stack(LOCAL_top_or_fr)) );
@ -1679,10 +1679,10 @@
GONext();
} else {
/* execute compiled code from the trie */
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
if (SgFr_state(sg_fr) < compiled)
update_answer_trie(sg_fr);
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
PREFETCH_OP(PREG);
*--YENV = 0; /* vars_arity */

View File

@ -88,6 +88,7 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
** Tabling defines **
******************************/
/* traverse macros */
#define SHOW_MODE_STRUCTURE 0
#define SHOW_MODE_STATISTICS 1
#define TRAVERSE_MODE_NORMAL 0
@ -135,6 +136,24 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#define CompactPairEndList AbsPair((Term *) (2*(LowTagBits + 1)))
#endif /* TRIE_COMPACT_PAIRS */
/* threads */
#if (_trie_retry_gterm - _trie_do_var + 1) + 1 <= 64 /* 60 (trie instructions) + 1 (ANSWER_TRIE_HASH_MARK) <= 64 */
#define ANSWER_LEAF_NODE_INSTR_BITS 6 /* 2^6 = 64 */
#define ANSWER_LEAF_NODE_INSTR_MASK 0x3F
#endif
#if SIZEOF_INT_P == 4
#define ANSWER_LEAF_NODE_MAX_THREADS (32 - ANSWER_LEAF_NODE_INSTR_BITS)
#elif SIZEOF_INT_P == 8
#define ANSWER_LEAF_NODE_MAX_THREADS (64 - ANSWER_LEAF_NODE_INSTR_BITS)
#else
#define ANSWER_LEAF_NODE_MAX_THREADS OOOOPPS!!! Unknown Pointer Sizeof
#endif /* SIZEOF_INT_P */
#define ANSWER_LEAF_NODE_INSTR_RELATIVE(NODE) TrNode_instr(NODE) = TrNode_instr(NODE) - _trie_do_var + 1
#define ANSWER_LEAF_NODE_INSTR_ABSOLUTE(NODE) TrNode_instr(NODE) = (TrNode_instr(NODE) & ANSWER_LEAF_NODE_INSTR_MASK) + _trie_do_var - 1
#define ANSWER_LEAF_NODE_SET_WID(NODE,WID) BITMAP_insert(TrNode_instr(NODE), WID + ANSWER_LEAF_NODE_INSTR_BITS)
#define ANSWER_LEAF_NODE_DEL_WID(NODE,WID) BITMAP_delete(TrNode_instr(NODE), WID + ANSWER_LEAF_NODE_INSTR_BITS)
#define ANSWER_LEAF_NODE_CHECK_WID(NODE,WID) BITMAP_member(TrNode_instr(NODE), WID + ANSWER_LEAF_NODE_INSTR_BITS)
/* choice points */
#define NORM_CP(CP) ((choiceptr)(CP))
#define GEN_CP(CP) ((struct generator_choicept *)(CP))
@ -235,6 +254,7 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
SgFr_gen_worker(SG_FR) = worker_id; \
SgFr_gen_top_or_fr(SG_FR) = LOCAL_top_or_fr
#define DepFr_init_yapor_fields(DEP_FR, DEP_ON_STACK, TOP_OR_FR) \
INIT_LOCK_DEP_FR(DEP_FR); \
DepFr_leader_dep_is_on_stack(DEP_FR) = DEP_ON_STACK; \
DepFr_top_or_fr(DEP_FR) = TOP_OR_FR; \
DepFr_init_timestamp_field(DEP_FR)
@ -273,6 +293,28 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#define AnsHash_init_previous_field(HASH, SG_FR)
#endif /* MODE_DIRECTED_TABLING */
#if defined(YAPOR) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
#define INIT_LOCK_SG_FR(SG_FR) INIT_LOCK(SgFr_lock(SG_FR))
#define LOCK_SG_FR(SG_FR) LOCK(SgFr_lock(SG_FR))
#define UNLOCK_SG_FR(SG_FR) UNLOCK(SgFr_lock(SG_FR))
#else
#define INIT_LOCK_SG_FR(SG_FR)
#define LOCK_SG_FR(SG_FR)
#define UNLOCK_SG_FR(SG_FR)
#endif /* YAPOR || THREADS_FULL_SHARING || THREADS_CONSUMER_SHARING */
#ifdef YAPOR
#define INIT_LOCK_DEP_FR(DEP_FR) INIT_LOCK(DepFr_lock(DEP_FR))
#define LOCK_DEP_FR(DEP_FR) LOCK(DepFr_lock(DEP_FR))
#define UNLOCK_DEP_FR(DEP_FR) UNLOCK(DepFr_lock(DEP_FR))
#define IS_UNLOCKED_DEP_FR(DEP_FR) IS_UNLOCKED(DepFr_lock(DEP_FR))
#else
#define INIT_LOCK_DEP_FR(DEF_FR)
#define LOCK_DEP_FR(DEP_FR)
#define UNLOCK_DEP_FR(DEP_FR)
#define IS_UNLOCKED_DEP_FR(DEP_FR)
#endif /* YAPOR */
#ifdef SUBGOAL_TRIE_LOCK_AT_ENTRY_LEVEL
#define LOCK_SUBGOAL_TRIE(TAB_ENT) LOCK(TabEnt_lock(TAB_ENT))
#define UNLOCK_SUBGOAL_TRIE(TAB_ENT) UNLOCK(TabEnt_lock(TAB_ENT))
@ -290,8 +332,8 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#endif /* SUBGOAL_TRIE_LOCK_AT_ENTRY_LEVEL */
#ifdef ANSWER_TRIE_LOCK_AT_ENTRY_LEVEL
#define LOCK_ANSWER_TRIE(SG_FR) LOCK(SgFr_lock(SG_FR))
#define UNLOCK_ANSWER_TRIE(SG_FR) UNLOCK(SgFr_lock(SG_FR))
#define LOCK_ANSWER_TRIE(SG_FR) LOCK_SG_FR(SG_FR)
#define UNLOCK_ANSWER_TRIE(SG_FR) UNLOCK_SG_FR(SG_FR)
#define AnsHash_init_chain_fields(HASH, SG_FR) \
AnsHash_init_previous_field(HASH, SG_FR); \
Hash_next(HASH) = SgFr_hash_chain(SG_FR); \
@ -300,18 +342,18 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#define LOCK_ANSWER_TRIE(SG_FR)
#define UNLOCK_ANSWER_TRIE(SG_FR)
#define AnsHash_init_chain_fields(HASH, SG_FR) \
LOCK(SgFr_lock(SG_FR)); \
LOCK_SG_FR(SG_FR); \
AnsHash_init_previous_field(HASH, SG_FR); \
Hash_next(HASH) = SgFr_hash_chain(SG_FR); \
SgFr_hash_chain(SG_FR) = HASH; \
UNLOCK(SgFr_lock(SG_FR))
UNLOCK_SG_FR(SG_FR)
#endif /* ANSWER_TRIE_LOCK_AT_ENTRY_LEVEL */
#ifdef SUBGOAL_TRIE_LOCK_USING_NODE_FIELD
#define LOCK_SUBGOAL_NODE(NODE) LOCK(TrNode_lock(NODE))
#define UNLOCK_SUBGOAL_NODE(NODE) UNLOCK(TrNode_lock(NODE))
#define SgNode_init_lock_field(NODE) INIT_LOCK(TrNode_lock(NODE))
#elif SUBGOAL_TRIE_LOCK_USING_GLOBAL_ARRAY
#elif defined(SUBGOAL_TRIE_LOCK_USING_GLOBAL_ARRAY)
#define LOCK_SUBGOAL_NODE(NODE) LOCK(HASH_TRIE_LOCK(NODE))
#define UNLOCK_SUBGOAL_NODE(NODE) UNLOCK(HASH_TRIE_LOCK(NODE))
#define SgNode_init_lock_field(NODE)
@ -325,7 +367,7 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#define LOCK_ANSWER_NODE(NODE) LOCK(TrNode_lock(NODE))
#define UNLOCK_ANSWER_NODE(NODE) UNLOCK(TrNode_lock(NODE))
#define AnsNode_init_lock_field(NODE) INIT_LOCK(TrNode_lock(NODE))
#elif ANSWER_TRIE_LOCK_USING_GLOBAL_ARRAY
#elif defined(ANSWER_TRIE_LOCK_USING_GLOBAL_ARRAY)
#define LOCK_ANSWER_NODE(NODE) LOCK(HASH_TRIE_LOCK(NODE))
#define UNLOCK_ANSWER_NODE(NODE) UNLOCK(HASH_TRIE_LOCK(NODE))
#define AnsNode_init_lock_field(NODE)
@ -339,7 +381,7 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#define LOCK_GLOBAL_NODE(NODE) LOCK(TrNode_lock(NODE))
#define UNLOCK_GLOBAL_NODE(NODE) UNLOCK(TrNode_lock(NODE))
#define GtNode_init_lock_field(NODE) INIT_LOCK(TrNode_lock(NODE))
#elif GLOBAL_TRIE_LOCK_USING_GLOBAL_ARRAY
#elif defined(GLOBAL_TRIE_LOCK_USING_GLOBAL_ARRAY)
#define LOCK_GLOBAL_NODE(NODE) LOCK(HASH_TRIE_LOCK(NODE))
#define UNLOCK_GLOBAL_NODE(NODE) UNLOCK(HASH_TRIE_LOCK(NODE))
#define GtNode_init_lock_field(NODE)
@ -379,7 +421,7 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
{ register ans_node_ptr ans_node; \
new_answer_trie_node(ans_node, 0, 0, NULL, NULL, NULL); \
ALLOC_SUBGOAL_FRAME(SG_FR); \
INIT_LOCK(SgFr_lock(SG_FR)); \
INIT_LOCK_SG_FR(SG_FR); \
SgFr_code(SG_FR) = CODE; \
SgFr_state(SG_FR) = ready; \
SgFr_hash_chain(SG_FR) = NULL; \
@ -398,7 +440,6 @@ static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames(tg_sol_fr_ptr, int);
#define new_dependency_frame(DEP_FR, DEP_ON_STACK, TOP_OR_FR, LEADER_CP, CONS_CP, SG_FR, NEXT) \
ALLOC_DEPENDENCY_FRAME(DEP_FR); \
INIT_LOCK(DepFr_lock(DEP_FR)); \
DepFr_init_yapor_fields(DEP_FR, DEP_ON_STACK, TOP_OR_FR); \
DepFr_backchain_cp(DEP_FR) = NULL; \
DepFr_leader_cp(DEP_FR) = NORM_CP(LEADER_CP); \
@ -565,9 +606,9 @@ static inline void adjust_freeze_registers(void) {
static inline void mark_as_completed(sg_fr_ptr sg_fr) {
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
SgFr_state(sg_fr) = complete;
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
#ifdef MODE_DIRECTED_TABLING
if (SgFr_invalid_chain(sg_fr)) {
ans_node_ptr current_node, next_node;
@ -786,23 +827,23 @@ static inline void abolish_incomplete_subgoals(choiceptr prune_cp) {
#endif /* YAPOR */
sg_fr = LOCAL_top_sg_fr;
LOCAL_top_sg_fr = SgFr_next(sg_fr);
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
if (SgFr_first_answer(sg_fr) == NULL) {
/* no answers --> ready */
SgFr_state(sg_fr) = ready;
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
} else if (SgFr_first_answer(sg_fr) == SgFr_answer_trie(sg_fr)) {
/* yes answer --> complete */
#ifndef TABLING_EARLY_COMPLETION
/* with early completion, at this point the subgoal should be already completed */
SgFr_state(sg_fr) = complete;
#endif /* TABLING_EARLY_COMPLETION */
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
} else {
/* answers --> incomplete/ready */
#ifdef INCOMPLETE_TABLING
SgFr_state(sg_fr) = incomplete;
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
#ifdef MODE_DIRECTED_TABLING
if (SgFr_invalid_chain(sg_fr)) {
ans_node_ptr current_node, next_node;
@ -846,7 +887,7 @@ static inline void abolish_incomplete_subgoals(choiceptr prune_cp) {
SgFr_last_answer(sg_fr) = NULL;
node = TrNode_child(SgFr_answer_trie(sg_fr));
TrNode_child(SgFr_answer_trie(sg_fr)) = NULL;
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
free_answer_trie(node, TRAVERSE_MODE_NORMAL, TRAVERSE_POSITION_FIRST);
#if defined(MODE_DIRECTED_TABLING) && ! defined(YAPOR)
/* free invalid answer nodes */
@ -1079,14 +1120,14 @@ static inline void CUT_validate_tg_answers(tg_sol_fr_ptr valid_solutions) {
FREE_TG_SOLUTION_FRAME(free_solution);
} while (ltt_valid_solutions);
if (first_answer) {
LOCK(SgFr_lock(sg_fr));
LOCK_SG_FR(sg_fr);
if (SgFr_first_answer(sg_fr) == NULL) {
SgFr_first_answer(sg_fr) = first_answer;
} else {
TrNode_child(SgFr_last_answer(sg_fr)) = first_answer;
}
SgFr_last_answer(sg_fr) = last_answer;
UNLOCK(SgFr_lock(sg_fr));
UNLOCK_SG_FR(sg_fr);
}
}
return;

View File

@ -30,22 +30,31 @@ typedef struct table_entry {
short execution_mode; /* combines yap_flags with pred_flags */
#ifdef MODE_DIRECTED_TABLING
int* mode_directed_array;
#endif /*MODE_DIRECTED_TABLING*/
#endif /* MODE_DIRECTED_TABLING */
#ifdef THREADS_NO_SHARING
struct subgoal_trie_node *subgoal_trie[THREADS_FIRST_LEVEL_BUCKETS];
#else
struct subgoal_trie_node *subgoal_trie;
#endif /* THREADS_NO_SHARING */
struct subgoal_trie_hash *hash_chain;
struct table_entry *next;
} *tab_ent_ptr;
#define TabEnt_lock(X) ((X)->lock)
#define TabEnt_pe(X) ((X)->pred_entry)
#define TabEnt_atom(X) ((X)->pred_atom)
#define TabEnt_arity(X) ((X)->pred_arity)
#define TabEnt_flags(X) ((X)->pred_flags)
#define TabEnt_mode(X) ((X)->execution_mode)
#define TabEnt_mode_directed(X) ((X)->mode_directed_array)
#define TabEnt_subgoal_trie(X) ((X)->subgoal_trie)
#define TabEnt_hash_chain(X) ((X)->hash_chain)
#define TabEnt_next(X) ((X)->next)
#define TabEnt_lock(X) ((X)->lock)
#define TabEnt_pe(X) ((X)->pred_entry)
#define TabEnt_atom(X) ((X)->pred_atom)
#define TabEnt_arity(X) ((X)->pred_arity)
#define TabEnt_flags(X) ((X)->pred_flags)
#define TabEnt_mode(X) ((X)->execution_mode)
#define TabEnt_mode_directed(X) ((X)->mode_directed_array)
#ifdef THREADS_NO_SHARING
#define TabEnt_subgoal_trie(X) ((X)->subgoal_trie[worker_id])
//#define TabEnt_subgoal_trie(X,I) ((X)->subgoal_trie[I])
#else
#define TabEnt_subgoal_trie(X) ((X)->subgoal_trie)
#endif /* THREADS_NO_SHARING */
#define TabEnt_hash_chain(X) ((X)->hash_chain)
#define TabEnt_next(X) ((X)->next)
@ -148,6 +157,24 @@ typedef struct global_trie_hash {
/******************************
** answer_ref_node **
******************************/
#ifdef THREADS_FULL_SHARING
typedef struct answer_ref_node {
struct answer_trie_node *ans_node;
struct answer_ref_node *next;
struct answer_ref_node *previous;
} *ans_ref_ptr;
#endif /* THREADS_FULL_SHARING */
#define RefNode_answer(X) ((X)->ans_node)
#define RefNode_next(X) ((X)->next)
#define RefNode_previous(X) ((X)->previous)
/************************************************************************
** Execution Data Structures **
************************************************************************/
@ -193,29 +220,32 @@ struct loader_choicept {
/*********************************
** subgoal_state_flag **
*********************************/
typedef enum { /* do not change order !!! */
incomplete = 0, /* INCOMPLETE_TABLING */
ready_external = 1, /* THREADS_CONSUMER_SHARING */
ready = 2,
evaluating = 3,
complete = 4,
complete_in_use = 5, /* LIMIT_TABLING */
compiled = 6,
compiled_in_use = 7 /* LIMIT_TABLING */
} subgoal_state_flag;
/****************************
** subgoal_frame **
** subgoal_entry **
****************************/
typedef struct subgoal_frame {
#if defined(YAPOR) || defined(THREADS)
typedef struct subgoal_entry {
#if defined(YAPOR) || defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
lockvar lock;
#endif /* YAPOR || THREADS */
#ifdef YAPOR
int generator_worker;
struct or_frame *top_or_frame_on_generator_branch;
#endif /* YAPOR */
#endif /* YAPOR || THREADS_FULL_SHARING || THREADS_CONSUMER_SHARING */
yamop *code_of_subgoal;
enum { /* do not change order !!! */
incomplete = 0, /* INCOMPLETE_TABLING */
ready = 1,
evaluating = 2,
complete = 3,
complete_in_use = 4, /* LIMIT_TABLING */
compiled = 5,
compiled_in_use = 6 /* LIMIT_TABLING */
} state_flag;
choiceptr generator_choice_point;
struct answer_trie_hash *hash_chain;
struct answer_trie_node *answer_trie;
struct answer_trie_node *first_answer;
@ -223,61 +253,128 @@ typedef struct subgoal_frame {
#ifdef MODE_DIRECTED_TABLING
int* mode_directed_array;
struct answer_trie_node *invalid_chain;
#endif /*MODE_DIRECTED_TABLING*/
#endif /* MODE_DIRECTED_TABLING */
#ifdef INCOMPLETE_TABLING
struct answer_trie_node *try_answer;
#endif /* INCOMPLETE_TABLING */
#ifdef LIMIT_TABLING
struct subgoal_frame *previous;
#endif /* LIMIT_TABLING */
#ifdef YAPOR
struct or_frame *top_or_frame_on_generator_branch;
#endif /* YAPOR */
#if defined(YAPOR) || defined(THREADS_CONSUMER_SHARING)
int generator_worker;
#endif /* YAPOR || THREADS_CONSUMER_SHARING */
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
subgoal_state_flag state_flag;
int active_workers;
struct subgoal_frame *subgoal_frame[THREADS_FIRST_LEVEL_BUCKETS];
#endif /* THREADS_FULL_SHARING || THREADS_CONSUMER_SHARING */
}* sg_ent_ptr;
#define SgEnt_lock(X) ((X)->lock)
#define SgEnt_code(X) ((X)->code_of_subgoal)
#define SgEnt_tab_ent(X) (((X)->code_of_subgoal)->u.Otapl.te)
#define SgEnt_arity(X) (((X)->code_of_subgoal)->u.Otapl.s)
#define SgEnt_hash_chain(X) ((X)->hash_chain)
#define SgEnt_answer_trie(X) ((X)->answer_trie)
#define SgEnt_first_answer(X) ((X)->first_answer)
#define SgEnt_last_answer(X) ((X)->last_answer)
#define SgEnt_mode_directed(X) ((X)->mode_directed_array)
#define SgEnt_invalid_chain(X) ((X)->invalid_chain)
#define SgEnt_try_answer(X) ((X)->try_answer)
#define SgEnt_previous(X) ((X)->previous)
#define SgEnt_gen_top_or_fr(X) ((X)->top_or_frame_on_generator_branch)
#define SgEnt_gen_worker(X) ((X)->generator_worker)
#define SgEnt_sg_ent_state(X) ((X)->state_flag)
#define SgEnt_active_workers(X) ((X)->active_workers)
#define SgEnt_sg_fr(X,I) ((X)->subgoal_frame[I])
/****************************
** subgoal_frame **
****************************/
typedef struct subgoal_frame {
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
struct subgoal_entry *subgoal_entry;
#ifdef THREADS_FULL_SHARING
struct answer_trie_node *batched_last_answer;
struct answer_ref_node *batched_cached_answers;
#endif /* THREADS_FULL_SHARING */
#else
struct subgoal_entry subgoal_entry;
#endif /* THREADS_FULL_SHARING || THREADS_CONSUMER_SHARING */
subgoal_state_flag state_flag;
choiceptr generator_choice_point;
struct subgoal_frame *next;
} *sg_fr_ptr;
#define SgFr_lock(X) ((X)->lock)
#define SgFr_gen_worker(X) ((X)->generator_worker)
#define SgFr_gen_top_or_fr(X) ((X)->top_or_frame_on_generator_branch)
#define SgFr_code(X) ((X)->code_of_subgoal)
#define SgFr_tab_ent(X) (((X)->code_of_subgoal)->u.Otapl.te)
#define SgFr_arity(X) (((X)->code_of_subgoal)->u.Otapl.s)
#define SgFr_state(X) ((X)->state_flag)
#define SgFr_gen_cp(X) ((X)->generator_choice_point)
#define SgFr_hash_chain(X) ((X)->hash_chain)
#define SgFr_answer_trie(X) ((X)->answer_trie)
#define SgFr_first_answer(X) ((X)->first_answer)
#define SgFr_last_answer(X) ((X)->last_answer)
#define SgFr_mode_directed(X) ((X)->mode_directed_array)
#define SgFr_invalid_chain(X) ((X)->invalid_chain)
#define SgFr_try_answer(X) ((X)->try_answer)
#define SgFr_previous(X) ((X)->previous)
#define SgFr_next(X) ((X)->next)
/* subgoal_entry fields */
#if defined(THREADS_FULL_SHARING) || defined(THREADS_CONSUMER_SHARING)
#define SUBGOAL_ENTRY(X) SgFr_subgoal_entry(X)->
#else
#define SUBGOAL_ENTRY(X) (X)->subgoal_entry.
#endif /* THREADS */
#define SgFr_lock(X) (SUBGOAL_ENTRY(X) lock)
#define SgFr_code(X) (SUBGOAL_ENTRY(X) code_of_subgoal)
#define SgFr_tab_ent(X) ((SUBGOAL_ENTRY(X) code_of_subgoal)->u.Otapl.te)
#define SgFr_arity(X) ((SUBGOAL_ENTRY(X) code_of_subgoal)->u.Otapl.s)
#define SgFr_hash_chain(X) (SUBGOAL_ENTRY(X) hash_chain)
#define SgFr_answer_trie(X) (SUBGOAL_ENTRY(X) answer_trie)
#define SgFr_first_answer(X) (SUBGOAL_ENTRY(X) first_answer)
#define SgFr_last_answer(X) (SUBGOAL_ENTRY(X) last_answer)
#define SgFr_mode_directed(X) (SUBGOAL_ENTRY(X) mode_directed_array)
#define SgFr_invalid_chain(X) (SUBGOAL_ENTRY(X) invalid_chain)
#define SgFr_try_answer(X) (SUBGOAL_ENTRY(X) try_answer)
#define SgFr_previous(X) (SUBGOAL_ENTRY(X) previous)
#define SgFr_gen_top_or_fr(X) (SUBGOAL_ENTRY(X) top_or_frame_on_generator_branch)
#define SgFr_gen_worker(X) (SUBGOAL_ENTRY(X) generator_worker)
#define SgFr_sg_ent_state(X) (SUBGOAL_ENTRY(X) state_flag)
#define SgFr_active_workers(X) (SUBGOAL_ENTRY(X) active_workers)
/* subgoal_frame fields */
#define SgFr_subgoal_entry(X) ((X)->subgoal_entry)
#define SgFr_batched_last_answer(X) ((X)->batched_last_answer)
#define SgFr_batched_cached_answers(X) ((X)->batched_cached_answers)
#define SgFr_state(X) ((X)->state_flag)
#define SgFr_gen_cp(X) ((X)->generator_choice_point)
#define SgFr_next(X) ((X)->next)
/**************************************************************************************************
/**********************************************************************************************************
SgFr_lock: spin-lock to modify the frame fields.
SgFr_gen_worker: the id of the worker that had allocated the frame.
SgFr_gen_top_or_fr: a pointer to the top or-frame in the generator choice point branch.
When the generator choice point is shared the pointer is updated
to its or-frame. It is used to find the direct dependency node for
consumer nodes in other workers branches.
SgFr_code initial instruction of the subgoal's compiled code.
SgFr_tab_ent a pointer to the correspondent table entry.
SgFr_arity the arity of the subgoal.
SgFr_state: a flag that indicates the subgoal state.
SgFr_gen_cp: a pointer to the correspondent generator choice point.
SgFr_hash_chain: a pointer to the first answer_trie_hash struct for the subgoal in hand.
SgFr_answer_trie: a pointer to the top answer trie node.
It is used to check for/insert new answers.
SgFr_first_answer: a pointer to the bottom answer trie node of the first available answer.
SgFr_last_answer: a pointer to the bottom answer trie node of the last available answer.
SgFr_mode_directed: a pointer to the mode directed array.
SgFr_invalid_chain: a pointer to the first invalid leaf node when using mode directed tabling.
SgFr_try_answer: a pointer to the bottom answer trie node of the last tried answer.
It is used when a subgoal was not completed during the previous evaluation.
Not completed subgoals start by trying the answers already found.
SgFr_previous: a pointer to the previous subgoal frame on the chain.
SgFr_next: a pointer to the next subgoal frame on the chain.
SgFr_lock: spin-lock to modify the frame fields.
SgFr_code initial instruction of the subgoal's compiled code.
SgFr_tab_ent a pointer to the corresponding table entry.
SgFr_arity the arity of the subgoal.
SgFr_hash_chain: a pointer to the first answer_trie_hash struct.
SgFr_answer_trie: a pointer to the top answer trie node.
SgFr_first_answer: a pointer to the leaf answer trie node of the first answer.
SgFr_last_answer: a pointer to the leaf answer trie node of the last answer.
SgFr_mode_directed: a pointer to the mode directed array.
SgFr_invalid_chain: a pointer to the first invalid leaf node when using mode directed tabling.
SgFr_try_answer: a pointer to the leaf answer trie node of the last tried answer.
It is used when a subgoal was not completed during the previous evaluation.
Not completed subgoals start by trying the answers already found.
SgFr_previous: a pointer to the previous subgoal frame on the chain.
SgFr_gen_top_or_fr: a pointer to the top or-frame in the generator choice point branch.
When the generator choice point is shared the pointer is updated
to its or-frame. It is used to find the direct dependency node for
consumer nodes in other workers branches.
SgFr_gen_worker: the id of the worker that had allocated the frame.
SgFr_sg_ent_state: a flag that indicates the subgoal entry state.
SgFr_active_workers: the number of workers evaluating the subgoal.
SgFr_subgoal_entry: a pointer to the corresponding subgoal entry.
SgFr_batched_last_answer: a pointer to the leaf answer trie node of the last checked answer
when using batched scheduling.
SgFr_batched_cached_answers: a pointer to the chain of answers already inserted in the trie, but not
yet found when using batched scheduling.
SgFr_state: a flag that indicates the subgoal frame state.
SgFr_gen_cp: a pointer to the correspondent generator choice point.
SgFr_next: a pointer to the next subgoal frame on the chain.
**************************************************************************************************/
**********************************************************************************************************/
@ -286,10 +383,8 @@ typedef struct subgoal_frame {
*******************************/
typedef struct dependency_frame {
#if defined(YAPOR) || defined(THREADS)
lockvar lock;
#endif /* YAPOR || THREADS */
#ifdef YAPOR
lockvar lock;
int leader_dependency_is_on_stack;
struct or_frame *top_or_frame;
#ifdef TIMESTAMP_CHECK
@ -300,6 +395,9 @@ typedef struct dependency_frame {
choiceptr leader_choice_point;
choiceptr consumer_choice_point;
struct answer_trie_node *last_consumed_answer;
#ifdef THREADS_CONSUMER_SHARING
int generator_is_external;
#endif /* THREADS_CONSUMER_SHARING */
struct dependency_frame *next;
} *dep_fr_ptr;
@ -311,9 +409,10 @@ typedef struct dependency_frame {
#define DepFr_leader_cp(X) ((X)->leader_choice_point)
#define DepFr_cons_cp(X) ((X)->consumer_choice_point)
#define DepFr_last_answer(X) ((X)->last_consumed_answer)
#define DepFr_external(X) ((X)->generator_is_external)
#define DepFr_next(X) ((X)->next)
/*******************************************************************************************************
/*********************************************************************************************************
DepFr_lock: lock variable to modify the frame fields.
DepFr_leader_dep_is_on_stack: the generator choice point for the correspondent consumer choice point
@ -330,9 +429,10 @@ typedef struct dependency_frame {
DepFr_leader_cp: a pointer to the leader choice point.
DepFr_cons_cp: a pointer to the correspondent consumer choice point.
DepFr_last_answer: a pointer to the last consumed answer.
DepFr_external: the generator choice point is external to the current thread (FALSE/TRUE).
DepFr_next: a pointer to the next dependency frame on the chain.
*******************************************************************************************************/
*********************************************************************************************************/

View File

@ -1246,6 +1246,8 @@ void update_answer_trie(sg_fr_ptr sg_fr) {
void free_subgoal_trie(sg_node_ptr current_node, int mode, int position) {
CACHE_REGS
if (! IS_SUBGOAL_LEAF_NODE(current_node)) {
int child_mode;
if (mode == TRAVERSE_MODE_NORMAL) {
@ -1315,6 +1317,8 @@ void free_subgoal_trie(sg_node_ptr current_node, int mode, int position) {
void free_answer_trie(ans_node_ptr current_node, int mode, int position) {
CACHE_REGS
#ifdef TABLING_INNER_CUTS
if (! IS_ANSWER_LEAF_NODE(current_node) && TrNode_child(current_node)) {
#else
@ -1363,6 +1367,8 @@ void free_answer_trie(ans_node_ptr current_node, int mode, int position) {
void free_subgoal_hash_chain(sg_hash_ptr hash) {
CACHE_REGS
while (hash) {
sg_node_ptr chain_node, *bucket, *last_bucket;
sg_hash_ptr next_hash;
@ -1391,6 +1397,8 @@ void free_subgoal_hash_chain(sg_hash_ptr hash) {
void free_answer_hash_chain(ans_hash_ptr hash) {
CACHE_REGS
while (hash) {
ans_node_ptr chain_node, *bucket, *last_bucket;
ans_hash_ptr next_hash;
@ -1419,6 +1427,7 @@ void free_answer_hash_chain(ans_hash_ptr hash) {
void show_table(tab_ent_ptr tab_ent, int show_mode, IOSTREAM *out) {
CACHE_REGS
sg_node_ptr sg_node;
TrStat_out = out;

View File

@ -64,6 +64,7 @@ static inline sg_node_ptr subgoal_trie_check_insert_gt_entry(tab_ent_ptr tab_ent
#else
static inline sg_node_ptr subgoal_trie_check_insert_entry(tab_ent_ptr tab_ent, sg_node_ptr parent_node, Term t) {
#endif /* MODE_GLOBAL_TRIE_ENTRY */
CACHE_REGS
sg_node_ptr child_node;
LOCK_SUBGOAL_NODE(parent_node);
@ -358,6 +359,7 @@ static inline ans_node_ptr answer_trie_check_insert_gt_entry(sg_fr_ptr sg_fr, an
#else
static inline ans_node_ptr answer_trie_check_insert_entry(sg_fr_ptr sg_fr, ans_node_ptr parent_node, Term t, int instr) {
#endif /* MODE_GLOBAL_TRIE_ENTRY */
CACHE_REGS
ans_node_ptr child_node;
TABLING_ERROR_CHECKING(answer_trie_check_insert_(gt)_entry, IS_ANSWER_LEAF_NODE(parent_node));

158
configure vendored
View File

@ -705,7 +705,8 @@ LN_S
DefTrailSpace
DefStackSpace
DefHeapSpace
PYTHON
GECODE_EXTRALIBS
GECODE_VERSION
EGREP
GREP
CPP
@ -4293,58 +4294,6 @@ else
fi
use_gecode_default=no
if test "$have_gecode" = yes; then
for ac_prog in python2.78 python
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_PYTHON+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$PYTHON"; then
ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_PYTHON="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
PYTHON=$ac_cv_prog_PYTHON
if test -n "$PYTHON"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
$as_echo "$PYTHON" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$PYTHON" && break
done
test -n "$PYTHON" || PYTHON="none"
if test "$PYTHON" != none; then
use_gecode_default=yes
fi
else
PYTHON=none
fi
# Check whether --enable-gecode was given.
if test "${enable_gecode+set}" = set; then :
enableval=$enable_gecode; use_gecode="$enableval"
@ -4352,12 +4301,9 @@ if test "${enable_gecode+set}" = set; then :
if test "$have_gecode" = no; then
as_fn_error $? "cannot enable gecode: gecode library not found" "$LINENO" 5
fi
if test "$PYTHON" = none; then
as_fn_error $? "cannot enable gecode: python not found" "$LINENO" 5
fi
fi
else
use_gecode=$use_gecode_default
use_gecode=$have_gecode
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if dynamic arrays are supported" >&5
@ -4390,6 +4336,97 @@ $as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
GECODE_VERSION=unknown-gecode-version
GECODE_EXTRALIBS="-lgecodesupport -lgecodekernel -lgecodeint -lgecodeset -lgecodesearch"
if test "$use_gecode" = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking gecode version" >&5
$as_echo_n "checking gecode version... " >&6; }
if test "$cross_compiling" = yes; then :
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "gecode/support/config.hpp"
#include <stdio.h>
int
main ()
{
FILE* out = fopen("conftest.out","w");
fprintf(out,"%s\n",GECODE_VERSION);
fclose(out);
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
GECODE_VERSION=$(cat conftest.out)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $GECODE_VERSION" >&5
$as_echo "$GECODE_VERSION" >&6; }
else
as_fn_error $? "cannot determine gecode version" "$LINENO" 5
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
case "$target_os" in
*darwin*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if -framework gecode is required" >&5
$as_echo_n "checking if -framework gecode is required... " >&6; }
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
saved_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -framework gecode"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include "gecode/int.hh"
int
main ()
{
Gecode::Exception e("","");
return 0;
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
GECODE_EXTRALIBS="-framework gecode"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
CXXFLAGS="$saved_CXXFLAGS"
;;
esac
fi
# Check whether --enable-tabling was given.
if test "${enable_tabling+set}" = set; then :
@ -4909,7 +4946,7 @@ _ACEOF
if test "$or-parallelism" = no
if test "$orparallelism" = no
then
$as_echo "#define MAX_WORKERS 1" >>confdefs.h
@ -4918,6 +4955,11 @@ else
#define MAX_WORKERS $yap_cv_max_workers
_ACEOF
if test "$orparallelism" = copy
then
use_malloc="no"
fi
tabling="no"
fi
if test "$threads" = no

View File

@ -80,16 +80,6 @@ case "$target_cpu" in
dnl Gecode support
AC_CHECK_HEADER(gecode/support/config.hpp,
have_gecode=yes, have_gecode=no)
use_gecode_default=no
AC_SUBST(PYTHON)
if test "$have_gecode" = yes; then
AC_CHECK_PROGS(PYTHON, [python2.78 python], [none])
if test "$PYTHON" != none; then
use_gecode_default=yes
fi
else
PYTHON=none
fi
AC_ARG_ENABLE(gecode,
[ --enable-gecode install gecode library],
[use_gecode="$enableval"
@ -97,10 +87,7 @@ AC_ARG_ENABLE(gecode,
if test "$have_gecode" = no; then
AC_MSG_ERROR([cannot enable gecode: gecode library not found])
fi
if test "$PYTHON" = none; then
AC_MSG_ERROR([cannot enable gecode: python not found])
fi
fi], use_gecode=$use_gecode_default)
fi], use_gecode=$have_gecode)
AC_MSG_CHECKING([if dynamic arrays are supported])
AC_COMPILE_IFELSE([
AC_LANG_PROGRAM([[void foo(int n) { int a[n]; a[1]=0; }]],[[foo(3);]])
@ -110,6 +97,42 @@ AC_COMPILE_IFELSE([
],[
AC_MSG_RESULT([no])
])
GECODE_VERSION=unknown-gecode-version
GECODE_EXTRALIBS="-lgecodesupport -lgecodekernel -lgecodeint -lgecodeset -lgecodesearch"
AC_SUBST(GECODE_VERSION)
AC_SUBST(GECODE_EXTRALIBS)
if test "$use_gecode" = yes; then
AC_MSG_CHECKING([gecode version])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include "gecode/support/config.hpp"
#include <stdio.h>
]],[[
FILE* out = fopen("conftest.out","w");
fprintf(out,"%s\n",GECODE_VERSION);
fclose(out);
return 0;
]])],[GECODE_VERSION=$(cat conftest.out)
AC_MSG_RESULT([$GECODE_VERSION])],
[AC_MSG_ERROR([cannot determine gecode version])])
case "$target_os" in
*darwin*)
AC_MSG_CHECKING([if -framework gecode is required])
AC_LANG_PUSH([C++])
saved_CXXFLAGS="$CXXFLAGS"
CXXFLAGS="$CXXFLAGS -framework gecode"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include "gecode/int.hh"
]],[[
Gecode::Exception e("","");
return 0;
]])],[GECODE_EXTRALIBS="-framework gecode"
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
AC_LANG_POP()
CXXFLAGS="$saved_CXXFLAGS"
;;
esac
fi
AC_ARG_ENABLE(tabling,
[ --enable-tabling support tabling ],
@ -441,11 +464,16 @@ AC_SUBST(DefHeapSpace)
AC_SUBST(DefStackSpace)
AC_SUBST(DefTrailSpace)
if test "$or-parallelism" = no
if test "$orparallelism" = no
then
AC_DEFINE(MAX_WORKERS,1)
else
AC_DEFINE_UNQUOTED(MAX_WORKERS,$yap_cv_max_workers)
if test "$orparallelism" = copy
then
use_malloc="no"
fi
tabling="no"
fi
if test "$threads" = no

View File

@ -2,6 +2,15 @@
#define YAP_REGS_H 1
#ifdef THREADS
#if USE_PTHREAD_LOCKING
#ifndef _XOPEN_SOURCE
#define _XOPEN_SOURCE 600
#endif /* !_XOPEN_SOURCE */
#endif /* USE_PTHREAD_LOCKING */
#include <pthread.h>
#endif
#if defined(TABLING) || defined(YAPOR_SBA)
typedef struct trail_frame {
Term term;
@ -12,7 +21,7 @@ typedef struct trail_frame {
#else
typedef Term *tr_fr_ptr;
#define TrailTerm(X) ((X)->term)
#define TrailTerm(X) (*(CELL*)(X))
#endif
typedef void *choiceptr;

View File

@ -118,6 +118,11 @@ bp_get_arity(TERM t)
// TERM bp_insert_pred(char *name, int arity, int (*func)())
#define bp_insert_pred(name, arity, func) YAP_UserCPredicate(name, func, arity)
extern inline int bp_call_string(const char *goal);
extern inline int bp_call_term(TERM t);
extern inline int bp_next_solution(void);
extern inline int bp_mount_query_term(TERM goal);
// int bp_call_string(char *goal)
extern inline int
bp_call_string(const char *goal) {

View File

@ -0,0 +1 @@
3.6.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
static IntRelType gecode_IntRelType_from_term(YAP_Term);
static BoolOpType gecode_BoolOpType_from_term(YAP_Term);
static IntConLevel gecode_IntConLevel_from_term(YAP_Term);
static TaskType gecode_TaskType_from_term(YAP_Term);
static ExtensionalPropKind gecode_ExtensionalPropKind_from_term(YAP_Term);
static IntVarBranch gecode_IntVarBranch_from_term(YAP_Term);
static IntValBranch gecode_IntValBranch_from_term(YAP_Term);
static IntAssign gecode_IntAssign_from_term(YAP_Term);
static SetRelType gecode_SetRelType_from_term(YAP_Term);
static SetOpType gecode_SetOpType_from_term(YAP_Term);
static SetVarBranch gecode_SetVarBranch_from_term(YAP_Term);
static SetValBranch gecode_SetValBranch_from_term(YAP_Term);
static SetAssign gecode_SetAssign_from_term(YAP_Term);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,662 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
{ YAP_Atom X= YAP_LookupAtom("IRT_EQ");
gecode_IRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_NQ");
gecode_IRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LQ");
gecode_IRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LE");
gecode_IRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GQ");
gecode_IRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GR");
gecode_IRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_AND");
gecode_BOT_AND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_OR");
gecode_BOT_OR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_IMP");
gecode_BOT_IMP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_EQV");
gecode_BOT_EQV = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_XOR");
gecode_BOT_XOR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_VAL");
gecode_ICL_VAL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_BND");
gecode_ICL_BND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DOM");
gecode_ICL_DOM = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DEF");
gecode_ICL_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXP");
gecode_TT_FIXP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXS");
gecode_TT_FIXS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXE");
gecode_TT_FIXE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_DEF");
gecode_EPK_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_SPEED");
gecode_EPK_SPEED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_MEMORY");
gecode_EPK_MEMORY = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_NONE");
gecode_INT_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_RND");
gecode_INT_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MIN");
gecode_INT_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MAX");
gecode_INT_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MIN");
gecode_INT_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MAX");
gecode_INT_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MIN");
gecode_INT_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MAX");
gecode_INT_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MIN");
gecode_INT_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MAX");
gecode_INT_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MIN");
gecode_INT_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MAX");
gecode_INT_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MIN");
gecode_INT_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MAX");
gecode_INT_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MIN");
gecode_INT_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MAX");
gecode_INT_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MIN");
gecode_INT_VAR_REGRET_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MAX");
gecode_INT_VAR_REGRET_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MIN");
gecode_INT_VAR_REGRET_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MAX");
gecode_INT_VAR_REGRET_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MIN");
gecode_INT_VAL_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MED");
gecode_INT_VAL_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MAX");
gecode_INT_VAL_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RND");
gecode_INT_VAL_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MIN");
gecode_INT_VAL_SPLIT_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MAX");
gecode_INT_VAL_SPLIT_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MIN");
gecode_INT_VAL_RANGE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MAX");
gecode_INT_VAL_RANGE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MIN");
gecode_INT_VALUES_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MAX");
gecode_INT_VALUES_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MIN");
gecode_INT_ASSIGN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MED");
gecode_INT_ASSIGN_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MAX");
gecode_INT_ASSIGN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_RND");
gecode_INT_ASSIGN_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_EQ");
gecode_SRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_NQ");
gecode_SRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUB");
gecode_SRT_SUB = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUP");
gecode_SRT_SUP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ");
gecode_SRT_DISJ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL");
gecode_SRT_CMPL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_UNION");
gecode_SOT_UNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION");
gecode_SOT_DUNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_INTER");
gecode_SOT_INTER = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS");
gecode_SOT_MINUS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_NONE");
gecode_SET_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_RND");
gecode_SET_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MIN");
gecode_SET_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MAX");
gecode_SET_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MIN");
gecode_SET_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MAX");
gecode_SET_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MIN");
gecode_SET_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MAX");
gecode_SET_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MIN");
gecode_SET_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MAX");
gecode_SET_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MIN");
gecode_SET_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MAX");
gecode_SET_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MIN");
gecode_SET_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MAX");
gecode_SET_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MIN");
gecode_SET_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MAX");
gecode_SET_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_INC");
gecode_SET_VAL_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_EXC");
gecode_SET_VAL_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_INC");
gecode_SET_VAL_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_EXC");
gecode_SET_VAL_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_INC");
gecode_SET_VAL_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_EXC");
gecode_SET_VAL_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_INC");
gecode_SET_VAL_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_EXC");
gecode_SET_VAL_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_INC");
gecode_SET_ASSIGN_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_EXC");
gecode_SET_ASSIGN_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_INC");
gecode_SET_ASSIGN_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_EXC");
gecode_SET_ASSIGN_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_INC");
gecode_SET_ASSIGN_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_EXC");
gecode_SET_ASSIGN_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_INC");
gecode_SET_ASSIGN_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_EXC");
gecode_SET_ASSIGN_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
YAP_UserCPredicate("gecode_constraint_unary_333", gecode_constraint_unary_333, 6);
YAP_UserCPredicate("gecode_constraint_unary_329", gecode_constraint_unary_329, 6);
YAP_UserCPredicate("gecode_constraint_sqr_321", gecode_constraint_sqr_321, 4);
YAP_UserCPredicate("gecode_constraint_dom_135", gecode_constraint_dom_135, 6);
YAP_UserCPredicate("gecode_constraint_dom_145", gecode_constraint_dom_145, 6);
YAP_UserCPredicate("gecode_constraint_convex_51", gecode_constraint_convex_51, 3);
YAP_UserCPredicate("gecode_constraint_nooverlap_226", gecode_constraint_nooverlap_226, 5);
YAP_UserCPredicate("gecode_constraint_assign_4", gecode_constraint_assign_4, 3);
YAP_UserCPredicate("gecode_constraint_assign_3", gecode_constraint_assign_3, 3);
YAP_UserCPredicate("gecode_constraint_assign_5", gecode_constraint_assign_5, 3);
YAP_UserCPredicate("gecode_constraint_assign_7", gecode_constraint_assign_7, 3);
YAP_UserCPredicate("gecode_constraint_assign_6", gecode_constraint_assign_6, 3);
YAP_UserCPredicate("gecode_constraint_assign_8", gecode_constraint_assign_8, 3);
YAP_UserCPredicate("gecode_constraint_element_154", gecode_constraint_element_154, 4);
YAP_UserCPredicate("gecode_constraint_element_158", gecode_constraint_element_158, 4);
YAP_UserCPredicate("gecode_constraint_element_148", gecode_constraint_element_148, 4);
YAP_UserCPredicate("gecode_constraint_element_146", gecode_constraint_element_146, 4);
YAP_UserCPredicate("gecode_constraint_element_153", gecode_constraint_element_153, 4);
YAP_UserCPredicate("gecode_constraint_element_161", gecode_constraint_element_161, 4);
YAP_UserCPredicate("gecode_constraint_element_164", gecode_constraint_element_164, 4);
YAP_UserCPredicate("gecode_constraint_element_170", gecode_constraint_element_170, 4);
YAP_UserCPredicate("gecode_constraint_element_162", gecode_constraint_element_162, 4);
YAP_UserCPredicate("gecode_constraint_sequence_314", gecode_constraint_sequence_314, 2);
YAP_UserCPredicate("gecode_constraint_notMax_232", gecode_constraint_notMax_232, 3);
YAP_UserCPredicate("gecode_constraint_unary_326", gecode_constraint_unary_326, 3);
YAP_UserCPredicate("gecode_constraint_circuit_45", gecode_constraint_circuit_45, 4);
YAP_UserCPredicate("gecode_constraint_circuit_36", gecode_constraint_circuit_36, 4);
YAP_UserCPredicate("gecode_constraint_dom_134", gecode_constraint_dom_134, 5);
YAP_UserCPredicate("gecode_constraint_dom_139", gecode_constraint_dom_139, 5);
YAP_UserCPredicate("gecode_constraint_dom_133", gecode_constraint_dom_133, 5);
YAP_UserCPredicate("gecode_constraint_dom_129", gecode_constraint_dom_129, 5);
YAP_UserCPredicate("gecode_constraint_dom_127", gecode_constraint_dom_127, 5);
YAP_UserCPredicate("gecode_constraint_dom_144", gecode_constraint_dom_144, 5);
YAP_UserCPredicate("gecode_constraint_dom_143", gecode_constraint_dom_143, 5);
YAP_UserCPredicate("gecode_constraint_dom_141", gecode_constraint_dom_141, 5);
YAP_UserCPredicate("gecode_constraint_channel_32", gecode_constraint_channel_32, 4);
YAP_UserCPredicate("gecode_constraint_channel_27", gecode_constraint_channel_27, 4);
YAP_UserCPredicate("gecode_constraint_channel_23", gecode_constraint_channel_23, 4);
YAP_UserCPredicate("gecode_constraint_channel_21", gecode_constraint_channel_21, 4);
YAP_UserCPredicate("gecode_constraint_nooverlap_228", gecode_constraint_nooverlap_228, 8);
YAP_UserCPredicate("gecode_constraint_nooverlap_231", gecode_constraint_nooverlap_231, 8);
YAP_UserCPredicate("gecode_constraint_element_156", gecode_constraint_element_156, 7);
YAP_UserCPredicate("gecode_constraint_element_150", gecode_constraint_element_150, 7);
YAP_UserCPredicate("gecode_constraint_element_152", gecode_constraint_element_152, 7);
YAP_UserCPredicate("gecode_constraint_element_160", gecode_constraint_element_160, 7);
YAP_UserCPredicate("gecode_constraint_element_168", gecode_constraint_element_168, 7);
YAP_UserCPredicate("gecode_constraint_element_166", gecode_constraint_element_166, 7);
YAP_UserCPredicate("gecode_constraint_max_208", gecode_constraint_max_208, 3);
YAP_UserCPredicate("gecode_constraint_max_212", gecode_constraint_max_212, 3);
YAP_UserCPredicate("gecode_constraint_unshare_338", gecode_constraint_unshare_338, 2);
YAP_UserCPredicate("gecode_constraint_unshare_336", gecode_constraint_unshare_336, 2);
YAP_UserCPredicate("gecode_constraint_path_244", gecode_constraint_path_244, 5);
YAP_UserCPredicate("gecode_constraint_path_243", gecode_constraint_path_243, 5);
YAP_UserCPredicate("gecode_constraint_mult_222", gecode_constraint_mult_222, 4);
YAP_UserCPredicate("gecode_constraint_clause_49", gecode_constraint_clause_49, 6);
YAP_UserCPredicate("gecode_constraint_clause_47", gecode_constraint_clause_47, 6);
YAP_UserCPredicate("gecode_constraint_precede_249", gecode_constraint_precede_249, 5);
YAP_UserCPredicate("gecode_constraint_distinct_116", gecode_constraint_distinct_116, 2);
YAP_UserCPredicate("gecode_constraint_mod_221", gecode_constraint_mod_221, 5);
YAP_UserCPredicate("gecode_constraint_cardinality_18", gecode_constraint_cardinality_18, 3);
YAP_UserCPredicate("gecode_constraint_atmostOne_9", gecode_constraint_atmostOne_9, 3);
YAP_UserCPredicate("gecode_constraint_channelSorted_33", gecode_constraint_channelSorted_33, 3);
YAP_UserCPredicate("gecode_constraint_linear_202", gecode_constraint_linear_202, 4);
YAP_UserCPredicate("gecode_constraint_linear_206", gecode_constraint_linear_206, 4);
YAP_UserCPredicate("gecode_constraint_linear_178", gecode_constraint_linear_178, 4);
YAP_UserCPredicate("gecode_constraint_linear_182", gecode_constraint_linear_182, 4);
YAP_UserCPredicate("gecode_constraint_circuit_42", gecode_constraint_circuit_42, 2);
YAP_UserCPredicate("gecode_constraint_rel_264", gecode_constraint_rel_264, 5);
YAP_UserCPredicate("gecode_constraint_rel_267", gecode_constraint_rel_267, 5);
YAP_UserCPredicate("gecode_constraint_rel_260", gecode_constraint_rel_260, 5);
YAP_UserCPredicate("gecode_constraint_rel_263", gecode_constraint_rel_263, 5);
YAP_UserCPredicate("gecode_constraint_rel_258", gecode_constraint_rel_258, 5);
YAP_UserCPredicate("gecode_constraint_rel_256", gecode_constraint_rel_256, 5);
YAP_UserCPredicate("gecode_constraint_rel_275", gecode_constraint_rel_275, 5);
YAP_UserCPredicate("gecode_constraint_rel_271", gecode_constraint_rel_271, 5);
YAP_UserCPredicate("gecode_constraint_rel_269", gecode_constraint_rel_269, 5);
YAP_UserCPredicate("gecode_constraint_rel_299", gecode_constraint_rel_299, 5);
YAP_UserCPredicate("gecode_constraint_rel_297", gecode_constraint_rel_297, 5);
YAP_UserCPredicate("gecode_constraint_rel_283", gecode_constraint_rel_283, 5);
YAP_UserCPredicate("gecode_constraint_rel_285", gecode_constraint_rel_285, 5);
YAP_UserCPredicate("gecode_constraint_rel_279", gecode_constraint_rel_279, 5);
YAP_UserCPredicate("gecode_constraint_rel_286", gecode_constraint_rel_286, 5);
YAP_UserCPredicate("gecode_constraint_rel_289", gecode_constraint_rel_289, 5);
YAP_UserCPredicate("gecode_constraint_rel_290", gecode_constraint_rel_290, 5);
YAP_UserCPredicate("gecode_constraint_rel_293", gecode_constraint_rel_293, 5);
YAP_UserCPredicate("gecode_constraint_rel_296", gecode_constraint_rel_296, 5);
YAP_UserCPredicate("gecode_constraint_rel_307", gecode_constraint_rel_307, 5);
YAP_UserCPredicate("gecode_constraint_rel_309", gecode_constraint_rel_309, 5);
YAP_UserCPredicate("gecode_constraint_rel_255", gecode_constraint_rel_255, 5);
YAP_UserCPredicate("gecode_constraint_rel_253", gecode_constraint_rel_253, 5);
YAP_UserCPredicate("gecode_constraint_min_216", gecode_constraint_min_216, 4);
YAP_UserCPredicate("gecode_constraint_min_215", gecode_constraint_min_215, 4);
YAP_UserCPredicate("gecode_constraint_min_219", gecode_constraint_min_219, 4);
YAP_UserCPredicate("gecode_constraint_cardinality_19", gecode_constraint_cardinality_19, 4);
YAP_UserCPredicate("gecode_constraint_count_65", gecode_constraint_count_65, 4);
YAP_UserCPredicate("gecode_constraint_count_62", gecode_constraint_count_62, 4);
YAP_UserCPredicate("gecode_constraint_count_60", gecode_constraint_count_60, 4);
YAP_UserCPredicate("gecode_constraint_count_59", gecode_constraint_count_59, 4);
YAP_UserCPredicate("gecode_constraint_count_56", gecode_constraint_count_56, 4);
YAP_UserCPredicate("gecode_constraint_sqrt_322", gecode_constraint_sqrt_322, 3);
YAP_UserCPredicate("gecode_constraint_cumulatives_113", gecode_constraint_cumulatives_113, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_111", gecode_constraint_cumulatives_111, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_109", gecode_constraint_cumulatives_109, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_107", gecode_constraint_cumulatives_107, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_105", gecode_constraint_cumulatives_105, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_103", gecode_constraint_cumulatives_103, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_101", gecode_constraint_cumulatives_101, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_99", gecode_constraint_cumulatives_99, 9);
YAP_UserCPredicate("gecode_constraint_binpacking_10", gecode_constraint_binpacking_10, 4);
YAP_UserCPredicate("gecode_constraint_linear_193", gecode_constraint_linear_193, 7);
YAP_UserCPredicate("gecode_constraint_linear_197", gecode_constraint_linear_197, 7);
YAP_UserCPredicate("gecode_constraint_linear_185", gecode_constraint_linear_185, 7);
YAP_UserCPredicate("gecode_constraint_linear_189", gecode_constraint_linear_189, 7);
YAP_UserCPredicate("gecode_constraint_abs_2", gecode_constraint_abs_2, 4);
YAP_UserCPredicate("gecode_constraint_convex_50", gecode_constraint_convex_50, 2);
YAP_UserCPredicate("gecode_constraint_div_118", gecode_constraint_div_118, 4);
YAP_UserCPredicate("gecode_constraint_rel_287", gecode_constraint_rel_287, 6);
YAP_UserCPredicate("gecode_constraint_rel_291", gecode_constraint_rel_291, 6);
YAP_UserCPredicate("gecode_constraint_rel_276", gecode_constraint_rel_276, 6);
YAP_UserCPredicate("gecode_constraint_rel_277", gecode_constraint_rel_277, 6);
YAP_UserCPredicate("gecode_constraint_rel_265", gecode_constraint_rel_265, 6);
YAP_UserCPredicate("gecode_constraint_rel_261", gecode_constraint_rel_261, 6);
YAP_UserCPredicate("gecode_constraint_rel_259", gecode_constraint_rel_259, 6);
YAP_UserCPredicate("gecode_constraint_rel_257", gecode_constraint_rel_257, 6);
YAP_UserCPredicate("gecode_constraint_rel_302", gecode_constraint_rel_302, 6);
YAP_UserCPredicate("gecode_constraint_rel_303", gecode_constraint_rel_303, 6);
YAP_UserCPredicate("gecode_constraint_rel_304", gecode_constraint_rel_304, 6);
YAP_UserCPredicate("gecode_constraint_rel_305", gecode_constraint_rel_305, 6);
YAP_UserCPredicate("gecode_constraint_weights_340", gecode_constraint_weights_340, 5);
YAP_UserCPredicate("gecode_constraint_max_211", gecode_constraint_max_211, 5);
YAP_UserCPredicate("gecode_constraint_path_239", gecode_constraint_path_239, 9);
YAP_UserCPredicate("gecode_constraint_unary_334", gecode_constraint_unary_334, 4);
YAP_UserCPredicate("gecode_constraint_unary_330", gecode_constraint_unary_330, 4);
YAP_UserCPredicate("gecode_constraint_unary_324", gecode_constraint_unary_324, 4);
YAP_UserCPredicate("gecode_constraint_unary_327", gecode_constraint_unary_327, 4);
YAP_UserCPredicate("gecode_constraint_sorted_317", gecode_constraint_sorted_317, 5);
YAP_UserCPredicate("gecode_constraint_circuit_40", gecode_constraint_circuit_40, 5);
YAP_UserCPredicate("gecode_constraint_circuit_37", gecode_constraint_circuit_37, 5);
YAP_UserCPredicate("gecode_constraint_circuit_34", gecode_constraint_circuit_34, 5);
YAP_UserCPredicate("gecode_constraint_dom_138", gecode_constraint_dom_138, 4);
YAP_UserCPredicate("gecode_constraint_dom_132", gecode_constraint_dom_132, 4);
YAP_UserCPredicate("gecode_constraint_dom_137", gecode_constraint_dom_137, 4);
YAP_UserCPredicate("gecode_constraint_dom_128", gecode_constraint_dom_128, 4);
YAP_UserCPredicate("gecode_constraint_dom_131", gecode_constraint_dom_131, 4);
YAP_UserCPredicate("gecode_constraint_dom_126", gecode_constraint_dom_126, 4);
YAP_UserCPredicate("gecode_constraint_dom_125", gecode_constraint_dom_125, 4);
YAP_UserCPredicate("gecode_constraint_dom_123", gecode_constraint_dom_123, 4);
YAP_UserCPredicate("gecode_constraint_dom_142", gecode_constraint_dom_142, 4);
YAP_UserCPredicate("gecode_constraint_dom_140", gecode_constraint_dom_140, 4);
YAP_UserCPredicate("gecode_constraint_abs_1", gecode_constraint_abs_1, 3);
YAP_UserCPredicate("gecode_constraint_channel_29", gecode_constraint_channel_29, 5);
YAP_UserCPredicate("gecode_constraint_channel_24", gecode_constraint_channel_24, 5);
YAP_UserCPredicate("gecode_constraint_rel_280", gecode_constraint_rel_280, 3);
YAP_UserCPredicate("gecode_constraint_rel_272", gecode_constraint_rel_272, 3);
YAP_UserCPredicate("gecode_constraint_path_242", gecode_constraint_path_242, 4);
YAP_UserCPredicate("gecode_constraint_branch_14", gecode_constraint_branch_14, 4);
YAP_UserCPredicate("gecode_constraint_branch_13", gecode_constraint_branch_13, 4);
YAP_UserCPredicate("gecode_constraint_branch_15", gecode_constraint_branch_15, 4);
YAP_UserCPredicate("gecode_constraint_mult_223", gecode_constraint_mult_223, 5);
YAP_UserCPredicate("gecode_constraint_circuit_41", gecode_constraint_circuit_41, 6);
YAP_UserCPredicate("gecode_constraint_circuit_38", gecode_constraint_circuit_38, 6);
YAP_UserCPredicate("gecode_constraint_circuit_35", gecode_constraint_circuit_35, 6);
YAP_UserCPredicate("gecode_constraint_clause_48", gecode_constraint_clause_48, 5);
YAP_UserCPredicate("gecode_constraint_clause_46", gecode_constraint_clause_46, 5);
YAP_UserCPredicate("gecode_constraint_precede_251", gecode_constraint_precede_251, 4);
YAP_UserCPredicate("gecode_constraint_precede_248", gecode_constraint_precede_248, 4);
YAP_UserCPredicate("gecode_constraint_precede_247", gecode_constraint_precede_247, 4);
YAP_UserCPredicate("gecode_constraint_channel_30", gecode_constraint_channel_30, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_82", gecode_constraint_cumulative_82, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_85", gecode_constraint_cumulative_85, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_78", gecode_constraint_cumulative_78, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_81", gecode_constraint_cumulative_81, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_75", gecode_constraint_cumulative_75, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_94", gecode_constraint_cumulative_94, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_97", gecode_constraint_cumulative_97, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_90", gecode_constraint_cumulative_90, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_93", gecode_constraint_cumulative_93, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_87", gecode_constraint_cumulative_87, 7);
YAP_UserCPredicate("gecode_constraint_distinct_117", gecode_constraint_distinct_117, 3);
YAP_UserCPredicate("gecode_constraint_distinct_114", gecode_constraint_distinct_114, 3);
YAP_UserCPredicate("gecode_constraint_mod_220", gecode_constraint_mod_220, 4);
YAP_UserCPredicate("gecode_constraint_sqr_320", gecode_constraint_sqr_320, 3);
YAP_UserCPredicate("gecode_constraint_sequence_313", gecode_constraint_sequence_313, 7);
YAP_UserCPredicate("gecode_constraint_sequence_311", gecode_constraint_sequence_311, 7);
YAP_UserCPredicate("gecode_constraint_path_240", gecode_constraint_path_240, 7);
YAP_UserCPredicate("gecode_constraint_path_237", gecode_constraint_path_237, 7);
YAP_UserCPredicate("gecode_constraint_path_234", gecode_constraint_path_234, 7);
YAP_UserCPredicate("gecode_constraint_divmod_121", gecode_constraint_divmod_121, 6);
YAP_UserCPredicate("gecode_constraint_sorted_318", gecode_constraint_sorted_318, 3);
YAP_UserCPredicate("gecode_constraint_circuit_44", gecode_constraint_circuit_44, 3);
YAP_UserCPredicate("gecode_constraint_circuit_43", gecode_constraint_circuit_43, 3);
YAP_UserCPredicate("gecode_constraint_channel_31", gecode_constraint_channel_31, 3);
YAP_UserCPredicate("gecode_constraint_channel_28", gecode_constraint_channel_28, 3);
YAP_UserCPredicate("gecode_constraint_channel_26", gecode_constraint_channel_26, 3);
YAP_UserCPredicate("gecode_constraint_channel_22", gecode_constraint_channel_22, 3);
YAP_UserCPredicate("gecode_constraint_channel_25", gecode_constraint_channel_25, 3);
YAP_UserCPredicate("gecode_constraint_channel_20", gecode_constraint_channel_20, 3);
YAP_UserCPredicate("gecode_constraint_count_52", gecode_constraint_count_52, 5);
YAP_UserCPredicate("gecode_constraint_count_54", gecode_constraint_count_54, 5);
YAP_UserCPredicate("gecode_constraint_count_66", gecode_constraint_count_66, 5);
YAP_UserCPredicate("gecode_constraint_count_68", gecode_constraint_count_68, 5);
YAP_UserCPredicate("gecode_constraint_count_61", gecode_constraint_count_61, 5);
YAP_UserCPredicate("gecode_constraint_count_57", gecode_constraint_count_57, 5);
YAP_UserCPredicate("gecode_constraint_count_63", gecode_constraint_count_63, 5);
YAP_UserCPredicate("gecode_constraint_count_70", gecode_constraint_count_70, 5);
YAP_UserCPredicate("gecode_constraint_count_72", gecode_constraint_count_72, 5);
YAP_UserCPredicate("gecode_constraint_cumulatives_112", gecode_constraint_cumulatives_112, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_110", gecode_constraint_cumulatives_110, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_108", gecode_constraint_cumulatives_108, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_106", gecode_constraint_cumulatives_106, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_104", gecode_constraint_cumulatives_104, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_102", gecode_constraint_cumulatives_102, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_100", gecode_constraint_cumulatives_100, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_98", gecode_constraint_cumulatives_98, 8);
YAP_UserCPredicate("gecode_constraint_binpacking_11", gecode_constraint_binpacking_11, 5);
YAP_UserCPredicate("gecode_constraint_linear_201", gecode_constraint_linear_201, 6);
YAP_UserCPredicate("gecode_constraint_linear_205", gecode_constraint_linear_205, 6);
YAP_UserCPredicate("gecode_constraint_linear_177", gecode_constraint_linear_177, 6);
YAP_UserCPredicate("gecode_constraint_linear_181", gecode_constraint_linear_181, 6);
YAP_UserCPredicate("gecode_constraint_linear_192", gecode_constraint_linear_192, 6);
YAP_UserCPredicate("gecode_constraint_linear_195", gecode_constraint_linear_195, 6);
YAP_UserCPredicate("gecode_constraint_linear_196", gecode_constraint_linear_196, 6);
YAP_UserCPredicate("gecode_constraint_linear_199", gecode_constraint_linear_199, 6);
YAP_UserCPredicate("gecode_constraint_linear_184", gecode_constraint_linear_184, 6);
YAP_UserCPredicate("gecode_constraint_linear_187", gecode_constraint_linear_187, 6);
YAP_UserCPredicate("gecode_constraint_linear_188", gecode_constraint_linear_188, 6);
YAP_UserCPredicate("gecode_constraint_linear_191", gecode_constraint_linear_191, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_230", gecode_constraint_nooverlap_230, 7);
YAP_UserCPredicate("gecode_constraint_nooverlap_225", gecode_constraint_nooverlap_225, 7);
YAP_UserCPredicate("gecode_constraint_div_119", gecode_constraint_div_119, 5);
YAP_UserCPredicate("gecode_constraint_max_210", gecode_constraint_max_210, 4);
YAP_UserCPredicate("gecode_constraint_max_209", gecode_constraint_max_209, 4);
YAP_UserCPredicate("gecode_constraint_max_213", gecode_constraint_max_213, 4);
YAP_UserCPredicate("gecode_constraint_path_241", gecode_constraint_path_241, 8);
YAP_UserCPredicate("gecode_constraint_path_238", gecode_constraint_path_238, 8);
YAP_UserCPredicate("gecode_constraint_path_235", gecode_constraint_path_235, 8);
YAP_UserCPredicate("gecode_constraint_unary_332", gecode_constraint_unary_332, 5);
YAP_UserCPredicate("gecode_constraint_unary_335", gecode_constraint_unary_335, 5);
YAP_UserCPredicate("gecode_constraint_unary_328", gecode_constraint_unary_328, 5);
YAP_UserCPredicate("gecode_constraint_unary_331", gecode_constraint_unary_331, 5);
YAP_UserCPredicate("gecode_constraint_unary_325", gecode_constraint_unary_325, 5);
YAP_UserCPredicate("gecode_constraint_sorted_316", gecode_constraint_sorted_316, 4);
YAP_UserCPredicate("gecode_constraint_sorted_319", gecode_constraint_sorted_319, 4);
YAP_UserCPredicate("gecode_constraint_element_157", gecode_constraint_element_157, 8);
YAP_UserCPredicate("gecode_constraint_element_151", gecode_constraint_element_151, 8);
YAP_UserCPredicate("gecode_constraint_element_169", gecode_constraint_element_169, 8);
YAP_UserCPredicate("gecode_constraint_element_167", gecode_constraint_element_167, 8);
YAP_UserCPredicate("gecode_constraint_element_155", gecode_constraint_element_155, 5);
YAP_UserCPredicate("gecode_constraint_element_159", gecode_constraint_element_159, 5);
YAP_UserCPredicate("gecode_constraint_element_149", gecode_constraint_element_149, 5);
YAP_UserCPredicate("gecode_constraint_element_147", gecode_constraint_element_147, 5);
YAP_UserCPredicate("gecode_constraint_element_174", gecode_constraint_element_174, 5);
YAP_UserCPredicate("gecode_constraint_element_172", gecode_constraint_element_172, 5);
YAP_UserCPredicate("gecode_constraint_element_165", gecode_constraint_element_165, 5);
YAP_UserCPredicate("gecode_constraint_element_171", gecode_constraint_element_171, 5);
YAP_UserCPredicate("gecode_constraint_element_163", gecode_constraint_element_163, 5);
YAP_UserCPredicate("gecode_constraint_sequence_315", gecode_constraint_sequence_315, 3);
YAP_UserCPredicate("gecode_constraint_circuit_39", gecode_constraint_circuit_39, 7);
YAP_UserCPredicate("gecode_constraint_precede_250", gecode_constraint_precede_250, 3);
YAP_UserCPredicate("gecode_constraint_precede_246", gecode_constraint_precede_246, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_84", gecode_constraint_cumulative_84, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_80", gecode_constraint_cumulative_80, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_74", gecode_constraint_cumulative_74, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_77", gecode_constraint_cumulative_77, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_96", gecode_constraint_cumulative_96, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_92", gecode_constraint_cumulative_92, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_86", gecode_constraint_cumulative_86, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_89", gecode_constraint_cumulative_89, 6);
YAP_UserCPredicate("gecode_constraint_distinct_115", gecode_constraint_distinct_115, 4);
YAP_UserCPredicate("gecode_constraint_min_214", gecode_constraint_min_214, 3);
YAP_UserCPredicate("gecode_constraint_min_218", gecode_constraint_min_218, 3);
YAP_UserCPredicate("gecode_constraint_sqrt_323", gecode_constraint_sqrt_323, 4);
YAP_UserCPredicate("gecode_constraint_sequence_312", gecode_constraint_sequence_312, 6);
YAP_UserCPredicate("gecode_constraint_sequence_310", gecode_constraint_sequence_310, 6);
YAP_UserCPredicate("gecode_constraint_unshare_339", gecode_constraint_unshare_339, 3);
YAP_UserCPredicate("gecode_constraint_unshare_337", gecode_constraint_unshare_337, 3);
YAP_UserCPredicate("gecode_constraint_path_245", gecode_constraint_path_245, 6);
YAP_UserCPredicate("gecode_constraint_path_236", gecode_constraint_path_236, 6);
YAP_UserCPredicate("gecode_constraint_divmod_120", gecode_constraint_divmod_120, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_229", gecode_constraint_nooverlap_229, 9);
YAP_UserCPredicate("gecode_constraint_cumulative_76", gecode_constraint_cumulative_76, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_88", gecode_constraint_cumulative_88, 5);
YAP_UserCPredicate("gecode_constraint_count_67", gecode_constraint_count_67, 6);
YAP_UserCPredicate("gecode_constraint_count_69", gecode_constraint_count_69, 6);
YAP_UserCPredicate("gecode_constraint_count_71", gecode_constraint_count_71, 6);
YAP_UserCPredicate("gecode_constraint_count_73", gecode_constraint_count_73, 6);
YAP_UserCPredicate("gecode_constraint_count_53", gecode_constraint_count_53, 6);
YAP_UserCPredicate("gecode_constraint_count_55", gecode_constraint_count_55, 6);
YAP_UserCPredicate("gecode_constraint_notMin_233", gecode_constraint_notMin_233, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_83", gecode_constraint_cumulative_83, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_79", gecode_constraint_cumulative_79, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_95", gecode_constraint_cumulative_95, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_91", gecode_constraint_cumulative_91, 8);
YAP_UserCPredicate("gecode_constraint_branch_16", gecode_constraint_branch_16, 3);
YAP_UserCPredicate("gecode_constraint_branch_12", gecode_constraint_branch_12, 3);
YAP_UserCPredicate("gecode_constraint_branch_17", gecode_constraint_branch_17, 3);
YAP_UserCPredicate("gecode_constraint_dom_136", gecode_constraint_dom_136, 3);
YAP_UserCPredicate("gecode_constraint_dom_130", gecode_constraint_dom_130, 3);
YAP_UserCPredicate("gecode_constraint_dom_124", gecode_constraint_dom_124, 3);
YAP_UserCPredicate("gecode_constraint_dom_122", gecode_constraint_dom_122, 3);
YAP_UserCPredicate("gecode_constraint_linear_200", gecode_constraint_linear_200, 5);
YAP_UserCPredicate("gecode_constraint_linear_203", gecode_constraint_linear_203, 5);
YAP_UserCPredicate("gecode_constraint_linear_204", gecode_constraint_linear_204, 5);
YAP_UserCPredicate("gecode_constraint_linear_207", gecode_constraint_linear_207, 5);
YAP_UserCPredicate("gecode_constraint_linear_176", gecode_constraint_linear_176, 5);
YAP_UserCPredicate("gecode_constraint_linear_179", gecode_constraint_linear_179, 5);
YAP_UserCPredicate("gecode_constraint_linear_180", gecode_constraint_linear_180, 5);
YAP_UserCPredicate("gecode_constraint_linear_183", gecode_constraint_linear_183, 5);
YAP_UserCPredicate("gecode_constraint_linear_194", gecode_constraint_linear_194, 5);
YAP_UserCPredicate("gecode_constraint_linear_198", gecode_constraint_linear_198, 5);
YAP_UserCPredicate("gecode_constraint_linear_186", gecode_constraint_linear_186, 5);
YAP_UserCPredicate("gecode_constraint_linear_190", gecode_constraint_linear_190, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_224", gecode_constraint_nooverlap_224, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_227", gecode_constraint_nooverlap_227, 6);
YAP_UserCPredicate("gecode_constraint_element_175", gecode_constraint_element_175, 6);
YAP_UserCPredicate("gecode_constraint_element_173", gecode_constraint_element_173, 6);
YAP_UserCPredicate("gecode_constraint_rel_266", gecode_constraint_rel_266, 4);
YAP_UserCPredicate("gecode_constraint_rel_262", gecode_constraint_rel_262, 4);
YAP_UserCPredicate("gecode_constraint_rel_274", gecode_constraint_rel_274, 4);
YAP_UserCPredicate("gecode_constraint_rel_270", gecode_constraint_rel_270, 4);
YAP_UserCPredicate("gecode_constraint_rel_268", gecode_constraint_rel_268, 4);
YAP_UserCPredicate("gecode_constraint_rel_273", gecode_constraint_rel_273, 4);
YAP_UserCPredicate("gecode_constraint_rel_300", gecode_constraint_rel_300, 4);
YAP_UserCPredicate("gecode_constraint_rel_298", gecode_constraint_rel_298, 4);
YAP_UserCPredicate("gecode_constraint_rel_282", gecode_constraint_rel_282, 4);
YAP_UserCPredicate("gecode_constraint_rel_284", gecode_constraint_rel_284, 4);
YAP_UserCPredicate("gecode_constraint_rel_278", gecode_constraint_rel_278, 4);
YAP_UserCPredicate("gecode_constraint_rel_281", gecode_constraint_rel_281, 4);
YAP_UserCPredicate("gecode_constraint_rel_288", gecode_constraint_rel_288, 4);
YAP_UserCPredicate("gecode_constraint_rel_292", gecode_constraint_rel_292, 4);
YAP_UserCPredicate("gecode_constraint_rel_294", gecode_constraint_rel_294, 4);
YAP_UserCPredicate("gecode_constraint_rel_295", gecode_constraint_rel_295, 4);
YAP_UserCPredicate("gecode_constraint_rel_301", gecode_constraint_rel_301, 4);
YAP_UserCPredicate("gecode_constraint_rel_306", gecode_constraint_rel_306, 4);
YAP_UserCPredicate("gecode_constraint_rel_308", gecode_constraint_rel_308, 4);
YAP_UserCPredicate("gecode_constraint_rel_254", gecode_constraint_rel_254, 4);
YAP_UserCPredicate("gecode_constraint_rel_252", gecode_constraint_rel_252, 4);
YAP_UserCPredicate("gecode_constraint_min_217", gecode_constraint_min_217, 5);
YAP_UserCPredicate("gecode_constraint_count_64", gecode_constraint_count_64, 3);
YAP_UserCPredicate("gecode_constraint_count_58", gecode_constraint_count_58, 3);

View File

@ -0,0 +1 @@
3.7.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
static IntRelType gecode_IntRelType_from_term(YAP_Term);
static BoolOpType gecode_BoolOpType_from_term(YAP_Term);
static IntConLevel gecode_IntConLevel_from_term(YAP_Term);
static TaskType gecode_TaskType_from_term(YAP_Term);
static ExtensionalPropKind gecode_ExtensionalPropKind_from_term(YAP_Term);
static IntVarBranch gecode_IntVarBranch_from_term(YAP_Term);
static IntValBranch gecode_IntValBranch_from_term(YAP_Term);
static IntAssign gecode_IntAssign_from_term(YAP_Term);
static SetRelType gecode_SetRelType_from_term(YAP_Term);
static SetOpType gecode_SetOpType_from_term(YAP_Term);
static SetVarBranch gecode_SetVarBranch_from_term(YAP_Term);
static SetValBranch gecode_SetValBranch_from_term(YAP_Term);
static SetAssign gecode_SetAssign_from_term(YAP_Term);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,698 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
{ YAP_Atom X= YAP_LookupAtom("IRT_EQ");
gecode_IRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_NQ");
gecode_IRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LQ");
gecode_IRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LE");
gecode_IRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GQ");
gecode_IRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GR");
gecode_IRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_AND");
gecode_BOT_AND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_OR");
gecode_BOT_OR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_IMP");
gecode_BOT_IMP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_EQV");
gecode_BOT_EQV = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_XOR");
gecode_BOT_XOR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_VAL");
gecode_ICL_VAL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_BND");
gecode_ICL_BND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DOM");
gecode_ICL_DOM = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DEF");
gecode_ICL_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXP");
gecode_TT_FIXP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXS");
gecode_TT_FIXS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXE");
gecode_TT_FIXE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_DEF");
gecode_EPK_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_SPEED");
gecode_EPK_SPEED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_MEMORY");
gecode_EPK_MEMORY = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_NONE");
gecode_INT_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_RND");
gecode_INT_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MIN");
gecode_INT_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MAX");
gecode_INT_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MIN");
gecode_INT_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MAX");
gecode_INT_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MIN");
gecode_INT_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MAX");
gecode_INT_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MIN");
gecode_INT_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MAX");
gecode_INT_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MIN");
gecode_INT_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MAX");
gecode_INT_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MIN");
gecode_INT_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MAX");
gecode_INT_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MIN");
gecode_INT_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MAX");
gecode_INT_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MIN");
gecode_INT_VAR_REGRET_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MAX");
gecode_INT_VAR_REGRET_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MIN");
gecode_INT_VAR_REGRET_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MAX");
gecode_INT_VAR_REGRET_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MIN");
gecode_INT_VAL_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MED");
gecode_INT_VAL_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MAX");
gecode_INT_VAL_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RND");
gecode_INT_VAL_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MIN");
gecode_INT_VAL_SPLIT_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MAX");
gecode_INT_VAL_SPLIT_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MIN");
gecode_INT_VAL_RANGE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MAX");
gecode_INT_VAL_RANGE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MIN");
gecode_INT_VALUES_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MAX");
gecode_INT_VALUES_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MIN");
gecode_INT_ASSIGN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MED");
gecode_INT_ASSIGN_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MAX");
gecode_INT_ASSIGN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_RND");
gecode_INT_ASSIGN_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_EQ");
gecode_SRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_NQ");
gecode_SRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUB");
gecode_SRT_SUB = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUP");
gecode_SRT_SUP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ");
gecode_SRT_DISJ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL");
gecode_SRT_CMPL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_LQ");
gecode_SRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_LE");
gecode_SRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_GQ");
gecode_SRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_GR");
gecode_SRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_UNION");
gecode_SOT_UNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION");
gecode_SOT_DUNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_INTER");
gecode_SOT_INTER = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS");
gecode_SOT_MINUS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_NONE");
gecode_SET_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_RND");
gecode_SET_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MIN");
gecode_SET_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MAX");
gecode_SET_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MIN");
gecode_SET_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MAX");
gecode_SET_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MIN");
gecode_SET_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MAX");
gecode_SET_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MIN");
gecode_SET_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MAX");
gecode_SET_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MIN");
gecode_SET_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MAX");
gecode_SET_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MIN");
gecode_SET_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MAX");
gecode_SET_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MIN");
gecode_SET_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MAX");
gecode_SET_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_INC");
gecode_SET_VAL_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_EXC");
gecode_SET_VAL_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_INC");
gecode_SET_VAL_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_EXC");
gecode_SET_VAL_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_INC");
gecode_SET_VAL_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_EXC");
gecode_SET_VAL_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_INC");
gecode_SET_VAL_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_EXC");
gecode_SET_VAL_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_INC");
gecode_SET_ASSIGN_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_EXC");
gecode_SET_ASSIGN_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_INC");
gecode_SET_ASSIGN_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_EXC");
gecode_SET_ASSIGN_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_INC");
gecode_SET_ASSIGN_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_EXC");
gecode_SET_ASSIGN_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_INC");
gecode_SET_ASSIGN_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_EXC");
gecode_SET_ASSIGN_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
YAP_UserCPredicate("gecode_constraint_unary_357", gecode_constraint_unary_357, 6);
YAP_UserCPredicate("gecode_constraint_unary_353", gecode_constraint_unary_353, 6);
YAP_UserCPredicate("gecode_constraint_nvalues_255", gecode_constraint_nvalues_255, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_257", gecode_constraint_nvalues_257, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_251", gecode_constraint_nvalues_251, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_253", gecode_constraint_nvalues_253, 5);
YAP_UserCPredicate("gecode_constraint_max_218", gecode_constraint_max_218, 4);
YAP_UserCPredicate("gecode_constraint_max_217", gecode_constraint_max_217, 4);
YAP_UserCPredicate("gecode_constraint_max_221", gecode_constraint_max_221, 4);
YAP_UserCPredicate("gecode_constraint_dom_139", gecode_constraint_dom_139, 6);
YAP_UserCPredicate("gecode_constraint_dom_149", gecode_constraint_dom_149, 6);
YAP_UserCPredicate("gecode_constraint_convex_51", gecode_constraint_convex_51, 3);
YAP_UserCPredicate("gecode_constraint_nooverlap_242", gecode_constraint_nooverlap_242, 5);
YAP_UserCPredicate("gecode_constraint_assign_4", gecode_constraint_assign_4, 3);
YAP_UserCPredicate("gecode_constraint_assign_3", gecode_constraint_assign_3, 3);
YAP_UserCPredicate("gecode_constraint_assign_5", gecode_constraint_assign_5, 3);
YAP_UserCPredicate("gecode_constraint_assign_7", gecode_constraint_assign_7, 3);
YAP_UserCPredicate("gecode_constraint_assign_6", gecode_constraint_assign_6, 3);
YAP_UserCPredicate("gecode_constraint_assign_8", gecode_constraint_assign_8, 3);
YAP_UserCPredicate("gecode_constraint_element_158", gecode_constraint_element_158, 4);
YAP_UserCPredicate("gecode_constraint_element_162", gecode_constraint_element_162, 4);
YAP_UserCPredicate("gecode_constraint_element_152", gecode_constraint_element_152, 4);
YAP_UserCPredicate("gecode_constraint_element_150", gecode_constraint_element_150, 4);
YAP_UserCPredicate("gecode_constraint_element_157", gecode_constraint_element_157, 4);
YAP_UserCPredicate("gecode_constraint_element_165", gecode_constraint_element_165, 4);
YAP_UserCPredicate("gecode_constraint_element_168", gecode_constraint_element_168, 4);
YAP_UserCPredicate("gecode_constraint_element_174", gecode_constraint_element_174, 4);
YAP_UserCPredicate("gecode_constraint_element_166", gecode_constraint_element_166, 4);
YAP_UserCPredicate("gecode_constraint_sequence_338", gecode_constraint_sequence_338, 2);
YAP_UserCPredicate("gecode_constraint_notMax_248", gecode_constraint_notMax_248, 3);
YAP_UserCPredicate("gecode_constraint_unary_350", gecode_constraint_unary_350, 3);
YAP_UserCPredicate("gecode_constraint_circuit_45", gecode_constraint_circuit_45, 4);
YAP_UserCPredicate("gecode_constraint_circuit_36", gecode_constraint_circuit_36, 4);
YAP_UserCPredicate("gecode_constraint_dom_138", gecode_constraint_dom_138, 5);
YAP_UserCPredicate("gecode_constraint_dom_143", gecode_constraint_dom_143, 5);
YAP_UserCPredicate("gecode_constraint_dom_137", gecode_constraint_dom_137, 5);
YAP_UserCPredicate("gecode_constraint_dom_133", gecode_constraint_dom_133, 5);
YAP_UserCPredicate("gecode_constraint_dom_131", gecode_constraint_dom_131, 5);
YAP_UserCPredicate("gecode_constraint_dom_148", gecode_constraint_dom_148, 5);
YAP_UserCPredicate("gecode_constraint_dom_147", gecode_constraint_dom_147, 5);
YAP_UserCPredicate("gecode_constraint_dom_145", gecode_constraint_dom_145, 5);
YAP_UserCPredicate("gecode_constraint_channel_32", gecode_constraint_channel_32, 4);
YAP_UserCPredicate("gecode_constraint_channel_27", gecode_constraint_channel_27, 4);
YAP_UserCPredicate("gecode_constraint_channel_23", gecode_constraint_channel_23, 4);
YAP_UserCPredicate("gecode_constraint_channel_21", gecode_constraint_channel_21, 4);
YAP_UserCPredicate("gecode_constraint_nooverlap_244", gecode_constraint_nooverlap_244, 8);
YAP_UserCPredicate("gecode_constraint_nooverlap_247", gecode_constraint_nooverlap_247, 8);
YAP_UserCPredicate("gecode_constraint_element_160", gecode_constraint_element_160, 7);
YAP_UserCPredicate("gecode_constraint_element_154", gecode_constraint_element_154, 7);
YAP_UserCPredicate("gecode_constraint_element_156", gecode_constraint_element_156, 7);
YAP_UserCPredicate("gecode_constraint_element_164", gecode_constraint_element_164, 7);
YAP_UserCPredicate("gecode_constraint_element_172", gecode_constraint_element_172, 7);
YAP_UserCPredicate("gecode_constraint_element_170", gecode_constraint_element_170, 7);
YAP_UserCPredicate("gecode_constraint_max_216", gecode_constraint_max_216, 3);
YAP_UserCPredicate("gecode_constraint_max_220", gecode_constraint_max_220, 3);
YAP_UserCPredicate("gecode_constraint_unshare_362", gecode_constraint_unshare_362, 2);
YAP_UserCPredicate("gecode_constraint_unshare_360", gecode_constraint_unshare_360, 2);
YAP_UserCPredicate("gecode_constraint_path_268", gecode_constraint_path_268, 5);
YAP_UserCPredicate("gecode_constraint_path_267", gecode_constraint_path_267, 5);
YAP_UserCPredicate("gecode_constraint_mult_238", gecode_constraint_mult_238, 4);
YAP_UserCPredicate("gecode_constraint_clause_49", gecode_constraint_clause_49, 6);
YAP_UserCPredicate("gecode_constraint_clause_47", gecode_constraint_clause_47, 6);
YAP_UserCPredicate("gecode_constraint_precede_273", gecode_constraint_precede_273, 5);
YAP_UserCPredicate("gecode_constraint_distinct_120", gecode_constraint_distinct_120, 2);
YAP_UserCPredicate("gecode_constraint_member_226", gecode_constraint_member_226, 4);
YAP_UserCPredicate("gecode_constraint_member_229", gecode_constraint_member_229, 4);
YAP_UserCPredicate("gecode_constraint_member_222", gecode_constraint_member_222, 4);
YAP_UserCPredicate("gecode_constraint_member_225", gecode_constraint_member_225, 4);
YAP_UserCPredicate("gecode_constraint_mod_237", gecode_constraint_mod_237, 5);
YAP_UserCPredicate("gecode_constraint_cardinality_18", gecode_constraint_cardinality_18, 3);
YAP_UserCPredicate("gecode_constraint_atmostOne_9", gecode_constraint_atmostOne_9, 3);
YAP_UserCPredicate("gecode_constraint_channelSorted_33", gecode_constraint_channelSorted_33, 3);
YAP_UserCPredicate("gecode_constraint_linear_210", gecode_constraint_linear_210, 4);
YAP_UserCPredicate("gecode_constraint_linear_214", gecode_constraint_linear_214, 4);
YAP_UserCPredicate("gecode_constraint_linear_186", gecode_constraint_linear_186, 4);
YAP_UserCPredicate("gecode_constraint_linear_190", gecode_constraint_linear_190, 4);
YAP_UserCPredicate("gecode_constraint_circuit_42", gecode_constraint_circuit_42, 2);
YAP_UserCPredicate("gecode_constraint_rel_288", gecode_constraint_rel_288, 5);
YAP_UserCPredicate("gecode_constraint_rel_291", gecode_constraint_rel_291, 5);
YAP_UserCPredicate("gecode_constraint_rel_284", gecode_constraint_rel_284, 5);
YAP_UserCPredicate("gecode_constraint_rel_287", gecode_constraint_rel_287, 5);
YAP_UserCPredicate("gecode_constraint_rel_282", gecode_constraint_rel_282, 5);
YAP_UserCPredicate("gecode_constraint_rel_280", gecode_constraint_rel_280, 5);
YAP_UserCPredicate("gecode_constraint_rel_299", gecode_constraint_rel_299, 5);
YAP_UserCPredicate("gecode_constraint_rel_295", gecode_constraint_rel_295, 5);
YAP_UserCPredicate("gecode_constraint_rel_293", gecode_constraint_rel_293, 5);
YAP_UserCPredicate("gecode_constraint_rel_323", gecode_constraint_rel_323, 5);
YAP_UserCPredicate("gecode_constraint_rel_321", gecode_constraint_rel_321, 5);
YAP_UserCPredicate("gecode_constraint_rel_307", gecode_constraint_rel_307, 5);
YAP_UserCPredicate("gecode_constraint_rel_309", gecode_constraint_rel_309, 5);
YAP_UserCPredicate("gecode_constraint_rel_303", gecode_constraint_rel_303, 5);
YAP_UserCPredicate("gecode_constraint_rel_310", gecode_constraint_rel_310, 5);
YAP_UserCPredicate("gecode_constraint_rel_313", gecode_constraint_rel_313, 5);
YAP_UserCPredicate("gecode_constraint_rel_314", gecode_constraint_rel_314, 5);
YAP_UserCPredicate("gecode_constraint_rel_317", gecode_constraint_rel_317, 5);
YAP_UserCPredicate("gecode_constraint_rel_320", gecode_constraint_rel_320, 5);
YAP_UserCPredicate("gecode_constraint_rel_331", gecode_constraint_rel_331, 5);
YAP_UserCPredicate("gecode_constraint_rel_333", gecode_constraint_rel_333, 5);
YAP_UserCPredicate("gecode_constraint_rel_279", gecode_constraint_rel_279, 5);
YAP_UserCPredicate("gecode_constraint_rel_277", gecode_constraint_rel_277, 5);
YAP_UserCPredicate("gecode_constraint_min_232", gecode_constraint_min_232, 4);
YAP_UserCPredicate("gecode_constraint_min_231", gecode_constraint_min_231, 4);
YAP_UserCPredicate("gecode_constraint_min_235", gecode_constraint_min_235, 4);
YAP_UserCPredicate("gecode_constraint_cardinality_19", gecode_constraint_cardinality_19, 4);
YAP_UserCPredicate("gecode_constraint_count_69", gecode_constraint_count_69, 4);
YAP_UserCPredicate("gecode_constraint_count_66", gecode_constraint_count_66, 4);
YAP_UserCPredicate("gecode_constraint_count_60", gecode_constraint_count_60, 4);
YAP_UserCPredicate("gecode_constraint_count_59", gecode_constraint_count_59, 4);
YAP_UserCPredicate("gecode_constraint_count_56", gecode_constraint_count_56, 4);
YAP_UserCPredicate("gecode_constraint_sqrt_346", gecode_constraint_sqrt_346, 3);
YAP_UserCPredicate("gecode_constraint_cumulatives_117", gecode_constraint_cumulatives_117, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_115", gecode_constraint_cumulatives_115, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_113", gecode_constraint_cumulatives_113, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_111", gecode_constraint_cumulatives_111, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_109", gecode_constraint_cumulatives_109, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_107", gecode_constraint_cumulatives_107, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_105", gecode_constraint_cumulatives_105, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_103", gecode_constraint_cumulatives_103, 9);
YAP_UserCPredicate("gecode_constraint_nvalues_254", gecode_constraint_nvalues_254, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_256", gecode_constraint_nvalues_256, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_250", gecode_constraint_nvalues_250, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_252", gecode_constraint_nvalues_252, 4);
YAP_UserCPredicate("gecode_constraint_binpacking_10", gecode_constraint_binpacking_10, 4);
YAP_UserCPredicate("gecode_constraint_linear_201", gecode_constraint_linear_201, 7);
YAP_UserCPredicate("gecode_constraint_linear_205", gecode_constraint_linear_205, 7);
YAP_UserCPredicate("gecode_constraint_linear_193", gecode_constraint_linear_193, 7);
YAP_UserCPredicate("gecode_constraint_linear_197", gecode_constraint_linear_197, 7);
YAP_UserCPredicate("gecode_constraint_abs_2", gecode_constraint_abs_2, 4);
YAP_UserCPredicate("gecode_constraint_convex_50", gecode_constraint_convex_50, 2);
YAP_UserCPredicate("gecode_constraint_div_122", gecode_constraint_div_122, 4);
YAP_UserCPredicate("gecode_constraint_rel_311", gecode_constraint_rel_311, 6);
YAP_UserCPredicate("gecode_constraint_rel_315", gecode_constraint_rel_315, 6);
YAP_UserCPredicate("gecode_constraint_rel_300", gecode_constraint_rel_300, 6);
YAP_UserCPredicate("gecode_constraint_rel_301", gecode_constraint_rel_301, 6);
YAP_UserCPredicate("gecode_constraint_rel_289", gecode_constraint_rel_289, 6);
YAP_UserCPredicate("gecode_constraint_rel_285", gecode_constraint_rel_285, 6);
YAP_UserCPredicate("gecode_constraint_rel_283", gecode_constraint_rel_283, 6);
YAP_UserCPredicate("gecode_constraint_rel_281", gecode_constraint_rel_281, 6);
YAP_UserCPredicate("gecode_constraint_rel_326", gecode_constraint_rel_326, 6);
YAP_UserCPredicate("gecode_constraint_rel_327", gecode_constraint_rel_327, 6);
YAP_UserCPredicate("gecode_constraint_rel_328", gecode_constraint_rel_328, 6);
YAP_UserCPredicate("gecode_constraint_rel_329", gecode_constraint_rel_329, 6);
YAP_UserCPredicate("gecode_constraint_weights_364", gecode_constraint_weights_364, 5);
YAP_UserCPredicate("gecode_constraint_max_219", gecode_constraint_max_219, 5);
YAP_UserCPredicate("gecode_constraint_path_263", gecode_constraint_path_263, 9);
YAP_UserCPredicate("gecode_constraint_unary_358", gecode_constraint_unary_358, 4);
YAP_UserCPredicate("gecode_constraint_unary_354", gecode_constraint_unary_354, 4);
YAP_UserCPredicate("gecode_constraint_unary_348", gecode_constraint_unary_348, 4);
YAP_UserCPredicate("gecode_constraint_unary_351", gecode_constraint_unary_351, 4);
YAP_UserCPredicate("gecode_constraint_sorted_341", gecode_constraint_sorted_341, 5);
YAP_UserCPredicate("gecode_constraint_circuit_40", gecode_constraint_circuit_40, 5);
YAP_UserCPredicate("gecode_constraint_circuit_37", gecode_constraint_circuit_37, 5);
YAP_UserCPredicate("gecode_constraint_circuit_34", gecode_constraint_circuit_34, 5);
YAP_UserCPredicate("gecode_constraint_dom_142", gecode_constraint_dom_142, 4);
YAP_UserCPredicate("gecode_constraint_dom_136", gecode_constraint_dom_136, 4);
YAP_UserCPredicate("gecode_constraint_dom_141", gecode_constraint_dom_141, 4);
YAP_UserCPredicate("gecode_constraint_dom_132", gecode_constraint_dom_132, 4);
YAP_UserCPredicate("gecode_constraint_dom_135", gecode_constraint_dom_135, 4);
YAP_UserCPredicate("gecode_constraint_dom_130", gecode_constraint_dom_130, 4);
YAP_UserCPredicate("gecode_constraint_dom_129", gecode_constraint_dom_129, 4);
YAP_UserCPredicate("gecode_constraint_dom_127", gecode_constraint_dom_127, 4);
YAP_UserCPredicate("gecode_constraint_dom_146", gecode_constraint_dom_146, 4);
YAP_UserCPredicate("gecode_constraint_dom_144", gecode_constraint_dom_144, 4);
YAP_UserCPredicate("gecode_constraint_abs_1", gecode_constraint_abs_1, 3);
YAP_UserCPredicate("gecode_constraint_channel_29", gecode_constraint_channel_29, 5);
YAP_UserCPredicate("gecode_constraint_channel_24", gecode_constraint_channel_24, 5);
YAP_UserCPredicate("gecode_constraint_rel_304", gecode_constraint_rel_304, 3);
YAP_UserCPredicate("gecode_constraint_rel_296", gecode_constraint_rel_296, 3);
YAP_UserCPredicate("gecode_constraint_path_266", gecode_constraint_path_266, 4);
YAP_UserCPredicate("gecode_constraint_branch_14", gecode_constraint_branch_14, 4);
YAP_UserCPredicate("gecode_constraint_branch_13", gecode_constraint_branch_13, 4);
YAP_UserCPredicate("gecode_constraint_branch_15", gecode_constraint_branch_15, 4);
YAP_UserCPredicate("gecode_constraint_mult_239", gecode_constraint_mult_239, 5);
YAP_UserCPredicate("gecode_constraint_circuit_41", gecode_constraint_circuit_41, 6);
YAP_UserCPredicate("gecode_constraint_circuit_38", gecode_constraint_circuit_38, 6);
YAP_UserCPredicate("gecode_constraint_circuit_35", gecode_constraint_circuit_35, 6);
YAP_UserCPredicate("gecode_constraint_clause_48", gecode_constraint_clause_48, 5);
YAP_UserCPredicate("gecode_constraint_clause_46", gecode_constraint_clause_46, 5);
YAP_UserCPredicate("gecode_constraint_precede_275", gecode_constraint_precede_275, 4);
YAP_UserCPredicate("gecode_constraint_precede_272", gecode_constraint_precede_272, 4);
YAP_UserCPredicate("gecode_constraint_precede_271", gecode_constraint_precede_271, 4);
YAP_UserCPredicate("gecode_constraint_channel_30", gecode_constraint_channel_30, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_86", gecode_constraint_cumulative_86, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_89", gecode_constraint_cumulative_89, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_82", gecode_constraint_cumulative_82, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_85", gecode_constraint_cumulative_85, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_79", gecode_constraint_cumulative_79, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_98", gecode_constraint_cumulative_98, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_101", gecode_constraint_cumulative_101, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_94", gecode_constraint_cumulative_94, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_97", gecode_constraint_cumulative_97, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_91", gecode_constraint_cumulative_91, 7);
YAP_UserCPredicate("gecode_constraint_distinct_121", gecode_constraint_distinct_121, 3);
YAP_UserCPredicate("gecode_constraint_distinct_118", gecode_constraint_distinct_118, 3);
YAP_UserCPredicate("gecode_constraint_member_227", gecode_constraint_member_227, 5);
YAP_UserCPredicate("gecode_constraint_member_223", gecode_constraint_member_223, 5);
YAP_UserCPredicate("gecode_constraint_mod_236", gecode_constraint_mod_236, 4);
YAP_UserCPredicate("gecode_constraint_sqr_344", gecode_constraint_sqr_344, 3);
YAP_UserCPredicate("gecode_constraint_sequence_337", gecode_constraint_sequence_337, 7);
YAP_UserCPredicate("gecode_constraint_sequence_335", gecode_constraint_sequence_335, 7);
YAP_UserCPredicate("gecode_constraint_path_264", gecode_constraint_path_264, 7);
YAP_UserCPredicate("gecode_constraint_path_261", gecode_constraint_path_261, 7);
YAP_UserCPredicate("gecode_constraint_path_258", gecode_constraint_path_258, 7);
YAP_UserCPredicate("gecode_constraint_divmod_125", gecode_constraint_divmod_125, 6);
YAP_UserCPredicate("gecode_constraint_sorted_342", gecode_constraint_sorted_342, 3);
YAP_UserCPredicate("gecode_constraint_circuit_44", gecode_constraint_circuit_44, 3);
YAP_UserCPredicate("gecode_constraint_circuit_43", gecode_constraint_circuit_43, 3);
YAP_UserCPredicate("gecode_constraint_channel_31", gecode_constraint_channel_31, 3);
YAP_UserCPredicate("gecode_constraint_channel_28", gecode_constraint_channel_28, 3);
YAP_UserCPredicate("gecode_constraint_channel_26", gecode_constraint_channel_26, 3);
YAP_UserCPredicate("gecode_constraint_channel_22", gecode_constraint_channel_22, 3);
YAP_UserCPredicate("gecode_constraint_channel_25", gecode_constraint_channel_25, 3);
YAP_UserCPredicate("gecode_constraint_channel_20", gecode_constraint_channel_20, 3);
YAP_UserCPredicate("gecode_constraint_count_52", gecode_constraint_count_52, 5);
YAP_UserCPredicate("gecode_constraint_count_54", gecode_constraint_count_54, 5);
YAP_UserCPredicate("gecode_constraint_count_70", gecode_constraint_count_70, 5);
YAP_UserCPredicate("gecode_constraint_count_72", gecode_constraint_count_72, 5);
YAP_UserCPredicate("gecode_constraint_count_62", gecode_constraint_count_62, 5);
YAP_UserCPredicate("gecode_constraint_count_64", gecode_constraint_count_64, 5);
YAP_UserCPredicate("gecode_constraint_count_61", gecode_constraint_count_61, 5);
YAP_UserCPredicate("gecode_constraint_count_57", gecode_constraint_count_57, 5);
YAP_UserCPredicate("gecode_constraint_count_67", gecode_constraint_count_67, 5);
YAP_UserCPredicate("gecode_constraint_count_74", gecode_constraint_count_74, 5);
YAP_UserCPredicate("gecode_constraint_count_76", gecode_constraint_count_76, 5);
YAP_UserCPredicate("gecode_constraint_cumulatives_116", gecode_constraint_cumulatives_116, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_114", gecode_constraint_cumulatives_114, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_112", gecode_constraint_cumulatives_112, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_110", gecode_constraint_cumulatives_110, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_108", gecode_constraint_cumulatives_108, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_106", gecode_constraint_cumulatives_106, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_104", gecode_constraint_cumulatives_104, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_102", gecode_constraint_cumulatives_102, 8);
YAP_UserCPredicate("gecode_constraint_binpacking_11", gecode_constraint_binpacking_11, 5);
YAP_UserCPredicate("gecode_constraint_linear_209", gecode_constraint_linear_209, 6);
YAP_UserCPredicate("gecode_constraint_linear_213", gecode_constraint_linear_213, 6);
YAP_UserCPredicate("gecode_constraint_linear_185", gecode_constraint_linear_185, 6);
YAP_UserCPredicate("gecode_constraint_linear_189", gecode_constraint_linear_189, 6);
YAP_UserCPredicate("gecode_constraint_linear_200", gecode_constraint_linear_200, 6);
YAP_UserCPredicate("gecode_constraint_linear_203", gecode_constraint_linear_203, 6);
YAP_UserCPredicate("gecode_constraint_linear_204", gecode_constraint_linear_204, 6);
YAP_UserCPredicate("gecode_constraint_linear_207", gecode_constraint_linear_207, 6);
YAP_UserCPredicate("gecode_constraint_linear_192", gecode_constraint_linear_192, 6);
YAP_UserCPredicate("gecode_constraint_linear_195", gecode_constraint_linear_195, 6);
YAP_UserCPredicate("gecode_constraint_linear_196", gecode_constraint_linear_196, 6);
YAP_UserCPredicate("gecode_constraint_linear_199", gecode_constraint_linear_199, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_246", gecode_constraint_nooverlap_246, 7);
YAP_UserCPredicate("gecode_constraint_nooverlap_241", gecode_constraint_nooverlap_241, 7);
YAP_UserCPredicate("gecode_constraint_div_123", gecode_constraint_div_123, 5);
YAP_UserCPredicate("gecode_constraint_sqr_345", gecode_constraint_sqr_345, 4);
YAP_UserCPredicate("gecode_constraint_path_265", gecode_constraint_path_265, 8);
YAP_UserCPredicate("gecode_constraint_path_262", gecode_constraint_path_262, 8);
YAP_UserCPredicate("gecode_constraint_path_259", gecode_constraint_path_259, 8);
YAP_UserCPredicate("gecode_constraint_unary_356", gecode_constraint_unary_356, 5);
YAP_UserCPredicate("gecode_constraint_unary_359", gecode_constraint_unary_359, 5);
YAP_UserCPredicate("gecode_constraint_unary_352", gecode_constraint_unary_352, 5);
YAP_UserCPredicate("gecode_constraint_unary_355", gecode_constraint_unary_355, 5);
YAP_UserCPredicate("gecode_constraint_unary_349", gecode_constraint_unary_349, 5);
YAP_UserCPredicate("gecode_constraint_sorted_340", gecode_constraint_sorted_340, 4);
YAP_UserCPredicate("gecode_constraint_sorted_343", gecode_constraint_sorted_343, 4);
YAP_UserCPredicate("gecode_constraint_element_161", gecode_constraint_element_161, 8);
YAP_UserCPredicate("gecode_constraint_element_155", gecode_constraint_element_155, 8);
YAP_UserCPredicate("gecode_constraint_element_173", gecode_constraint_element_173, 8);
YAP_UserCPredicate("gecode_constraint_element_171", gecode_constraint_element_171, 8);
YAP_UserCPredicate("gecode_constraint_element_159", gecode_constraint_element_159, 5);
YAP_UserCPredicate("gecode_constraint_element_163", gecode_constraint_element_163, 5);
YAP_UserCPredicate("gecode_constraint_element_153", gecode_constraint_element_153, 5);
YAP_UserCPredicate("gecode_constraint_element_151", gecode_constraint_element_151, 5);
YAP_UserCPredicate("gecode_constraint_element_182", gecode_constraint_element_182, 5);
YAP_UserCPredicate("gecode_constraint_element_180", gecode_constraint_element_180, 5);
YAP_UserCPredicate("gecode_constraint_element_178", gecode_constraint_element_178, 5);
YAP_UserCPredicate("gecode_constraint_element_176", gecode_constraint_element_176, 5);
YAP_UserCPredicate("gecode_constraint_element_169", gecode_constraint_element_169, 5);
YAP_UserCPredicate("gecode_constraint_element_175", gecode_constraint_element_175, 5);
YAP_UserCPredicate("gecode_constraint_element_167", gecode_constraint_element_167, 5);
YAP_UserCPredicate("gecode_constraint_sequence_339", gecode_constraint_sequence_339, 3);
YAP_UserCPredicate("gecode_constraint_circuit_39", gecode_constraint_circuit_39, 7);
YAP_UserCPredicate("gecode_constraint_precede_274", gecode_constraint_precede_274, 3);
YAP_UserCPredicate("gecode_constraint_precede_270", gecode_constraint_precede_270, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_88", gecode_constraint_cumulative_88, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_84", gecode_constraint_cumulative_84, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_78", gecode_constraint_cumulative_78, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_81", gecode_constraint_cumulative_81, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_100", gecode_constraint_cumulative_100, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_96", gecode_constraint_cumulative_96, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_90", gecode_constraint_cumulative_90, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_93", gecode_constraint_cumulative_93, 6);
YAP_UserCPredicate("gecode_constraint_distinct_119", gecode_constraint_distinct_119, 4);
YAP_UserCPredicate("gecode_constraint_min_230", gecode_constraint_min_230, 3);
YAP_UserCPredicate("gecode_constraint_min_234", gecode_constraint_min_234, 3);
YAP_UserCPredicate("gecode_constraint_sqrt_347", gecode_constraint_sqrt_347, 4);
YAP_UserCPredicate("gecode_constraint_sequence_336", gecode_constraint_sequence_336, 6);
YAP_UserCPredicate("gecode_constraint_sequence_334", gecode_constraint_sequence_334, 6);
YAP_UserCPredicate("gecode_constraint_unshare_363", gecode_constraint_unshare_363, 3);
YAP_UserCPredicate("gecode_constraint_unshare_361", gecode_constraint_unshare_361, 3);
YAP_UserCPredicate("gecode_constraint_path_269", gecode_constraint_path_269, 6);
YAP_UserCPredicate("gecode_constraint_path_260", gecode_constraint_path_260, 6);
YAP_UserCPredicate("gecode_constraint_divmod_124", gecode_constraint_divmod_124, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_245", gecode_constraint_nooverlap_245, 9);
YAP_UserCPredicate("gecode_constraint_cumulative_80", gecode_constraint_cumulative_80, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_92", gecode_constraint_cumulative_92, 5);
YAP_UserCPredicate("gecode_constraint_member_228", gecode_constraint_member_228, 3);
YAP_UserCPredicate("gecode_constraint_member_224", gecode_constraint_member_224, 3);
YAP_UserCPredicate("gecode_constraint_count_71", gecode_constraint_count_71, 6);
YAP_UserCPredicate("gecode_constraint_count_73", gecode_constraint_count_73, 6);
YAP_UserCPredicate("gecode_constraint_count_75", gecode_constraint_count_75, 6);
YAP_UserCPredicate("gecode_constraint_count_77", gecode_constraint_count_77, 6);
YAP_UserCPredicate("gecode_constraint_count_63", gecode_constraint_count_63, 6);
YAP_UserCPredicate("gecode_constraint_count_65", gecode_constraint_count_65, 6);
YAP_UserCPredicate("gecode_constraint_count_53", gecode_constraint_count_53, 6);
YAP_UserCPredicate("gecode_constraint_count_55", gecode_constraint_count_55, 6);
YAP_UserCPredicate("gecode_constraint_notMin_249", gecode_constraint_notMin_249, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_87", gecode_constraint_cumulative_87, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_83", gecode_constraint_cumulative_83, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_99", gecode_constraint_cumulative_99, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_95", gecode_constraint_cumulative_95, 8);
YAP_UserCPredicate("gecode_constraint_branch_16", gecode_constraint_branch_16, 3);
YAP_UserCPredicate("gecode_constraint_branch_12", gecode_constraint_branch_12, 3);
YAP_UserCPredicate("gecode_constraint_branch_17", gecode_constraint_branch_17, 3);
YAP_UserCPredicate("gecode_constraint_dom_140", gecode_constraint_dom_140, 3);
YAP_UserCPredicate("gecode_constraint_dom_134", gecode_constraint_dom_134, 3);
YAP_UserCPredicate("gecode_constraint_dom_128", gecode_constraint_dom_128, 3);
YAP_UserCPredicate("gecode_constraint_dom_126", gecode_constraint_dom_126, 3);
YAP_UserCPredicate("gecode_constraint_linear_208", gecode_constraint_linear_208, 5);
YAP_UserCPredicate("gecode_constraint_linear_211", gecode_constraint_linear_211, 5);
YAP_UserCPredicate("gecode_constraint_linear_212", gecode_constraint_linear_212, 5);
YAP_UserCPredicate("gecode_constraint_linear_215", gecode_constraint_linear_215, 5);
YAP_UserCPredicate("gecode_constraint_linear_184", gecode_constraint_linear_184, 5);
YAP_UserCPredicate("gecode_constraint_linear_187", gecode_constraint_linear_187, 5);
YAP_UserCPredicate("gecode_constraint_linear_188", gecode_constraint_linear_188, 5);
YAP_UserCPredicate("gecode_constraint_linear_191", gecode_constraint_linear_191, 5);
YAP_UserCPredicate("gecode_constraint_linear_202", gecode_constraint_linear_202, 5);
YAP_UserCPredicate("gecode_constraint_linear_206", gecode_constraint_linear_206, 5);
YAP_UserCPredicate("gecode_constraint_linear_194", gecode_constraint_linear_194, 5);
YAP_UserCPredicate("gecode_constraint_linear_198", gecode_constraint_linear_198, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_240", gecode_constraint_nooverlap_240, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_243", gecode_constraint_nooverlap_243, 6);
YAP_UserCPredicate("gecode_constraint_element_183", gecode_constraint_element_183, 6);
YAP_UserCPredicate("gecode_constraint_element_181", gecode_constraint_element_181, 6);
YAP_UserCPredicate("gecode_constraint_element_179", gecode_constraint_element_179, 6);
YAP_UserCPredicate("gecode_constraint_element_177", gecode_constraint_element_177, 6);
YAP_UserCPredicate("gecode_constraint_rel_290", gecode_constraint_rel_290, 4);
YAP_UserCPredicate("gecode_constraint_rel_286", gecode_constraint_rel_286, 4);
YAP_UserCPredicate("gecode_constraint_rel_298", gecode_constraint_rel_298, 4);
YAP_UserCPredicate("gecode_constraint_rel_294", gecode_constraint_rel_294, 4);
YAP_UserCPredicate("gecode_constraint_rel_292", gecode_constraint_rel_292, 4);
YAP_UserCPredicate("gecode_constraint_rel_297", gecode_constraint_rel_297, 4);
YAP_UserCPredicate("gecode_constraint_rel_324", gecode_constraint_rel_324, 4);
YAP_UserCPredicate("gecode_constraint_rel_322", gecode_constraint_rel_322, 4);
YAP_UserCPredicate("gecode_constraint_rel_306", gecode_constraint_rel_306, 4);
YAP_UserCPredicate("gecode_constraint_rel_308", gecode_constraint_rel_308, 4);
YAP_UserCPredicate("gecode_constraint_rel_302", gecode_constraint_rel_302, 4);
YAP_UserCPredicate("gecode_constraint_rel_305", gecode_constraint_rel_305, 4);
YAP_UserCPredicate("gecode_constraint_rel_312", gecode_constraint_rel_312, 4);
YAP_UserCPredicate("gecode_constraint_rel_316", gecode_constraint_rel_316, 4);
YAP_UserCPredicate("gecode_constraint_rel_318", gecode_constraint_rel_318, 4);
YAP_UserCPredicate("gecode_constraint_rel_319", gecode_constraint_rel_319, 4);
YAP_UserCPredicate("gecode_constraint_rel_325", gecode_constraint_rel_325, 4);
YAP_UserCPredicate("gecode_constraint_rel_330", gecode_constraint_rel_330, 4);
YAP_UserCPredicate("gecode_constraint_rel_332", gecode_constraint_rel_332, 4);
YAP_UserCPredicate("gecode_constraint_rel_278", gecode_constraint_rel_278, 4);
YAP_UserCPredicate("gecode_constraint_rel_276", gecode_constraint_rel_276, 4);
YAP_UserCPredicate("gecode_constraint_min_233", gecode_constraint_min_233, 5);
YAP_UserCPredicate("gecode_constraint_count_68", gecode_constraint_count_68, 3);
YAP_UserCPredicate("gecode_constraint_count_58", gecode_constraint_count_58, 3);

View File

@ -0,0 +1 @@
3.7.1

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
static IntRelType gecode_IntRelType_from_term(YAP_Term);
static BoolOpType gecode_BoolOpType_from_term(YAP_Term);
static IntConLevel gecode_IntConLevel_from_term(YAP_Term);
static TaskType gecode_TaskType_from_term(YAP_Term);
static ExtensionalPropKind gecode_ExtensionalPropKind_from_term(YAP_Term);
static IntVarBranch gecode_IntVarBranch_from_term(YAP_Term);
static IntValBranch gecode_IntValBranch_from_term(YAP_Term);
static IntAssign gecode_IntAssign_from_term(YAP_Term);
static SetRelType gecode_SetRelType_from_term(YAP_Term);
static SetOpType gecode_SetOpType_from_term(YAP_Term);
static SetVarBranch gecode_SetVarBranch_from_term(YAP_Term);
static SetValBranch gecode_SetValBranch_from_term(YAP_Term);
static SetAssign gecode_SetAssign_from_term(YAP_Term);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,698 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
{ YAP_Atom X= YAP_LookupAtom("IRT_EQ");
gecode_IRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_NQ");
gecode_IRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LQ");
gecode_IRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LE");
gecode_IRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GQ");
gecode_IRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GR");
gecode_IRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_AND");
gecode_BOT_AND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_OR");
gecode_BOT_OR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_IMP");
gecode_BOT_IMP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_EQV");
gecode_BOT_EQV = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_XOR");
gecode_BOT_XOR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_VAL");
gecode_ICL_VAL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_BND");
gecode_ICL_BND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DOM");
gecode_ICL_DOM = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DEF");
gecode_ICL_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXP");
gecode_TT_FIXP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXS");
gecode_TT_FIXS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXE");
gecode_TT_FIXE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_DEF");
gecode_EPK_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_SPEED");
gecode_EPK_SPEED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_MEMORY");
gecode_EPK_MEMORY = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_NONE");
gecode_INT_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_RND");
gecode_INT_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MIN");
gecode_INT_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MAX");
gecode_INT_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MIN");
gecode_INT_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MAX");
gecode_INT_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MIN");
gecode_INT_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MAX");
gecode_INT_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MIN");
gecode_INT_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MAX");
gecode_INT_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MIN");
gecode_INT_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MAX");
gecode_INT_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MIN");
gecode_INT_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MAX");
gecode_INT_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MIN");
gecode_INT_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MAX");
gecode_INT_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MIN");
gecode_INT_VAR_REGRET_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MAX");
gecode_INT_VAR_REGRET_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MIN");
gecode_INT_VAR_REGRET_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MAX");
gecode_INT_VAR_REGRET_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MIN");
gecode_INT_VAL_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MED");
gecode_INT_VAL_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MAX");
gecode_INT_VAL_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RND");
gecode_INT_VAL_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MIN");
gecode_INT_VAL_SPLIT_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MAX");
gecode_INT_VAL_SPLIT_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MIN");
gecode_INT_VAL_RANGE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MAX");
gecode_INT_VAL_RANGE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MIN");
gecode_INT_VALUES_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MAX");
gecode_INT_VALUES_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MIN");
gecode_INT_ASSIGN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MED");
gecode_INT_ASSIGN_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MAX");
gecode_INT_ASSIGN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_RND");
gecode_INT_ASSIGN_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_EQ");
gecode_SRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_NQ");
gecode_SRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUB");
gecode_SRT_SUB = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUP");
gecode_SRT_SUP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ");
gecode_SRT_DISJ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL");
gecode_SRT_CMPL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_LQ");
gecode_SRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_LE");
gecode_SRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_GQ");
gecode_SRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_GR");
gecode_SRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_UNION");
gecode_SOT_UNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION");
gecode_SOT_DUNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_INTER");
gecode_SOT_INTER = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS");
gecode_SOT_MINUS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_NONE");
gecode_SET_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_RND");
gecode_SET_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MIN");
gecode_SET_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MAX");
gecode_SET_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MIN");
gecode_SET_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MAX");
gecode_SET_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MIN");
gecode_SET_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MAX");
gecode_SET_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MIN");
gecode_SET_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MAX");
gecode_SET_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MIN");
gecode_SET_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MAX");
gecode_SET_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MIN");
gecode_SET_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MAX");
gecode_SET_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MIN");
gecode_SET_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MAX");
gecode_SET_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_INC");
gecode_SET_VAL_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_EXC");
gecode_SET_VAL_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_INC");
gecode_SET_VAL_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_EXC");
gecode_SET_VAL_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_INC");
gecode_SET_VAL_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_EXC");
gecode_SET_VAL_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_INC");
gecode_SET_VAL_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_EXC");
gecode_SET_VAL_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_INC");
gecode_SET_ASSIGN_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_EXC");
gecode_SET_ASSIGN_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_INC");
gecode_SET_ASSIGN_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_EXC");
gecode_SET_ASSIGN_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_INC");
gecode_SET_ASSIGN_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_EXC");
gecode_SET_ASSIGN_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_INC");
gecode_SET_ASSIGN_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_EXC");
gecode_SET_ASSIGN_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
YAP_UserCPredicate("gecode_constraint_unary_357", gecode_constraint_unary_357, 6);
YAP_UserCPredicate("gecode_constraint_unary_353", gecode_constraint_unary_353, 6);
YAP_UserCPredicate("gecode_constraint_nvalues_255", gecode_constraint_nvalues_255, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_257", gecode_constraint_nvalues_257, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_251", gecode_constraint_nvalues_251, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_253", gecode_constraint_nvalues_253, 5);
YAP_UserCPredicate("gecode_constraint_max_218", gecode_constraint_max_218, 4);
YAP_UserCPredicate("gecode_constraint_max_217", gecode_constraint_max_217, 4);
YAP_UserCPredicate("gecode_constraint_max_221", gecode_constraint_max_221, 4);
YAP_UserCPredicate("gecode_constraint_dom_139", gecode_constraint_dom_139, 6);
YAP_UserCPredicate("gecode_constraint_dom_149", gecode_constraint_dom_149, 6);
YAP_UserCPredicate("gecode_constraint_convex_51", gecode_constraint_convex_51, 3);
YAP_UserCPredicate("gecode_constraint_nooverlap_242", gecode_constraint_nooverlap_242, 5);
YAP_UserCPredicate("gecode_constraint_assign_4", gecode_constraint_assign_4, 3);
YAP_UserCPredicate("gecode_constraint_assign_3", gecode_constraint_assign_3, 3);
YAP_UserCPredicate("gecode_constraint_assign_5", gecode_constraint_assign_5, 3);
YAP_UserCPredicate("gecode_constraint_assign_7", gecode_constraint_assign_7, 3);
YAP_UserCPredicate("gecode_constraint_assign_6", gecode_constraint_assign_6, 3);
YAP_UserCPredicate("gecode_constraint_assign_8", gecode_constraint_assign_8, 3);
YAP_UserCPredicate("gecode_constraint_element_158", gecode_constraint_element_158, 4);
YAP_UserCPredicate("gecode_constraint_element_162", gecode_constraint_element_162, 4);
YAP_UserCPredicate("gecode_constraint_element_152", gecode_constraint_element_152, 4);
YAP_UserCPredicate("gecode_constraint_element_150", gecode_constraint_element_150, 4);
YAP_UserCPredicate("gecode_constraint_element_157", gecode_constraint_element_157, 4);
YAP_UserCPredicate("gecode_constraint_element_165", gecode_constraint_element_165, 4);
YAP_UserCPredicate("gecode_constraint_element_168", gecode_constraint_element_168, 4);
YAP_UserCPredicate("gecode_constraint_element_174", gecode_constraint_element_174, 4);
YAP_UserCPredicate("gecode_constraint_element_166", gecode_constraint_element_166, 4);
YAP_UserCPredicate("gecode_constraint_sequence_338", gecode_constraint_sequence_338, 2);
YAP_UserCPredicate("gecode_constraint_notMax_248", gecode_constraint_notMax_248, 3);
YAP_UserCPredicate("gecode_constraint_unary_350", gecode_constraint_unary_350, 3);
YAP_UserCPredicate("gecode_constraint_circuit_45", gecode_constraint_circuit_45, 4);
YAP_UserCPredicate("gecode_constraint_circuit_36", gecode_constraint_circuit_36, 4);
YAP_UserCPredicate("gecode_constraint_dom_138", gecode_constraint_dom_138, 5);
YAP_UserCPredicate("gecode_constraint_dom_143", gecode_constraint_dom_143, 5);
YAP_UserCPredicate("gecode_constraint_dom_137", gecode_constraint_dom_137, 5);
YAP_UserCPredicate("gecode_constraint_dom_133", gecode_constraint_dom_133, 5);
YAP_UserCPredicate("gecode_constraint_dom_131", gecode_constraint_dom_131, 5);
YAP_UserCPredicate("gecode_constraint_dom_148", gecode_constraint_dom_148, 5);
YAP_UserCPredicate("gecode_constraint_dom_147", gecode_constraint_dom_147, 5);
YAP_UserCPredicate("gecode_constraint_dom_145", gecode_constraint_dom_145, 5);
YAP_UserCPredicate("gecode_constraint_channel_32", gecode_constraint_channel_32, 4);
YAP_UserCPredicate("gecode_constraint_channel_27", gecode_constraint_channel_27, 4);
YAP_UserCPredicate("gecode_constraint_channel_23", gecode_constraint_channel_23, 4);
YAP_UserCPredicate("gecode_constraint_channel_21", gecode_constraint_channel_21, 4);
YAP_UserCPredicate("gecode_constraint_nooverlap_244", gecode_constraint_nooverlap_244, 8);
YAP_UserCPredicate("gecode_constraint_nooverlap_247", gecode_constraint_nooverlap_247, 8);
YAP_UserCPredicate("gecode_constraint_element_160", gecode_constraint_element_160, 7);
YAP_UserCPredicate("gecode_constraint_element_154", gecode_constraint_element_154, 7);
YAP_UserCPredicate("gecode_constraint_element_156", gecode_constraint_element_156, 7);
YAP_UserCPredicate("gecode_constraint_element_164", gecode_constraint_element_164, 7);
YAP_UserCPredicate("gecode_constraint_element_172", gecode_constraint_element_172, 7);
YAP_UserCPredicate("gecode_constraint_element_170", gecode_constraint_element_170, 7);
YAP_UserCPredicate("gecode_constraint_max_216", gecode_constraint_max_216, 3);
YAP_UserCPredicate("gecode_constraint_max_220", gecode_constraint_max_220, 3);
YAP_UserCPredicate("gecode_constraint_unshare_362", gecode_constraint_unshare_362, 2);
YAP_UserCPredicate("gecode_constraint_unshare_360", gecode_constraint_unshare_360, 2);
YAP_UserCPredicate("gecode_constraint_path_268", gecode_constraint_path_268, 5);
YAP_UserCPredicate("gecode_constraint_path_267", gecode_constraint_path_267, 5);
YAP_UserCPredicate("gecode_constraint_mult_238", gecode_constraint_mult_238, 4);
YAP_UserCPredicate("gecode_constraint_clause_49", gecode_constraint_clause_49, 6);
YAP_UserCPredicate("gecode_constraint_clause_47", gecode_constraint_clause_47, 6);
YAP_UserCPredicate("gecode_constraint_precede_273", gecode_constraint_precede_273, 5);
YAP_UserCPredicate("gecode_constraint_distinct_120", gecode_constraint_distinct_120, 2);
YAP_UserCPredicate("gecode_constraint_member_226", gecode_constraint_member_226, 4);
YAP_UserCPredicate("gecode_constraint_member_229", gecode_constraint_member_229, 4);
YAP_UserCPredicate("gecode_constraint_member_222", gecode_constraint_member_222, 4);
YAP_UserCPredicate("gecode_constraint_member_225", gecode_constraint_member_225, 4);
YAP_UserCPredicate("gecode_constraint_mod_237", gecode_constraint_mod_237, 5);
YAP_UserCPredicate("gecode_constraint_cardinality_18", gecode_constraint_cardinality_18, 3);
YAP_UserCPredicate("gecode_constraint_atmostOne_9", gecode_constraint_atmostOne_9, 3);
YAP_UserCPredicate("gecode_constraint_channelSorted_33", gecode_constraint_channelSorted_33, 3);
YAP_UserCPredicate("gecode_constraint_linear_210", gecode_constraint_linear_210, 4);
YAP_UserCPredicate("gecode_constraint_linear_214", gecode_constraint_linear_214, 4);
YAP_UserCPredicate("gecode_constraint_linear_186", gecode_constraint_linear_186, 4);
YAP_UserCPredicate("gecode_constraint_linear_190", gecode_constraint_linear_190, 4);
YAP_UserCPredicate("gecode_constraint_circuit_42", gecode_constraint_circuit_42, 2);
YAP_UserCPredicate("gecode_constraint_rel_288", gecode_constraint_rel_288, 5);
YAP_UserCPredicate("gecode_constraint_rel_291", gecode_constraint_rel_291, 5);
YAP_UserCPredicate("gecode_constraint_rel_284", gecode_constraint_rel_284, 5);
YAP_UserCPredicate("gecode_constraint_rel_287", gecode_constraint_rel_287, 5);
YAP_UserCPredicate("gecode_constraint_rel_282", gecode_constraint_rel_282, 5);
YAP_UserCPredicate("gecode_constraint_rel_280", gecode_constraint_rel_280, 5);
YAP_UserCPredicate("gecode_constraint_rel_299", gecode_constraint_rel_299, 5);
YAP_UserCPredicate("gecode_constraint_rel_295", gecode_constraint_rel_295, 5);
YAP_UserCPredicate("gecode_constraint_rel_293", gecode_constraint_rel_293, 5);
YAP_UserCPredicate("gecode_constraint_rel_323", gecode_constraint_rel_323, 5);
YAP_UserCPredicate("gecode_constraint_rel_321", gecode_constraint_rel_321, 5);
YAP_UserCPredicate("gecode_constraint_rel_307", gecode_constraint_rel_307, 5);
YAP_UserCPredicate("gecode_constraint_rel_309", gecode_constraint_rel_309, 5);
YAP_UserCPredicate("gecode_constraint_rel_303", gecode_constraint_rel_303, 5);
YAP_UserCPredicate("gecode_constraint_rel_310", gecode_constraint_rel_310, 5);
YAP_UserCPredicate("gecode_constraint_rel_313", gecode_constraint_rel_313, 5);
YAP_UserCPredicate("gecode_constraint_rel_314", gecode_constraint_rel_314, 5);
YAP_UserCPredicate("gecode_constraint_rel_317", gecode_constraint_rel_317, 5);
YAP_UserCPredicate("gecode_constraint_rel_320", gecode_constraint_rel_320, 5);
YAP_UserCPredicate("gecode_constraint_rel_331", gecode_constraint_rel_331, 5);
YAP_UserCPredicate("gecode_constraint_rel_333", gecode_constraint_rel_333, 5);
YAP_UserCPredicate("gecode_constraint_rel_279", gecode_constraint_rel_279, 5);
YAP_UserCPredicate("gecode_constraint_rel_277", gecode_constraint_rel_277, 5);
YAP_UserCPredicate("gecode_constraint_min_232", gecode_constraint_min_232, 4);
YAP_UserCPredicate("gecode_constraint_min_231", gecode_constraint_min_231, 4);
YAP_UserCPredicate("gecode_constraint_min_235", gecode_constraint_min_235, 4);
YAP_UserCPredicate("gecode_constraint_cardinality_19", gecode_constraint_cardinality_19, 4);
YAP_UserCPredicate("gecode_constraint_count_69", gecode_constraint_count_69, 4);
YAP_UserCPredicate("gecode_constraint_count_66", gecode_constraint_count_66, 4);
YAP_UserCPredicate("gecode_constraint_count_60", gecode_constraint_count_60, 4);
YAP_UserCPredicate("gecode_constraint_count_59", gecode_constraint_count_59, 4);
YAP_UserCPredicate("gecode_constraint_count_56", gecode_constraint_count_56, 4);
YAP_UserCPredicate("gecode_constraint_sqrt_346", gecode_constraint_sqrt_346, 3);
YAP_UserCPredicate("gecode_constraint_cumulatives_117", gecode_constraint_cumulatives_117, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_115", gecode_constraint_cumulatives_115, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_113", gecode_constraint_cumulatives_113, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_111", gecode_constraint_cumulatives_111, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_109", gecode_constraint_cumulatives_109, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_107", gecode_constraint_cumulatives_107, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_105", gecode_constraint_cumulatives_105, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_103", gecode_constraint_cumulatives_103, 9);
YAP_UserCPredicate("gecode_constraint_nvalues_254", gecode_constraint_nvalues_254, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_256", gecode_constraint_nvalues_256, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_250", gecode_constraint_nvalues_250, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_252", gecode_constraint_nvalues_252, 4);
YAP_UserCPredicate("gecode_constraint_binpacking_10", gecode_constraint_binpacking_10, 4);
YAP_UserCPredicate("gecode_constraint_linear_201", gecode_constraint_linear_201, 7);
YAP_UserCPredicate("gecode_constraint_linear_205", gecode_constraint_linear_205, 7);
YAP_UserCPredicate("gecode_constraint_linear_193", gecode_constraint_linear_193, 7);
YAP_UserCPredicate("gecode_constraint_linear_197", gecode_constraint_linear_197, 7);
YAP_UserCPredicate("gecode_constraint_abs_2", gecode_constraint_abs_2, 4);
YAP_UserCPredicate("gecode_constraint_convex_50", gecode_constraint_convex_50, 2);
YAP_UserCPredicate("gecode_constraint_div_122", gecode_constraint_div_122, 4);
YAP_UserCPredicate("gecode_constraint_rel_311", gecode_constraint_rel_311, 6);
YAP_UserCPredicate("gecode_constraint_rel_315", gecode_constraint_rel_315, 6);
YAP_UserCPredicate("gecode_constraint_rel_300", gecode_constraint_rel_300, 6);
YAP_UserCPredicate("gecode_constraint_rel_301", gecode_constraint_rel_301, 6);
YAP_UserCPredicate("gecode_constraint_rel_289", gecode_constraint_rel_289, 6);
YAP_UserCPredicate("gecode_constraint_rel_285", gecode_constraint_rel_285, 6);
YAP_UserCPredicate("gecode_constraint_rel_283", gecode_constraint_rel_283, 6);
YAP_UserCPredicate("gecode_constraint_rel_281", gecode_constraint_rel_281, 6);
YAP_UserCPredicate("gecode_constraint_rel_326", gecode_constraint_rel_326, 6);
YAP_UserCPredicate("gecode_constraint_rel_327", gecode_constraint_rel_327, 6);
YAP_UserCPredicate("gecode_constraint_rel_328", gecode_constraint_rel_328, 6);
YAP_UserCPredicate("gecode_constraint_rel_329", gecode_constraint_rel_329, 6);
YAP_UserCPredicate("gecode_constraint_weights_364", gecode_constraint_weights_364, 5);
YAP_UserCPredicate("gecode_constraint_max_219", gecode_constraint_max_219, 5);
YAP_UserCPredicate("gecode_constraint_path_263", gecode_constraint_path_263, 9);
YAP_UserCPredicate("gecode_constraint_unary_358", gecode_constraint_unary_358, 4);
YAP_UserCPredicate("gecode_constraint_unary_354", gecode_constraint_unary_354, 4);
YAP_UserCPredicate("gecode_constraint_unary_348", gecode_constraint_unary_348, 4);
YAP_UserCPredicate("gecode_constraint_unary_351", gecode_constraint_unary_351, 4);
YAP_UserCPredicate("gecode_constraint_sorted_341", gecode_constraint_sorted_341, 5);
YAP_UserCPredicate("gecode_constraint_circuit_40", gecode_constraint_circuit_40, 5);
YAP_UserCPredicate("gecode_constraint_circuit_37", gecode_constraint_circuit_37, 5);
YAP_UserCPredicate("gecode_constraint_circuit_34", gecode_constraint_circuit_34, 5);
YAP_UserCPredicate("gecode_constraint_dom_142", gecode_constraint_dom_142, 4);
YAP_UserCPredicate("gecode_constraint_dom_136", gecode_constraint_dom_136, 4);
YAP_UserCPredicate("gecode_constraint_dom_141", gecode_constraint_dom_141, 4);
YAP_UserCPredicate("gecode_constraint_dom_132", gecode_constraint_dom_132, 4);
YAP_UserCPredicate("gecode_constraint_dom_135", gecode_constraint_dom_135, 4);
YAP_UserCPredicate("gecode_constraint_dom_130", gecode_constraint_dom_130, 4);
YAP_UserCPredicate("gecode_constraint_dom_129", gecode_constraint_dom_129, 4);
YAP_UserCPredicate("gecode_constraint_dom_127", gecode_constraint_dom_127, 4);
YAP_UserCPredicate("gecode_constraint_dom_146", gecode_constraint_dom_146, 4);
YAP_UserCPredicate("gecode_constraint_dom_144", gecode_constraint_dom_144, 4);
YAP_UserCPredicate("gecode_constraint_abs_1", gecode_constraint_abs_1, 3);
YAP_UserCPredicate("gecode_constraint_channel_29", gecode_constraint_channel_29, 5);
YAP_UserCPredicate("gecode_constraint_channel_24", gecode_constraint_channel_24, 5);
YAP_UserCPredicate("gecode_constraint_rel_304", gecode_constraint_rel_304, 3);
YAP_UserCPredicate("gecode_constraint_rel_296", gecode_constraint_rel_296, 3);
YAP_UserCPredicate("gecode_constraint_path_266", gecode_constraint_path_266, 4);
YAP_UserCPredicate("gecode_constraint_branch_14", gecode_constraint_branch_14, 4);
YAP_UserCPredicate("gecode_constraint_branch_13", gecode_constraint_branch_13, 4);
YAP_UserCPredicate("gecode_constraint_branch_15", gecode_constraint_branch_15, 4);
YAP_UserCPredicate("gecode_constraint_mult_239", gecode_constraint_mult_239, 5);
YAP_UserCPredicate("gecode_constraint_circuit_41", gecode_constraint_circuit_41, 6);
YAP_UserCPredicate("gecode_constraint_circuit_38", gecode_constraint_circuit_38, 6);
YAP_UserCPredicate("gecode_constraint_circuit_35", gecode_constraint_circuit_35, 6);
YAP_UserCPredicate("gecode_constraint_clause_48", gecode_constraint_clause_48, 5);
YAP_UserCPredicate("gecode_constraint_clause_46", gecode_constraint_clause_46, 5);
YAP_UserCPredicate("gecode_constraint_precede_275", gecode_constraint_precede_275, 4);
YAP_UserCPredicate("gecode_constraint_precede_272", gecode_constraint_precede_272, 4);
YAP_UserCPredicate("gecode_constraint_precede_271", gecode_constraint_precede_271, 4);
YAP_UserCPredicate("gecode_constraint_channel_30", gecode_constraint_channel_30, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_86", gecode_constraint_cumulative_86, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_89", gecode_constraint_cumulative_89, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_82", gecode_constraint_cumulative_82, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_85", gecode_constraint_cumulative_85, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_79", gecode_constraint_cumulative_79, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_98", gecode_constraint_cumulative_98, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_101", gecode_constraint_cumulative_101, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_94", gecode_constraint_cumulative_94, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_97", gecode_constraint_cumulative_97, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_91", gecode_constraint_cumulative_91, 7);
YAP_UserCPredicate("gecode_constraint_distinct_121", gecode_constraint_distinct_121, 3);
YAP_UserCPredicate("gecode_constraint_distinct_118", gecode_constraint_distinct_118, 3);
YAP_UserCPredicate("gecode_constraint_member_227", gecode_constraint_member_227, 5);
YAP_UserCPredicate("gecode_constraint_member_223", gecode_constraint_member_223, 5);
YAP_UserCPredicate("gecode_constraint_mod_236", gecode_constraint_mod_236, 4);
YAP_UserCPredicate("gecode_constraint_sqr_344", gecode_constraint_sqr_344, 3);
YAP_UserCPredicate("gecode_constraint_sequence_337", gecode_constraint_sequence_337, 7);
YAP_UserCPredicate("gecode_constraint_sequence_335", gecode_constraint_sequence_335, 7);
YAP_UserCPredicate("gecode_constraint_path_264", gecode_constraint_path_264, 7);
YAP_UserCPredicate("gecode_constraint_path_261", gecode_constraint_path_261, 7);
YAP_UserCPredicate("gecode_constraint_path_258", gecode_constraint_path_258, 7);
YAP_UserCPredicate("gecode_constraint_divmod_125", gecode_constraint_divmod_125, 6);
YAP_UserCPredicate("gecode_constraint_sorted_342", gecode_constraint_sorted_342, 3);
YAP_UserCPredicate("gecode_constraint_circuit_44", gecode_constraint_circuit_44, 3);
YAP_UserCPredicate("gecode_constraint_circuit_43", gecode_constraint_circuit_43, 3);
YAP_UserCPredicate("gecode_constraint_channel_31", gecode_constraint_channel_31, 3);
YAP_UserCPredicate("gecode_constraint_channel_28", gecode_constraint_channel_28, 3);
YAP_UserCPredicate("gecode_constraint_channel_26", gecode_constraint_channel_26, 3);
YAP_UserCPredicate("gecode_constraint_channel_22", gecode_constraint_channel_22, 3);
YAP_UserCPredicate("gecode_constraint_channel_25", gecode_constraint_channel_25, 3);
YAP_UserCPredicate("gecode_constraint_channel_20", gecode_constraint_channel_20, 3);
YAP_UserCPredicate("gecode_constraint_count_52", gecode_constraint_count_52, 5);
YAP_UserCPredicate("gecode_constraint_count_54", gecode_constraint_count_54, 5);
YAP_UserCPredicate("gecode_constraint_count_70", gecode_constraint_count_70, 5);
YAP_UserCPredicate("gecode_constraint_count_72", gecode_constraint_count_72, 5);
YAP_UserCPredicate("gecode_constraint_count_62", gecode_constraint_count_62, 5);
YAP_UserCPredicate("gecode_constraint_count_64", gecode_constraint_count_64, 5);
YAP_UserCPredicate("gecode_constraint_count_61", gecode_constraint_count_61, 5);
YAP_UserCPredicate("gecode_constraint_count_57", gecode_constraint_count_57, 5);
YAP_UserCPredicate("gecode_constraint_count_67", gecode_constraint_count_67, 5);
YAP_UserCPredicate("gecode_constraint_count_74", gecode_constraint_count_74, 5);
YAP_UserCPredicate("gecode_constraint_count_76", gecode_constraint_count_76, 5);
YAP_UserCPredicate("gecode_constraint_cumulatives_116", gecode_constraint_cumulatives_116, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_114", gecode_constraint_cumulatives_114, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_112", gecode_constraint_cumulatives_112, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_110", gecode_constraint_cumulatives_110, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_108", gecode_constraint_cumulatives_108, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_106", gecode_constraint_cumulatives_106, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_104", gecode_constraint_cumulatives_104, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_102", gecode_constraint_cumulatives_102, 8);
YAP_UserCPredicate("gecode_constraint_binpacking_11", gecode_constraint_binpacking_11, 5);
YAP_UserCPredicate("gecode_constraint_linear_209", gecode_constraint_linear_209, 6);
YAP_UserCPredicate("gecode_constraint_linear_213", gecode_constraint_linear_213, 6);
YAP_UserCPredicate("gecode_constraint_linear_185", gecode_constraint_linear_185, 6);
YAP_UserCPredicate("gecode_constraint_linear_189", gecode_constraint_linear_189, 6);
YAP_UserCPredicate("gecode_constraint_linear_200", gecode_constraint_linear_200, 6);
YAP_UserCPredicate("gecode_constraint_linear_203", gecode_constraint_linear_203, 6);
YAP_UserCPredicate("gecode_constraint_linear_204", gecode_constraint_linear_204, 6);
YAP_UserCPredicate("gecode_constraint_linear_207", gecode_constraint_linear_207, 6);
YAP_UserCPredicate("gecode_constraint_linear_192", gecode_constraint_linear_192, 6);
YAP_UserCPredicate("gecode_constraint_linear_195", gecode_constraint_linear_195, 6);
YAP_UserCPredicate("gecode_constraint_linear_196", gecode_constraint_linear_196, 6);
YAP_UserCPredicate("gecode_constraint_linear_199", gecode_constraint_linear_199, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_246", gecode_constraint_nooverlap_246, 7);
YAP_UserCPredicate("gecode_constraint_nooverlap_241", gecode_constraint_nooverlap_241, 7);
YAP_UserCPredicate("gecode_constraint_div_123", gecode_constraint_div_123, 5);
YAP_UserCPredicate("gecode_constraint_sqr_345", gecode_constraint_sqr_345, 4);
YAP_UserCPredicate("gecode_constraint_path_265", gecode_constraint_path_265, 8);
YAP_UserCPredicate("gecode_constraint_path_262", gecode_constraint_path_262, 8);
YAP_UserCPredicate("gecode_constraint_path_259", gecode_constraint_path_259, 8);
YAP_UserCPredicate("gecode_constraint_unary_356", gecode_constraint_unary_356, 5);
YAP_UserCPredicate("gecode_constraint_unary_359", gecode_constraint_unary_359, 5);
YAP_UserCPredicate("gecode_constraint_unary_352", gecode_constraint_unary_352, 5);
YAP_UserCPredicate("gecode_constraint_unary_355", gecode_constraint_unary_355, 5);
YAP_UserCPredicate("gecode_constraint_unary_349", gecode_constraint_unary_349, 5);
YAP_UserCPredicate("gecode_constraint_sorted_340", gecode_constraint_sorted_340, 4);
YAP_UserCPredicate("gecode_constraint_sorted_343", gecode_constraint_sorted_343, 4);
YAP_UserCPredicate("gecode_constraint_element_161", gecode_constraint_element_161, 8);
YAP_UserCPredicate("gecode_constraint_element_155", gecode_constraint_element_155, 8);
YAP_UserCPredicate("gecode_constraint_element_173", gecode_constraint_element_173, 8);
YAP_UserCPredicate("gecode_constraint_element_171", gecode_constraint_element_171, 8);
YAP_UserCPredicate("gecode_constraint_element_159", gecode_constraint_element_159, 5);
YAP_UserCPredicate("gecode_constraint_element_163", gecode_constraint_element_163, 5);
YAP_UserCPredicate("gecode_constraint_element_153", gecode_constraint_element_153, 5);
YAP_UserCPredicate("gecode_constraint_element_151", gecode_constraint_element_151, 5);
YAP_UserCPredicate("gecode_constraint_element_182", gecode_constraint_element_182, 5);
YAP_UserCPredicate("gecode_constraint_element_180", gecode_constraint_element_180, 5);
YAP_UserCPredicate("gecode_constraint_element_178", gecode_constraint_element_178, 5);
YAP_UserCPredicate("gecode_constraint_element_176", gecode_constraint_element_176, 5);
YAP_UserCPredicate("gecode_constraint_element_169", gecode_constraint_element_169, 5);
YAP_UserCPredicate("gecode_constraint_element_175", gecode_constraint_element_175, 5);
YAP_UserCPredicate("gecode_constraint_element_167", gecode_constraint_element_167, 5);
YAP_UserCPredicate("gecode_constraint_sequence_339", gecode_constraint_sequence_339, 3);
YAP_UserCPredicate("gecode_constraint_circuit_39", gecode_constraint_circuit_39, 7);
YAP_UserCPredicate("gecode_constraint_precede_274", gecode_constraint_precede_274, 3);
YAP_UserCPredicate("gecode_constraint_precede_270", gecode_constraint_precede_270, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_88", gecode_constraint_cumulative_88, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_84", gecode_constraint_cumulative_84, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_78", gecode_constraint_cumulative_78, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_81", gecode_constraint_cumulative_81, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_100", gecode_constraint_cumulative_100, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_96", gecode_constraint_cumulative_96, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_90", gecode_constraint_cumulative_90, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_93", gecode_constraint_cumulative_93, 6);
YAP_UserCPredicate("gecode_constraint_distinct_119", gecode_constraint_distinct_119, 4);
YAP_UserCPredicate("gecode_constraint_min_230", gecode_constraint_min_230, 3);
YAP_UserCPredicate("gecode_constraint_min_234", gecode_constraint_min_234, 3);
YAP_UserCPredicate("gecode_constraint_sqrt_347", gecode_constraint_sqrt_347, 4);
YAP_UserCPredicate("gecode_constraint_sequence_336", gecode_constraint_sequence_336, 6);
YAP_UserCPredicate("gecode_constraint_sequence_334", gecode_constraint_sequence_334, 6);
YAP_UserCPredicate("gecode_constraint_unshare_363", gecode_constraint_unshare_363, 3);
YAP_UserCPredicate("gecode_constraint_unshare_361", gecode_constraint_unshare_361, 3);
YAP_UserCPredicate("gecode_constraint_path_269", gecode_constraint_path_269, 6);
YAP_UserCPredicate("gecode_constraint_path_260", gecode_constraint_path_260, 6);
YAP_UserCPredicate("gecode_constraint_divmod_124", gecode_constraint_divmod_124, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_245", gecode_constraint_nooverlap_245, 9);
YAP_UserCPredicate("gecode_constraint_cumulative_80", gecode_constraint_cumulative_80, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_92", gecode_constraint_cumulative_92, 5);
YAP_UserCPredicate("gecode_constraint_member_228", gecode_constraint_member_228, 3);
YAP_UserCPredicate("gecode_constraint_member_224", gecode_constraint_member_224, 3);
YAP_UserCPredicate("gecode_constraint_count_71", gecode_constraint_count_71, 6);
YAP_UserCPredicate("gecode_constraint_count_73", gecode_constraint_count_73, 6);
YAP_UserCPredicate("gecode_constraint_count_75", gecode_constraint_count_75, 6);
YAP_UserCPredicate("gecode_constraint_count_77", gecode_constraint_count_77, 6);
YAP_UserCPredicate("gecode_constraint_count_63", gecode_constraint_count_63, 6);
YAP_UserCPredicate("gecode_constraint_count_65", gecode_constraint_count_65, 6);
YAP_UserCPredicate("gecode_constraint_count_53", gecode_constraint_count_53, 6);
YAP_UserCPredicate("gecode_constraint_count_55", gecode_constraint_count_55, 6);
YAP_UserCPredicate("gecode_constraint_notMin_249", gecode_constraint_notMin_249, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_87", gecode_constraint_cumulative_87, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_83", gecode_constraint_cumulative_83, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_99", gecode_constraint_cumulative_99, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_95", gecode_constraint_cumulative_95, 8);
YAP_UserCPredicate("gecode_constraint_branch_16", gecode_constraint_branch_16, 3);
YAP_UserCPredicate("gecode_constraint_branch_12", gecode_constraint_branch_12, 3);
YAP_UserCPredicate("gecode_constraint_branch_17", gecode_constraint_branch_17, 3);
YAP_UserCPredicate("gecode_constraint_dom_140", gecode_constraint_dom_140, 3);
YAP_UserCPredicate("gecode_constraint_dom_134", gecode_constraint_dom_134, 3);
YAP_UserCPredicate("gecode_constraint_dom_128", gecode_constraint_dom_128, 3);
YAP_UserCPredicate("gecode_constraint_dom_126", gecode_constraint_dom_126, 3);
YAP_UserCPredicate("gecode_constraint_linear_208", gecode_constraint_linear_208, 5);
YAP_UserCPredicate("gecode_constraint_linear_211", gecode_constraint_linear_211, 5);
YAP_UserCPredicate("gecode_constraint_linear_212", gecode_constraint_linear_212, 5);
YAP_UserCPredicate("gecode_constraint_linear_215", gecode_constraint_linear_215, 5);
YAP_UserCPredicate("gecode_constraint_linear_184", gecode_constraint_linear_184, 5);
YAP_UserCPredicate("gecode_constraint_linear_187", gecode_constraint_linear_187, 5);
YAP_UserCPredicate("gecode_constraint_linear_188", gecode_constraint_linear_188, 5);
YAP_UserCPredicate("gecode_constraint_linear_191", gecode_constraint_linear_191, 5);
YAP_UserCPredicate("gecode_constraint_linear_202", gecode_constraint_linear_202, 5);
YAP_UserCPredicate("gecode_constraint_linear_206", gecode_constraint_linear_206, 5);
YAP_UserCPredicate("gecode_constraint_linear_194", gecode_constraint_linear_194, 5);
YAP_UserCPredicate("gecode_constraint_linear_198", gecode_constraint_linear_198, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_240", gecode_constraint_nooverlap_240, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_243", gecode_constraint_nooverlap_243, 6);
YAP_UserCPredicate("gecode_constraint_element_183", gecode_constraint_element_183, 6);
YAP_UserCPredicate("gecode_constraint_element_181", gecode_constraint_element_181, 6);
YAP_UserCPredicate("gecode_constraint_element_179", gecode_constraint_element_179, 6);
YAP_UserCPredicate("gecode_constraint_element_177", gecode_constraint_element_177, 6);
YAP_UserCPredicate("gecode_constraint_rel_290", gecode_constraint_rel_290, 4);
YAP_UserCPredicate("gecode_constraint_rel_286", gecode_constraint_rel_286, 4);
YAP_UserCPredicate("gecode_constraint_rel_298", gecode_constraint_rel_298, 4);
YAP_UserCPredicate("gecode_constraint_rel_294", gecode_constraint_rel_294, 4);
YAP_UserCPredicate("gecode_constraint_rel_292", gecode_constraint_rel_292, 4);
YAP_UserCPredicate("gecode_constraint_rel_297", gecode_constraint_rel_297, 4);
YAP_UserCPredicate("gecode_constraint_rel_324", gecode_constraint_rel_324, 4);
YAP_UserCPredicate("gecode_constraint_rel_322", gecode_constraint_rel_322, 4);
YAP_UserCPredicate("gecode_constraint_rel_306", gecode_constraint_rel_306, 4);
YAP_UserCPredicate("gecode_constraint_rel_308", gecode_constraint_rel_308, 4);
YAP_UserCPredicate("gecode_constraint_rel_302", gecode_constraint_rel_302, 4);
YAP_UserCPredicate("gecode_constraint_rel_305", gecode_constraint_rel_305, 4);
YAP_UserCPredicate("gecode_constraint_rel_312", gecode_constraint_rel_312, 4);
YAP_UserCPredicate("gecode_constraint_rel_316", gecode_constraint_rel_316, 4);
YAP_UserCPredicate("gecode_constraint_rel_318", gecode_constraint_rel_318, 4);
YAP_UserCPredicate("gecode_constraint_rel_319", gecode_constraint_rel_319, 4);
YAP_UserCPredicate("gecode_constraint_rel_325", gecode_constraint_rel_325, 4);
YAP_UserCPredicate("gecode_constraint_rel_330", gecode_constraint_rel_330, 4);
YAP_UserCPredicate("gecode_constraint_rel_332", gecode_constraint_rel_332, 4);
YAP_UserCPredicate("gecode_constraint_rel_278", gecode_constraint_rel_278, 4);
YAP_UserCPredicate("gecode_constraint_rel_276", gecode_constraint_rel_276, 4);
YAP_UserCPredicate("gecode_constraint_min_233", gecode_constraint_min_233, 5);
YAP_UserCPredicate("gecode_constraint_count_68", gecode_constraint_count_68, 3);
YAP_UserCPredicate("gecode_constraint_count_58", gecode_constraint_count_58, 3);

View File

@ -0,0 +1 @@
4.0.0

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,32 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
static ReifyMode gecode_ReifyMode_from_term(YAP_Term);
static IntRelType gecode_IntRelType_from_term(YAP_Term);
static BoolOpType gecode_BoolOpType_from_term(YAP_Term);
static IntConLevel gecode_IntConLevel_from_term(YAP_Term);
static TaskType gecode_TaskType_from_term(YAP_Term);
static ExtensionalPropKind gecode_ExtensionalPropKind_from_term(YAP_Term);
static IntVarBranch gecode_IntVarBranch_from_term(YAP_Term);
static IntValBranch gecode_IntValBranch_from_term(YAP_Term);
static IntAssign gecode_IntAssign_from_term(YAP_Term);
static SetRelType gecode_SetRelType_from_term(YAP_Term);
static SetOpType gecode_SetOpType_from_term(YAP_Term);
static SetVarBranch gecode_SetVarBranch_from_term(YAP_Term);
static SetValBranch gecode_SetValBranch_from_term(YAP_Term);
static SetAssign gecode_SetAssign_from_term(YAP_Term);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,709 @@
// -*- c++ -*-
//=============================================================================
// Copyright (C) 2011 by Denys Duchier
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at your
// option) any later version.
//
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//=============================================================================
{ YAP_Atom X= YAP_LookupAtom("RM_EQV");
gecode_RM_EQV = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("RM_IMP");
gecode_RM_IMP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("RM_PMI");
gecode_RM_PMI = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_EQ");
gecode_IRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_NQ");
gecode_IRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LQ");
gecode_IRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_LE");
gecode_IRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GQ");
gecode_IRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("IRT_GR");
gecode_IRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_AND");
gecode_BOT_AND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_OR");
gecode_BOT_OR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_IMP");
gecode_BOT_IMP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_EQV");
gecode_BOT_EQV = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("BOT_XOR");
gecode_BOT_XOR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_VAL");
gecode_ICL_VAL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_BND");
gecode_ICL_BND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DOM");
gecode_ICL_DOM = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("ICL_DEF");
gecode_ICL_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXP");
gecode_TT_FIXP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXS");
gecode_TT_FIXS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("TT_FIXE");
gecode_TT_FIXE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_DEF");
gecode_EPK_DEF = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_SPEED");
gecode_EPK_SPEED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("EPK_MEMORY");
gecode_EPK_MEMORY = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_NONE");
gecode_INT_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_RND");
gecode_INT_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MIN");
gecode_INT_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_DEGREE_MAX");
gecode_INT_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MIN");
gecode_INT_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_AFC_MAX");
gecode_INT_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MIN");
gecode_INT_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MIN_MAX");
gecode_INT_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MIN");
gecode_INT_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_MAX_MAX");
gecode_INT_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MIN");
gecode_INT_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_MAX");
gecode_INT_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MIN");
gecode_INT_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_DEGREE_MAX");
gecode_INT_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MIN");
gecode_INT_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_SIZE_AFC_MAX");
gecode_INT_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MIN");
gecode_INT_VAR_REGRET_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MIN_MAX");
gecode_INT_VAR_REGRET_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MIN");
gecode_INT_VAR_REGRET_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAR_REGRET_MAX_MAX");
gecode_INT_VAR_REGRET_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MIN");
gecode_INT_VAL_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MED");
gecode_INT_VAL_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_MAX");
gecode_INT_VAL_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RND");
gecode_INT_VAL_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MIN");
gecode_INT_VAL_SPLIT_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_SPLIT_MAX");
gecode_INT_VAL_SPLIT_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MIN");
gecode_INT_VAL_RANGE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VAL_RANGE_MAX");
gecode_INT_VAL_RANGE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MIN");
gecode_INT_VALUES_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_VALUES_MAX");
gecode_INT_VALUES_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MIN");
gecode_INT_ASSIGN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MED");
gecode_INT_ASSIGN_MED = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_MAX");
gecode_INT_ASSIGN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("INT_ASSIGN_RND");
gecode_INT_ASSIGN_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_EQ");
gecode_SRT_EQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_NQ");
gecode_SRT_NQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUB");
gecode_SRT_SUB = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_SUP");
gecode_SRT_SUP = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ");
gecode_SRT_DISJ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL");
gecode_SRT_CMPL = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_LQ");
gecode_SRT_LQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_LE");
gecode_SRT_LE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_GQ");
gecode_SRT_GQ = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SRT_GR");
gecode_SRT_GR = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_UNION");
gecode_SOT_UNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION");
gecode_SOT_DUNION = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_INTER");
gecode_SOT_INTER = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS");
gecode_SOT_MINUS = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_NONE");
gecode_SET_VAR_NONE = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_RND");
gecode_SET_VAR_RND = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MIN");
gecode_SET_VAR_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_DEGREE_MAX");
gecode_SET_VAR_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MIN");
gecode_SET_VAR_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_AFC_MAX");
gecode_SET_VAR_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MIN");
gecode_SET_VAR_MIN_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MIN_MAX");
gecode_SET_VAR_MIN_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MIN");
gecode_SET_VAR_MAX_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_MAX_MAX");
gecode_SET_VAR_MAX_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MIN");
gecode_SET_VAR_SIZE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_MAX");
gecode_SET_VAR_SIZE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MIN");
gecode_SET_VAR_SIZE_DEGREE_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_DEGREE_MAX");
gecode_SET_VAR_SIZE_DEGREE_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MIN");
gecode_SET_VAR_SIZE_AFC_MIN = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAR_SIZE_AFC_MAX");
gecode_SET_VAR_SIZE_AFC_MAX = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_INC");
gecode_SET_VAL_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MIN_EXC");
gecode_SET_VAL_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_INC");
gecode_SET_VAL_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MED_EXC");
gecode_SET_VAL_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_INC");
gecode_SET_VAL_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_MAX_EXC");
gecode_SET_VAL_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_INC");
gecode_SET_VAL_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_VAL_RND_EXC");
gecode_SET_VAL_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_INC");
gecode_SET_ASSIGN_MIN_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MIN_EXC");
gecode_SET_ASSIGN_MIN_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_INC");
gecode_SET_ASSIGN_MED_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MED_EXC");
gecode_SET_ASSIGN_MED_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_INC");
gecode_SET_ASSIGN_MAX_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_MAX_EXC");
gecode_SET_ASSIGN_MAX_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_INC");
gecode_SET_ASSIGN_RND_INC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
{ YAP_Atom X= YAP_LookupAtom("SET_ASSIGN_RND_EXC");
gecode_SET_ASSIGN_RND_EXC = YAP_MkAtomTerm(X);
YAP_AtomGetHold(X); }
YAP_UserCPredicate("gecode_constraint_unary_358", gecode_constraint_unary_358, 6);
YAP_UserCPredicate("gecode_constraint_unary_354", gecode_constraint_unary_354, 6);
YAP_UserCPredicate("gecode_constraint_nvalues_256", gecode_constraint_nvalues_256, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_258", gecode_constraint_nvalues_258, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_252", gecode_constraint_nvalues_252, 5);
YAP_UserCPredicate("gecode_constraint_nvalues_254", gecode_constraint_nvalues_254, 5);
YAP_UserCPredicate("gecode_constraint_max_219", gecode_constraint_max_219, 4);
YAP_UserCPredicate("gecode_constraint_max_218", gecode_constraint_max_218, 4);
YAP_UserCPredicate("gecode_constraint_max_222", gecode_constraint_max_222, 4);
YAP_UserCPredicate("gecode_constraint_dom_142", gecode_constraint_dom_142, 6);
YAP_UserCPredicate("gecode_constraint_dom_150", gecode_constraint_dom_150, 6);
YAP_UserCPredicate("gecode_constraint_convex_52", gecode_constraint_convex_52, 3);
YAP_UserCPredicate("gecode_constraint_nooverlap_243", gecode_constraint_nooverlap_243, 5);
YAP_UserCPredicate("gecode_constraint_assign_4", gecode_constraint_assign_4, 3);
YAP_UserCPredicate("gecode_constraint_assign_3", gecode_constraint_assign_3, 3);
YAP_UserCPredicate("gecode_constraint_assign_5", gecode_constraint_assign_5, 3);
YAP_UserCPredicate("gecode_constraint_assign_7", gecode_constraint_assign_7, 3);
YAP_UserCPredicate("gecode_constraint_assign_6", gecode_constraint_assign_6, 3);
YAP_UserCPredicate("gecode_constraint_assign_8", gecode_constraint_assign_8, 3);
YAP_UserCPredicate("gecode_constraint_element_159", gecode_constraint_element_159, 4);
YAP_UserCPredicate("gecode_constraint_element_163", gecode_constraint_element_163, 4);
YAP_UserCPredicate("gecode_constraint_element_153", gecode_constraint_element_153, 4);
YAP_UserCPredicate("gecode_constraint_element_151", gecode_constraint_element_151, 4);
YAP_UserCPredicate("gecode_constraint_element_158", gecode_constraint_element_158, 4);
YAP_UserCPredicate("gecode_constraint_element_166", gecode_constraint_element_166, 4);
YAP_UserCPredicate("gecode_constraint_element_169", gecode_constraint_element_169, 4);
YAP_UserCPredicate("gecode_constraint_element_175", gecode_constraint_element_175, 4);
YAP_UserCPredicate("gecode_constraint_element_167", gecode_constraint_element_167, 4);
YAP_UserCPredicate("gecode_constraint_sequence_339", gecode_constraint_sequence_339, 2);
YAP_UserCPredicate("gecode_constraint_notMax_249", gecode_constraint_notMax_249, 3);
YAP_UserCPredicate("gecode_constraint_unary_351", gecode_constraint_unary_351, 3);
YAP_UserCPredicate("gecode_constraint_circuit_46", gecode_constraint_circuit_46, 4);
YAP_UserCPredicate("gecode_constraint_circuit_37", gecode_constraint_circuit_37, 4);
YAP_UserCPredicate("gecode_constraint_dom_141", gecode_constraint_dom_141, 5);
YAP_UserCPredicate("gecode_constraint_dom_140", gecode_constraint_dom_140, 5);
YAP_UserCPredicate("gecode_constraint_dom_144", gecode_constraint_dom_144, 5);
YAP_UserCPredicate("gecode_constraint_dom_136", gecode_constraint_dom_136, 5);
YAP_UserCPredicate("gecode_constraint_dom_132", gecode_constraint_dom_132, 5);
YAP_UserCPredicate("gecode_constraint_dom_149", gecode_constraint_dom_149, 5);
YAP_UserCPredicate("gecode_constraint_dom_148", gecode_constraint_dom_148, 5);
YAP_UserCPredicate("gecode_constraint_dom_146", gecode_constraint_dom_146, 5);
YAP_UserCPredicate("gecode_constraint_channel_33", gecode_constraint_channel_33, 4);
YAP_UserCPredicate("gecode_constraint_channel_27", gecode_constraint_channel_27, 4);
YAP_UserCPredicate("gecode_constraint_channel_23", gecode_constraint_channel_23, 4);
YAP_UserCPredicate("gecode_constraint_channel_21", gecode_constraint_channel_21, 4);
YAP_UserCPredicate("gecode_constraint_nooverlap_245", gecode_constraint_nooverlap_245, 8);
YAP_UserCPredicate("gecode_constraint_nooverlap_248", gecode_constraint_nooverlap_248, 8);
YAP_UserCPredicate("gecode_constraint_element_161", gecode_constraint_element_161, 7);
YAP_UserCPredicate("gecode_constraint_element_155", gecode_constraint_element_155, 7);
YAP_UserCPredicate("gecode_constraint_element_157", gecode_constraint_element_157, 7);
YAP_UserCPredicate("gecode_constraint_element_165", gecode_constraint_element_165, 7);
YAP_UserCPredicate("gecode_constraint_element_173", gecode_constraint_element_173, 7);
YAP_UserCPredicate("gecode_constraint_element_171", gecode_constraint_element_171, 7);
YAP_UserCPredicate("gecode_constraint_max_217", gecode_constraint_max_217, 3);
YAP_UserCPredicate("gecode_constraint_max_221", gecode_constraint_max_221, 3);
YAP_UserCPredicate("gecode_constraint_unshare_363", gecode_constraint_unshare_363, 2);
YAP_UserCPredicate("gecode_constraint_unshare_361", gecode_constraint_unshare_361, 2);
YAP_UserCPredicate("gecode_constraint_path_269", gecode_constraint_path_269, 5);
YAP_UserCPredicate("gecode_constraint_path_268", gecode_constraint_path_268, 5);
YAP_UserCPredicate("gecode_constraint_mult_239", gecode_constraint_mult_239, 4);
YAP_UserCPredicate("gecode_constraint_clause_50", gecode_constraint_clause_50, 6);
YAP_UserCPredicate("gecode_constraint_clause_48", gecode_constraint_clause_48, 6);
YAP_UserCPredicate("gecode_constraint_precede_274", gecode_constraint_precede_274, 5);
YAP_UserCPredicate("gecode_constraint_distinct_121", gecode_constraint_distinct_121, 2);
YAP_UserCPredicate("gecode_constraint_member_229", gecode_constraint_member_229, 4);
YAP_UserCPredicate("gecode_constraint_member_228", gecode_constraint_member_228, 4);
YAP_UserCPredicate("gecode_constraint_member_225", gecode_constraint_member_225, 4);
YAP_UserCPredicate("gecode_constraint_member_224", gecode_constraint_member_224, 4);
YAP_UserCPredicate("gecode_constraint_mod_238", gecode_constraint_mod_238, 5);
YAP_UserCPredicate("gecode_constraint_cardinality_18", gecode_constraint_cardinality_18, 3);
YAP_UserCPredicate("gecode_constraint_atmostOne_9", gecode_constraint_atmostOne_9, 3);
YAP_UserCPredicate("gecode_constraint_channelSorted_34", gecode_constraint_channelSorted_34, 3);
YAP_UserCPredicate("gecode_constraint_linear_209", gecode_constraint_linear_209, 4);
YAP_UserCPredicate("gecode_constraint_linear_213", gecode_constraint_linear_213, 4);
YAP_UserCPredicate("gecode_constraint_linear_185", gecode_constraint_linear_185, 4);
YAP_UserCPredicate("gecode_constraint_linear_189", gecode_constraint_linear_189, 4);
YAP_UserCPredicate("gecode_constraint_circuit_43", gecode_constraint_circuit_43, 2);
YAP_UserCPredicate("gecode_constraint_rel_291", gecode_constraint_rel_291, 5);
YAP_UserCPredicate("gecode_constraint_rel_290", gecode_constraint_rel_290, 5);
YAP_UserCPredicate("gecode_constraint_rel_287", gecode_constraint_rel_287, 5);
YAP_UserCPredicate("gecode_constraint_rel_286", gecode_constraint_rel_286, 5);
YAP_UserCPredicate("gecode_constraint_rel_283", gecode_constraint_rel_283, 5);
YAP_UserCPredicate("gecode_constraint_rel_281", gecode_constraint_rel_281, 5);
YAP_UserCPredicate("gecode_constraint_rel_300", gecode_constraint_rel_300, 5);
YAP_UserCPredicate("gecode_constraint_rel_296", gecode_constraint_rel_296, 5);
YAP_UserCPredicate("gecode_constraint_rel_294", gecode_constraint_rel_294, 5);
YAP_UserCPredicate("gecode_constraint_rel_324", gecode_constraint_rel_324, 5);
YAP_UserCPredicate("gecode_constraint_rel_322", gecode_constraint_rel_322, 5);
YAP_UserCPredicate("gecode_constraint_rel_308", gecode_constraint_rel_308, 5);
YAP_UserCPredicate("gecode_constraint_rel_310", gecode_constraint_rel_310, 5);
YAP_UserCPredicate("gecode_constraint_rel_304", gecode_constraint_rel_304, 5);
YAP_UserCPredicate("gecode_constraint_rel_313", gecode_constraint_rel_313, 5);
YAP_UserCPredicate("gecode_constraint_rel_312", gecode_constraint_rel_312, 5);
YAP_UserCPredicate("gecode_constraint_rel_317", gecode_constraint_rel_317, 5);
YAP_UserCPredicate("gecode_constraint_rel_316", gecode_constraint_rel_316, 5);
YAP_UserCPredicate("gecode_constraint_rel_321", gecode_constraint_rel_321, 5);
YAP_UserCPredicate("gecode_constraint_rel_332", gecode_constraint_rel_332, 5);
YAP_UserCPredicate("gecode_constraint_rel_334", gecode_constraint_rel_334, 5);
YAP_UserCPredicate("gecode_constraint_rel_280", gecode_constraint_rel_280, 5);
YAP_UserCPredicate("gecode_constraint_rel_278", gecode_constraint_rel_278, 5);
YAP_UserCPredicate("gecode_constraint_min_233", gecode_constraint_min_233, 4);
YAP_UserCPredicate("gecode_constraint_min_232", gecode_constraint_min_232, 4);
YAP_UserCPredicate("gecode_constraint_min_236", gecode_constraint_min_236, 4);
YAP_UserCPredicate("gecode_constraint_cardinality_19", gecode_constraint_cardinality_19, 4);
YAP_UserCPredicate("gecode_constraint_count_70", gecode_constraint_count_70, 4);
YAP_UserCPredicate("gecode_constraint_count_67", gecode_constraint_count_67, 4);
YAP_UserCPredicate("gecode_constraint_count_61", gecode_constraint_count_61, 4);
YAP_UserCPredicate("gecode_constraint_count_60", gecode_constraint_count_60, 4);
YAP_UserCPredicate("gecode_constraint_count_57", gecode_constraint_count_57, 4);
YAP_UserCPredicate("gecode_constraint_sqrt_347", gecode_constraint_sqrt_347, 3);
YAP_UserCPredicate("gecode_constraint_cumulatives_118", gecode_constraint_cumulatives_118, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_116", gecode_constraint_cumulatives_116, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_114", gecode_constraint_cumulatives_114, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_112", gecode_constraint_cumulatives_112, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_110", gecode_constraint_cumulatives_110, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_108", gecode_constraint_cumulatives_108, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_106", gecode_constraint_cumulatives_106, 9);
YAP_UserCPredicate("gecode_constraint_cumulatives_104", gecode_constraint_cumulatives_104, 9);
YAP_UserCPredicate("gecode_constraint_nvalues_255", gecode_constraint_nvalues_255, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_257", gecode_constraint_nvalues_257, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_251", gecode_constraint_nvalues_251, 4);
YAP_UserCPredicate("gecode_constraint_nvalues_253", gecode_constraint_nvalues_253, 4);
YAP_UserCPredicate("gecode_constraint_binpacking_10", gecode_constraint_binpacking_10, 4);
YAP_UserCPredicate("gecode_constraint_linear_204", gecode_constraint_linear_204, 7);
YAP_UserCPredicate("gecode_constraint_linear_208", gecode_constraint_linear_208, 7);
YAP_UserCPredicate("gecode_constraint_linear_196", gecode_constraint_linear_196, 7);
YAP_UserCPredicate("gecode_constraint_linear_200", gecode_constraint_linear_200, 7);
YAP_UserCPredicate("gecode_constraint_abs_2", gecode_constraint_abs_2, 4);
YAP_UserCPredicate("gecode_constraint_convex_51", gecode_constraint_convex_51, 2);
YAP_UserCPredicate("gecode_constraint_div_123", gecode_constraint_div_123, 4);
YAP_UserCPredicate("gecode_constraint_rel_314", gecode_constraint_rel_314, 6);
YAP_UserCPredicate("gecode_constraint_rel_318", gecode_constraint_rel_318, 6);
YAP_UserCPredicate("gecode_constraint_rel_301", gecode_constraint_rel_301, 6);
YAP_UserCPredicate("gecode_constraint_rel_302", gecode_constraint_rel_302, 6);
YAP_UserCPredicate("gecode_constraint_rel_292", gecode_constraint_rel_292, 6);
YAP_UserCPredicate("gecode_constraint_rel_288", gecode_constraint_rel_288, 6);
YAP_UserCPredicate("gecode_constraint_rel_284", gecode_constraint_rel_284, 6);
YAP_UserCPredicate("gecode_constraint_rel_282", gecode_constraint_rel_282, 6);
YAP_UserCPredicate("gecode_constraint_rel_327", gecode_constraint_rel_327, 6);
YAP_UserCPredicate("gecode_constraint_rel_328", gecode_constraint_rel_328, 6);
YAP_UserCPredicate("gecode_constraint_rel_329", gecode_constraint_rel_329, 6);
YAP_UserCPredicate("gecode_constraint_rel_330", gecode_constraint_rel_330, 6);
YAP_UserCPredicate("gecode_constraint_weights_365", gecode_constraint_weights_365, 5);
YAP_UserCPredicate("gecode_constraint_max_220", gecode_constraint_max_220, 5);
YAP_UserCPredicate("gecode_constraint_path_264", gecode_constraint_path_264, 9);
YAP_UserCPredicate("gecode_constraint_unary_359", gecode_constraint_unary_359, 4);
YAP_UserCPredicate("gecode_constraint_unary_355", gecode_constraint_unary_355, 4);
YAP_UserCPredicate("gecode_constraint_unary_349", gecode_constraint_unary_349, 4);
YAP_UserCPredicate("gecode_constraint_unary_352", gecode_constraint_unary_352, 4);
YAP_UserCPredicate("gecode_constraint_sorted_342", gecode_constraint_sorted_342, 5);
YAP_UserCPredicate("gecode_constraint_circuit_41", gecode_constraint_circuit_41, 5);
YAP_UserCPredicate("gecode_constraint_circuit_38", gecode_constraint_circuit_38, 5);
YAP_UserCPredicate("gecode_constraint_circuit_35", gecode_constraint_circuit_35, 5);
YAP_UserCPredicate("gecode_constraint_dom_139", gecode_constraint_dom_139, 4);
YAP_UserCPredicate("gecode_constraint_dom_143", gecode_constraint_dom_143, 4);
YAP_UserCPredicate("gecode_constraint_dom_138", gecode_constraint_dom_138, 4);
YAP_UserCPredicate("gecode_constraint_dom_135", gecode_constraint_dom_135, 4);
YAP_UserCPredicate("gecode_constraint_dom_134", gecode_constraint_dom_134, 4);
YAP_UserCPredicate("gecode_constraint_dom_131", gecode_constraint_dom_131, 4);
YAP_UserCPredicate("gecode_constraint_dom_130", gecode_constraint_dom_130, 4);
YAP_UserCPredicate("gecode_constraint_dom_128", gecode_constraint_dom_128, 4);
YAP_UserCPredicate("gecode_constraint_dom_147", gecode_constraint_dom_147, 4);
YAP_UserCPredicate("gecode_constraint_dom_145", gecode_constraint_dom_145, 4);
YAP_UserCPredicate("gecode_constraint_abs_1", gecode_constraint_abs_1, 3);
YAP_UserCPredicate("gecode_constraint_channel_29", gecode_constraint_channel_29, 5);
YAP_UserCPredicate("gecode_constraint_channel_24", gecode_constraint_channel_24, 5);
YAP_UserCPredicate("gecode_constraint_rel_305", gecode_constraint_rel_305, 3);
YAP_UserCPredicate("gecode_constraint_rel_297", gecode_constraint_rel_297, 3);
YAP_UserCPredicate("gecode_constraint_path_267", gecode_constraint_path_267, 4);
YAP_UserCPredicate("gecode_constraint_branch_14", gecode_constraint_branch_14, 4);
YAP_UserCPredicate("gecode_constraint_branch_13", gecode_constraint_branch_13, 4);
YAP_UserCPredicate("gecode_constraint_branch_15", gecode_constraint_branch_15, 4);
YAP_UserCPredicate("gecode_constraint_mult_240", gecode_constraint_mult_240, 5);
YAP_UserCPredicate("gecode_constraint_circuit_42", gecode_constraint_circuit_42, 6);
YAP_UserCPredicate("gecode_constraint_circuit_39", gecode_constraint_circuit_39, 6);
YAP_UserCPredicate("gecode_constraint_circuit_36", gecode_constraint_circuit_36, 6);
YAP_UserCPredicate("gecode_constraint_clause_49", gecode_constraint_clause_49, 5);
YAP_UserCPredicate("gecode_constraint_clause_47", gecode_constraint_clause_47, 5);
YAP_UserCPredicate("gecode_constraint_precede_276", gecode_constraint_precede_276, 4);
YAP_UserCPredicate("gecode_constraint_precede_273", gecode_constraint_precede_273, 4);
YAP_UserCPredicate("gecode_constraint_precede_272", gecode_constraint_precede_272, 4);
YAP_UserCPredicate("gecode_constraint_channel_30", gecode_constraint_channel_30, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_87", gecode_constraint_cumulative_87, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_90", gecode_constraint_cumulative_90, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_83", gecode_constraint_cumulative_83, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_86", gecode_constraint_cumulative_86, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_80", gecode_constraint_cumulative_80, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_99", gecode_constraint_cumulative_99, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_102", gecode_constraint_cumulative_102, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_95", gecode_constraint_cumulative_95, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_98", gecode_constraint_cumulative_98, 7);
YAP_UserCPredicate("gecode_constraint_cumulative_92", gecode_constraint_cumulative_92, 7);
YAP_UserCPredicate("gecode_constraint_distinct_122", gecode_constraint_distinct_122, 3);
YAP_UserCPredicate("gecode_constraint_distinct_119", gecode_constraint_distinct_119, 3);
YAP_UserCPredicate("gecode_constraint_member_230", gecode_constraint_member_230, 5);
YAP_UserCPredicate("gecode_constraint_member_226", gecode_constraint_member_226, 5);
YAP_UserCPredicate("gecode_constraint_mod_237", gecode_constraint_mod_237, 4);
YAP_UserCPredicate("gecode_constraint_sqr_345", gecode_constraint_sqr_345, 3);
YAP_UserCPredicate("gecode_constraint_sequence_338", gecode_constraint_sequence_338, 7);
YAP_UserCPredicate("gecode_constraint_sequence_336", gecode_constraint_sequence_336, 7);
YAP_UserCPredicate("gecode_constraint_path_265", gecode_constraint_path_265, 7);
YAP_UserCPredicate("gecode_constraint_path_262", gecode_constraint_path_262, 7);
YAP_UserCPredicate("gecode_constraint_path_259", gecode_constraint_path_259, 7);
YAP_UserCPredicate("gecode_constraint_divmod_126", gecode_constraint_divmod_126, 6);
YAP_UserCPredicate("gecode_constraint_sorted_343", gecode_constraint_sorted_343, 3);
YAP_UserCPredicate("gecode_constraint_circuit_45", gecode_constraint_circuit_45, 3);
YAP_UserCPredicate("gecode_constraint_circuit_44", gecode_constraint_circuit_44, 3);
YAP_UserCPredicate("gecode_constraint_channel_32", gecode_constraint_channel_32, 3);
YAP_UserCPredicate("gecode_constraint_channel_28", gecode_constraint_channel_28, 3);
YAP_UserCPredicate("gecode_constraint_channel_26", gecode_constraint_channel_26, 3);
YAP_UserCPredicate("gecode_constraint_channel_22", gecode_constraint_channel_22, 3);
YAP_UserCPredicate("gecode_constraint_channel_25", gecode_constraint_channel_25, 3);
YAP_UserCPredicate("gecode_constraint_channel_20", gecode_constraint_channel_20, 3);
YAP_UserCPredicate("gecode_constraint_channel_31", gecode_constraint_channel_31, 3);
YAP_UserCPredicate("gecode_constraint_count_53", gecode_constraint_count_53, 5);
YAP_UserCPredicate("gecode_constraint_count_55", gecode_constraint_count_55, 5);
YAP_UserCPredicate("gecode_constraint_count_71", gecode_constraint_count_71, 5);
YAP_UserCPredicate("gecode_constraint_count_73", gecode_constraint_count_73, 5);
YAP_UserCPredicate("gecode_constraint_count_63", gecode_constraint_count_63, 5);
YAP_UserCPredicate("gecode_constraint_count_65", gecode_constraint_count_65, 5);
YAP_UserCPredicate("gecode_constraint_count_62", gecode_constraint_count_62, 5);
YAP_UserCPredicate("gecode_constraint_count_58", gecode_constraint_count_58, 5);
YAP_UserCPredicate("gecode_constraint_count_68", gecode_constraint_count_68, 5);
YAP_UserCPredicate("gecode_constraint_count_75", gecode_constraint_count_75, 5);
YAP_UserCPredicate("gecode_constraint_count_77", gecode_constraint_count_77, 5);
YAP_UserCPredicate("gecode_constraint_cumulatives_117", gecode_constraint_cumulatives_117, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_115", gecode_constraint_cumulatives_115, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_113", gecode_constraint_cumulatives_113, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_111", gecode_constraint_cumulatives_111, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_109", gecode_constraint_cumulatives_109, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_107", gecode_constraint_cumulatives_107, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_105", gecode_constraint_cumulatives_105, 8);
YAP_UserCPredicate("gecode_constraint_cumulatives_103", gecode_constraint_cumulatives_103, 8);
YAP_UserCPredicate("gecode_constraint_binpacking_11", gecode_constraint_binpacking_11, 5);
YAP_UserCPredicate("gecode_constraint_linear_212", gecode_constraint_linear_212, 6);
YAP_UserCPredicate("gecode_constraint_linear_216", gecode_constraint_linear_216, 6);
YAP_UserCPredicate("gecode_constraint_linear_188", gecode_constraint_linear_188, 6);
YAP_UserCPredicate("gecode_constraint_linear_192", gecode_constraint_linear_192, 6);
YAP_UserCPredicate("gecode_constraint_linear_203", gecode_constraint_linear_203, 6);
YAP_UserCPredicate("gecode_constraint_linear_202", gecode_constraint_linear_202, 6);
YAP_UserCPredicate("gecode_constraint_linear_207", gecode_constraint_linear_207, 6);
YAP_UserCPredicate("gecode_constraint_linear_206", gecode_constraint_linear_206, 6);
YAP_UserCPredicate("gecode_constraint_linear_195", gecode_constraint_linear_195, 6);
YAP_UserCPredicate("gecode_constraint_linear_194", gecode_constraint_linear_194, 6);
YAP_UserCPredicate("gecode_constraint_linear_199", gecode_constraint_linear_199, 6);
YAP_UserCPredicate("gecode_constraint_linear_198", gecode_constraint_linear_198, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_247", gecode_constraint_nooverlap_247, 7);
YAP_UserCPredicate("gecode_constraint_nooverlap_242", gecode_constraint_nooverlap_242, 7);
YAP_UserCPredicate("gecode_constraint_div_124", gecode_constraint_div_124, 5);
YAP_UserCPredicate("gecode_constraint_sqr_346", gecode_constraint_sqr_346, 4);
YAP_UserCPredicate("gecode_constraint_path_266", gecode_constraint_path_266, 8);
YAP_UserCPredicate("gecode_constraint_path_263", gecode_constraint_path_263, 8);
YAP_UserCPredicate("gecode_constraint_path_260", gecode_constraint_path_260, 8);
YAP_UserCPredicate("gecode_constraint_unary_357", gecode_constraint_unary_357, 5);
YAP_UserCPredicate("gecode_constraint_unary_360", gecode_constraint_unary_360, 5);
YAP_UserCPredicate("gecode_constraint_unary_353", gecode_constraint_unary_353, 5);
YAP_UserCPredicate("gecode_constraint_unary_356", gecode_constraint_unary_356, 5);
YAP_UserCPredicate("gecode_constraint_unary_350", gecode_constraint_unary_350, 5);
YAP_UserCPredicate("gecode_constraint_sorted_341", gecode_constraint_sorted_341, 4);
YAP_UserCPredicate("gecode_constraint_sorted_344", gecode_constraint_sorted_344, 4);
YAP_UserCPredicate("gecode_constraint_element_162", gecode_constraint_element_162, 8);
YAP_UserCPredicate("gecode_constraint_element_156", gecode_constraint_element_156, 8);
YAP_UserCPredicate("gecode_constraint_element_174", gecode_constraint_element_174, 8);
YAP_UserCPredicate("gecode_constraint_element_172", gecode_constraint_element_172, 8);
YAP_UserCPredicate("gecode_constraint_element_160", gecode_constraint_element_160, 5);
YAP_UserCPredicate("gecode_constraint_element_164", gecode_constraint_element_164, 5);
YAP_UserCPredicate("gecode_constraint_element_154", gecode_constraint_element_154, 5);
YAP_UserCPredicate("gecode_constraint_element_152", gecode_constraint_element_152, 5);
YAP_UserCPredicate("gecode_constraint_element_183", gecode_constraint_element_183, 5);
YAP_UserCPredicate("gecode_constraint_element_181", gecode_constraint_element_181, 5);
YAP_UserCPredicate("gecode_constraint_element_179", gecode_constraint_element_179, 5);
YAP_UserCPredicate("gecode_constraint_element_177", gecode_constraint_element_177, 5);
YAP_UserCPredicate("gecode_constraint_element_170", gecode_constraint_element_170, 5);
YAP_UserCPredicate("gecode_constraint_element_176", gecode_constraint_element_176, 5);
YAP_UserCPredicate("gecode_constraint_element_168", gecode_constraint_element_168, 5);
YAP_UserCPredicate("gecode_constraint_sequence_340", gecode_constraint_sequence_340, 3);
YAP_UserCPredicate("gecode_constraint_circuit_40", gecode_constraint_circuit_40, 7);
YAP_UserCPredicate("gecode_constraint_precede_275", gecode_constraint_precede_275, 3);
YAP_UserCPredicate("gecode_constraint_precede_271", gecode_constraint_precede_271, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_89", gecode_constraint_cumulative_89, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_85", gecode_constraint_cumulative_85, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_79", gecode_constraint_cumulative_79, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_82", gecode_constraint_cumulative_82, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_101", gecode_constraint_cumulative_101, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_97", gecode_constraint_cumulative_97, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_91", gecode_constraint_cumulative_91, 6);
YAP_UserCPredicate("gecode_constraint_cumulative_94", gecode_constraint_cumulative_94, 6);
YAP_UserCPredicate("gecode_constraint_distinct_120", gecode_constraint_distinct_120, 4);
YAP_UserCPredicate("gecode_constraint_min_231", gecode_constraint_min_231, 3);
YAP_UserCPredicate("gecode_constraint_min_235", gecode_constraint_min_235, 3);
YAP_UserCPredicate("gecode_constraint_sqrt_348", gecode_constraint_sqrt_348, 4);
YAP_UserCPredicate("gecode_constraint_sequence_337", gecode_constraint_sequence_337, 6);
YAP_UserCPredicate("gecode_constraint_sequence_335", gecode_constraint_sequence_335, 6);
YAP_UserCPredicate("gecode_constraint_unshare_364", gecode_constraint_unshare_364, 3);
YAP_UserCPredicate("gecode_constraint_unshare_362", gecode_constraint_unshare_362, 3);
YAP_UserCPredicate("gecode_constraint_path_270", gecode_constraint_path_270, 6);
YAP_UserCPredicate("gecode_constraint_path_261", gecode_constraint_path_261, 6);
YAP_UserCPredicate("gecode_constraint_divmod_125", gecode_constraint_divmod_125, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_246", gecode_constraint_nooverlap_246, 9);
YAP_UserCPredicate("gecode_constraint_cumulative_81", gecode_constraint_cumulative_81, 5);
YAP_UserCPredicate("gecode_constraint_cumulative_93", gecode_constraint_cumulative_93, 5);
YAP_UserCPredicate("gecode_constraint_member_227", gecode_constraint_member_227, 3);
YAP_UserCPredicate("gecode_constraint_member_223", gecode_constraint_member_223, 3);
YAP_UserCPredicate("gecode_constraint_count_72", gecode_constraint_count_72, 6);
YAP_UserCPredicate("gecode_constraint_count_74", gecode_constraint_count_74, 6);
YAP_UserCPredicate("gecode_constraint_count_76", gecode_constraint_count_76, 6);
YAP_UserCPredicate("gecode_constraint_count_78", gecode_constraint_count_78, 6);
YAP_UserCPredicate("gecode_constraint_count_64", gecode_constraint_count_64, 6);
YAP_UserCPredicate("gecode_constraint_count_66", gecode_constraint_count_66, 6);
YAP_UserCPredicate("gecode_constraint_count_54", gecode_constraint_count_54, 6);
YAP_UserCPredicate("gecode_constraint_count_56", gecode_constraint_count_56, 6);
YAP_UserCPredicate("gecode_constraint_notMin_250", gecode_constraint_notMin_250, 3);
YAP_UserCPredicate("gecode_constraint_cumulative_88", gecode_constraint_cumulative_88, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_84", gecode_constraint_cumulative_84, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_100", gecode_constraint_cumulative_100, 8);
YAP_UserCPredicate("gecode_constraint_cumulative_96", gecode_constraint_cumulative_96, 8);
YAP_UserCPredicate("gecode_constraint_branch_16", gecode_constraint_branch_16, 3);
YAP_UserCPredicate("gecode_constraint_branch_12", gecode_constraint_branch_12, 3);
YAP_UserCPredicate("gecode_constraint_branch_17", gecode_constraint_branch_17, 3);
YAP_UserCPredicate("gecode_constraint_dom_137", gecode_constraint_dom_137, 3);
YAP_UserCPredicate("gecode_constraint_dom_133", gecode_constraint_dom_133, 3);
YAP_UserCPredicate("gecode_constraint_dom_129", gecode_constraint_dom_129, 3);
YAP_UserCPredicate("gecode_constraint_dom_127", gecode_constraint_dom_127, 3);
YAP_UserCPredicate("gecode_constraint_linear_211", gecode_constraint_linear_211, 5);
YAP_UserCPredicate("gecode_constraint_linear_210", gecode_constraint_linear_210, 5);
YAP_UserCPredicate("gecode_constraint_linear_215", gecode_constraint_linear_215, 5);
YAP_UserCPredicate("gecode_constraint_linear_214", gecode_constraint_linear_214, 5);
YAP_UserCPredicate("gecode_constraint_linear_187", gecode_constraint_linear_187, 5);
YAP_UserCPredicate("gecode_constraint_linear_186", gecode_constraint_linear_186, 5);
YAP_UserCPredicate("gecode_constraint_linear_191", gecode_constraint_linear_191, 5);
YAP_UserCPredicate("gecode_constraint_linear_190", gecode_constraint_linear_190, 5);
YAP_UserCPredicate("gecode_constraint_linear_201", gecode_constraint_linear_201, 5);
YAP_UserCPredicate("gecode_constraint_linear_205", gecode_constraint_linear_205, 5);
YAP_UserCPredicate("gecode_constraint_linear_193", gecode_constraint_linear_193, 5);
YAP_UserCPredicate("gecode_constraint_linear_197", gecode_constraint_linear_197, 5);
YAP_UserCPredicate("gecode_constraint_nooverlap_241", gecode_constraint_nooverlap_241, 6);
YAP_UserCPredicate("gecode_constraint_nooverlap_244", gecode_constraint_nooverlap_244, 6);
YAP_UserCPredicate("gecode_constraint_element_184", gecode_constraint_element_184, 6);
YAP_UserCPredicate("gecode_constraint_element_182", gecode_constraint_element_182, 6);
YAP_UserCPredicate("gecode_constraint_element_180", gecode_constraint_element_180, 6);
YAP_UserCPredicate("gecode_constraint_element_178", gecode_constraint_element_178, 6);
YAP_UserCPredicate("gecode_constraint_rel_289", gecode_constraint_rel_289, 4);
YAP_UserCPredicate("gecode_constraint_rel_285", gecode_constraint_rel_285, 4);
YAP_UserCPredicate("gecode_constraint_rel_299", gecode_constraint_rel_299, 4);
YAP_UserCPredicate("gecode_constraint_rel_295", gecode_constraint_rel_295, 4);
YAP_UserCPredicate("gecode_constraint_rel_293", gecode_constraint_rel_293, 4);
YAP_UserCPredicate("gecode_constraint_rel_298", gecode_constraint_rel_298, 4);
YAP_UserCPredicate("gecode_constraint_rel_325", gecode_constraint_rel_325, 4);
YAP_UserCPredicate("gecode_constraint_rel_323", gecode_constraint_rel_323, 4);
YAP_UserCPredicate("gecode_constraint_rel_307", gecode_constraint_rel_307, 4);
YAP_UserCPredicate("gecode_constraint_rel_309", gecode_constraint_rel_309, 4);
YAP_UserCPredicate("gecode_constraint_rel_303", gecode_constraint_rel_303, 4);
YAP_UserCPredicate("gecode_constraint_rel_306", gecode_constraint_rel_306, 4);
YAP_UserCPredicate("gecode_constraint_rel_311", gecode_constraint_rel_311, 4);
YAP_UserCPredicate("gecode_constraint_rel_315", gecode_constraint_rel_315, 4);
YAP_UserCPredicate("gecode_constraint_rel_319", gecode_constraint_rel_319, 4);
YAP_UserCPredicate("gecode_constraint_rel_320", gecode_constraint_rel_320, 4);
YAP_UserCPredicate("gecode_constraint_rel_326", gecode_constraint_rel_326, 4);
YAP_UserCPredicate("gecode_constraint_rel_331", gecode_constraint_rel_331, 4);
YAP_UserCPredicate("gecode_constraint_rel_333", gecode_constraint_rel_333, 4);
YAP_UserCPredicate("gecode_constraint_rel_279", gecode_constraint_rel_279, 4);
YAP_UserCPredicate("gecode_constraint_rel_277", gecode_constraint_rel_277, 4);
YAP_UserCPredicate("gecode_constraint_min_234", gecode_constraint_min_234, 5);
YAP_UserCPredicate("gecode_constraint_count_69", gecode_constraint_count_69, 3);
YAP_UserCPredicate("gecode_constraint_count_59", gecode_constraint_count_59, 3);

View File

@ -38,6 +38,16 @@ for an interval of themselves). It might be tempting to simply represent an
IntSet as a list of specs, but this would be ambiguous with IntArgs which,
here, are represented as lists of ints.
Space += keep(Var)
Space += keep(Vars)
Variables can be marked as "kept". In this case, only such variables will be
explicitly copied during search. This could bring substantial benefits in
memory usage. Of course, in a solution, you can then only look at variables
that have been "kept". If no variable is marked as "kept", then they are all
kept. Thus marking variables as "kept" is purely an optimization.
CONSTRAINTS AND BRANCHINGS
==========================
@ -60,10 +70,24 @@ represented by atoms with the same name as the Gecode constant
SEARCHING FOR SOLUTIONS
=======================
SolSpace := search(Space)
SolSpace := search(Space)
This is a backtrackable predicate that enumerates all solution spaces
(SolSpace).
(SolSpace). It may also take options:
SolSpace := search(Space,Options)
Options is a list whose elements maybe:
restart
to select the Restart search engine
threads=N
to activate the parallel search engine and control the number of
workers (see Gecode doc)
c_d=N
to set the commit distance for recomputation
a_d=N
to set the adaptive distance for recomputation
EXTRACTING INFO FROM A SOLUTION
===============================

View File

@ -42,45 +42,32 @@ CWD=$(PWD)
OBJS=gecode_yap.o
SOBJS=gecode_yap.@SO@
CODEGEN=$(srcdir)/code-generator.py
GECODE_VERSION = @GECODE_VERSION@
DISJUNCTOR = -DDISJUNCTOR
PYTHON = @PYTHON@ -B
export PYTHONPATH:=$(srcdir):$(PYTHONPATH)
GECODE_LIBS = @GECODE_EXTRALIBS@
all: $(SOBJS) gecode.yap
gecode_yap.o: \
$(srcdir)/gecode_yap.cc \
$(srcdir)/gecode-common.icc \
gecode_yap_cc_impl_auto_generated.icc \
gecode_yap_cc_init_auto_generated.icc \
gecode_yap_cc_forward_auto_generated.icc \
$(srcdir)/$(GECODE_VERSION)/gecode_yap_cc_impl_auto_generated.icc \
$(srcdir)/$(GECODE_VERSION)/gecode_yap_cc_init_auto_generated.icc \
$(srcdir)/$(GECODE_VERSION)/gecode_yap_cc_forward_auto_generated.icc \
$(srcdir)/disjunctor.icc \
$(srcdir)/disjunctor.hh
$(CXX) -c $(CXXFLAGS) $(DISJUNCTOR) -o $@ $<
$(CXX) -c -I$(srcdir)/$(GECODE_VERSION) $(CXXFLAGS) $(DISJUNCTOR) -o $@ $<
@DO_SECOND_LD@gecode_yap.@SO@: gecode_yap.o
@DO_SECOND_LD@ @SHLIB_LD@ -o gecode_yap.@SO@ gecode_yap.o $(LDFLAGS) -lgecodeint -lgecodeset -lgecodesearch @EXTRA_LIBS_FOR_DLLS@
@DO_SECOND_LD@ @SHLIB_CXX_LD@ -o gecode_yap.@SO@ gecode_yap.o $(LDFLAGS) $(GECODE_LIBS) @EXTRA_LIBS_FOR_DLLS@
gecode_yap_cc_init_auto_generated.icc: $(CODEGEN)
$(PYTHON) $< -t yap-cc-init -s $(srcdir) > $@
gecode_yap_cc_impl_auto_generated.icc: $(CODEGEN)
$(PYTHON) $< -t yap-cc-impl -s $(srcdir) > $@
gecode_yap_cc_forward_auto_generated.icc: $(CODEGEN)
$(PYTHON) $< -t yap-cc-forward -s $(srcdir) > $@
gecode_yap_auto_generated.yap: $(CODEGEN)
$(PYTHON) $< -t yap-prolog -s $(srcdir) > $@
gecode.yap: $(srcdir)/gecode_yap_hand_written.yap gecode_yap_auto_generated.yap
gecode.yap: $(srcdir)/gecode_yap_hand_written.yap $(srcdir)/$(GECODE_VERSION)/gecode_yap_auto_generated.yap
cat $^ > $@
.PHONY: all clean install
clean:
-rm -f *.o *.so *~ *_auto_generated* gecode.yap *.pyc
-rm -f *.o *.so *~ gecode.yap
install: all
mkdir -p $(DESTDIR)$(YAPLIBDIR)

View File

@ -0,0 +1,5 @@
all:
python code-generator.py
clean:
-rm -f *~ *.pyc

View File

@ -13,7 +13,7 @@
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see <http:##www.gnu.org/licenses/>.
# this program. If not, see <http://www.gnu.org/licenses/>.
#==============================================================================
import re
@ -515,16 +515,13 @@ ENUM_CLASSES_AVOID = ('ScriptMode','ViewSelStatus','ExecStatus',
def enum_classes():
global ENUM_CLASSES
filename = "gecode-enums-%s.py" % gecode_version()
if SRCDIR is not None:
import os.path
filename = os.path.join(SRCDIR,filename)
if ENUM_CLASSES is None:
filename = "gecode-enums-%s.py" % gecode_version()
import imp
ENUM_CLASSES = imp.load_source(
"gecode_enums",
filename).ENUM_CLASSES
ENUM_CLASSES = (x for x in ENUM_CLASSES if x.TYPE not in ENUM_CLASSES_AVOID)
ENUM_CLASSES = tuple(x for x in ENUM_CLASSES if x.TYPE not in ENUM_CLASSES_AVOID)
return ENUM_CLASSES
class YAPEnumImpl(object):
@ -668,42 +665,40 @@ def gecode_version():
GECODE_VERSION = version
return version
SRCDIR = None
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser(
description="code generator for gecode bindings")
parser.add_argument(
"-t", "--target", choices=("yap-prolog","yap-cc-impl","yap-cc-init",
"yap-cc-forward"),
default=None, metavar="TARGET", required=True,
help="type of code to generate")
parser.add_argument(
"-s", "--srcdir", metavar="DIR", default=None,
help="source directory")
args = parser.parse_args()
if args.srcdir is not None:
import os.path
SRCDIR = os.path.abspath(args.srcdir)
def generate_files():
DIR = "../%s" % gecode_version()
import os, os.path
DIR = os.path.abspath(DIR)
if not os.path.exists(DIR):
os.mkdir(DIR)
filename = "gecode-prototypes-%s.hh" % gecode_version()
if SRCDIR is not None:
filename = os.path.join(SRCDIR,filename)
if args.target == "yap-prolog":
import sys
stdout = sys.stdout
try:
sys.stdout = file(os.path.join(DIR,"gecode-version.txt"),"w")
print gecode_version()
sys.stdout.close()
sys.stdout = file(os.path.join(DIR,"gecode_yap_auto_generated.yap"),"w")
prolog_print_notice()
YAPEnumPrologGenerator().generate()
YAPConstraintPrologGenerator(filename).generate()
elif args.target == "yap-cc-impl":
sys.stdout.close()
sys.stdout = file(os.path.join(DIR,"gecode_yap_cc_impl_auto_generated.icc"),"w")
cc_print_notice()
YAPEnumImplGenerator().generate()
YAPConstraintCCGenerator(filename).generate_impl()
elif args.target == "yap-cc-init":
sys.stdout.close()
sys.stdout = file(os.path.join(DIR,"gecode_yap_cc_init_auto_generated.icc"),"w")
cc_print_notice()
YAPEnumInitGenerator().generate()
YAPConstraintCCGenerator(filename).generate_init()
elif args.target == "yap-cc-forward":
sys.stdout.close()
sys.stdout = file(os.path.join(DIR,"gecode_yap_cc_forward_auto_generated.icc"),"w")
cc_print_notice()
YAPEnumForwardGenerator().generate()
else:
raise NotImplementedError("target not yet suported: %s" % args.target)
sys.stdout.close()
finally:
sys.stdout = stdout
if __name__ == '__main__':
generate_files()

View File

@ -1,8 +1,8 @@
GECODEDIR := $(shell g++ -q $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||')
GECODECONFIG := $(GECODEDIR)/support/config.hpp
GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep GECODE_VERSION | awk '{print $$3}' | sed 's/"//g')
PROTOTYPES = gecode-prototypes-$(GECODEVERSION).hh
ENUMS = gecode-enums-$(GECODEVERSION).py
GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep '\<GECODE_VERSION\>' | awk '{print $$3}' | sed 's/"//g')
PROTOTYPES = ../gecode-prototypes-$(GECODEVERSION).hh
ENUMS = ../gecode-enums-$(GECODEVERSION).py
all: $(PROTOTYPES) $(ENUMS)

View File

@ -0,0 +1,113 @@
# This file was automatically extracted from Gecode source files.
# It is subject to the same Copyright as the source files from which
# it is derived, and is distributed under the same Licensing conditions.
ENUM_CLASSES = []
class ScriptMode(object):
TYPE = 'ScriptMode'
ENUM = ['SM_SOLUTION','SM_TIME','SM_STAT','SM_GIST']
ENUM_CLASSES.append(ScriptMode)
class IntRelType(object):
TYPE = 'IntRelType'
ENUM = ['IRT_EQ','IRT_NQ','IRT_LQ','IRT_LE','IRT_GQ','IRT_GR']
ENUM_CLASSES.append(IntRelType)
class BoolOpType(object):
TYPE = 'BoolOpType'
ENUM = ['BOT_AND','BOT_OR','BOT_IMP','BOT_EQV','BOT_XOR']
ENUM_CLASSES.append(BoolOpType)
class IntConLevel(object):
TYPE = 'IntConLevel'
ENUM = ['ICL_VAL','ICL_BND','ICL_DOM','ICL_DEF']
ENUM_CLASSES.append(IntConLevel)
class TaskType(object):
TYPE = 'TaskType'
ENUM = ['TT_FIXP','TT_FIXS','TT_FIXE']
ENUM_CLASSES.append(TaskType)
class ExtensionalPropKind(object):
TYPE = 'ExtensionalPropKind'
ENUM = ['EPK_DEF','EPK_SPEED','EPK_MEMORY']
ENUM_CLASSES.append(ExtensionalPropKind)
class IntVarBranch(object):
TYPE = 'IntVarBranch'
ENUM = ['INT_VAR_NONE','INT_VAR_RND','INT_VAR_DEGREE_MIN','INT_VAR_DEGREE_MAX','INT_VAR_AFC_MIN','INT_VAR_AFC_MAX','INT_VAR_MIN_MIN','INT_VAR_MIN_MAX','INT_VAR_MAX_MIN','INT_VAR_MAX_MAX','INT_VAR_SIZE_MIN','INT_VAR_SIZE_MAX','INT_VAR_SIZE_DEGREE_MIN','INT_VAR_SIZE_DEGREE_MAX','INT_VAR_SIZE_AFC_MIN','INT_VAR_SIZE_AFC_MAX','INT_VAR_REGRET_MIN_MIN','INT_VAR_REGRET_MIN_MAX','INT_VAR_REGRET_MAX_MIN','INT_VAR_REGRET_MAX_MAX']
ENUM_CLASSES.append(IntVarBranch)
class IntValBranch(object):
TYPE = 'IntValBranch'
ENUM = ['INT_VAL_MIN','INT_VAL_MED','INT_VAL_MAX','INT_VAL_RND','INT_VAL_SPLIT_MIN','INT_VAL_SPLIT_MAX','INT_VAL_RANGE_MIN','INT_VAL_RANGE_MAX','INT_VALUES_MIN','INT_VALUES_MAX']
ENUM_CLASSES.append(IntValBranch)
class IntAssign(object):
TYPE = 'IntAssign'
ENUM = ['INT_ASSIGN_MIN','INT_ASSIGN_MED','INT_ASSIGN_MAX','INT_ASSIGN_RND']
ENUM_CLASSES.append(IntAssign)
class ViewSelStatus(object):
TYPE = 'ViewSelStatus'
ENUM = ['VSS_BEST','VSS_BETTER','VSS_TIE','VSS_WORSE']
ENUM_CLASSES.append(ViewSelStatus)
class ExecStatus(object):
TYPE = 'ExecStatus'
ENUM = ['__ES_SUBSUMED','ES_FAILED','ES_NOFIX','ES_OK','ES_FIX','ES_NOFIX_FORCE','__ES_PARTIAL']
ENUM_CLASSES.append(ExecStatus)
class ActorProperty(object):
TYPE = 'ActorProperty'
ENUM = ['AP_DISPOSE','AP_WEAKLY']
ENUM_CLASSES.append(ActorProperty)
class SpaceStatus(object):
TYPE = 'SpaceStatus'
ENUM = ['SS_FAILED','SS_SOLVED','SS_BRANCH']
ENUM_CLASSES.append(SpaceStatus)
class SetRelType(object):
TYPE = 'SetRelType'
ENUM = ['SRT_EQ','SRT_NQ','SRT_SUB','SRT_SUP','SRT_DISJ','SRT_CMPL','SRT_LQ','SRT_LE','SRT_GQ','SRT_GR']
ENUM_CLASSES.append(SetRelType)
class SetOpType(object):
TYPE = 'SetOpType'
ENUM = ['SOT_UNION','SOT_DUNION','SOT_INTER','SOT_MINUS']
ENUM_CLASSES.append(SetOpType)
class SetVarBranch(object):
TYPE = 'SetVarBranch'
ENUM = ['SET_VAR_NONE','SET_VAR_RND','SET_VAR_DEGREE_MIN','SET_VAR_DEGREE_MAX','SET_VAR_AFC_MIN','SET_VAR_AFC_MAX','SET_VAR_MIN_MIN','SET_VAR_MIN_MAX','SET_VAR_MAX_MIN','SET_VAR_MAX_MAX','SET_VAR_SIZE_MIN','SET_VAR_SIZE_MAX','SET_VAR_SIZE_DEGREE_MIN','SET_VAR_SIZE_DEGREE_MAX','SET_VAR_SIZE_AFC_MIN','SET_VAR_SIZE_AFC_MAX']
ENUM_CLASSES.append(SetVarBranch)
class SetValBranch(object):
TYPE = 'SetValBranch'
ENUM = ['SET_VAL_MIN_INC','SET_VAL_MIN_EXC','SET_VAL_MED_INC','SET_VAL_MED_EXC','SET_VAL_MAX_INC','SET_VAL_MAX_EXC','SET_VAL_RND_INC','SET_VAL_RND_EXC']
ENUM_CLASSES.append(SetValBranch)
class SetAssign(object):
TYPE = 'SetAssign'
ENUM = ['SET_ASSIGN_MIN_INC','SET_ASSIGN_MIN_EXC','SET_ASSIGN_MED_INC','SET_ASSIGN_MED_EXC','SET_ASSIGN_MAX_INC','SET_ASSIGN_MAX_EXC','SET_ASSIGN_RND_INC','SET_ASSIGN_RND_EXC']
ENUM_CLASSES.append(SetAssign)

View File

@ -0,0 +1,119 @@
# This file was automatically extracted from Gecode source files.
# It is subject to the same Copyright as the source files from which
# it is derived, and is distributed under the same Licensing conditions.
ENUM_CLASSES = []
class ScriptMode(object):
TYPE = 'ScriptMode'
ENUM = ['SM_SOLUTION','SM_TIME','SM_STAT','SM_GIST']
ENUM_CLASSES.append(ScriptMode)
class ReifyMode(object):
TYPE = 'ReifyMode'
ENUM = ['RM_EQV','RM_IMP','RM_PMI']
ENUM_CLASSES.append(ReifyMode)
class IntRelType(object):
TYPE = 'IntRelType'
ENUM = ['IRT_EQ','IRT_NQ','IRT_LQ','IRT_LE','IRT_GQ','IRT_GR']
ENUM_CLASSES.append(IntRelType)
class BoolOpType(object):
TYPE = 'BoolOpType'
ENUM = ['BOT_AND','BOT_OR','BOT_IMP','BOT_EQV','BOT_XOR']
ENUM_CLASSES.append(BoolOpType)
class IntConLevel(object):
TYPE = 'IntConLevel'
ENUM = ['ICL_VAL','ICL_BND','ICL_DOM','ICL_DEF']
ENUM_CLASSES.append(IntConLevel)
class TaskType(object):
TYPE = 'TaskType'
ENUM = ['TT_FIXP','TT_FIXS','TT_FIXE']
ENUM_CLASSES.append(TaskType)
class ExtensionalPropKind(object):
TYPE = 'ExtensionalPropKind'
ENUM = ['EPK_DEF','EPK_SPEED','EPK_MEMORY']
ENUM_CLASSES.append(ExtensionalPropKind)
class IntVarBranch(object):
TYPE = 'IntVarBranch'
ENUM = ['INT_VAR_NONE','INT_VAR_RND','INT_VAR_DEGREE_MIN','INT_VAR_DEGREE_MAX','INT_VAR_AFC_MIN','INT_VAR_AFC_MAX','INT_VAR_MIN_MIN','INT_VAR_MIN_MAX','INT_VAR_MAX_MIN','INT_VAR_MAX_MAX','INT_VAR_SIZE_MIN','INT_VAR_SIZE_MAX','INT_VAR_SIZE_DEGREE_MIN','INT_VAR_SIZE_DEGREE_MAX','INT_VAR_SIZE_AFC_MIN','INT_VAR_SIZE_AFC_MAX','INT_VAR_REGRET_MIN_MIN','INT_VAR_REGRET_MIN_MAX','INT_VAR_REGRET_MAX_MIN','INT_VAR_REGRET_MAX_MAX']
ENUM_CLASSES.append(IntVarBranch)
class IntValBranch(object):
TYPE = 'IntValBranch'
ENUM = ['INT_VAL_MIN','INT_VAL_MED','INT_VAL_MAX','INT_VAL_RND','INT_VAL_SPLIT_MIN','INT_VAL_SPLIT_MAX','INT_VAL_RANGE_MIN','INT_VAL_RANGE_MAX','INT_VALUES_MIN','INT_VALUES_MAX']
ENUM_CLASSES.append(IntValBranch)
class IntAssign(object):
TYPE = 'IntAssign'
ENUM = ['INT_ASSIGN_MIN','INT_ASSIGN_MED','INT_ASSIGN_MAX','INT_ASSIGN_RND']
ENUM_CLASSES.append(IntAssign)
class ViewSelStatus(object):
TYPE = 'ViewSelStatus'
ENUM = ['VSS_BEST','VSS_BETTER','VSS_TIE','VSS_WORSE']
ENUM_CLASSES.append(ViewSelStatus)
class ExecStatus(object):
TYPE = 'ExecStatus'
ENUM = ['__ES_SUBSUMED','ES_FAILED','ES_NOFIX','ES_OK','ES_FIX','ES_NOFIX_FORCE','__ES_PARTIAL']
ENUM_CLASSES.append(ExecStatus)
class ActorProperty(object):
TYPE = 'ActorProperty'
ENUM = ['AP_DISPOSE','AP_WEAKLY']
ENUM_CLASSES.append(ActorProperty)
class SpaceStatus(object):
TYPE = 'SpaceStatus'
ENUM = ['SS_FAILED','SS_SOLVED','SS_BRANCH']
ENUM_CLASSES.append(SpaceStatus)
class SetRelType(object):
TYPE = 'SetRelType'
ENUM = ['SRT_EQ','SRT_NQ','SRT_SUB','SRT_SUP','SRT_DISJ','SRT_CMPL','SRT_LQ','SRT_LE','SRT_GQ','SRT_GR']
ENUM_CLASSES.append(SetRelType)
class SetOpType(object):
TYPE = 'SetOpType'
ENUM = ['SOT_UNION','SOT_DUNION','SOT_INTER','SOT_MINUS']
ENUM_CLASSES.append(SetOpType)
class SetVarBranch(object):
TYPE = 'SetVarBranch'
ENUM = ['SET_VAR_NONE','SET_VAR_RND','SET_VAR_DEGREE_MIN','SET_VAR_DEGREE_MAX','SET_VAR_AFC_MIN','SET_VAR_AFC_MAX','SET_VAR_MIN_MIN','SET_VAR_MIN_MAX','SET_VAR_MAX_MIN','SET_VAR_MAX_MAX','SET_VAR_SIZE_MIN','SET_VAR_SIZE_MAX','SET_VAR_SIZE_DEGREE_MIN','SET_VAR_SIZE_DEGREE_MAX','SET_VAR_SIZE_AFC_MIN','SET_VAR_SIZE_AFC_MAX']
ENUM_CLASSES.append(SetVarBranch)
class SetValBranch(object):
TYPE = 'SetValBranch'
ENUM = ['SET_VAL_MIN_INC','SET_VAL_MIN_EXC','SET_VAL_MED_INC','SET_VAL_MED_EXC','SET_VAL_MAX_INC','SET_VAL_MAX_EXC','SET_VAL_RND_INC','SET_VAL_RND_EXC']
ENUM_CLASSES.append(SetValBranch)
class SetAssign(object):
TYPE = 'SetAssign'
ENUM = ['SET_ASSIGN_MIN_INC','SET_ASSIGN_MIN_EXC','SET_ASSIGN_MED_INC','SET_ASSIGN_MED_EXC','SET_ASSIGN_MAX_INC','SET_ASSIGN_MAX_EXC','SET_ASSIGN_RND_INC','SET_ASSIGN_RND_EXC']
ENUM_CLASSES.append(SetAssign)

View File

@ -0,0 +1,221 @@
// This file was automatically extracted from Gecode source files.
// It is subject to the same Copyright as the source files from which
// it is derived, and is distributed under the same Licensing conditions.
void abs(Home,IntVar,IntVar,IntConLevel=ICL_DEF);
void assign(Home,BoolVar,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,const BoolVarArgs&,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,const IntVarArgs&,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,const SetVarArgs&,SetAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,IntVar,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,SetVar,SetAssign,const ValBranchOptions&=ValBranchOptions::def);
void atmostOne(Home,const SetVarArgs&,unsigned int);
void binpacking(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void branch(Home,BoolVar,IntValBranch,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const BoolVarArgs&,const TieBreakVarBranch<IntVarBranch>&,IntValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const BoolVarArgs&,IntVarBranch,IntValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const IntVarArgs&,const TieBreakVarBranch<IntVarBranch>&,IntValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const IntVarArgs&,IntVarBranch,IntValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const SetVarArgs&,const TieBreakVarBranch<SetVarBranch>&,SetValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const SetVarArgs&,SetVarBranch,SetValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,IntVar,IntValBranch,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,SetVar,SetValBranch,const ValBranchOptions&=ValBranchOptions::def);
void cardinality(Home,SetVar,IntVar);
void cardinality(Home,SetVar,unsigned int,unsigned int);
void channel(Home,BoolVar,IntVar,IntConLevel=ICL_DEF);
void channel(Home,const BoolVarArgs&,IntVar,int=0,IntConLevel=ICL_DEF);
void channel(Home,const BoolVarArgs&,SetVar);
void channel(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void channel(Home,const IntVarArgs&,const SetVarArgs&);
void channel(Home,const IntVarArgs&,int,const IntVarArgs&,int,IntConLevel=ICL_DEF);
void channel(Home,IntVar,BoolVar,IntConLevel=ICL_DEF);
void channelSorted(Home,const IntVarArgs&,SetVar);
void circuit(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntArgs&,int,const IntVarArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntVarArgs&,IntConLevel=ICL_DEF);
void circuit(Home,int,const IntVarArgs&,IntConLevel=ICL_DEF);
void clause(Home,BoolOpType,const BoolVarArgs&,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF);
void clause(Home,BoolOpType,const BoolVarArgs&,const BoolVarArgs&,int,IntConLevel=ICL_DEF);
void convex(Home,SetVar);
void convex(Home,SetVar,SetVar);
void count(Home,const IntVarArgs&,const IntArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSetArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSetArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSet&,const IntArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSet&,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSet&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,int,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,int,IntRelType,IntVar,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,IntVar,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,IntVar,IntRelType,IntVar,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void distinct(Home,const IntArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void distinct(Home,const IntVarArgs&,IntConLevel=ICL_DEF);
void div(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void divmod(Home,IntVar,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void dom(Home,const IntVarArgs&,const IntSet&,IntConLevel=ICL_DEF);
void dom(Home,const IntVarArgs&,int,IntConLevel=ICL_DEF);
void dom(Home,const IntVarArgs&,int,int,IntConLevel=ICL_DEF);
void dom(Home,IntVar,const IntSet&,BoolVar,IntConLevel=ICL_DEF);
void dom(Home,IntVar,const IntSet&,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,BoolVar,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,int,BoolVar,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,int,IntConLevel=ICL_DEF);
void dom(Home,SetVar,SetRelType,const IntSet&);
void dom(Home,SetVar,SetRelType,const IntSet&,BoolVar);
void dom(Home,SetVar,SetRelType,int);
void dom(Home,SetVar,SetRelType,int,BoolVar);
void dom(Home,SetVar,SetRelType,int,int);
void dom(Home,SetVar,SetRelType,int,int,BoolVar);
void element(Home,const BoolVarArgs&,IntVar,BoolVar,IntConLevel=ICL_DEF);
void element(Home,const BoolVarArgs&,IntVar,int,IntConLevel=ICL_DEF);
void element(Home,const BoolVarArgs&,IntVar,int,IntVar,int,BoolVar,IntConLevel=ICL_DEF);
void element(Home,const IntSetArgs&,IntVar,int,IntVar,int,SetVar);
void element(Home,const IntSetArgs&,IntVar,SetVar);
void element(Home,const IntVarArgs&,IntVar,int,IntConLevel=ICL_DEF);
void element(Home,const IntVarArgs&,IntVar,int,IntVar,int,IntVar,IntConLevel=ICL_DEF);
void element(Home,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF);
void element(Home,const SetVarArgs&,IntVar,int,IntVar,int,SetVar);
void element(Home,const SetVarArgs&,IntVar,SetVar);
void element(Home,IntSharedArray,IntVar,BoolVar,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,int,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,int,IntVar,int,BoolVar,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,int,IntVar,int,IntVar,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,IntVar,IntConLevel=ICL_DEF);
void element(Home,SetOpType,const IntArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void element(Home,SetOpType,const IntSetArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void element(Home,SetOpType,const IntVarArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void element(Home,SetOpType,const SetVarArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void extensional(Home,const BoolVarArgs&,const TupleSet&,ExtensionalPropKind=EPK_DEF,IntConLevel=ICL_DEF);
void extensional(Home,const BoolVarArgs&,DFA,IntConLevel=ICL_DEF);
void extensional(Home,const IntVarArgs&,const TupleSet&,ExtensionalPropKind=EPK_DEF,IntConLevel=ICL_DEF);
void extensional(Home,const IntVarArgs&,DFA,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void max(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void max(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void max(Home,SetVar,IntVar);
void max(Home,SetVar,IntVar,BoolVar);
void member(Home,const BoolVarArgs&,BoolVar,BoolVar,IntConLevel=ICL_DEF);
void member(Home,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF);
void member(Home,const IntVarArgs&,IntVar,BoolVar,IntConLevel=ICL_DEF);
void member(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void min(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void min(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void min(Home,SetVar,IntVar);
void min(Home,SetVar,IntVar,BoolVar);
void mod(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void mult(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void notMax(Home,SetVar,IntVar);
void notMin(Home,SetVar,IntVar);
void nvalues(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void nvalues(Home,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void nvalues(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void nvalues(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,const IntVarArgs&,IntVar,IntVar,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,const IntVarArgs&,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntVar,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF);
void path(Home,int,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF);
void precede(Home,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void precede(Home,const IntVarArgs&,int,int,IntConLevel=ICL_DEF);
void precede(Home,const SetVarArgs&,const IntArgs&);
void precede(Home,const SetVarArgs&,int,int);
void rel(Home,BoolOpType,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolOpType,const BoolVarArgs&,int,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,BoolOpType,BoolVar,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,BoolOpType,BoolVar,int,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,BoolVar,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,int,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,const BoolVarArgs&,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,const IntSet&,SetOpType,SetVar,SetRelType,const IntSet&);
void rel(Home,const IntSet&,SetOpType,SetVar,SetRelType,SetVar);
void rel(Home,const IntVarArgs&,IntRelType,const IntVarArgs&,IntConLevel=ICL_DEF);
void rel(Home,const IntVarArgs&,IntRelType,IntConLevel=ICL_DEF);
void rel(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,int,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,IntVar,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,SetVar);
void rel(Home,IntVar,SetRelType,SetVar);
void rel(Home,IntVar,SetRelType,SetVar,BoolVar);
void rel(Home,SetOpType,const IntVarArgs&,const IntSet&,SetVar);
void rel(Home,SetOpType,const IntVarArgs&,SetVar);
void rel(Home,SetOpType,const SetVarArgs&,const IntSet&,SetVar);
void rel(Home,SetOpType,const SetVarArgs&,SetVar);
void rel(Home,SetVar,IntRelType,IntVar);
void rel(Home,SetVar,SetOpType,const IntSet&,SetRelType,const IntSet&);
void rel(Home,SetVar,SetOpType,const IntSet&,SetRelType,SetVar);
void rel(Home,SetVar,SetOpType,SetVar,SetRelType,const IntSet&);
void rel(Home,SetVar,SetOpType,SetVar,SetRelType,SetVar);
void rel(Home,SetVar,SetRelType,IntVar);
void rel(Home,SetVar,SetRelType,IntVar,BoolVar);
void rel(Home,SetVar,SetRelType,SetVar);
void rel(Home,SetVar,SetRelType,SetVar,BoolVar);
void sequence(Home,const BoolVarArgs&,const IntSet&,int,int,int,IntConLevel=ICL_DEF);
void sequence(Home,const IntVarArgs&,const IntSet&,int,int,int,IntConLevel=ICL_DEF);
void sequence(Home,const SetVarArgs&);
void sequence(Home,const SetVarArgs&,SetVar);
void sorted(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void sorted(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void sqr(Home,IntVar,IntVar,IntConLevel=ICL_DEF);
void sqrt(Home,IntVar,IntVar,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void unshare(Home,BoolVarArgs&,IntConLevel=ICL_DEF);
void unshare(Home,IntVarArgs&,IntConLevel=ICL_DEF);
void weights(Home,IntSharedArray,IntSharedArray,SetVar,IntVar);

View File

@ -0,0 +1,222 @@
// This file was automatically extracted from Gecode source files.
// It is subject to the same Copyright as the source files from which
// it is derived, and is distributed under the same Licensing conditions.
void abs(Home,IntVar,IntVar,IntConLevel=ICL_DEF);
void assign(Home,BoolVar,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,const BoolVarArgs&,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,const IntVarArgs&,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,const SetVarArgs&,SetAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,IntVar,IntAssign,const ValBranchOptions&=ValBranchOptions::def);
void assign(Home,SetVar,SetAssign,const ValBranchOptions&=ValBranchOptions::def);
void atmostOne(Home,const SetVarArgs&,unsigned int);
void binpacking(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void branch(Home,BoolVar,IntValBranch,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const BoolVarArgs&,const TieBreakVarBranch<IntVarBranch>&,IntValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const BoolVarArgs&,IntVarBranch,IntValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const IntVarArgs&,const TieBreakVarBranch<IntVarBranch>&,IntValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const IntVarArgs&,IntVarBranch,IntValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const SetVarArgs&,const TieBreakVarBranch<SetVarBranch>&,SetValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,const SetVarArgs&,SetVarBranch,SetValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,IntVar,IntValBranch,const ValBranchOptions&=ValBranchOptions::def);
void branch(Home,SetVar,SetValBranch,const ValBranchOptions&=ValBranchOptions::def);
void cardinality(Home,SetVar,IntVar);
void cardinality(Home,SetVar,unsigned int,unsigned int);
void channel(Home,BoolVar,IntVar,IntConLevel=ICL_DEF);
void channel(Home,const BoolVarArgs&,IntVar,int=0,IntConLevel=ICL_DEF);
void channel(Home,const BoolVarArgs&,SetVar);
void channel(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void channel(Home,const IntVarArgs&,const SetVarArgs&);
void channel(Home,const IntVarArgs&,int,const IntVarArgs&,int,IntConLevel=ICL_DEF);
void channel(Home,const SetVarArgs&,const SetVarArgs&);
void channel(Home,IntVar,BoolVar,IntConLevel=ICL_DEF);
void channelSorted(Home,const IntVarArgs&,SetVar);
void circuit(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntArgs&,int,const IntVarArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void circuit(Home,const IntVarArgs&,IntConLevel=ICL_DEF);
void circuit(Home,int,const IntVarArgs&,IntConLevel=ICL_DEF);
void clause(Home,BoolOpType,const BoolVarArgs&,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF);
void clause(Home,BoolOpType,const BoolVarArgs&,const BoolVarArgs&,int,IntConLevel=ICL_DEF);
void convex(Home,SetVar);
void convex(Home,SetVar,SetVar);
void count(Home,const IntVarArgs&,const IntArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSetArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSetArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSet&,const IntArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSet&,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntSet&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,int,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,int,IntRelType,IntVar,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,IntVar,IntRelType,int,IntConLevel=ICL_DEF);
void count(Home,const IntVarArgs&,IntVar,IntRelType,IntVar,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,int,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void cumulative(Home,IntVar,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF);
void distinct(Home,const IntArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void distinct(Home,const IntVarArgs&,IntConLevel=ICL_DEF);
void div(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void divmod(Home,IntVar,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void dom(Home,const IntVarArgs&,const IntSet&,IntConLevel=ICL_DEF);
void dom(Home,const IntVarArgs&,int,IntConLevel=ICL_DEF);
void dom(Home,const IntVarArgs&,int,int,IntConLevel=ICL_DEF);
void dom(Home,IntVar,const IntSet&,IntConLevel=ICL_DEF);
void dom(Home,IntVar,const IntSet&,Reify,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,int,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,int,Reify,IntConLevel=ICL_DEF);
void dom(Home,IntVar,int,Reify,IntConLevel=ICL_DEF);
void dom(Home,SetVar,SetRelType,const IntSet&);
void dom(Home,SetVar,SetRelType,const IntSet&,BoolVar);
void dom(Home,SetVar,SetRelType,int);
void dom(Home,SetVar,SetRelType,int,BoolVar);
void dom(Home,SetVar,SetRelType,int,int);
void dom(Home,SetVar,SetRelType,int,int,BoolVar);
void element(Home,const BoolVarArgs&,IntVar,BoolVar,IntConLevel=ICL_DEF);
void element(Home,const BoolVarArgs&,IntVar,int,IntConLevel=ICL_DEF);
void element(Home,const BoolVarArgs&,IntVar,int,IntVar,int,BoolVar,IntConLevel=ICL_DEF);
void element(Home,const IntSetArgs&,IntVar,int,IntVar,int,SetVar);
void element(Home,const IntSetArgs&,IntVar,SetVar);
void element(Home,const IntVarArgs&,IntVar,int,IntConLevel=ICL_DEF);
void element(Home,const IntVarArgs&,IntVar,int,IntVar,int,IntVar,IntConLevel=ICL_DEF);
void element(Home,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF);
void element(Home,const SetVarArgs&,IntVar,int,IntVar,int,SetVar);
void element(Home,const SetVarArgs&,IntVar,SetVar);
void element(Home,IntSharedArray,IntVar,BoolVar,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,int,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,int,IntVar,int,BoolVar,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,int,IntVar,int,IntVar,IntConLevel=ICL_DEF);
void element(Home,IntSharedArray,IntVar,IntVar,IntConLevel=ICL_DEF);
void element(Home,SetOpType,const IntArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void element(Home,SetOpType,const IntSetArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void element(Home,SetOpType,const IntVarArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void element(Home,SetOpType,const SetVarArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max));
void extensional(Home,const BoolVarArgs&,const TupleSet&,ExtensionalPropKind=EPK_DEF,IntConLevel=ICL_DEF);
void extensional(Home,const BoolVarArgs&,DFA,IntConLevel=ICL_DEF);
void extensional(Home,const IntVarArgs&,const TupleSet&,ExtensionalPropKind=EPK_DEF,IntConLevel=ICL_DEF);
void extensional(Home,const IntVarArgs&,DFA,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,int,Reify,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const BoolVarArgs&,IntRelType,IntVar,Reify,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,int,Reify,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,IntVar,Reify,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,int,Reify,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,IntVar,Reify,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,int,Reify,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void linear(Home,const IntVarArgs&,IntRelType,IntVar,Reify,IntConLevel=ICL_DEF);
void max(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void max(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void max(Home,SetVar,IntVar);
void max(Home,SetVar,IntVar,BoolVar);
void member(Home,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF);
void member(Home,const BoolVarArgs&,BoolVar,Reify,IntConLevel=ICL_DEF);
void member(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void member(Home,const IntVarArgs&,IntVar,Reify,IntConLevel=ICL_DEF);
void min(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void min(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void min(Home,SetVar,IntVar);
void min(Home,SetVar,IntVar,BoolVar);
void mod(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void mult(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void nooverlap(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void notMax(Home,SetVar,IntVar);
void notMin(Home,SetVar,IntVar);
void nvalues(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void nvalues(Home,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void nvalues(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void nvalues(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,const IntVarArgs&,IntVar,IntVar,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,const IntVarArgs&,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntVar,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF);
void path(Home,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF);
void path(Home,int,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF);
void precede(Home,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void precede(Home,const IntVarArgs&,int,int,IntConLevel=ICL_DEF);
void precede(Home,const SetVarArgs&,const IntArgs&);
void precede(Home,const SetVarArgs&,int,int);
void rel(Home,BoolOpType,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolOpType,const BoolVarArgs&,int,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,BoolOpType,BoolVar,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,BoolOpType,BoolVar,int,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,BoolVar,Reify,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,BoolVar,IntRelType,int,Reify,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,BoolVar,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,const BoolVarArgs&,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,IntConLevel=ICL_DEF);
void rel(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,const IntSet&,SetOpType,SetVar,SetRelType,const IntSet&);
void rel(Home,const IntSet&,SetOpType,SetVar,SetRelType,SetVar);
void rel(Home,const IntVarArgs&,IntRelType,const IntVarArgs&,IntConLevel=ICL_DEF);
void rel(Home,const IntVarArgs&,IntRelType,IntConLevel=ICL_DEF);
void rel(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,int,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,int,Reify,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,IntVar,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,IntVar,Reify,IntConLevel=ICL_DEF);
void rel(Home,IntVar,IntRelType,SetVar);
void rel(Home,IntVar,SetRelType,SetVar);
void rel(Home,IntVar,SetRelType,SetVar,BoolVar);
void rel(Home,SetOpType,const IntVarArgs&,const IntSet&,SetVar);
void rel(Home,SetOpType,const IntVarArgs&,SetVar);
void rel(Home,SetOpType,const SetVarArgs&,const IntSet&,SetVar);
void rel(Home,SetOpType,const SetVarArgs&,SetVar);
void rel(Home,SetVar,IntRelType,IntVar);
void rel(Home,SetVar,SetOpType,const IntSet&,SetRelType,const IntSet&);
void rel(Home,SetVar,SetOpType,const IntSet&,SetRelType,SetVar);
void rel(Home,SetVar,SetOpType,SetVar,SetRelType,const IntSet&);
void rel(Home,SetVar,SetOpType,SetVar,SetRelType,SetVar);
void rel(Home,SetVar,SetRelType,IntVar);
void rel(Home,SetVar,SetRelType,IntVar,BoolVar);
void rel(Home,SetVar,SetRelType,SetVar);
void rel(Home,SetVar,SetRelType,SetVar,BoolVar);
void sequence(Home,const BoolVarArgs&,const IntSet&,int,int,int,IntConLevel=ICL_DEF);
void sequence(Home,const IntVarArgs&,const IntSet&,int,int,int,IntConLevel=ICL_DEF);
void sequence(Home,const SetVarArgs&);
void sequence(Home,const SetVarArgs&,SetVar);
void sorted(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void sorted(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void sqr(Home,IntVar,IntVar,IntConLevel=ICL_DEF);
void sqrt(Home,IntVar,IntVar,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF);
void unary(Home,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF);
void unshare(Home,BoolVarArgs&,IntConLevel=ICL_DEF);
void unshare(Home,IntVarArgs&,IntConLevel=ICL_DEF);
void weights(Home,IntSharedArray,IntSharedArray,SetVar,IntVar);

View File

@ -41,14 +41,17 @@ namespace generic_gecode
Optimizing(): num(-1), den(-1), what(OPT_NONE), how(OPT_MAX) {}
Optimizing(Optimizing& o)
: num(o.num), den(o.den), what(o.what), how(o.how) {}
void check_ok() const
{ if (what!=OPT_NONE)
throw Exception("gecode-python","too many optimization criteria"); }
void maximize(int i)
{ what = OPT_INT; how = OPT_MAX; num = i; };
{ check_ok(); what = OPT_INT; how = OPT_MAX; num = i; };
void maximize(int i,int j)
{ what = OPT_RATIO; how = OPT_MAX; num = i; den = j; };
{ check_ok(); what = OPT_RATIO; how = OPT_MAX; num = i; den = j; };
void minimize(int i)
{ what = OPT_INT; how = OPT_MIN; num = i; };
{ check_ok(); what = OPT_INT; how = OPT_MIN; num = i; };
void minimize(int i,int j)
{ what = OPT_RATIO; how = OPT_MIN; num = i; den = j; };
{ check_ok(); what = OPT_RATIO; how = OPT_MIN; num = i; den = j; };
};
struct GenericSpace;
@ -62,32 +65,124 @@ namespace generic_gecode
struct GenericDFS: GenericEngine
{
DFS<GenericSpace> engine;
GenericDFS(GenericSpace* s) : engine(s) {}
GenericDFS(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
struct GenericBAB: GenericEngine
{
BAB<GenericSpace> engine;
GenericBAB(GenericSpace* s) : engine(s) {}
GenericBAB(GenericSpace* s,Search::Options& opt) : engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
struct GenericRestart: GenericEngine
{
Restart<GenericSpace> engine;
GenericRestart(GenericSpace* s,Search::Options& opt): engine(s,opt) {}
virtual GenericSpace* next(void) { return engine.next(); }
};
struct LoadingDock
{
vector<IntVar> ivars;
vector<BoolVar> bvars;
vector<SetVar> svars;
vector<int> ikeep;
vector<int> bkeep;
vector<int> skeep;
bool keeping_some() const
{
return (ikeep.size() != 0)
|| (bkeep.size() != 0)
|| (skeep.size() != 0);
}
IntVar get_ivar(int i) const { return ivars[i]; }
BoolVar get_bvar(int i) const { return bvars[i]; }
SetVar get_svar(int i) const { return svars[i]; }
int enter_ivar(const IntVar& v)
{ ivars.push_back(v); return static_cast<int>(ivars.size()-1); }
int enter_bvar(const BoolVar& v)
{ bvars.push_back(v); return static_cast<int>(bvars.size()-1); }
int enter_svar(const SetVar& v)
{ svars.push_back(v); return static_cast<int>(svars.size()-1); }
int keep_ivar(int i) { ikeep.push_back(i); return static_cast<int>(ikeep.size()-1); }
int keep_bvar(int i) { bkeep.push_back(i); return static_cast<int>(bkeep.size()-1); }
int keep_svar(int i) { skeep.push_back(i); return static_cast<int>(skeep.size()-1); }
void freeze(Space& home,
IntVarArray& iarr, BoolVarArray& barr, SetVarArray& sarr,
int& num, int& den)
{
if (keeping_some())
{
// make sure that optimization vars (if any) are kept
if (num != -1)
{
const int _num(num);
const int _den(den);
int n = static_cast<int>(ikeep.size());
bool num_found(false);
bool den_found(false);
for (;n--;)
{
const int idx(ikeep[n]);
if (idx==_num)
{ num_found=true; if (den_found) break; }
if (idx==_den)
{ den_found=true; if (num_found) break; }
}
if (!num_found)
{ ikeep.push_back(_num);
num=static_cast<int>(ikeep.size()-1); }
if (_den != -1 && !den_found)
{ ikeep.push_back(_den);
den=static_cast<int>(ikeep.size()-1); }
}
{ int n = static_cast<int>(ikeep.size());
iarr = IntVarArray(home, n);
for (;n--;) iarr[n]=ivars[ikeep[n]]; }
{ int n = static_cast<int>(bkeep.size());
barr = BoolVarArray(home, n);
for (;n--;) barr[n]=bvars[bkeep[n]]; }
{ int n = static_cast<int>(skeep.size());
sarr = SetVarArray(home, n);
for (;n--;) sarr[n]=svars[skeep[n]]; }
}
else
{
{ int n = static_cast<int>(ivars.size());
iarr = IntVarArray(home, n);
for (;n--;) iarr[n]=ivars[n]; }
{ int n = static_cast<int>(bvars.size());
barr = BoolVarArray(home, n);
for (;n--;) barr[n]=bvars[n]; }
{ int n = static_cast<int>(svars.size());
sarr = SetVarArray(home, n);
for (;n--;) sarr[n]=svars[n]; }
}
}
};
struct GenericSpace: Space
{
Optimizing optim;
IntVarArray ivars;
BoolVarArray bvars;
SetVarArray svars;
vector<IntVar>* _ivars;
vector<BoolVar>* _bvars;
vector<SetVar>* _svars;
LoadingDock* dock;
bool keeping_some; // iff only SOME of the vars are kept
Space* space() { return this; }
GenericSpace(bool share, GenericSpace& s)
: Space(share, s), optim(s.optim),
_ivars(NULL), _bvars(NULL), _svars(NULL)
: Space(share, s), optim(s.optim), dock(NULL), keeping_some(s.keeping_some)
{
ivars.update(*this, share, s.ivars);
bvars.update(*this, share, s.bvars);
@ -97,60 +192,68 @@ namespace generic_gecode
Space* copy(bool share)
{ freeze(); return new GenericSpace(share, *this); }
GenericSpace() : _ivars(NULL), _bvars(NULL), _svars(NULL) {}
GenericSpace() : dock(new LoadingDock()), keeping_some(false) {}
~GenericSpace() { delete dock; }
// throw some C++ exception on behalf of glue code
void kaboom(const char* s)
{ throw Exception("gecode-python", s); }
int ikaboom(const char* s)
{ kaboom(s); return 0; }
// freeze the space before handing it off to a search engine
void freeze()
{
if (_ivars)
if (dock)
{
int n = _ivars->size();
ivars = IntVarArray(*this, n);
vector<IntVar>& v(*_ivars);
for (; n--;) ivars[n] = v[n];
delete _ivars;
_ivars = NULL;
}
if (_bvars)
{
int n = _bvars->size();
bvars = BoolVarArray(*this, n);
vector<BoolVar>& v(*_bvars);
for (; n--;) bvars[n] = v[n];
delete _bvars;
_bvars = NULL;
}
if (_svars)
{
int n = _svars->size();
svars = SetVarArray(*this, n);
vector<SetVar>& v(*_svars);
for (; n--;) svars[n] = v[n];
delete _svars;
_svars = NULL;
keeping_some = dock->keeping_some();
dock->freeze(*this, ivars, bvars, svars, optim.num, optim.den);
delete dock;
dock = NULL;
}
}
IntVar get_ivar(int i) const { return (_ivars) ? (*_ivars)[i] : ivars[i]; }
BoolVar get_bvar(int i) const { return (_bvars) ? (*_bvars)[i] : bvars[i]; }
SetVar get_svar(int i) const { return (_svars) ? (*_svars)[i] : svars[i]; }
IntVar get_ivar(int i) const { return (dock)?dock->get_ivar(i):ivars[i]; }
BoolVar get_bvar(int i) const { return (dock)?dock->get_bvar(i):bvars[i]; }
SetVar get_svar(int i) const { return (dock)?dock->get_svar(i):svars[i]; }
GenericEngine* new_engine()
int keep_ivar(int i)
{
if (dock) return dock->keep_ivar(i);
else return ikaboom("too late to keep");
}
int keep_bvar(int i)
{
if (dock) return dock->keep_bvar(i);
else return ikaboom("too late to keep");
}
int keep_svar(int i)
{
if (dock) return dock->keep_svar(i);
else return ikaboom("too late to keep");
}
bool frozen() const { return dock==NULL; }
bool has_keepers() const { return keeping_some; }
// when frozen and has_keepers: which is just has_keepers actually
bool use_keep_index() const { return has_keepers(); }
GenericEngine* new_engine(bool restart, Search::Options& opt)
{
freeze();
return (optim.what == Optimizing::OPT_NONE)
? static_cast<GenericEngine*>(new GenericDFS(this))
: static_cast<GenericEngine*>(new GenericBAB(this));
? static_cast<GenericEngine*>(new GenericDFS(this,opt))
: (restart
? static_cast<GenericEngine*>(new GenericRestart(this,opt))
: static_cast<GenericEngine*>(new GenericBAB(this,opt)));
}
int _new_ivar(IntVar& v)
{
if (!_ivars) _ivars = new vector<IntVar>;
int i = _ivars->size();
_ivars->push_back(v);
return i;
if (dock) return dock->enter_ivar(v);
else return ikaboom("too late to create vars");
}
int new_ivar(int lo, int hi)
@ -167,10 +270,8 @@ namespace generic_gecode
int _new_bvar(BoolVar& v)
{
if (!_bvars) _bvars = new vector<BoolVar>;
int i = _bvars->size();
_bvars->push_back(v);
return i;
if (dock) return dock->enter_bvar(v);
else return ikaboom("too late to create vars");
}
int new_bvar()
@ -181,10 +282,8 @@ namespace generic_gecode
int _new_svar(SetVar& v)
{
if (!_svars) _svars = new vector<SetVar>;
int i = _svars->size();
_svars->push_back(v);
return i;
if (dock) return dock->enter_svar(v);
else return ikaboom("too late to create vars");
}
int new_svar(int glbMin, int glbMax, int lubMin, int lubMax,

View File

@ -156,8 +156,17 @@ extern "C"
{
YAP_Term arg1 = YAP_ARG1;
YAP_Term arg2 = YAP_ARG2;
YAP_Term arg3 = YAP_ARG3;
bool restart = YAP_IntOfTerm(YAP_ArgOfTerm(1, arg3));
double threads = YAP_FloatOfTerm(YAP_ArgOfTerm(2, arg3));
unsigned int c_d = YAP_IntOfTerm(YAP_ArgOfTerm(3, arg3));
unsigned int a_d = YAP_IntOfTerm(YAP_ArgOfTerm(4, arg3));
Search::Options opt;
opt.threads = threads;
opt.c_d = c_d;
opt.a_d = a_d;
GenericSpace* space = gecode_Space_from_term(arg1);
GenericEngine* engine = space->new_engine();
GenericEngine* engine = space->new_engine(restart,opt);
YAP_Term y_engine =
YAP_NewOpaqueObject(gecode_engine_tag, sizeof(GenericEngine*));
GenericEngine** ptr =
@ -642,6 +651,48 @@ extern "C"
cerr << "this should never happen" << endl; exit(1);
}
static int gecode_space_use_keep_index(void)
{
YAP_Term arg1 = YAP_ARG1;
YAP_Term arg2 = YAP_ARG2;
GenericSpace* space = gecode_Space_from_term(arg1);
return YAP_Unify(arg2,(space->use_keep_index()
?gecode_TRUE:gecode_FALSE));
}
static int gecode_intvar_keep(void)
{
YAP_Term arg1 = YAP_ARG1;
YAP_Term arg2 = YAP_ARG2;
YAP_Term arg3 = YAP_ARG3;
GenericSpace* space = gecode_Space_from_term(arg1);
int idx = YAP_IntOfTerm(arg2);
int kidx = space->keep_ivar(idx);
return YAP_Unify(arg3,YAP_MkIntTerm(kidx));
}
static int gecode_boolvar_keep(void)
{
YAP_Term arg1 = YAP_ARG1;
YAP_Term arg2 = YAP_ARG2;
YAP_Term arg3 = YAP_ARG3;
GenericSpace* space = gecode_Space_from_term(arg1);
int idx = YAP_IntOfTerm(arg2);
int kidx = space->keep_bvar(idx);
return YAP_Unify(arg3,YAP_MkIntTerm(kidx));
}
static int gecode_setvar_keep(void)
{
YAP_Term arg1 = YAP_ARG1;
YAP_Term arg2 = YAP_ARG2;
YAP_Term arg3 = YAP_ARG3;
GenericSpace* space = gecode_Space_from_term(arg1);
int idx = YAP_IntOfTerm(arg2);
int kidx = space->keep_svar(idx);
return YAP_Unify(arg3,YAP_MkIntTerm(kidx));
}
// INFO ON INTVARS
static int gecode_intvar_assigned(void)
{
@ -1045,7 +1096,7 @@ extern "C"
gecode_engine_handler.fail_handler = gecode_engine_fail_handler;
gecode_engine_handler.write_handler = gecode_engine_write_handler;
gecode_engine_tag = YAP_NewOpaqueType(&gecode_engine_handler);
YAP_UserCPredicate("gecode_new_engine", gecode_new_engine, 2);
YAP_UserCPredicate("gecode_new_engine", gecode_new_engine, 3);
#ifdef DISJUNCTOR
// opaque disjunctors and clauses
gecode_disjunctor_handler.write_handler = gecode_disjunctor_write_handler;
@ -1124,5 +1175,9 @@ extern "C"
YAP_UserCPredicate("gecode_setvar_glb_values", gecode_setvar_glb_values, 3);
YAP_UserCPredicate("gecode_setvar_lub_values", gecode_setvar_lub_values, 3);
YAP_UserCPredicate("gecode_setvar_unknown_values", gecode_setvar_unknown_values, 3);
YAP_UserCPredicate("gecode_space_use_keep_index", gecode_space_use_keep_index, 2);
YAP_UserCPredicate("gecode_intvar_keep", gecode_intvar_keep, 3);
YAP_UserCPredicate("gecode_boolvar_keep", gecode_boolvar_keep, 3);
YAP_UserCPredicate("gecode_setvar_keep", gecode_setvar_keep, 3);
}
}

View File

@ -31,9 +31,21 @@ is_bool_(false,false).
is_bool(X,Y) :- nonvar(X), Y=X.
is_bool(X) :- is_bool(X,_).
is_IntVar_('IntVar'(I),I) :- integer(I).
is_BoolVar_('BoolVar'(I),I) :- integer(I).
is_SetVar_('SetVar'(I),I) :- integer(I).
is_IntVar_('IntVar'(I,K),N) :-
integer(I),
integer(K),
nb_getval(gecode_space_use_keep_index,B),
(B=true -> N=K ; N=I).
is_BoolVar_('BoolVar'(I,K),N) :-
integer(I),
integer(K),
nb_getval(gecode_space_use_keep_index,B),
(B=true -> N=K ; N=I).
is_SetVar_('SetVar'(I,K),N) :-
integer(I),
integer(K),
nb_getval(gecode_space_use_keep_index,B),
(B=true -> N=K ; N=I).
is_IntVar(X,I) :- nonvar(X), is_IntVar_(X,I).
is_BoolVar(X,I) :- nonvar(X), is_BoolVar_(X,I).
@ -142,7 +154,18 @@ new_space(Space) :-
gecode_new_space(Space_),
Space='Space'(Space_).
is_Space_('Space'(X),X).
%% checking that an argument is a space sets a global variable
%% indicating whether variables need to be translated to their
%% original index or to their "keep" index.
%%
%% these bindings are going to take advantage of the fact that,
%% when a space is involved, it is checked first, thus setting
%% this global variable. subsequent accesses to variables are
%% then correctly translated.
is_Space_('Space'(X),X) :-
gecode_space_use_keep_index(X,B),
nb_setval(gecode_space_use_keep_index,B).
is_Space(X,Y) :- nonvar(X), is_Space_(X,Y).
is_Space(X) :- is_Space(X,_).
@ -198,19 +221,19 @@ new_intvar(IVar, Space, Lo, Hi) :- !,
assert_integer(Lo),
assert_integer(Hi),
gecode_new_intvar_from_bounds(Idx,Space_,Lo,Hi),
IVar='IntVar'(Idx).
IVar='IntVar'(Idx,-1).
new_intvar(IVar, Space, IntSet) :- !,
assert_var(IVar),
assert_is_Space_or_Clause(Space,Space_),
assert_is_IntSet(IntSet, L),
gecode_new_intvar_from_intset(Idx,Space_,L),
IVar='IntVar'(Idx).
IVar='IntVar'(Idx,-1).
new_boolvar(BVar, Space) :- !,
assert_var(BVar),
assert_is_Space_or_Clause(Space,Space_),
gecode_new_boolvar(Idx,Space_),
BVar='BoolVar'(Idx).
BVar='BoolVar'(Idx,-1).
%% (GlbMin,GlbMax,LubMin,LubMax,CardMin,CardMax) 6 new_setvar_1
%% (GlbMin,GlbMax,LubMin,LubMax,CardMin) 5 new_setvar_2
@ -237,7 +260,7 @@ new_setvar(SVar, Space, GlbMin, GlbMax, LubMin, LubMax, CardMin, CardMax) :-
assert_integer(CardMin),
assert_integer(CardMax),
gecode_new_setvar(Idx, Space_, GlbMin, GlbMax, LubMib, LubMax, CardMin, CardMax),
SVar='SetVar'(Idx).
SVar='SetVar'(Idx,-1).
%% 5 arguments
%% (GlbMin,GlbMax,LubMin,LubMax,CardMin) 5 new_setvar_2
@ -344,13 +367,55 @@ maximize(Space,IVar1,IVar2) :-
assert_is_IntVar(IVar2,IVar2_),
gecode_space_maximize_ratio(Space_,IVar1_,IVar2_).
gecode_search_options_init(search_options(0,1.0,8,2)).
gecode_search_options_offset(restart,1).
gecode_search_options_offset(threads,2).
gecode_search_options_offset(c_d ,3).
gecode_search_options_offset(a_d ,4).
gecode_search_option_set(O,V,R) :-
gecode_search_options_offset(O,I),
setarg(I,R,V).
gecode_search_options_from_alist(L,R) :-
gecode_search_options_init(R),
gecode_search_options_process_alist(L,R).
gecode_search_options_process_alist([],R).
gecode_search_options_process_alist([H|T],R) :- !,
gecode_search_options_process1(H,R),
gecode_search_options_process_alist(T,R).
gecode_search_options_process1(restart,R) :- !,
gecode_search_option_set(restart,1,R).
gecode_search_options_process1(threads=N,R) :- !,
(integer(N) -> V is float(N)
; (float(N) -> V=N
; throw(bad_search_option_value(threads=N)))),
gecode_search_option_set(threads,V,R).
gecode_search_options_process1(c_d=N,R) :- !,
(integer(N) -> V=N
; throw(bad_search_option_value(c_d=N))),
gecode_search_option_set(c_d,V,R).
gecode_search_options_process1(a_d=N,R) :- !,
(integer(N) -> V=N
; throw(bad_search_option_value(a_d=N))),
gecode_search_option_set(a_d,V,R).
gecode_search_options_process1(O,_) :-
throw(gecode_error(unrecognized_search_option(O))).
search(Space, Solution) :-
search(Space, Solution, []).
search(Space, Solution, Alist) :-
assert_is_Space(Space,Space_),
assert_var(Solution),
gecode_new_engine(Space_,Engine_),
gecode_search_options_from_alist(Alist,O),
gecode_new_engine(Space_,Engine_,O),
gecode_engine_search(Engine_,Solution_),
Solution='Space'(Solution_).
%% INSPECTING VARIABLES
get_for_vars([],Space,[],F).
@ -551,7 +616,9 @@ new_clause(X, Disj) :-
gecode_new_clause(C, Disj_),
X='Clause'(C).
is_Clause_('Clause'(C),C).
is_Clause_('Clause'(C),C) :-
gecode_space_use_keep_index(C,B),
nb_setval(gecode_space_use_keep_index,B).
is_Clause(X,Y) :- nonvar(X), is_Clause_(X,Y).
is_Clause(X) :- is_Clause(X,_).
@ -594,6 +661,24 @@ new_setvars_(L,Space,N,X1,X2,X3,X4) :- length(L,N), new_setvars(L,Space,X1,X2,X3
new_setvars_(L,Space,N,X1,X2,X3) :- length(L,N), new_setvars(L,Space,X1,X2,X3).
new_setvars_(L,Space,N,X1,X2) :- length(L,N), new_setvars(L,Space,X1,X2).
keep_(Space, Var) :-
(Var = 'IntVar'(I,J)
-> (J = -1 -> (gecode_intvar_keep(Space,I,K),setarg(2,Var,K))
; throw(gecode_error(variable_already_kept(Var))))
; (Var = 'BoolVar'(I,J)
-> (J = -1 -> (gecode_boolvar_keep(Space,I,K),setarg(2,Var,K))
; throw(gecode_error(variable_already_kept(Var))))
; (Var = 'SetVar'(I,J)
-> (J = -1 -> (gecode_setvar_keep(Space,I,K),setarg(2,Var,K))
; throw(gecode_error(variable_already_kept(Var))))
; keep_list_(Space,Var)))).
keep_list_(Space, []) :- !.
keep_list_(Space, [H|T]) :- !,
keep_(Space,H), keep_list_(Space,T).
keep_list_(_, X) :-
throw(gecode_error(not_a_variable(X))).
%% more concise interface:
(X := Y) :- var(Y), !, throw(gecode_error((X := Y))).
(X := intset(I,J)) :- !, new_intset(X,I,J).
@ -647,6 +732,7 @@ new_setvars_(L,Space,N,X1,X2) :- length(L,N), new_setvars(L,Space,X1,X2).
(X := clause(Disj)) :- !, new_clause(X,Disj).
(X := search(Y)) :- !, search(Y,X).
(X := search(Y,L)) :- !, search(Y,X,L).
% these should be autogenerated:
(C += forward(X,Y)) :- !, new_forward(C,X,Y).
@ -758,3 +844,5 @@ new_setvars_(L,Space,N,X1,X2) :- length(L,N), new_setvars(L,Space,X1,X2).
(Space += maximize(X)) :- !, maximize(Space,X).
(Space += minimize(X,Y)) :- !, minimize(Space,X,Y).
(Space += maximize(X,Y)) :- !, maximize(Space,X,Y).
(Space += keep(X)) :- !, keep_(Space,X).

View File

@ -30,6 +30,8 @@ PL_get_chars_ex(term_t t, char **s, unsigned int flags)
}
#undef PL_get_atom_ex
int
PL_get_atom_ex__LD(term_t t, atom_t *a ARG_LD)
{ if ( PL_get_atom(t, a) )
@ -38,6 +40,14 @@ PL_get_atom_ex__LD(term_t t, atom_t *a ARG_LD)
return PL_error(NULL, 0, NULL, ERR_TYPE, ATOM_atom, t);
}
int
PL_get_atom_ex(term_t t, atom_t *a)
{ if ( PL_get_atom(t, a) )
succeed;
return PL_error(NULL, 0, NULL, ERR_TYPE, ATOM_atom, t);
}
int
PL_get_integer_ex(term_t t, int *i)

View File

@ -11,6 +11,8 @@
clpbn_init_solver/5,
clpbn_run_solver/4,
clpbn_init_graph/1,
probability/2,
conditional_probability/3,
op( 500, xfy, with)]).
:- use_module(library(atts)).
@ -113,6 +115,8 @@
solver(ve).
em_solver(ve).
:- meta_predicate probability(:,-), conditional_probability(:,:,-).
%output(xbif(user_error)).
%output(gviz(user_error)).
output(no).
@ -468,3 +472,49 @@ clpbn_finalize_solver(State) :-
arg(Last, State, Info),
finalize_bp_solver(Info).
clpbn_finalize_solver(_State).
probability(Goal, Prob) :-
findall(Prob, do_probability(Goal, [], Prob), [Prob]).
conditional_probability(Goal, ListOfGoals, Prob) :-
\+ ground(ListOfGoals), !,
throw(error(ground(ListOfGoals),conditional_probability(Goal, ListOfGoals, Prob))).
conditional_probability(Goal, ListOfGoals, Prob) :-
findall(Prob, do_probability(Goal, ListOfGoals, Prob), [Prob]).
do_probability(Goal, ListOfGoals, Prob) :-
evidence_to_var(Goal, C, NGoal, V),
call_residue(run( ListOfGoals, NGoal), Vars), !,
match_probability(Vars, C, V, Prob).
run(ListOfGoals,Goal) :-
do(ListOfGoals),
call(Goal).
do(M:ListOfGoals) :-
do(ListOfGoals, M).
do([]).
do([], _M).
do(G.ListOfGoals, M) :-
M:G,
do(ListOfGoals, M).
evidence_to_var(M:Goal, C, M:VItem, V) :- !,
evidence_to_var(Goal, C, VItem, V).
evidence_to_var(Goal, C, VItem, V) :-
Goal =.. [L|Args],
variabilise_last(Args, C, NArgs, V),
VItem =.. [L|NArgs].
variabilise_last([Arg], Arg, [V], V).
variabilise_last([Arg1,Arg2|Args], Arg, Arg1.NArgs, V) :-
variabilise_last(Arg2.Args, Arg, NArgs, V).
match_probability([p(V0=C)=Prob|_], C, V, Prob) :-
V0 == V,
!.
match_probability([_|Probs], C, V, Prob) :-
match_probability(Probs, C, V, Prob).

View File

@ -58,8 +58,7 @@ init_bp_solver(_, AllVars, _, (BayesNet, DistIds)) :-
sort(DistIds0, DistIds),
%(num_bayes_nets(0) -> writeln(vars:VarsInfo) ; true),
%(num_bayes_nets(0) -> writeln(dists:DistsInfo) ; true),
create_network(VarsInfo, BayesNet),
get_extra_vars_info(AllVars, ExtraVarsInfo).
create_network(VarsInfo, BayesNet).
%set_extra_vars_info(BayesNet, ExtraVarsInfo).
@ -99,17 +98,10 @@ get_evidence(_V, -1). % no evidence !!!
get_extra_vars_info([], []).
get_extra_vars_info([V|Vs], [v(VarId, Label, Domain)|VarsInfo]) :-
get_atts(V, [id(VarId)]), !,
writeln(k:V),
clpbn:get_atts(V, [key(Key),dist(DistId, _)]),
writeln(j:Key),
term_to_atom(Key, Label),
writeln(i:Label),
get_dist_domain(DistId, Domain0),
writeln(a:Domain0),
numbers2atoms(Domain0, Domain),
writeln(b:Domain),
get_extra_vars_info(Vs, VarsInfo).
get_extra_vars_info([_|Vs], VarsInfo) :-
get_extra_vars_info(Vs, VarsInfo).

View File

@ -12,6 +12,8 @@
clpbn_tableallargs/1,
clpbn_table_nondet/1,
clpbn_tabled_clause/2,
clpbn_tabled_clause_ref/3,
clpbn_tabled_retract/2,
clpbn_tabled_abolish/1,
clpbn_tabled_asserta/1,
clpbn_tabled_assertz/1,
@ -31,6 +33,8 @@
:- meta_predicate clpbn_table(:),
clpbn_tabled_clause(:.?),
clpbn_tabled_clause_ref(:.?,?),
clpbn_tabled_retract(:),
clpbn_tabled_abolish(:),
clpbn_tabled_asserta(:),
clpbn_tabled_assertz(:),
@ -121,6 +125,9 @@ clpbn_table(F/N,M) :-
% enter evidence after binding.
( var(A0) -> A0 = V2 ; put_evidence(A0, V2) )
;
clpbn:clpbn_flag(solver,none) ->
true
;
throw(error(tabled_clpbn_predicate_should_never_fail,S))
)
)
@ -179,7 +186,7 @@ clpbn_table_nondet(F/N,M) :-
NKey =.. [NF|Args],
asserta(clpbn_table(Key, M, NKey)),
assert(
(M:Key :- writeln(in:Key),
(M:Key :- % writeln(in:Key),
b_getval(clpbn_tables, Tab),
( b_hash_lookup(Key, Out, Tab) ->
fail
@ -217,6 +224,31 @@ clpbn_tabled_clause(Head, M, Body) :-
clpbn_table(Head, M, THead),
clause(M:THead, Body).
clpbn_tabled_clause_ref(M:Head, Body, Ref) :- !,
clpbn_tabled_clause_ref(Head, M, Body, Ref).
clpbn_tabled_clause_ref(Head, Body, Ref) :-
prolog_load_context(module, M),
clpbn_tabled_clause_ref(Head, M, Body, Ref).
clpbn_tabled_clause_ref(M:Head, _, Body, Ref) :- !,
clpbn_tabled_clause_ref(Head, M, Body, Ref).
clpbn_tabled_clause_ref(Head, M, Body, Ref) :-
clpbn_table(Head, M, THead),
clause(M:THead, Body, Ref).
clpbn_tabled_retract(M:Head) :- !,
clpbn_tabled_retract(Head, M).
clpbn_tabled_retract(Head) :-
prolog_load_context(module, M),
clpbn_tabled_retract(Head, M).
clpbn_tabled_retract(M:Head, _) :- !,
clpbn_tabled_retract(Head, M).
clpbn_tabled_retract(Head, M) :-
clpbn_table(Head, M, THead),
retract(M:THead).
clpbn_tabled_assertz(M:Clause) :- !,
clpbn_tabled_assertz2(Clause, M).

View File

@ -103,6 +103,7 @@ solve_ve([LVs|_], [NVs0|_], Ps) :-
sort(LV0, LV),
% construct the graph
find_all_table_deps(Tables0, LV),
%writeln((Li: LVs: LV)),
process(LVi, LVs, tab(Dist,_,_)),
%writeln(m:Dist),matrix:matrix_to_list(Dist,LD),writeln(LD),
%exps(LD,LDE),writeln(LDE),

View File

@ -1,8 +1,13 @@
%
% Interface the Aleph ILP system to CLP(BN)
%
% Relies on the Aleph cost function.
% It assumes Aleph work as usual, but some variables are of type random.
% Aleph was written by Ashwin Srinivasan
%
% this code relies on hacked version of Aleph, contact
% vsc@dcc.fc.up.pt
%
% Aleph generates clauses as usual,
% but some variables are of special type random.
%
:- module(clpbn_aleph,
[init_clpbn_cost/0,
@ -33,6 +38,7 @@
clpbn_tabled_asserta/2,
clpbn_tabled_assertz/1,
clpbn_tabled_clause/2,
clpbn_tabled_clause_ref/3,
clpbn_tabled_number_of_clauses/2,
clpbn_is_tabled/1,
clpbn_reset_tables/0,
@ -42,7 +48,7 @@
% Tell Aleph not to use default solver during saturation
%
% all work will be done by EM
:- set_clpbn_flag(solver,none).
%:- set_clpbn_flag(solver,none).
%
% This is the Aleph interface
@ -58,85 +64,50 @@
:- user:set(skolem_examples, false).
% avoid doing CLP(BN) stuff except at start
:- user:set(sat_start_hook, clpbn_aleph:disable_solver).
:- user:set(sat_stop_hook, clpbn_aleph:enable_solver).
:- user:set(sat_begin_hook, clpbn_aleph:disable_solver).
:- user:set(sat_end_hook, clpbn_aleph:enable_solver).
:- user:set(reduce_start_hook, clpbn_aleph:disable_solver).
:- user:set(reduce_stop_hook, clpbn_aleph:enable_solver).
:- user:set(reduce_begin_hook, clpbn_aleph:disable_solver).
:- user:set(reduce_end_hook, clpbn_aleph:enable_solver).
:- user:set(record_testclause_hook, clpbn_aleph:do_nothing).
:- user:set(best_clause_hook, clpbn_aleph:add_new_clause).
:- user:set(newbest_hook, clpbn_aleph:store_theory).
disable_solver(_) :-
clpbn_flag(solver, Old, none),
nb_setval(old_clpbn_solver, Old).
disable_solver(_,_) :-
disable_solver.
disable_solver(_) :-
disable_solver.
disable_solver :-
clpbn_flag(solver, Old, none),
nb_setval(old_clpbn_solver, Old).
enable_solver(_) :-
enable_solver.
enable_solver(_,_) :-
enable_solver.
enable_solver :-
nb_getval(old_clpbn_solver, Old),
set_clpbn_flag(solver, Old).
enable_solver(_,_) :-
nb_getval(old_clpbn_solver, Old),
set_clpbn_flag(solver, Old).
do_nothing(_).
% backup current best theory in DB.
store_theory(_,_,_) :-
eraseall(best_theory),
% step 1: update distributions to better values.
add_new_clause(_,(H :- _),_,_) :-
(
clpbn_is_tabled(user:H)
->
update_tabled_theory(H)
;
update_theory(H)
),
fail.
store_theory(_,(H:-_),_) :-
clpbn_is_tabled(user:H), !,
store_tabled_theory(H).
store_theory(_,(H:-_),_) :- !,
store_theory(H).
store_theory(_,H,_) :-
store_theory(H).
store_tabled_theory(H) :-
clpbn_tabled_clause(user:H,B),
add_correct_cpt(B,NB),
store_cl((H:-NB)),
fail.
store_tabled_theory(_).
store_theory(H) :-
clause(user:H,B),
add_correct_cpt(B,NB),
store_cl((H:-NB)),
fail.
store_theory(_).
add_correct_cpt((G,B),(G,NB)) :- !,
add_correct_cpt(B,NB).
add_correct_cpt((clpbn:{V = K with Tab }), ({V = K with NTab})) :-
correct_tab(Tab,K,NTab).
add_correct_cpt(({V = K with Tab }), ({V = K with NTab})) :-
correct_tab(Tab,K,NTab).
correct_tab(p(Vs,_),K,p(Vs,TDist)) :-
get_dist_key(Id, K),
get_dist_params(Id, TDist).
correct_tab(p(Vs,_,Ps),K,p(Vs,TDist,Ps)) :-
get_dist_key(Id, K),
get_dist_params(Id, TDist).
store_cl(Cl) :-
recordz(best_theory, Cl, _).
:- user:set(best_clause_hook, clpbn_aleph:add_new_clause).
% step 2: add clause
add_new_clause(_,(_ :- true),_,_) :- !.
add_new_clause(_,(H :- B),_,_) :-
%trace,
% user:db_usage,
% user:db_dynamic,
domain(H, K, V, D),
user:cost((H :- B), _, Cost),
format(user_error,'Current Cost: ~w.~n', [Cost]),
user:cost((H :- B), _, _Cost),
rewrite_body(B, IB, Vs, _, ( !, { V = K with p(D, CPTList, Vs) })),
% need to remember which CPT we want
get_dist_key(Id, K),
@ -157,8 +128,38 @@ add_new_clause(_,(H :- B),_,_) :-
).
update_tabled_theory(H) :-
clpbn_tabled_clause_ref(user:H,B,Ref),
add_correct_cpt(B,NB),
erase(Ref),
clpbn_tabled_assertz((user:(H:-NB))),
fail.
update_tabled_theory(_).
update_theory(H) :-
clause(user:H,B,Ref),
add_correct_cpt(B,NB),
erase(Ref),
assert((user:H:-NB)),
fail.
update_theory(_).
add_correct_cpt((G,B),(G,NB)) :-
add_correct_cpt(B,NB).
add_correct_cpt((clpbn:{V = K with Tab }), ({V = K with NTab})) :-
correct_tab(Tab,K,NTab).
add_correct_cpt(({V = K with Tab }), ({V = K with NTab})) :-
correct_tab(Tab,K,NTab).
correct_tab(p(Vs,_),K,p(Vs,TDist)) :-
get_dist_key(Id, K),
get_dist_params(Id, TDist).
correct_tab(p(Vs,_,Ps),K,p(Vs,TDist,Ps)) :-
get_dist_key(Id, K),
get_dist_params(Id, TDist).
% user-defined cost function, Aleph knows about this (and only about this).
user:cost((H :- B),Inf,Score) :- !,
user:cost((H :- B),Inf,Score) :-
domain(H, K, V, D),
check_info(Inf),
rewrite_body(B, IB, Vs, Ds, ( !, { V = K with p(D, CPTList, Vs) })),

View File

@ -5,13 +5,15 @@
:- module(clpbn_em, [em/5]).
:- use_module(library(lists),
[append/3]).
[append/3,
delete/3]).
:- use_module(library(clpbn),
[clpbn_init_graph/1,
clpbn_init_solver/5,
clpbn_run_solver/4,
clpbn_finalize_solver/1,
conditional_probability/3,
clpbn_flag/2]).
:- use_module(library('clpbn/dists'),
@ -203,8 +205,7 @@ compute_parameters([], [], _, Lik, Lik, _).
compute_parameters([Id-Samples|Dists], [Id-NewTable|Tables], MDistTable, Lik0, Lik, LPs:MargVars) :-
empty_dist(Id, Table0),
add_samples(Samples, Table0, MDistTable),
%matrix_to_list(Table0,Mat),
%format(user_error, 'FINAL ~d ~w~n', [Id,Mat]),
%matrix_to_list(Table0,Mat), lists:sumlist(Mat, Sum), format(user_error, 'FINAL ~d ~w ~w~n', [Id,Sum,Mat]),
soften_sample(Table0, SoftenedTable),
% matrix:matrix_sum(Table0,TotM),
normalise_counts(SoftenedTable, NewTable),
@ -240,3 +241,4 @@ backtrack_run_all([Item|_], Mod) :-
backtrack_run_all([_|Items], Mod) :-
backtrack_run_all(Items, Mod).
backtrack_run_all([], _).

View File

@ -50,7 +50,7 @@ CFLAGS=$(COFLAGS) $(CWFLAGS) $(CMFLAGS) $(CIFLAGS) $(PKGCFLAGS) @DEFS@
LDSOFLAGS=@LDFLAGS@ @EXTRA_LIBS_FOR_SWIDLLS@
LDFLAGS=$(PKGLDFLAGS)
MKINDEX=$(PL) -f none -g make -t halt
MKINDEX=(cd $(srcdir) ; $(PL) -f none -g make -t halt)
.txt.tex:
swipl -f script.pl -g "doc_latex('$*.txt','$*.tex',[stand_alone(false)]),halt" -t "halt(1)"

View File

@ -2099,6 +2099,398 @@ problog_low(_, _, LP, Status) :-
(problog_flag(retain_tables, true) -> retain_tabling; true),
clear_tabling.
:- ensure_loaded(library(tries)).
:- ensure_loaded(library(rbtrees)).
:- ensure_loaded(library(readutil)).
:- ensure_loaded(library(lineutils)).
problog_cnf(Goal, _) :-
init_problog_low(0.0),
problog_control(off, up),
timer_start(sld_time),
problog_call(Goal),
add_solution,
fail.
problog_cnf(_,Prob) :-
timer_stop(sld_time,SLD_Time),
problog_var_set(sld_time, SLD_Time),
nb_getval(problog_completed_proofs, Trie_Completed_Proofs),
trie_to_cnf(Trie_Completed_Proofs, CNF, RB),
% randomize_cnf_varids(CNF, RandomVNameCNF),
% invert_cnf_varids(CNF, RandomVNameCNF),
CNF = RandomVNameCNF,
cnf_to_dimacs(RandomVNameCNF, _File),
% should generate a tmp file.
unix(system('./c2d_linux -in dimacs')),
nnf_to_probability(_NNFFile, RB, CompProb),
Prob is 1-CompProb,
delete_ptree(Trie_Completed_Proofs),
(problog_flag(retain_tables, true) -> retain_tabling; true),
clear_tabling.
problog_wcnf(Goal, _) :-
init_problog_low(0.0),
problog_control(off, up),
timer_start(sld_time),
problog_call(Goal),
add_solution,
fail.
problog_wcnf(_,Prob) :-
timer_stop(sld_time,SLD_Time),
problog_var_set(sld_time, SLD_Time),
nb_getval(problog_completed_proofs, Trie_Completed_Proofs),
trie_to_cnf(Trie_Completed_Proofs, CNF, RB),
% randomize_cnf_varids(CNF, RandomVNameCNF),
% invert_cnf_varids(CNF, RandomVNameCNF),
CNF = RandomVNameCNF,
cnf_to_wdimacs(RandomVNameCNF, RB, _File),
% should generate a tmp file.
unix(system('./c2d_linux -in dimacs')),
nnf_to_probability(_NNFFile, RB, CompProb),
Prob is 1-CompProb,
delete_ptree(Trie_Completed_Proofs),
(problog_flag(retain_tables, true) -> retain_tabling; true),
clear_tabling.
trie_to_cnf(Trie, CNF, RB) :-
trie_traverse_first(Trie, RefFirst),
rb_new(RB0),
nb_setval(cnf_nodes, 0),
trie_to_list_of_numbers(Trie, RB0, RefFirst, CNF, RB).
trie_to_list_of_numbers(Trie, RB0, CurrentRef, Proof.Proofs, RB) :-
trie_get_entry(CurrentRef, Entry),
convert_trie_entry_to_numbers(Entry, RB0, Proof, RBI),
continue_processing_trie(Trie, RBI, CurrentRef, Proofs, RB).
continue_processing_trie(Trie, RB0, CurrentRef, Proofs, RB) :-
trie_traverse_next(CurrentRef, NextRef), !,
trie_to_list_of_numbers(Trie, RB0, NextRef, Proofs, RB).
continue_processing_trie(_, RB, _CurrentRef, [], RB).
convert_trie_entry_to_numbers([], RB, [], RB).
convert_trie_entry_to_numbers(not(Val).Entry, RB0, Numb.Proof, RB) :- !,
convert_goal_to_number(Val, RB0, Numb, RBI),
convert_trie_entry_to_numbers(Entry, RBI, Proof, RB).
convert_trie_entry_to_numbers(Val.Entry, RB0, NegNumb.Proof, RB) :- !,
convert_goal_to_number(Val, RB0, Numb, RBI),
NegNumb is -Numb,
convert_trie_entry_to_numbers(Entry, RBI, Proof, RB).
convert_goal_to_number(Val, RB0, Numb, RBI) :-
rb_lookup(Val, Numb, RB0), !,
RB0 = RBI.
convert_goal_to_number(Val, RB0, I, RBI) :-
nb_getval(cnf_nodes, I0),
I is I0+1,
nb_setval(cnf_nodes, I),
rb_insert(RB0, Val, I, RBI).
invert_cnf_varids(CNF, InvVNameCNF) :-
nb_getval(cnf_nodes,Nodes),
invert_cnf_varids(CNF, Nodes, InvVNameCNF, []).
invert_cnf_varids([], _) --> [].
invert_cnf_varids(C.CNF, Nodes) --> [NC],
{ invert_c_varids(C, Nodes, NC, []) },
invert_cnf_varids(CNF, Nodes).
invert_c_varids([], _Nodes) --> [].
invert_c_varids(N.CNF, Nodes) -->
[NN],
{ inv_node(N,Nodes,NN) },
invert_c_varids(CNF, Nodes).
inv_node(N,Nodes,NN) :-
( N > 0 -> NN is (Nodes-N)+1 ; NN is -(Nodes+N+1) ).
randomize_cnf_varids(CNF, RandomVNameCNF) :-
nb_getval(cnf_nodes,Nodes),
generate_numbers(Nodes, Numbers),
randomize_list(Numbers, RandomNumbers).
cnf_to_wdimacs(CNF, RB, File) :-
File = dimacs,
open(dimacs,write,Stream),
length(CNF,M),
nb_getval(cnf_nodes,N),
format(Stream,'p cnf ~d ~d~n',[N,M]),
output_probs(Stream, RB),
cnf_lines_to_dimacs(CNF, Stream),
close(Stream).
output_probs(Stream, RB) :-
rb_in(K, V, RB),
dump_weight(Stream, K, V),
fail.
output_probs(_Stream, _RB).
dump_weight(Stream, K, V) :-
get_fact_probability(K,ProbFact),
format(Stream,'w ~d ~f~n',[V,ProbFact]).
cnf_to_dimacs(CNF, File) :-
File = dimacs,
open(dimacs,write,Stream),
length(CNF,M),
nb_getval(cnf_nodes,N),
format(Stream,'p cnf ~d ~d~n',[N,M]),
cnf_lines_to_dimacs(CNF, Stream),
close(Stream).
cnf_lines_to_dimacs([], _Stream).
cnf_lines_to_dimacs([Line|CNF], Stream) :-
cnf_line_to_dimacs(Line,Stream),
cnf_lines_to_dimacs(CNF, Stream).
cnf_line_to_dimacs([],Stream) :-
format(Stream,'0~n',[]).
cnf_line_to_dimacs([L|Line],Stream) :-
format(Stream,'~w ',[L]),
cnf_line_to_dimacs(Line,Stream).
nnf_to_probability(File, RBTree, Result) :-
File = 'dimacs.nnf',
open(File, read, Stream),
process_nnf(Stream, RBTree, Result),
close(Stream).
process_nnf(Stream, RevRBTree, Result) :-
rb_visit(RevRBTree, ListOfPairs),
swap_key_values(ListOfPairs, SwappedList),
list_to_rbtree(SwappedList, RBTree),
read_line_to_codes(Stream, Header),
split(Header, ["nnf",VS,_ES,_NS]),
number_codes(V, VS),
%trace,
call(functor(TempResults, nnf, V)),
process_nnf_lines(Stream, RBTree, 1, TempResults),
arg(V, TempResults, Result).
swap_key_values([], []).
swap_key_values((K-V).ListOfPairs, (V-K).SwappedList) :-
swap_key_values(ListOfPairs, SwappedList).
process_nnf_lines(Stream, RBTree, LineNumber, TempResults) :-
read_line_to_codes(Stream, Codes),
( Codes = end_of_file -> true ;
% (LineNumber > 1 -> N is LineNumber-1, arg(N,TempResults,P), format("~w ",[P]);true),
% format("~s~n",[Codes]),
process_nnf_line(RBTree, LineNumber, TempResults, Codes, []),
NewLine is LineNumber+1,
process_nnf_lines(Stream, RBTree, NewLine, TempResults)
).
process_nnf_line(RBTree, Line, TempResults) --> "L ",
nnf_leaf(RBTree, Line, TempResults).
process_nnf_line(_RBTree, Line, TempResults) --> "A ",
nnf_and_node(Line, TempResults).
process_nnf_line(_RBTree, Line, TempResults) --> "O ",
nnf_or_node(Line, TempResults).
nnf_leaf(RBTree, LineNumber, TempResults, Codes, []) :-
number_codes(Number, Codes),
Abs is abs(Number),
rb_lookup(Abs, Node, RBTree),
% get_fact_probability(Node, ProbFact),
% (Number < 0 -> Prob is 1-ProbFact ; Prob = ProbFact),
(get_fact_probability(Node,ProbFact) -> (Number < 0 -> Prob is 1-ProbFact ; Prob = ProbFact) ; Prob = special),
arg(LineNumber, TempResults, Prob).
nnf_and_node(LineNumber, TempResults, Codes, []) :-
split(Codes, [_|NumberAsStrings]),
multiply_nodes(NumberAsStrings, 1.0, TempResults, Product),
arg(LineNumber, TempResults, Product).
multiply_nodes([], Product, _, Product).
multiply_nodes(NumberAsString.NumberAsStrings, Product0, TempResults, Product) :-
number_codes(Pos, NumberAsString),
Pos1 is Pos+1,
arg(Pos1, TempResults, P),
( P == special -> ProductI=Product0; ProductI is P*Product0 ),
multiply_nodes(NumberAsStrings, ProductI, TempResults, Product).
nnf_or_node(LineNumber, TempResults, Codes, []) :-
split(Codes, [_,_|NumberAsStrings]),
add_nodes(NumberAsStrings, 0.0, TempResults, Product),
arg(LineNumber, TempResults, Product).
add_nodes([], Product, _, Product).
add_nodes(NumberAsString.NumberAsStrings, Product0, TempResults, Product) :-
number_codes(Pos, NumberAsString),
Pos1 is Pos+1,
arg(Pos1, TempResults, P),
( P == special -> ProductI=Product0; ProductI is P+Product0 ),
add_nodes(NumberAsStrings, ProductI, TempResults, Product).
problog_cnf_positive(Goal, _) :-
init_problog_low(0.0),
problog_control(off, up),
timer_start(sld_time),
problog_call(Goal),
add_solution,
fail.
problog_cnf_positive(_,Prob) :-
timer_stop(sld_time,SLD_Time),
problog_var_set(sld_time, SLD_Time),
nb_getval(problog_completed_proofs, Trie_Completed_Proofs),
% trie_to_cnf(Trie_Completed_Proofs, CNF, RB),
% cnf_to_dimacs(CNF, _File),
trie_to_dimacs(Trie_Completed_Proofs, RB, _File),
unix(system('./c2d_linux -in dimacs')),
% execute c2d at this point, but we're lazy
nnf_to_probability(_NNFFile, RB, Prob),
delete_ptree(Trie_Completed_Proofs),
(problog_flag(retain_tables, true) -> retain_tabling; true),
clear_tabling.
trie_to_dimacs(Trie_Completed_Proofs, RB, File) :-
problog_flag(db_trie_opt_lvl, OptimizationLevel),
trie_to_depth_breadth_trie(Trie_Completed_Proofs, DBTrie, LL, OptimizationLevel),
dbtrie_to_cnf(DBTrie, LL, RB, CNF),
File = dimacs,
open(dimacs,write,Stream),
length(CNF,M),
nb_getval(cnf_nodes,N),
format(Stream,'p cnf ~d ~d~n',[N,M]),
cnf_lines_to_dimacs(CNF, Stream),
close(Stream).
dbtrie_to_cnf(DBTrie, LL, RB, CNF) :-
% tricky way to find the number of intermediate nodes.
(atomic_concat('L', _InterStep, LL) ->
% cleanup
retractall(deref(_,_)),
(problog_flag(deref_terms, true) ->
asserta(deref(LL,no)),
mark_for_deref(DBTrie),
V = 3
;
V = 1
),
% do the real work
bdd_defs_to_cnf(DBTrie, CNF, LL, RB)
;
% cases true, false, single literal
( LL == true -> CNF = [[1,-1]]
;
LL == false -> CNF = [[1],[-1]]
;
convert_goal_to_number(LL, RB, NN, _RBI),
CNF = [[NN]]
)
).
bdd_defs_to_cnf(DBTrie, [[NN]|CNF], LL, RB) :- fail,
findall(Node, in_trie(DBTrie, Node), Nodes0),
% reverse(Nodes0, Nodes),
% depth_first(Nodes0, LL, Nodes),
Nodes0 = Nodes,
rb_new(RB0),
nb_setval(cnf_nodes, 0),
convert_goal_to_number(LL, RB0, NN, RB1),
xnodes_to_cnf(Nodes, RB1, RB, CNF, []).
bdd_defs_to_cnf(Trie, [[NN]|CNF], LL, RB) :-
trie_traverse_first(Trie, RefFirst),
rb_new(RB0),
nb_setval(cnf_nodes, 0),
convert_goal_to_number(LL, RB0, NN, RB1),
bdd_defs_to_list_of_numbers(Trie, RB1, RefFirst, [], CNF, RB).
depth_first(Nodes0, LL, Nodes) :-
rb_new(RB0),
insert_all(Nodes0, RB0, RB),
pick_nodes(LL, RB, _, Nodes, []).
insert_all([], RB, RB).
insert_all(Node.Nodes0, RB0, RB) :-
arg(2, Node, Key),
rb_insert(RB0, Key, Node, RBI),
insert_all(Nodes0, RBI, RB).
pick_nodes(Key, RB0, RBF) -->
{ rb_delete(RB0, Key, Node, RBI) },
!,
[Node],
{ arg(1, Node, Children) },
pick_recursively(Children, RBI, RBF).
pick_nodes(_, RB, RB) --> [].
pick_recursively([], RB, RB) --> [].
pick_recursively(Key.Keys, RB0, RBF) -->
pick_nodes(Key, RB0, RBI),
pick_recursively(Keys, RBI, RBF).
in_trie(Trie, Entry) :-
trie_traverse(Trie, Ref),
trie_get_entry(Ref, Entry).
xnodes_to_cnf([], RB, RB) --> [].
xnodes_to_cnf(Node.Nodes, RB0, RB) -->
xnode_to_cnf(Node, RB0, RBI),
xnodes_to_cnf(Nodes, RBI, RB).
xnode_to_cnf(Node, RB0, RBI, CNF, PartialCNF) :-
convert_dbtrie_entry_to_numbers(Node, RB0, PartialCNF, CNF, RBI).
bdd_defs_to_list_of_numbers(Trie, RB0, CurrentRef, PartialCNF, FinalCNF, RB) :-
trie_get_entry(CurrentRef, Entry),
writeln(Entry),
convert_dbtrie_entry_to_numbers(Entry, RB0, PartialCNF, NextCNF, RBI),
continue_processing_dbtrie(Trie, RBI, CurrentRef, NextCNF, FinalCNF, RB).
continue_processing_dbtrie(Trie, RB0, CurrentRef, PartialCNF, FinalCNF, RB) :-
trie_traverse_next(CurrentRef, NextRef), !,
bdd_defs_to_list_of_numbers(Trie, RB0, NextRef, PartialCNF, FinalCNF, RB).
continue_processing_dbtrie(_, RB, _CurrentRef, CNF, CNF, RB).
convert_dbtrie_entry_to_numbers(depth(List,Name), RB0, PartialCNF, CNF, RBI) :-
convert_trie_entry_to_numbers_positive(List, RB0, NumList, NextRB),
convert_goal_to_number(Name, NextRB, NumName, RBI),
add_conjunction_to_cnf(NumList, NumName, PartialCNF, CNF).%,format(user_error,'conj ~q gives ~q~n',[NumList-NumName, CNF]).
convert_dbtrie_entry_to_numbers(breadth(List,Name), RB0, PartialCNF, CNF, RBI) :-
convert_trie_entry_to_numbers_positive(List, RB0, NumList, NextRB),
convert_goal_to_number(Name, NextRB, NumName, RBI),
add_disjunction_to_cnf(NumList, NumName, PartialCNF, CNF).%,format(user_error,'disj ~q gives ~q~n',[NumList-NumName, CNF]).
convert_trie_entry_to_numbers_positive([], RB, [], RB).
convert_trie_entry_to_numbers_positive(not(Val).Entry, RB0, (-Numb).Proof, RB) :- !,
convert_goal_to_number(Val, RB0, Numb, RBI),
convert_trie_entry_to_numbers_positive(Entry, RBI, Proof, RB).
convert_trie_entry_to_numbers_positive(Val.Entry, RB0, Numb.Proof, RB) :- !,
convert_goal_to_number(Val, RB0, Numb, RBI),
convert_trie_entry_to_numbers_positive(Entry, RBI, Proof, RB).
add_conjunction_to_cnf(NumList, NumName, PartialCNF, CNF) :-
neg_numbers(NumList,NegList),
add_conj_to_cnf(NumList, NumName, [[NumName|NegList]|PartialCNF], CNF).
add_conj_to_cnf([],_,CNF,CNF).
add_conj_to_cnf([Num|List],NumName,CNF0,CNF) :-
NegNumName is -NumName,
add_conj_to_cnf(List,NumName,[[NegNumName,Num]|CNF0],CNF).
add_disjunction_to_cnf(NumList, NumName, PartialCNF, CNF) :-
NegNumName is -NumName,
add_disj_to_cnf(NumList, NumName, [[NegNumName|NumList]|PartialCNF], CNF).
add_disj_to_cnf([],_,CNF,CNF).
add_disj_to_cnf([Num|List],NumName,CNF0,CNF) :-
neg_num(Num,NegNum),
add_disj_to_cnf(List,NumName,[[NumName,NegNum]|CNF0],CNF).
neg_num(Y,X) :- X is -Y.
neg_numbers([],[]).
neg_numbers([Y|List],[X|ListN]) :-
neg_num(Y,X),
neg_numbers(List,ListN).
%%%%
init_problog_low(Threshold) :-
init_ptree(Trie_Completed_Proofs),
nb_setval(problog_completed_proofs, Trie_Completed_Proofs),

View File

@ -239,6 +239,8 @@
:- dynamic(query_all_scripts/2).
:- dynamic(last_llh/1).
:- dynamic(user:myclause/2).
:- discontiguous(user:myclause/1).
:- discontiguous(user:myclause/2).
:- discontiguous(user:known/3).

@ -1 +1 @@
Subproject commit f218eaacc9ef3922829ff4a8c5cd64cca9c19dc7
Subproject commit 27b398187116aaa5c6b687d1abe79b0a270381bb

@ -1 +1 @@
Subproject commit f0e208de69f5303648fe1d035e2bfa164411d42d
Subproject commit e6b682d909a4d63ee876af70c738d900449625fb

View File

@ -127,10 +127,12 @@ bool bpx_is_identical(TERM t1, TERM t2)
TERM bpx_get_call_arg(BPLONG i, BPLONG arity)
{
if (i < 1 || i > arity) {
bpx_raise("index out of range");
}
return ARG(i, arity);
CACHE_REGS
if (i < 1 || i > arity) {
bpx_raise("index out of range");
}
return ARG(i, arity);
}
BPLONG bpx_get_integer(TERM t)
@ -245,6 +247,7 @@ TERM bpx_get_cdr(TERM t)
TERM bpx_build_var(void)
{
CACHE_REGS
TERM term;
REQUIRE_HEAP(1);
@ -260,6 +263,7 @@ TERM bpx_build_integer(BPLONG n)
TERM bpx_build_float(double x)
{
CACHE_REGS
REQUIRE_HEAP(4);
return encodefloat1(x);
}
@ -274,6 +278,7 @@ TERM bpx_build_atom(const char *name)
TERM bpx_build_list(void)
{
CACHE_REGS
TERM term;
REQUIRE_HEAP(2);
@ -290,6 +295,7 @@ TERM bpx_build_nil(void)
TERM bpx_build_structure(const char *name, BPLONG arity)
{
CACHE_REGS
SYM_REC_PTR sym;
TERM term;
@ -314,6 +320,7 @@ bool bpx_unify(TERM t1, TERM t2)
TERM bpx_string_2_term(const char *s)
{
CACHE_REGS
TERM term, vars;
int result;

View File

@ -80,6 +80,27 @@ long int XTAG(TERM t)
}
}
extern inline TERM ADDTAG(void * t,int tag);
extern inline int is_UNIFIABLE(TERM t1, TERM t2);
extern inline int is_IDENTICAL(TERM t1, TERM t2);
extern inline char *bp_term_2_string(TERM t);
extern inline int bp_string_2_term(const char *s, TERM to, TERM tv);
extern inline SYM_REC_PTR insert(const char *name, int size, int arity);
extern inline int compare(TERM t1, TERM t2);
extern inline void write_term(TERM t);
extern inline void numberVarTermOpt(TERM t);
extern inline TERM unnumberVarTerm(TERM t, BPLONG_PTR pt1, BPLONG_PTR pt2);
extern inline int unifyNumberedTerms(TERM t1, TERM t2);
int bpx_call_term(TERM t);
int bpx_call_string(const char *s);
int bpx_call_string(const char *s);
int bpx_mount_query_string(const char *s);
int bpx_next_solution(void);
void bpx_write(TERM t);
int bpx_printf(const char *fmt, ...);
extern inline TERM ADDTAG(void * t,int tag) {
if (tag == ATM)
return MkAtomTerm((Atom)t);
@ -210,13 +231,13 @@ list_length(BPLONG t1, BPLONG t2)
#define PRE_NUMBER_VAR(X)
static inline void
extern inline void
numberVarTermOpt(TERM t)
{
YAP_NumberVars(t, 0);
}
static inline TERM
extern inline TERM
unnumberVarTerm(TERM t, BPLONG_PTR pt1, BPLONG_PTR pt2)
{
return YAP_UnNumberVars(t);

View File

@ -170,6 +170,7 @@ int id_table_count(const ID_TABLE *this)
TERM unnumber_var_term(TERM term)
{
CACHE_REGS
BPLONG mvn = -1;
return unnumberVarTerm(term, local_top, &mvn);
}

View File

@ -15,6 +15,38 @@ char * bp_term_2_string(TERM);
/* unify.c */
int unify(TERM, TERM);
int prism_goal_id_register(TERM term);
int prism_sw_id_register(TERM term);
int prism_sw_ins_id_register(TERM term);
int prism_goal_id_get(TERM term);
int prism_sw_id_get(TERM term);
int prism_sw_ins_id_get(TERM term);
int prism_goal_count(void);
int prism_sw_count(void);
int prism_sw_ins_count(void);
TERM prism_goal_term(IDNUM i);
TERM prism_sw_term(IDNUM i);
TERM prism_sw_ins_term(IDNUM i);
char * prism_goal_string(IDNUM i);
char * prism_sw_string(IDNUM i);
char * prism_sw_ins_string(IDNUM i);
char * copy_prism_goal_string(IDNUM i);
char * copy_prism_sw_string(IDNUM i);
char * copy_prism_sw_ins_string(IDNUM i);
int pc_prism_id_table_init_0(void);
int pc_prism_goal_id_register_2(void);
int pc_prism_sw_id_register_2(void);
int pc_prism_sw_ins_id_register_2(void);
int pc_prism_goal_id_get_2(void);
int pc_prism_sw_id_get_2(void);
int pc_prism_sw_ins_id_get_2(void);
int pc_prism_goal_count_1(void);
int pc_prism_sw_count_1(void);
int pc_prism_sw_ins_count_1(void);
int pc_prism_goal_term_2(void);
int pc_prism_sw_term_2(void);
int pc_prism_sw_ins_term_2(void);
/*--------------------------------------------------------------------*/
int prism_goal_id_register(TERM term)
@ -125,6 +157,7 @@ int pc_prism_id_table_init_0(void)
int pc_prism_goal_id_register_2(void)
{
CACHE_REGS
TERM term;
IDNUM id;
@ -137,6 +170,7 @@ int pc_prism_goal_id_register_2(void)
int pc_prism_sw_id_register_2(void)
{
CACHE_REGS
TERM term;
IDNUM id;
@ -149,6 +183,7 @@ int pc_prism_sw_id_register_2(void)
int pc_prism_sw_ins_id_register_2(void)
{
CACHE_REGS
TERM term;
IDNUM id;
@ -161,6 +196,7 @@ int pc_prism_sw_ins_id_register_2(void)
int pc_prism_goal_id_get_2(void)
{
CACHE_REGS
TERM term;
IDNUM id;
@ -175,6 +211,7 @@ int pc_prism_goal_id_get_2(void)
int pc_prism_sw_id_get_2(void)
{
CACHE_REGS
TERM term;
IDNUM id;
@ -188,6 +225,7 @@ int pc_prism_sw_id_get_2(void)
int pc_prism_sw_ins_id_get_2(void)
{
CACHE_REGS
TERM term;
IDNUM id;
@ -201,21 +239,25 @@ int pc_prism_sw_ins_id_get_2(void)
int pc_prism_goal_count_1(void)
{
CACHE_REGS
return unify(MAKEINT(prism_goal_count()), ARG(1,1));
}
int pc_prism_sw_count_1(void)
{
CACHE_REGS
return unify(MAKEINT(prism_sw_count()), ARG(1,1));
}
int pc_prism_sw_ins_count_1(void)
{
CACHE_REGS
return unify(MAKEINT(prism_sw_ins_count()), ARG(1,1));
}
int pc_prism_goal_term_2(void)
{
CACHE_REGS
TERM id, term;
id = ARG(1,2);
@ -227,6 +269,7 @@ int pc_prism_goal_term_2(void)
int pc_prism_sw_term_2(void)
{
CACHE_REGS
TERM id, term;
id = ARG(1,2);
@ -239,6 +282,7 @@ int pc_prism_sw_term_2(void)
int pc_prism_sw_ins_term_2(void)
{
CACHE_REGS
TERM id, term;
id = ARG(1,2);

View File

@ -247,18 +247,21 @@ double random_gaussian(void)
int pc_random_auto_seed_1(void)
{
CACHE_REGS
BPLONG seed = (BPLONG)(time(NULL));
return bpx_unify(ARG(1,1), bpx_build_integer(seed));
}
int pc_random_init_by_seed_1(void)
{
CACHE_REGS
init_genrand((unsigned long)(bpx_get_integer(ARG(1,1))));
return BP_TRUE;
}
int pc_random_init_by_list_1(void)
{
CACHE_REGS
unsigned long *seed;
TERM t, u;
@ -278,16 +281,19 @@ int pc_random_init_by_list_1(void)
int pc_random_float_1(void)
{
CACHE_REGS
return bpx_unify(ARG(1,1), bpx_build_float(random_float()));
}
int pc_random_gaussian_1(void)
{
CACHE_REGS
return bpx_unify(ARG(1,1), bpx_build_float(random_gaussian(0.0,1.0)));
}
int pc_random_int_2(void)
{
CACHE_REGS
int n_max = bpx_get_integer(ARG(1,2));
int n_out = random_int(n_max);
return bpx_unify(ARG(2,2), bpx_build_integer((BPLONG)(n_out)));
@ -295,6 +301,7 @@ int pc_random_int_2(void)
int pc_random_int_3(void)
{
CACHE_REGS
int n_min = bpx_get_integer(ARG(1,3));
int n_max = bpx_get_integer(ARG(2,3));
int n_out = random_int(n_max - n_min + 1) + n_min;
@ -305,6 +312,7 @@ int pc_random_int_3(void)
int pc_random_get_state_1(void)
{
CACHE_REGS
int i, j;
TERM t, u;
unsigned long temp;
@ -333,6 +341,7 @@ int pc_random_get_state_1(void)
int pc_random_set_state_1(void)
{
CACHE_REGS
int i, j;
TERM term;
unsigned long temp;

View File

@ -62,6 +62,7 @@ static ptrdiff_t trail_pos0 = 0;
static void number_vars(TERM term)
{
CACHE_REGS
assert(trail_pos0 == 0);
trail_pos0 = trail_up_addr - trail_top;
@ -75,6 +76,7 @@ static void number_vars(TERM term)
static void revert_vars(void)
{
CACHE_REGS
BPLONG_PTR trail_top0;
assert(trail_pos0 != 0);
@ -90,6 +92,7 @@ static void revert_vars(void)
*/
static BPULONG prism_hash_value(TERM term)
{
CACHE_REGS
TERM t, *rest;
BPLONG i, n;
SYM_REC_PTR sym;

View File

@ -770,6 +770,7 @@ int pc_get_snode_expectation_2(void)
int pc_import_occ_switches_3(void)
{
CACHE_REGS
TERM p_sw_list,p_sw_list0,p_sw_list1;
TERM p_sw_ins_list0,p_sw_ins_list1,sw,sw_ins;
TERM p_num_sw, p_num_sw_ins;

@ -1 +1 @@
Subproject commit 1028ec347935a5f61925541d7adcf6b08aca820c
Subproject commit 2a859fd75795cc428e911b59abf8404c87b530f4

View File

@ -83,6 +83,10 @@ tabling_statistics(global_trie_nodes,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(10,BytesInUse,StructsInUse).
tabling_statistics(global_trie_hashes,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(11,BytesInUse,StructsInUse).
tabling_statistics(subgoal_entries,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(16,BytesInUse,StructsInUse).
tabling_statistics(answer_ref_nodes,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(17,BytesInUse,StructsInUse).

View File

@ -86,6 +86,10 @@ opt_statistics(table_subgoal_solution_frames,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(14,BytesInUse,StructsInUse).
opt_statistics(table_subgoal_answer_frames,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(15,BytesInUse,StructsInUse).
opt_statistics(subgoal_entries,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(16,BytesInUse,StructsInUse).
opt_statistics(answer_ref_nodes,[BytesInUse,StructsInUse]) :-
'$c_get_optyap_statistics'(17,BytesInUse,StructsInUse).