diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-11-20 03:04:13 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-02-14 17:30:31 +0100 |
commit | d833b81b49366e95cf20a1d00f9c63883adb8942 (patch) | |
tree | 1afca49fcd42e96b658c90d28e9da692ccc39724 /pretyping | |
parent | c0d38ae52ac410811e7df54c52e8d3a18bb11bcb (diff) |
Rewrite API using EConstr.
Diffstat (limited to 'pretyping')
-rw-r--r-- | pretyping/reductionops.ml | 3 | ||||
-rw-r--r-- | pretyping/reductionops.mli | 2 | ||||
-rw-r--r-- | pretyping/unification.ml | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/pretyping/reductionops.ml b/pretyping/reductionops.ml index 480ec2319..31354217f 100644 --- a/pretyping/reductionops.ml +++ b/pretyping/reductionops.ml @@ -1592,8 +1592,9 @@ let meta_instance sigma b = EConstr.of_constr (instance sigma c_sigma b.rebus) let nf_meta sigma c = + let c = EConstr.Unsafe.to_constr c in let cl = mk_freelisted c in - EConstr.Unsafe.to_constr (meta_instance sigma { cl with rebus = EConstr.of_constr cl.rebus }) + meta_instance sigma { cl with rebus = EConstr.of_constr cl.rebus } (* Instantiate metas that create beta/iota redexes *) diff --git a/pretyping/reductionops.mli b/pretyping/reductionops.mli index e67fad3fd..1e6527b29 100644 --- a/pretyping/reductionops.mli +++ b/pretyping/reductionops.mli @@ -296,5 +296,5 @@ val whd_betaiota_deltazeta_for_iota_state : (** {6 Meta-related reduction functions } *) val meta_instance : evar_map -> EConstr.constr freelisted -> EConstr.constr -val nf_meta : evar_map -> constr -> constr +val nf_meta : evar_map -> EConstr.constr -> EConstr.constr val meta_reducible_instance : evar_map -> EConstr.constr freelisted -> EConstr.constr diff --git a/pretyping/unification.ml b/pretyping/unification.ml index bc59a4108..81d9ecad5 100644 --- a/pretyping/unification.ml +++ b/pretyping/unification.ml @@ -1272,13 +1272,15 @@ let w_coerce env evd mv c = let unify_to_type env sigma flags c status u = let sigma, c = refresh_universes (Some false) env sigma c in - let t = get_type_of env sigma (EConstr.of_constr (nf_meta sigma c)) in - let t = nf_betaiota sigma (EConstr.of_constr (nf_meta sigma t)) in - unify_0 env sigma CUMUL flags (EConstr.of_constr t) (EConstr.of_constr u) + let c = EConstr.of_constr c in + let t = get_type_of env sigma (nf_meta sigma c) in + let t = EConstr.of_constr t in + let t = nf_betaiota sigma (nf_meta sigma t) in + let t = EConstr.of_constr t in + unify_0 env sigma CUMUL flags t u let unify_type env sigma flags mv status c = let mvty = Typing.meta_type sigma mv in - let mvty = EConstr.Unsafe.to_constr mvty in let mvty = nf_meta sigma mvty in unify_to_type env sigma (set_flags_for_type flags) |