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 **
|
|
|
|
** **
|
|
|
|
************************************************************************/
|
|
|
|
|
2011-05-27 17:21:03 +01:00
|
|
|
#if defined(TABLING) || defined(YAPOR)
|
2011-05-25 18:38:46 +01:00
|
|
|
#include "SWI-Stream.h"
|
2011-05-27 17:21:03 +01:00
|
|
|
#endif /* TABLING || YAPOR */
|
2011-05-25 18:38:46 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
/*************************
|
|
|
|
** opt.init.c **
|
|
|
|
*************************/
|
|
|
|
|
2011-05-09 19:36:51 +01:00
|
|
|
void Yap_init_global_optyap_data(int, int, int, int);
|
|
|
|
void Yap_init_local_optyap_data(int);
|
|
|
|
void Yap_init_root_frames(void);
|
2010-04-19 02:34:08 +01:00
|
|
|
void itos(int, char *);
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|
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 *);
|
2010-04-19 02:34:08 +01:00
|
|
|
CELL *exec_substitution(gt_node_ptr, CELL *);
|
|
|
|
void update_answer_trie(sg_fr_ptr);
|
2010-04-23 04:22:10 +01:00
|
|
|
void free_subgoal_trie(sg_node_ptr, int, int);
|
|
|
|
void free_answer_trie(ans_node_ptr, int, int);
|
|
|
|
void free_subgoal_hash_chain(sg_hash_ptr);
|
|
|
|
void free_answer_hash_chain(ans_hash_ptr);
|
2011-05-25 18:38:46 +01:00
|
|
|
void show_table(tab_ent_ptr, int, IOSTREAM *);
|
|
|
|
void show_global_trie(int, IOSTREAM *);
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* TABLING */
|
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
2010-04-19 02:34:08 +01:00
|
|
|
/*******************************
|
|
|
|
** tab.completion.c **
|
|
|
|
*******************************/
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2010-04-19 02:34:08 +01:00
|
|
|
#ifdef TABLING
|
|
|
|
void private_completion(sg_fr_ptr);
|
|
|
|
#ifdef YAPOR
|
2001-04-09 20:54:03 +01:00
|
|
|
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);
|
2010-04-19 02:34:08 +01:00
|
|
|
#endif /* YAPOR */
|
|
|
|
#endif /* TABLING */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
|
2010-04-03 05:58:14 +01:00
|
|
|
|
2011-06-02 17:05:58 +01:00
|
|
|
/**************************
|
|
|
|
** or.memory.c **
|
|
|
|
**************************/
|
|
|
|
|
|
|
|
#ifdef YAPOR
|
|
|
|
void Yap_init_yapor_global_local_memory(void);
|
|
|
|
void Yap_init_yapor_stacks_memory(long, long, long, int);
|
|
|
|
void Yap_unmap_yapor_memory(void);
|
|
|
|
void Yap_remap_yapor_memory(void);
|
|
|
|
#endif /* YAPOR */
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-06-01 18:51:12 +01:00
|
|
|
/*******************************
|
2011-03-31 14:50:47 +01:00
|
|
|
** or.copy_engine.c **
|
2011-06-01 18:51:12 +01:00
|
|
|
*******************************/
|
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 */
|