diff options
| author | Maxime Dénès | 2017-05-09 22:14:35 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2017-06-06 12:58:57 +0200 |
| commit | 954fbd3b102060ed1e2122f571a430f05a174e42 (patch) | |
| tree | a6f3db424624eae05ded3be6a84357d1ad291eda /pretyping/program.ml | |
| parent | 2f23c27e08f66402b8fba4745681becd402f4c5c (diff) | |
Remove the Sigma (monotonous state) API.
Reminder of (some of) the reasons for removal:
- Despite the claim in sigma.mli, it does *not* prevent evar
leaks, something like:
fun env evd ->
let (evd',ev) = new_evar env evd in
(evd,ev)
will typecheck even with Sigma-like type annotations (with a proof of
reflexivity)
- The API stayed embryonic. Even typing functions were not ported to
Sigma.
- Some unsafe combinators (Unsafe.tclEVARS) were replaced with slightly
less unsafe ones (e.g. s_enter), but those ones were not marked unsafe
at all (despite still being so).
- There was no good story for higher order functions manipulating evar
maps. Without higher order, one can most of the time get away with
reusing the same name for the updated evar map.
- Most of the code doing complex things with evar maps was using unsafe
casts to sigma. This code should be fixed, but this is an orthogonal
issue.
Of course, this was showing a nice and elegant use of GADTs, but the
cost/benefit ratio in practice did not seem good.
Diffstat (limited to 'pretyping/program.ml')
| -rw-r--r-- | pretyping/program.ml | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pretyping/program.ml b/pretyping/program.ml index 2fa3facb30..f9be82024a 100644 --- a/pretyping/program.ml +++ b/pretyping/program.ml @@ -41,13 +41,8 @@ let coq_JMeq_refl = init_reference ["Logic";"JMeq"] "JMeq_refl" let coq_not = init_reference ["Init";"Logic"] "not" let coq_and = init_reference ["Init";"Logic"] "and" -let new_global sigma gr = - let open Sigma in - let Sigma (c, sigma, _) = Evarutil.new_global (Sigma.Unsafe.of_evar_map sigma) gr - in Sigma.to_evar_map sigma, c - let mk_coq_not sigma x = - let sigma, notc = new_global sigma (coq_not ()) in + let sigma, notc = Evarutil.new_global sigma (coq_not ()) in sigma, EConstr.mkApp (notc, [| x |]) let unsafe_fold_right f = function @@ -55,7 +50,7 @@ let unsafe_fold_right f = function | [] -> invalid_arg "unsafe_fold_right" let mk_coq_and sigma l = - let sigma, and_typ = new_global sigma (coq_and ()) in + let sigma, and_typ = Evarutil.new_global sigma (coq_and ()) in sigma, unsafe_fold_right (fun c conj -> EConstr.mkApp (and_typ, [| c ; conj |])) |
