From ea47086be3b724968053525e8fa795b9cdd77800 Mon Sep 17 00:00:00 2001 From: Maxime Dénès Date: Mon, 30 Dec 2013 10:40:39 -0500 Subject: 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. --- kernel/nativevalues.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'kernel/nativevalues.ml') diff --git a/kernel/nativevalues.ml b/kernel/nativevalues.ml index c38b72031..c3e2b3ab7 100644 --- a/kernel/nativevalues.ml +++ b/kernel/nativevalues.ml @@ -58,6 +58,8 @@ type atom = | Acofix of t array * t array * int * t | Acofixe of t array * t array * int * t | Aprod of name * t * (t -> t) + | Ameta of metavariable * t + | Aevar of existential * t let accumulate_tag = 0 @@ -120,6 +122,12 @@ let mk_sw_accu annot c p ac = let mk_prod_accu s dom codom = mk_accu (Aprod (s,dom,codom)) +let mk_meta_accu mv ty = + mk_accu (Ameta (mv,ty)) + +let mk_evar_accu ev ty = + mk_accu (Aevar (ev,ty)) + let atom_of_accu (k:accumulator) = (Obj.magic (Obj.field (Obj.magic k) 2) : atom) -- cgit v1.2.3