diff options
author | Matthieu Sozeau <mattam@mattam.org> | 2016-07-29 19:41:46 +0200 |
---|---|---|
committer | Matthieu Sozeau <mattam@mattam.org> | 2016-07-29 19:41:46 +0200 |
commit | dabe6d0e1d1782d3e9647e04aa1bf161765ad882 (patch) | |
tree | e0ac77d200c301b08e2f0532993de6d6e3ab1862 /toplevel | |
parent | 81c19bdd631fa72afa0cac5c8b915d836e0646df (diff) | |
parent | 639eecd27e42c7dd646afdcb67b5a4e51a4541c1 (diff) |
Merge remote-tracking branch 'gforge/v8.5' into v8.6
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/command.ml | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/toplevel/command.ml b/toplevel/command.ml index f92ea027d..097865648 100644 --- a/toplevel/command.ml +++ b/toplevel/command.ml @@ -1251,6 +1251,11 @@ let out_def = function | Some def -> def | None -> error "Program Fixpoint needs defined bodies." +let collect_evars_of_term evd c ty = + let evars = Evar.Set.union (Evd.evars_of_term c) (Evd.evars_of_term ty) in + Evar.Set.fold (fun ev acc -> Evd.add acc ev (Evd.find_undefined evd ev)) + evars (Evd.from_ctx (Evd.evar_universe_context evd)) + let do_program_recursive local p fixkind fixl ntns = let isfix = fixkind != Obligations.IsCoFixpoint in let (env, rec_sign, pl, evd), fix, info = @@ -1268,8 +1273,9 @@ let do_program_recursive local p fixkind fixl ntns = and typ = nf_evar evd (Termops.it_mkNamedProd_or_LetIn typ rec_sign) in + let evm = collect_evars_of_term evd def typ in let evars, _, def, typ = - Obligations.eterm_obligations env id evd + Obligations.eterm_obligations env id evm (List.length rec_sign) def typ in (id, def, typ, imps, evars) in |