/* Insert slices into a battle branch, starting between defense and attack move * The inserted slices are copies of the elements of prototypes; the elements of * prototypes are deallocated by battle_branch_insert_slices(). * Each slice is inserted at a position that corresponds to its predefined rank. * @param si identifies starting point of insertion * @param prototypes contains the prototypes whose copies are inserted * @param nr_prototypes number of elements of array prototypes */ void attack_branch_insert_slices(slice_index si, slice_index const prototypes[], unsigned int nr_prototypes) { TraceFunctionEntry(__func__); TraceFunctionParam("%u",si); TraceFunctionParam("%u",nr_prototypes); TraceFunctionParamListEnd(); attack_branch_insert_slices_behind_proxy(si,prototypes,nr_prototypes,si); TraceFunctionExit(__func__); TraceFunctionResultEnd(); }
static void spin_off_measuring_branch(slice_index si, stip_structure_traversal *st) { instrumentation_state_type const * const state = st->param; stip_deep_copies_type copies; stip_structure_traversal st_nested; TraceFunctionEntry(__func__); TraceFunctionParam("%u",si); TraceFunctionParamListEnd(); if (SLICE_NEXT2(si)==no_slice) { SLICE_NEXT2(si) = alloc_proxy_slice(); init_deep_copy(&st_nested,st,&copies); stip_structure_traversal_override_single(&st_nested, STMummerDeadend, &stop_copying); stip_structure_traversal_override_single(&st_nested, STRestartGuard, &skip_copying); stip_structure_traversal_override_single(&st_nested, STDeadEndGoal, &skip_copying); stip_structure_traversal_override_single(&st_nested, STGoalReachableGuardFilterMate, &skip_copying); stip_structure_traversal_override_single(&st_nested, STGoalReachableGuardFilterStalemate, &skip_copying); stip_structure_traversal_override_single(&st_nested, STGoalReachableGuardFilterProof, &skip_copying); stip_structure_traversal_override_single(&st_nested, STGoalReachableGuardFilterProofFairy, &skip_copying); stip_structure_traversal_override_by_function(&st_nested, slice_function_move_removing_optimiser, &skip_copying); if (mummer_strictness[state->current_side]!=mummer_strictness_regular) { stip_structure_traversal_override_single(&st_nested, STEndOfBranchGoal, &skip_copying); stip_structure_traversal_override_single(&st_nested, STSelfCheckGuard, &skip_copying); } else { regular_deep_copy_end_of_branch_goal = st_nested.map.visitors[STEndOfBranchGoal]; stip_structure_traversal_override_single(&st_nested, STEndOfBranchGoal, ©_end_of_branch_goal_if_necessary); stip_structure_traversal_override_single(&st_nested, STEndOfBranchGoalImmobile, ©_end_of_branch_goal_if_necessary); } stip_traverse_structure(SLICE_NEXT1(si),&st_nested); link_to_branch(SLICE_NEXT2(si),copies[SLICE_NEXT1(si)]); { slice_index const prototype = alloc_pipe(STMummerBookkeeper); switch (st->context) { case stip_traversal_context_attack: attack_branch_insert_slices_behind_proxy(SLICE_NEXT2(si),&prototype,1,si); break; case stip_traversal_context_defense: defense_branch_insert_slices_behind_proxy(SLICE_NEXT2(si),&prototype,1,si); break; case stip_traversal_context_help: help_branch_insert_slices_behind_proxy(SLICE_NEXT2(si),&prototype,1,si); break; default: assert(0); break; } } if (mummer_strictness[state->current_side]!=mummer_strictness_regular) { slice_index const prototype = alloc_pipe(STUltraMummerMeasurerDeadend); slice_insertion_insert_contextually(copies[SLICE_NEXT1(si)],st->context,&prototype,1); } } stip_traverse_structure_children(si,st); TraceFunctionExit(__func__); TraceFunctionResultEnd(); }