Skip to content
Snippets Groups Projects
Commit 7284fc2d authored by Leandre Lacourt's avatar Leandre Lacourt
Browse files

first version to get the task list

parent b060cdc8
No related branches found
No related tags found
No related merge requests found
......@@ -164,3 +164,34 @@ let get_instances : Soc.t -> instance_type list = fun soc ->
let res = List.mapi gao_to_instance_type gaol in
(* List.iter print_instance_type res; *)
res
let get_tasks : Soc.t -> task list = fun soc ->
(*let gaol = get_gaol soc in*)
let task_list = soc.tasks in
task_list
(*let ltbl = Hashtbl.create 2 in
let node_cpt_ref = ref (-1) in
let all_vars = (get_inputs_assoc soc) @ (get_outputs_assoc soc) @ (get_variables_assoc soc) in
let gao_to_tasks i gao =
match gao with
| Call(_,Assign,_,_) -> assert false
| Call(args_out, Method((_,k), _,_), args_in, _)
| Call(args_out, Procedure (k,_) , args_in, _) ->
let node_cpt, _inst_cpt = match Hashtbl.find_opt ltbl k with
| None -> incr node_cpt_ref; Hashtbl.add ltbl k (!node_cpt_ref, 0); !node_cpt_ref, 0
| Some (node_cpt, inst_cpt) ->
let inst_cpt = inst_cpt+1 in
Hashtbl.add ltbl k (node_cpt, inst_cpt);
node_cpt, inst_cpt
in
{
id = i+1;
node = node_cpt;
var_in = List.map (var_expr_to_index all_vars) args_in;
var_out = List.map (var_expr_to_index all_vars) args_out
}
| Case(_, _,_) -> assert false
in
let res = List.mapi gao_to_tasks gaol in
(* List.iter print_instance_type res; *)
res*)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment