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 **
|
|
|
|
** **
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
/***************************
|
|
|
|
** opt.memory.c **
|
|
|
|
***************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2003-11-05 16:12:25 +00:00
|
|
|
#ifdef YAPOR
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef SHM_MEMORY_MAPPING_SCHEME
|
2010-04-03 05:58:14 +01:00
|
|
|
void shm_map_memory(int, int, void *);
|
2001-04-09 20:54:03 +01:00
|
|
|
#else /* MMAP_MEMORY_MAPPING_SCHEME */
|
|
|
|
void open_mapfile(long);
|
|
|
|
void close_mapfile(void);
|
2003-11-05 16:12:25 +00:00
|
|
|
#endif /* MEMORY_MAPPING_SCHEME */
|
2010-04-03 05:58:14 +01:00
|
|
|
void map_memory(long, long, long, int);
|
2001-04-09 20:54:03 +01:00
|
|
|
void unmap_memory(void);
|
|
|
|
void remap_memory(void);
|
|
|
|
#endif /* YAPOR */
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*************************
|
|
|
|
** opt.misc.c **
|
|
|
|
*************************/
|
|
|
|
|
|
|
|
void itos(int, char *);
|
|
|
|
void information_message(const char *,...);
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(YAPOR_ERRORS) || defined(TABLING_ERRORS)
|
2010-04-03 05:58:14 +01:00
|
|
|
void error_message(const char *, ...);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* YAPOR_ERRORS || TABLING_ERRORS */
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*************************
|
|
|
|
** opt.init.c **
|
|
|
|
*************************/
|
|
|
|
|
|
|
|
void Yap_init_global(int, int, int, int);
|
2009-11-19 08:24:38 +00:00
|
|
|
void Yap_init_local(void);
|
2001-04-09 20:54:03 +01:00
|
|
|
void make_root_frames(void);
|
|
|
|
#ifdef YAPOR
|
|
|
|
void init_workers(void);
|
|
|
|
#endif /* YAPOR */
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
|
|
|
/**************************
|
|
|
|
** opt.preds.c **
|
|
|
|
**************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#ifdef YAPOR
|
|
|
|
void finish_yapor(void);
|
|
|
|
#endif /* YAPOR */
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
|
|
|
/**************************
|
|
|
|
** tab.tries.c **
|
|
|
|
**************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#ifdef TABLING
|
2010-04-03 05:58:14 +01:00
|
|
|
sg_fr_ptr subgoal_search(yamop *, CELL **);
|
|
|
|
ans_node_ptr answer_search(sg_fr_ptr, CELL *);
|
|
|
|
void load_answer(ans_node_ptr, CELL *);
|
|
|
|
#ifndef GLOBAL_TRIE
|
|
|
|
void free_subgoal_trie_branch(sg_node_ptr, int, int, int);
|
|
|
|
#else /* GLOBAL_TRIE */
|
2010-04-15 01:09:59 +01:00
|
|
|
CELL *exec_substitution(gt_node_ptr, CELL *);
|
2010-04-03 05:58:14 +01:00
|
|
|
void free_subgoal_trie_branch(sg_node_ptr, int, int);
|
2009-09-27 02:31:31 +01:00
|
|
|
#endif /* GLOBAL_TRIE */
|
2010-04-03 05:58:14 +01:00
|
|
|
void free_answer_trie_branch(ans_node_ptr, int);
|
|
|
|
void update_answer_trie(sg_fr_ptr);
|
|
|
|
void show_table(tab_ent_ptr, int);
|
2009-09-27 02:31:31 +01:00
|
|
|
#ifdef GLOBAL_TRIE
|
2010-04-16 03:07:37 +01:00
|
|
|
void show_global_trie(int);
|
2009-09-27 02:31:31 +01:00
|
|
|
#endif /* GLOBAL_TRIE */
|
2010-04-03 05:58:14 +01:00
|
|
|
void private_completion(sg_fr_ptr);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* TABLING */
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
|
|
|
/****************************
|
|
|
|
** tab.suspend.c **
|
|
|
|
****************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#if defined(TABLING) && defined(YAPOR)
|
|
|
|
void public_completion(void);
|
2010-04-03 05:58:14 +01:00
|
|
|
void complete_suspension_frames(or_fr_ptr);
|
2001-04-09 20:54:03 +01:00
|
|
|
void suspend_branch(void);
|
2010-04-03 05:58:14 +01:00
|
|
|
void resume_suspension_frame(susp_fr_ptr, or_fr_ptr);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* TABLING && YAPOR */
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
|
|
|
/**************************
|
|
|
|
** or.engine.c **
|
|
|
|
**************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2010-01-14 15:58:19 +00:00
|
|
|
#ifdef YAPOR
|
2001-04-09 20:54:03 +01:00
|
|
|
void make_root_choice_point(void);
|
|
|
|
void free_root_choice_point(void);
|
|
|
|
int q_share_work(int p);
|
|
|
|
int p_share_work(void);
|
2010-01-14 15:58:19 +00:00
|
|
|
#endif /* YAPOR */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
/*****************************
|
|
|
|
** or.scheduler.c **
|
|
|
|
*****************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#ifdef YAPOR
|
|
|
|
int get_work(void);
|
|
|
|
#endif /* YAPOR */
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
|
|
|
/***********************
|
|
|
|
** or.cut.c **
|
|
|
|
***********************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#ifdef YAPOR
|
2010-04-03 05:58:14 +01:00
|
|
|
void prune_shared_branch(choiceptr);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* YAPOR */
|