aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel
diff options
context:
space:
mode:
authorGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2016-07-27 18:26:42 +0200
committerGravatar Matthieu Sozeau <matthieu.sozeau@inria.fr>2016-07-29 19:35:25 +0200
commit9f5e248704f1574b0acbb9bddd287e40daac8727 (patch)
tree18325ccd1644df6d265c1d5dfda168a1f6a42fff /toplevel
parent25ef9dda0311213bb2f6e2b9cd0b87be2128599b (diff)
Fix bug #3886, generation of obligations of fixes
Diffstat (limited to 'toplevel')
-rw-r--r--toplevel/command.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/toplevel/command.ml b/toplevel/command.ml
index 8eb2232ed..b9e4dbd7b 100644
--- a/toplevel/command.ml
+++ b/toplevel/command.ml
@@ -1222,6 +1222,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 =
@@ -1239,8 +1244,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