From 23e4a6318260b38be4549ec7bbfab76dbb5eab13 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Wed, 14 Feb 2018 17:07:46 +0000 Subject: Support monorphisation analysis of bitvectors inside existentials --- src/monomorphise.ml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/monomorphise.ml b/src/monomorphise.ml index 3af1c242..4f8fc257 100644 --- a/src/monomorphise.ml +++ b/src/monomorphise.ml @@ -2843,8 +2843,15 @@ let rec analyse_exp fn_id env assigns (E_aux (e,(l,annot)) as exp) = match annot with | None -> r | Some (tenv,typ,_) -> - (* TODO: existential wrappers *) - let typ = Env.expand_synonyms tenv typ in + let typ = Env.base_typ_of tenv typ in + let env, typ = + match destruct_exist tenv typ with + | None -> env, typ + | Some (kids, nc, typ) -> + { env with kid_deps = + List.fold_left (fun kds kid -> KBindings.add kid deps kds) env.kid_deps kids }, + typ + in if is_bitvector_typ typ then let _,size,_,_ = vector_typ_args_of typ in let Nexp_aux (size,_) as size_nexp = simplify_size_nexp env tenv size in -- cgit v1.2.3