123456789101112131415161718192021222324252627282930313233343536373839404142434445(* Time-stamp: <modified the 29/08/2019 (at 15:35) by Erwan Jahier> *)openLicopenLxm(** [left_eff] is a kind of list, but which is in the « reverse » order for
easy checking; [filtered_left] contains just the same information, but
the list is made explicit and the information (struct or array
accesses) is ordered in the « good » way.
*)typefiltered_left=Lic.var_info*Lxm.t*filterlistandfilter=|Sliceofint*int*int*Lic.type_|FaccessofLv6Id.t*Lic.type_|Aaccessofint*Lic.type_let(left_eff_to_filtered_left:Lic.leftLxm.srcflagged->filtered_left)=funle->letrec(aux:Lic.type_->filterlist->Lic.left->filtered_left)=fun_te_topaccle->matchlewith|LeftVarLic(v,lxm)->v,lxm,acc|LeftFieldLic(le,id,te)->auxte(Faccess(id,te)::acc)le|LeftArrayLic(le,i,te)->auxte(Aaccess(i,te)::acc)le|LeftSliceLic(le,si,te)->auxte(Slice(si.se_first,si.se_last,si.se_step,te)::acc)leinlette_top=(Lic.var_info_of_leftle.it).var_type_effinlet(v,lxm,f)=auxte_top[]le.itinlet(_,f)=(* It's more useful want to associate to each accessors the
type of the « accessed elements », but its own type. E.g.,
if "t" is an array of bool, we want to associate 't[0]' and
an array of bool, and not to a bool. *)List.fold_left(fun(te_top,acc)el->matchelwith|Slice(i,j,k,te)->te,(Slice(i,j,k,te_top))::acc|Faccess(id,te)->te,(Faccess(id,te_top))::acc|Aaccess(i,te)->te,(Aaccess(i,te_top))::acc)(te_top,[])fin(v,lxm,List.revf)