add_action_name_transitions([],_CurID,_ActionName,RemTransitions,RemTransitions,no,ActSuccsGen,ActSuccsGen).
add_action_name_transitions([(ActionName1,Transitions)|R],CurID,ActionName,IgnoredActions_so_far,
RemTransitions,FullyExplored,ActSuccsGen,ActSuccs) :-
(ActionName == ActionName1 ->
% in this case we do not need to go through the rest of the transitions list
add_action_transitions(ActionName,Transitions,CurID,NewIds),
ActSuccsGen1 = [(ActionName,NewIds)|ActSuccsGen],
append(IgnoredActions_so_far,R,AllRemainedActions),
(cycle_condition_check_positive_l(NewIds) ->
debug_println(9,'*********** POSSIBLE CYCLE DETECTED *************'),
debug_println(9,computing_all_other_enabled_actions(back_transition(ActionName),AllRemainedActions)),
add_all_other_enabled_transitions(AllRemainedActions,CurID,ActSuccsGen1,ActSuccs),
RemTransitions=[],
FullyExplored = yes
; FullyExplored = no, RemTransitions = AllRemainedActions, ActSuccs=ActSuccsGen1)
;
% keeping track of all ignored actions so far, we don't want to go through the same order of actions every time we
% want to add a transition from AmpleSet to the state space
ord_add_element(IgnoredActions_so_far, (ActionName1,Transitions), IgnoredActions_so_far1),
add_action_name_transitions(R,CurID,ActionName,IgnoredActions_so_far1,RemTransitions,FullyExplored,ActSuccsGen,ActSuccs)
).