1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677openAstopenDatatypesopenList0openListDef(** val lexp_subexps : 'a1 lexp -> 'a1 exp list **)letreclexp_subexps=function|LE_aux(aux,_)->(matchauxwith|LE_derefx->x::[]|LE_app(_,xs)->xs|LE_tuplels->concat(maplexp_subexpsls)|LE_vector_concatls->concat(maplexp_subexpsls)|LE_vector(l0,x)->app(lexp_subexpsl0)(x::[])|LE_vector_range(l0,n,m)->app(lexp_subexpsl0)(n::(m::[]))|LE_field(l0,_)->lexp_subexpsl0|_->[])(** val take_drop : Big_int_Z.big_int -> 'a1 list -> 'a1 list * 'a1 list **)letrectake_dropnxs=(funfOfSn->ifBig_int_Z.sign_big_intn<=0thenfO()elsefS(Big_int_Z.pred_big_intn))(fun_->([],xs))(funm->matchxswith|[]->([],[])|x::xs0->let(ys,zs)=take_dropmxs0in((x::ys),zs))n(** val update_lexp_subexps :
'a1 exp list -> 'a1 lexp -> 'a1 lexp * 'a1 exp list **)letrecupdate_lexp_subexpsxsl=matchlwith|LE_aux(aux,annot)->(matchauxwith|LE_deref_->(matchxswith|[]->(l,xs)|y::ys->((LE_aux((LE_derefy),annot)),ys))|LE_app(id,args)->let(ys,zs)=take_drop(lengthargs)xsin((LE_aux((LE_app(id,ys)),annot)),zs)|LE_tuplels->let(ls0,xs0)=fold_left(funaccl0->let(ls0,xs0)=accinlet(l1,xs1)=update_lexp_subexpsxs0l0in((appls0(l1::[])),xs1))ls([],xs)in((LE_aux((LE_tuplels0),annot)),xs0)|LE_vector_concatls->let(ls0,xs0)=fold_left(funaccl0->let(ls0,xs0)=accinlet(l1,xs1)=update_lexp_subexpsxs0l0in((appls0(l1::[])),xs1))ls([],xs)in((LE_aux((LE_vector_concatls0),annot)),xs0)|LE_vector(l0,_)->let(l1,l2)=update_lexp_subexpsxsl0in(matchl2with|[]->(l0,[])|n::xs0->((LE_aux((LE_vector(l1,n)),annot)),xs0))|LE_vector_range(l0,_,_)->let(l1,l2)=update_lexp_subexpsxsl0in(matchl2with|[]->(l0,[])|n::l3->(matchl3with|[]->(l0,[])|m::xs0->((LE_aux((LE_vector_range(l1,n,m)),annot)),xs0)))|LE_field(l0,f)->let(l',ys)=update_lexp_subexpsxsl0in((LE_aux((LE_field(l',f)),annot)),ys)|_->(l,xs))