Beispiel #1
0
void init_itries(void) {
  itrie_init_module();

  YAP_UserCPredicate("itrie_open", p_itrie_open, 1);
  YAP_UserCPredicate("itrie_close", p_itrie_close, 1);
  YAP_UserCPredicate("itrie_close_all", p_itrie_close_all, 0);
  YAP_UserCPredicate("itrie_mode", p_itrie_mode, 2);
  YAP_UserCPredicate("itrie_timestamp", p_itrie_timestamp, 2);
  YAP_UserCPredicate("itrie_put_entry", p_itrie_put_entry, 2);
  YAP_UserCPredicate("itrie_update_entry", p_itrie_update_entry, 2);
  YAP_UserCPredicate("itrie_check_entry", p_itrie_check_entry, 3);
  YAP_UserCPredicate("itrie_get_entry", p_itrie_get_entry, 2);
  YAP_UserCPredicate("itrie_get_data", p_itrie_get_data, 2);
  YAP_UserBackCPredicate("itrie_traverse", p_itrie_traverse_init, p_itrie_traverse_cont, 2, 0);
  YAP_UserCPredicate("itrie_remove_entry", p_itrie_remove_entry, 1);
  YAP_UserCPredicate("itrie_remove_subtree", p_itrie_remove_subtree, 1);
  YAP_UserCPredicate("itrie_add", p_itrie_add, 2);
  YAP_UserCPredicate("itrie_subtract", p_itrie_subtract, 2);
  YAP_UserCPredicate("itrie_join", p_itrie_join, 2);
  YAP_UserCPredicate("itrie_intersect", p_itrie_intersect, 2);
  YAP_UserCPredicate("itrie_count_join", p_itrie_count_join, 3);
  YAP_UserCPredicate("itrie_count_intersect", p_itrie_count_intersect, 3);
  YAP_UserCPredicate("itrie_save", p_itrie_save, 2);
  YAP_UserCPredicate("itrie_save_as_trie", p_itrie_save_as_trie, 2);
  YAP_UserCPredicate("itrie_load", p_itrie_load, 2);
  YAP_UserCPredicate("itrie_save2stream", p_itrie_save2stream, 2);
  YAP_UserCPredicate("itrie_loadFromstream", p_itrie_loadFromStream, 2);
  YAP_UserCPredicate("itrie_stats", p_itrie_stats, 4);
  YAP_UserCPredicate("itrie_max_stats", p_itrie_max_stats, 4);
  YAP_UserCPredicate("itrie_usage", p_itrie_usage, 4);
  YAP_UserCPredicate("itrie_print", p_itrie_print, 1);
  return;
}
Beispiel #2
0
void init_rl(void){

     
 YAP_UserCPredicate("rl_new", p_rl_new,2);        //  Maximum -> RangeID
 YAP_UserCPredicate("rl_free", p_rl_free,1);      //  RangeId ->
 YAP_UserCPredicate("rl_size", p_rl_size,2);      //  RangeId -> Size (in bytes)
 YAP_UserCPredicate("rl_mem", p_rl_mem_usage,1);  //  -> TotalMemory (in bytes)

 YAP_UserCPredicate("rl_copy", p_rl_copy,2);      //  RangeId  -> NewRangeId
 YAP_UserCPredicate("rl_set_out", p_rl_set_out,2);//  RangeId x Number  ->
 YAP_UserBackCPredicate("rl_in", p_rl_b_in1,p_rl_b_in2,2,sizeof(yap_back_data_type));   //  +RangeId x ?Number 
 //YAP_UserCPredicate("rl_in", p_rl_in,2);        //  RangeId x Number  ->
 YAP_UserCPredicate("rl_set_in", p_rl_set_in,2);  //  RangeIdxNumber  -> 
 YAP_UserCPredicate("rl_set_all_in", p_rl_set_all_in,1); //  RangeId -> 

 YAP_UserCPredicate("rl_print", p_rl_print,1);    //  RangeId ->

 YAP_UserCPredicate("rl_freeze", p_rl_freeze,1);  //  RangeId
 
 // fprintf(stderr,"Range list  module succesfully loaded.");
 //fflush(stderr);
}
Beispiel #3
0
void init_tries(void) {
  trie_init_module();

  YAP_UserCPredicate("trie_open", p_trie_open, 1);
  YAP_UserCPredicate("trie_close", p_trie_close, 1);
  YAP_UserCPredicate("trie_close_all", p_trie_close_all, 0);
  YAP_UserCPredicate("trie_mode", p_trie_mode, 1);
  YAP_UserCPredicate("trie_put_entry", p_trie_put_entry, 3);
  YAP_UserCPredicate("trie_check_entry", p_trie_check_entry, 3);
  YAP_UserCPredicate("trie_get_entry", p_trie_get_entry, 2);
  YAP_UserCPredicate("trie_get_first_entry", p_trie_get_first_entry, 2);
  YAP_UserCPredicate("trie_get_last_entry", p_trie_get_last_entry, 2);
  YAP_UserBackCPredicate("trie_traverse", p_trie_traverse_init, p_trie_traverse_cont, 3, 0);
  YAP_UserCPredicate("trie_remove_entry", p_trie_remove_entry, 1);
  YAP_UserCPredicate("trie_remove_subtree", p_trie_remove_subtree, 1);
  YAP_UserCPredicate("trie_join", p_trie_join, 2);
  YAP_UserCPredicate("trie_intersect", p_trie_intersect, 2);
  YAP_UserCPredicate("trie_count_join", p_trie_count_join, 3);
  YAP_UserCPredicate("trie_count_intersect", p_trie_count_intersect, 3);
  YAP_UserCPredicate("trie_save", p_trie_save, 2);
  YAP_UserCPredicate("trie_load", p_trie_load, 2);
  YAP_UserCPredicate("trie_usage", p_trie_usage, 4);
  YAP_UserCPredicate("trie_stats", p_trie_stats, 4);
  YAP_UserCPredicate("trie_max_stats", p_trie_max_stats, 4);
  YAP_UserCPredicate("trie_print", p_trie_print, 1);
  /* backwards compatibility */
  YAP_UserCPredicate("open_trie", p_open_trie, 1);
  YAP_UserCPredicate("close_trie", p_close_trie, 1);
  YAP_UserCPredicate("close_all_tries", p_close_all_tries, 0);
  YAP_UserCPredicate("put_trie_entry", p_put_trie_entry, 4);
  YAP_UserCPredicate("get_trie_entry", p_get_trie_entry, 3);
  YAP_UserCPredicate("remove_trie_entry", p_remove_trie_entry, 1);
  YAP_UserCPredicate("print_trie", p_print_trie, 1);
  YAP_UserCPredicate("trie_tree", p_trie_tree, 2);
  return;
}