diff options
| author | Pierre-Marie Pédrot | 2019-05-31 14:27:36 +0200 |
|---|---|---|
| committer | Pierre-Marie Pédrot | 2019-06-04 11:16:17 +0200 |
| commit | e7ffa1bfa25300a25c1e81583b77d2d7587bbb5d (patch) | |
| tree | f3b9bc7307d04f2757b3d00504100023bc9f2d9a /kernel/safe_typing.ml | |
| parent | 589aaf4f97d5cfcdabfda285739228f5ee52261f (diff) | |
Do not substitute opaque constants when discharging.
Instead we do that on a by-need basis by reusing the section info already
stored in the opaque proof.
Diffstat (limited to 'kernel/safe_typing.ml')
| -rw-r--r-- | kernel/safe_typing.ml | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/safe_typing.ml b/kernel/safe_typing.ml index 9f7466902d..759cbe22ee 100644 --- a/kernel/safe_typing.ml +++ b/kernel/safe_typing.ml @@ -749,9 +749,13 @@ let export_side_effects mb env (b_ctx, eff) = in translate_seff trusted seff [] env +let n_univs cb = match cb.const_universes with +| Monomorphic _ -> 0 +| Polymorphic auctx -> Univ.AUContext.size auctx + let export_private_constants ~in_section ce senv = let exported, ce = export_side_effects senv.revstruct senv.env ce in - let map (kn, cb, _) = (kn, map_constant (fun p -> Opaqueproof.create (Future.from_val p)) cb) in + let map (kn, cb, _) = (kn, map_constant (fun p -> Opaqueproof.create ~univs:(n_univs cb) (Future.from_val p)) cb) in let bodies = List.map map exported in let exported = List.map (fun (kn, _, r) -> (kn, r)) exported in let senv = List.fold_left (add_constant_aux ~in_section) senv bodies in @@ -778,7 +782,7 @@ let add_constant ?role ~in_section l decl senv = Term_typing.translate_constant Term_typing.Pure senv.env kn ce in let senv = - let cb = map_constant Opaqueproof.create cb in + let cb = map_constant (fun c -> Opaqueproof.create ~univs:(n_univs cb) c) cb in add_constant_aux ~in_section senv (kn, cb) in let senv = match decl with |
