int pc_crf_prepare_4(void) { TERM p_fact_list; int size; p_fact_list = bpx_get_call_arg(1,4); size = bpx_get_integer(bpx_get_call_arg(2,4)); num_goals = bpx_get_integer(bpx_get_call_arg(3,4)); failure_root_index = bpx_get_integer(bpx_get_call_arg(4,4)); failure_observed = (failure_root_index != -1); if (failure_root_index != -1) { failure_subgoal_id = prism_goal_id_get(failure_atom); if (failure_subgoal_id == -1) { emit_internal_error("no subgoal ID allocated to `failure'"); RET_INTERNAL_ERR; } } initialize_egraph_index(); alloc_sorted_egraph(size); RET_ON_ERR(sort_crf_egraphs(p_fact_list)); #ifndef MPI if (verb_graph) { print_egraph(0, PRINT_NEUTRAL); } #endif /* !(MPI) */ alloc_occ_switches(); alloc_num_sw_vals(); return BP_TRUE; }
int pc_mpm_alloc_occ_switches_0(void) { occ_switches = MALLOC(sizeof(SW_INS_PTR) * sw_tab_size); occ_switch_tab_size = sw_tab_size; memmove(occ_switches, switches, sizeof(SW_INS_PTR) * sw_tab_size); if (fix_init_order) { sort_occ_switches(); } alloc_num_sw_vals(); return BP_TRUE; }