let find_operation_of_state (name : string) (state : string) : (string list * string list) * (string list * string list) =
let rec aux lActions =
match lActions with [] -> (([],[]),([],[]))
|((_,p,final)::ls) -> if(state=(findState final)) then p else aux ls;
in
let rec find_operation l_automate =
match l_automate with [] -> (([],[]),([],[]))
|((name2,id2,_,lActions)::ls) -> if(name=(get_name_in_session name2 id2))
then aux lActions
else find_operation ls;
in find_operation (!automate)