diff options
author | Maxime Dénès <mail@maximedenes.fr> | 2013-12-30 10:40:39 -0500 |
---|---|---|
committer | Maxime Dénès <mail@maximedenes.fr> | 2013-12-30 10:40:39 -0500 |
commit | ea47086be3b724968053525e8fa795b9cdd77800 (patch) | |
tree | b888ca03e686b4c44984eb72632cdf35f260efce /proofs/redexpr.ml | |
parent | f2087508a325bd4dae8be54ea3c6111f6b652775 (diff) |
Support for evars and metas in native compiler.
Experimental. Turned out to be much harder to implement than I thought. The main
issue is that the reification in the native compiler and the VM is not quite
untyped. Indeed, type annotations for lambdas have to be reconstructed. Hence,
when reifying an application u = t a1 ... an, the type of t has to be known or
reconstructed. It is always possible to do so in plain CIC, when u is in normal
form and its type is known. However, with partial terms this may no longer be
the case, as in: ?1 a1 ... an. So we also compile and evaluate the type of
evars and metas.
This still has to be tested more extensively, but the correction of the kernel
native conversion (on terms without evars or metas) should not be impacted.
Much of this could be reused for the VM.
Diffstat (limited to 'proofs/redexpr.ml')
-rw-r--r-- | proofs/redexpr.ml | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/proofs/redexpr.ml b/proofs/redexpr.ml index f71ec440e..db6f48547 100644 --- a/proofs/redexpr.ml +++ b/proofs/redexpr.ml @@ -29,9 +29,10 @@ let cbv_vm env sigma c = error "vm_compute does not support existential variables."; Vnorm.cbv_vm env c ctyp -let cbv_native env _ c = - let ctyp = (fst (Typeops.infer env c)).Environ.uj_type in - Nativenorm.native_norm env c ctyp +let cbv_native env sigma c = + let ctyp = Retyping.get_type_of env sigma c in + let evars = Nativenorm.evars_of_evar_map sigma in + Nativenorm.native_norm env evars c ctyp let set_strategy_one ref l = let k = @@ -212,7 +213,8 @@ let reduction_of_red_expr env = let lp = out_with_occurrences lp in let nativefun _ env map c = let tpe = Retyping.get_type_of env map c in - Nativenorm.native_norm env c tpe + let evars = Nativenorm.evars_of_evar_map map in + Nativenorm.native_norm env evars c tpe in let redfun = contextually b lp nativefun in (redfun, NATIVEcast) |