Esempio n. 1
0
void make_root_frames(void) {
#ifdef YAPOR
    /* root or frame */
    or_fr_ptr or_fr;

    ALLOC_OR_FRAME(or_fr);
    INIT_LOCK(OrFr_lock(or_fr));
    OrFr_alternative(or_fr) = NULL;
    BITMAP_copy(OrFr_members(or_fr), GLOBAL_bm_present_workers);
    SetOrFr_node(or_fr, (choiceptr) Yap_LocalBase);
    OrFr_nearest_livenode(or_fr) = NULL;
    OrFr_depth(or_fr) = 0;
    Set_OrFr_pend_prune_cp(or_fr, NULL);
    OrFr_nearest_leftnode(or_fr) = or_fr;
    OrFr_qg_solutions(or_fr) = NULL;
#ifdef TABLING_INNER_CUTS
    OrFr_tg_solutions(or_fr) = NULL;
#endif /* TABLING_INNER_CUTS */
#ifdef TABLING
    OrFr_owners(or_fr) = number_workers;
    OrFr_next_on_stack(or_fr) = NULL;
    OrFr_suspensions(or_fr) = NULL;
    OrFr_nearest_suspnode(or_fr) = or_fr;
#endif /* TABLING */
    OrFr_next(or_fr) = NULL;
    GLOBAL_root_or_fr = or_fr;
#endif /* YAPOR */

#ifdef TABLING
    /* root dependency frame */
    if (!GLOBAL_root_dep_fr) {
        new_dependency_frame(GLOBAL_root_dep_fr, FALSE, NULL, NULL, NULL, NULL, NULL);
    }
#endif /* TABLING */
}
Esempio n. 2
0
void Yap_init_root_frames(void) {
  CACHE_REGS

#ifdef YAPOR
  /* root or frame */
  or_fr_ptr or_fr = GLOBAL_root_or_fr;
  INIT_LOCK(OrFr_lock(or_fr));
  OrFr_alternative(or_fr) = NULL;
  BITMAP_copy(OrFr_members(or_fr), GLOBAL_bm_present_workers);
  SetOrFr_node(or_fr, (choiceptr)LOCAL_LocalBase);
  OrFr_nearest_livenode(or_fr) = NULL;
  OrFr_depth(or_fr) = 0;
  Set_OrFr_pend_prune_cp(or_fr, NULL);
  OrFr_nearest_leftnode(or_fr) = or_fr;
  OrFr_qg_solutions(or_fr) = NULL;
#ifdef TABLING_INNER_CUTS
  OrFr_tg_solutions(or_fr) = NULL;
#endif /* TABLING_INNER_CUTS */
#ifdef TABLING
  OrFr_owners(or_fr) = GLOBAL_number_workers;
  OrFr_next_on_stack(or_fr) = NULL;
  OrFr_suspensions(or_fr) = NULL;
  OrFr_nearest_suspnode(or_fr) = or_fr;
#endif /* TABLING */
  OrFr_next(or_fr) = NULL;
#endif /* YAPOR */

#ifdef TABLING
  /* root global trie node */
  new_global_trie_node(GLOBAL_root_gt, 0, NULL, NULL, NULL);
/* root dependency frame */
#ifdef YAPOR
  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
  new_dependency_frame(LOCAL_top_dep_fr, FALSE, NULL, NULL, B, NULL, FALSE,
                       NULL);
#endif /* YAPOR */
#endif /* TABLING */
}