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/nativelambda.mli | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'kernel/nativelambda.mli') diff --git a/kernel/nativelambda.mli b/kernel/nativelambda.mli index 997efd969..860283e06 100644 --- a/kernel/nativelambda.mli +++ b/kernel/nativelambda.mli @@ -18,6 +18,8 @@ open Nativevalues type lambda = | Lrel of name * int | Lvar of identifier + | Lmeta of metavariable * lambda (* type *) + | Levar of existential * lambda (* type *) | Lprod of lambda * lambda | Llam of name array * lambda | Llet of name * lambda * lambda @@ -40,9 +42,16 @@ type lambda = | Lforce and lam_branches = (constructor * name array * lambda) array - + and fix_decl = name array * lambda array * lambda array +type evars = + { evars_val : existential -> constr option; + evars_typ : existential -> types; + evars_metas : metavariable -> types } + +val empty_evars : evars + val decompose_Llam : lambda -> Names.name array * lambda val decompose_Llam_Llet : lambda -> (Names.name * lambda option) array * lambda @@ -51,4 +60,4 @@ val mk_lazy : lambda -> lambda val get_allias : env -> constant -> constant -val lambda_of_constr : env -> types -> lambda +val lambda_of_constr : env -> evars -> Constr.constr -> lambda -- cgit v1.2.3