2010-04-03 05:58:14 +01:00
|
|
|
/************************************************************************
|
|
|
|
** **
|
|
|
|
** The YapTab/YapOr/OPTYap systems **
|
|
|
|
** **
|
|
|
|
** YapTab extends the Yap Prolog engine to support sequential tabling **
|
|
|
|
** YapOr extends the Yap Prolog engine to support or-parallelism **
|
|
|
|
** OPTYap extends the Yap Prolog engine to support or-parallel tabling **
|
|
|
|
** **
|
|
|
|
** **
|
|
|
|
** Yap Prolog was developed at University of Porto, Portugal **
|
|
|
|
** **
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/************************************************************************
|
|
|
|
** General Configuration Parameters **
|
|
|
|
************************************************************************/
|
|
|
|
|
2011-04-28 09:48:42 +01:00
|
|
|
/****************************************************************
|
|
|
|
** use shared pages memory alloc scheme ? (optional) **
|
|
|
|
****************************************************************/
|
2011-04-14 19:19:13 +01:00
|
|
|
|
2011-04-28 09:48:42 +01:00
|
|
|
/* #define USE_PAGES_MALLOC 1 */
|
2009-07-03 00:54:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/************************************************************************
|
|
|
|
** TABLING Configuration Parameters **
|
|
|
|
************************************************************************/
|
2009-07-03 00:54:39 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/****************************
|
2005-07-11 20:17:32 +01:00
|
|
|
** default sizes **
|
2010-04-03 05:58:14 +01:00
|
|
|
****************************/
|
2009-08-07 17:29:53 +01:00
|
|
|
#define MAX_TABLE_VARS 1000
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/**********************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** trail freeze scheme (mandatory, define one) **
|
2010-04-03 05:58:14 +01:00
|
|
|
**********************************************************/
|
2009-08-07 17:29:53 +01:00
|
|
|
#define BFZ_TRAIL_SCHEME 1
|
2005-06-03 19:28:11 +01:00
|
|
|
/* #define BBREG_TRAIL_SCHEME 1 */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/****************************************************
|
2009-08-09 03:38:07 +01:00
|
|
|
** support early completion ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
****************************************************/
|
2009-08-09 03:38:07 +01:00
|
|
|
#define TABLING_EARLY_COMPLETION 1
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/******************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** support trie compact pairs ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
******************************************************/
|
2009-08-12 14:32:12 +01:00
|
|
|
#define TRIE_COMPACT_PAIRS 1
|
2009-06-24 20:04:16 +01:00
|
|
|
|
2010-04-23 04:22:10 +01:00
|
|
|
/************************************************************
|
|
|
|
** support global trie for subterms ? (optional) **
|
|
|
|
************************************************************/
|
2009-09-27 02:31:31 +01:00
|
|
|
/* #define GLOBAL_TRIE_FOR_SUBTERMS 1 */
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/******************************************************
|
|
|
|
** support incomplete tabling ? (optional) **
|
|
|
|
******************************************************/
|
|
|
|
/* #define INCOMPLETE_TABLING 1 */
|
2009-08-06 02:27:59 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/******************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** limit the table space size ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
******************************************************/
|
2009-08-06 02:27:59 +01:00
|
|
|
/* #define LIMIT_TABLING 1 */
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*********************************************************
|
|
|
|
** support deterministic tabling ? (optional) **
|
|
|
|
*********************************************************/
|
|
|
|
/* #define DETERMINISTIC_TABLING 1 */
|
2009-08-06 02:27:59 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** enable error checking ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
*************************************************/
|
2010-04-18 04:59:11 +01:00
|
|
|
/* #define DEBUG_TABLING 1 */
|
2009-07-03 00:54:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/************************************************************************
|
|
|
|
** YAPOR Configuration Parameters **
|
|
|
|
************************************************************************/
|
2009-07-03 00:54:39 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/****************************
|
2009-07-03 00:54:39 +01:00
|
|
|
** default sizes **
|
2010-04-03 05:58:14 +01:00
|
|
|
****************************/
|
2009-07-03 00:54:39 +01:00
|
|
|
#define MAX_LENGTH_ANSWER 1000
|
|
|
|
#define MAX_BRANCH_DEPTH 1000
|
|
|
|
#define MAX_BEST_TIMES 21
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/************************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** memory mapping scheme (mandatory, define one) **
|
2010-04-03 05:58:14 +01:00
|
|
|
************************************************************/
|
2011-04-29 14:59:17 +01:00
|
|
|
#define MMAP_MEMORY_MAPPING_SCHEME 1
|
2011-04-29 16:44:59 +01:00
|
|
|
/* #define SHM_MEMORY_MAPPING_SCHEME 1 */
|
2009-07-03 00:54:39 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** enable error checking ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
*************************************************/
|
2010-04-18 04:59:11 +01:00
|
|
|
/* #define DEBUG_YAPOR 1 */
|
2009-07-03 00:54:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/************************************************************************
|
|
|
|
** OPTYAP Configuration Parameters **
|
|
|
|
************************************************************************/
|
2009-07-03 00:54:39 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/****************************
|
2009-07-03 00:54:39 +01:00
|
|
|
** default sizes **
|
2010-04-03 05:58:14 +01:00
|
|
|
****************************/
|
2009-07-03 00:54:39 +01:00
|
|
|
#define TABLE_LOCK_BUCKETS 512
|
|
|
|
#define TG_ANSWER_SLOTS 20
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/***********************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** tries locking scheme (mandatory, define one) **
|
2010-04-03 05:58:14 +01:00
|
|
|
************************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** The TABLE_LOCK_AT_ENTRY_LEVEL scheme locks the access **
|
|
|
|
** to the table space in the entry data structure. It **
|
|
|
|
** restricts the number of lock operations needed to go **
|
|
|
|
** through the table data structures. **
|
|
|
|
** **
|
|
|
|
** The TABLE_LOCK_AT_NODE_LEVEL scheme locks each data **
|
|
|
|
** structure before accessing it. It decreases **
|
|
|
|
** concurrrency for workers accessing commom parts of the **
|
|
|
|
** table space. **
|
|
|
|
** **
|
|
|
|
** The TABLE_LOCK_AT_WRITE_LEVEL scheme is an hibrid **
|
|
|
|
** scheme, it only locks a table data structure when it **
|
|
|
|
** is going to update it. You can use ALLOC_BEFORE_CHECK **
|
|
|
|
** with this scheme to allocate a node before checking **
|
|
|
|
** if it will be necessary. **
|
2010-04-03 05:58:14 +01:00
|
|
|
***********************************************************/
|
2009-07-03 00:54:39 +01:00
|
|
|
/* #define TABLE_LOCK_AT_ENTRY_LEVEL 1 */
|
|
|
|
/* #define TABLE_LOCK_AT_NODE_LEVEL 1 */
|
|
|
|
#define TABLE_LOCK_AT_WRITE_LEVEL 1
|
|
|
|
/* #define ALLOC_BEFORE_CHECK 1 */
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/**********************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** support inner cuts ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
**********************************************/
|
2003-11-05 16:00:01 +00:00
|
|
|
#define TABLING_INNER_CUTS 1
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*********************************************************
|
2009-09-27 02:31:31 +01:00
|
|
|
** use timestamps for suspension ? (optional) **
|
2010-04-03 05:58:14 +01:00
|
|
|
*********************************************************/
|
2003-11-05 16:00:01 +00:00
|
|
|
#define TIMESTAMP_CHECK 1
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/************************************************************************
|
|
|
|
** Parameter Checks **
|
|
|
|
************************************************************************/
|
2005-07-11 20:17:32 +01:00
|
|
|
|
2011-04-28 09:48:42 +01:00
|
|
|
#ifndef USE_PAGES_MALLOC
|
2011-04-18 14:59:17 +01:00
|
|
|
#undef LIMIT_TABLING
|
2011-04-28 09:48:42 +01:00
|
|
|
#endif /* !USE_PAGES_MALLOC */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2005-06-03 19:28:11 +01:00
|
|
|
#ifdef YAPOR
|
|
|
|
#ifdef i386 /* For i386 machines we use shared memory segments */
|
|
|
|
#undef MMAP_MEMORY_MAPPING_SCHEME
|
|
|
|
#define SHM_MEMORY_MAPPING_SCHEME
|
|
|
|
#endif /* i386 */
|
|
|
|
#if !defined(MMAP_MEMORY_MAPPING_SCHEME) && !defined(SHM_MEMORY_MAPPING_SCHEME)
|
|
|
|
#error Define a memory mapping scheme
|
|
|
|
#endif /* !MMAP_MEMORY_MAPPING_SCHEME && !SHM_MEMORY_MAPPING_SCHEME */
|
|
|
|
#if defined(MMAP_MEMORY_MAPPING_SCHEME) && defined(SHM_MEMORY_MAPPING_SCHEME)
|
|
|
|
#error Do not define multiple memory mapping schemes
|
|
|
|
#endif /* MMAP_MEMORY_MAPPING_SCHEME && SHM_MEMORY_MAPPING_SCHEME */
|
2005-08-04 16:45:56 +01:00
|
|
|
#undef LIMIT_TABLING
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* YAPOR */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#ifdef TABLING
|
|
|
|
#if !defined(BFZ_TRAIL_SCHEME) && !defined(BBREG_TRAIL_SCHEME)
|
|
|
|
#error Define a trail scheme
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* !BFZ_TRAIL_SCHEME && !BBREG_TRAIL_SCHEME */
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(BFZ_TRAIL_SCHEME) && defined(BBREG_TRAIL_SCHEME)
|
|
|
|
#error Do not define multiple trail schemes
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* BFZ_TRAIL_SCHEME && BBREG_TRAIL_SCHEME */
|
|
|
|
#endif /* TABLING */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#if defined(YAPOR) && defined(TABLING)
|
|
|
|
#if !defined(TABLE_LOCK_AT_ENTRY_LEVEL) && !defined(TABLE_LOCK_AT_NODE_LEVEL) && !defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
|
|
|
#error Define a table lock scheme
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* !TABLE_LOCK_AT_ENTRY_LEVEL && !TABLE_LOCK_AT_NODE_LEVEL && !TABLE_LOCK_AT_WRITE_LEVEL */
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(TABLE_LOCK_AT_ENTRY_LEVEL)
|
|
|
|
#if defined(TABLE_LOCK_AT_NODE_LEVEL) || defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
|
|
|
#error Do not define multiple table lock schemes
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* TABLE_LOCK_AT_NODE_LEVEL || TABLE_LOCK_AT_WRITE_LEVEL */
|
|
|
|
#endif /* TABLE_LOCK_AT_ENTRY_LEVEL */
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(TABLE_LOCK_AT_NODE_LEVEL) && defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
|
|
|
#error Do not define multiple table lock schemes
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* TABLE_LOCK_AT_NODE_LEVEL || TABLE_LOCK_AT_WRITE_LEVEL */
|
|
|
|
#ifndef TABLE_LOCK_AT_WRITE_LEVEL
|
|
|
|
#undef ALLOC_BEFORE_CHECK
|
|
|
|
#endif /* !TABLE_LOCK_AT_WRITE_LEVEL */
|
2001-04-09 20:54:03 +01:00
|
|
|
#else
|
|
|
|
#undef TABLE_LOCK_AT_ENTRY_LEVEL
|
|
|
|
#undef TABLE_LOCK_AT_NODE_LEVEL
|
|
|
|
#undef TABLE_LOCK_AT_WRITE_LEVEL
|
2005-06-03 19:28:11 +01:00
|
|
|
#undef ALLOC_BEFORE_CHECK
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* YAPOR && TABLING */
|
|
|
|
|
2005-06-03 19:28:11 +01:00
|
|
|
#if !defined(TABLING) || !defined(YAPOR)
|
|
|
|
#undef TABLING_INNER_CUTS
|
|
|
|
#undef TIMESTAMP_CHECK
|
|
|
|
#endif /* !TABLING || !YAPOR */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2005-06-03 19:28:11 +01:00
|
|
|
#ifndef YAPOR
|
2010-04-18 04:59:11 +01:00
|
|
|
#undef DEBUG_YAPOR
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* !YAPOR */
|
2005-08-01 16:40:39 +01:00
|
|
|
|
2005-06-03 19:28:11 +01:00
|
|
|
#ifndef TABLING
|
2005-08-04 16:45:56 +01:00
|
|
|
#undef BFZ_TRAIL_SCHEME
|
|
|
|
#undef BBREG_TRAIL_SCHEME
|
2009-08-06 02:27:59 +01:00
|
|
|
#undef TABLING_EARLY_COMPLETION
|
2009-09-27 02:31:31 +01:00
|
|
|
#undef TRIE_COMPACT_PAIRS
|
|
|
|
#undef GLOBAL_TRIE_FOR_SUBTERMS
|
2009-07-03 00:54:39 +01:00
|
|
|
#undef DETERMINISTIC_TABLING
|
2009-08-06 02:27:59 +01:00
|
|
|
#undef LIMIT_TABLING
|
|
|
|
#undef INCOMPLETE_TABLING
|
2010-04-18 04:59:11 +01:00
|
|
|
#undef DEBUG_TABLING
|
2005-06-03 19:28:11 +01:00
|
|
|
#endif /* !TABLING */
|
2005-08-01 16:40:39 +01:00
|
|
|
|
2010-04-18 04:59:11 +01:00
|
|
|
#if defined(DEBUG_YAPOR) && defined(DEBUG_TABLING)
|
|
|
|
#define DEBUG_OPTYAP
|
|
|
|
#endif /* DEBUG_YAPOR && DEBUG_TABLING */
|