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 /kernel/nativelambda.mli | |
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 'kernel/nativelambda.mli')
-rw-r--r-- | kernel/nativelambda.mli | 13 |
1 files changed, 11 insertions, 2 deletions
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 |