diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2016-11-04 14:38:35 +0100 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-02-14 17:23:47 +0100 |
commit | 6bd193ff409b01948751525ce0f905916d7a64bd (patch) | |
tree | 02dc0f466fd40a3208d34519960b3c73f9c167bf /pretyping | |
parent | 2db085e62f7797cc999518eb58983ac059763e1f (diff) |
Nativenorm API using EConstr.
Diffstat (limited to 'pretyping')
-rw-r--r-- | pretyping/nativenorm.ml | 6 | ||||
-rw-r--r-- | pretyping/nativenorm.mli | 5 | ||||
-rw-r--r-- | pretyping/pretyping.ml | 2 |
3 files changed, 9 insertions, 4 deletions
diff --git a/pretyping/nativenorm.ml b/pretyping/nativenorm.ml index e45c920a3..c8bcae0c8 100644 --- a/pretyping/nativenorm.ml +++ b/pretyping/nativenorm.ml @@ -377,7 +377,9 @@ let evars_of_evar_map sigma = Nativelambda.evars_typ = Evd.existential_type sigma; Nativelambda.evars_metas = Evd.meta_type sigma } -let native_norm env sigma c ty = +let native_norm env sigma c ty = + let c = EConstr.Unsafe.to_constr c in + let ty = EConstr.Unsafe.to_constr ty in if Coq_config.no_native_compiler then error "Native_compute reduction has been disabled at configure time." else @@ -407,5 +409,7 @@ let native_conv_generic pb sigma t = Nativeconv.native_conv_gen pb (evars_of_evar_map sigma) t let native_infer_conv ?(pb=Reduction.CUMUL) env sigma t1 t2 = + let t1 = EConstr.Unsafe.to_constr t1 in + let t2 = EConstr.Unsafe.to_constr t2 in Reductionops.infer_conv_gen (fun pb ~l2r sigma ts -> native_conv_generic pb sigma) ~catch_incon:true ~pb env sigma t1 t2 diff --git a/pretyping/nativenorm.mli b/pretyping/nativenorm.mli index 0b1ce8e51..ba46138a4 100644 --- a/pretyping/nativenorm.mli +++ b/pretyping/nativenorm.mli @@ -5,13 +5,14 @@ (* // * This file is distributed under the terms of the *) (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -open Term + +open EConstr open Environ open Evd (** This module implements normalization by evaluation to OCaml code *) -val native_norm : env -> evar_map -> constr -> types -> constr +val native_norm : env -> evar_map -> constr -> types -> Constr.t (** Conversion with inference of universe constraints *) val native_infer_conv : ?pb:conv_pb -> env -> evar_map -> constr -> constr -> diff --git a/pretyping/pretyping.ml b/pretyping/pretyping.ml index 3a6d4f36c..2f42ad395 100644 --- a/pretyping/pretyping.ml +++ b/pretyping/pretyping.ml @@ -1021,7 +1021,7 @@ let rec pretype k0 resolve_tc (tycon : type_constraint) (env : ExtraEnv.t) evdre let cj = pretype empty_tycon env evdref lvar c in let cty = nf_evar !evdref cj.uj_type and tval = nf_evar !evdref tval in begin - let (evd,b) = Nativenorm.native_infer_conv env.ExtraEnv.env !evdref cty tval in + let (evd,b) = Nativenorm.native_infer_conv env.ExtraEnv.env !evdref (EConstr.of_constr cty) (EConstr.of_constr tval) in if b then (evdref := evd; cj, tval) else error_actual_type ~loc env.ExtraEnv.env !evdref cj tval |