diff options
author | Arnaud Spiwack <arnaud@spiwack.net> | 2014-11-07 18:38:12 +0100 |
---|---|---|
committer | Arnaud Spiwack <arnaud@spiwack.net> | 2014-11-19 10:11:45 +0100 |
commit | fc2476e4a29592dcf2860a16d3a7c0aeeb4bffac (patch) | |
tree | 0fbe3e51ea0fd8e68e9f555fdc52a18bc2cf417c /interp | |
parent | 7232e8f3fc5237705b80a870a6a3ad1a4748b838 (diff) |
Printing function for [uconstr].
The core is a "detyping" function for [closed_glob_constr]. Which interpretes the variable names according to the Ltac context, and apply the standard detyping procedure to typed terms in the closure.
Diffstat (limited to 'interp')
-rw-r--r-- | interp/constrextern.ml | 8 | ||||
-rw-r--r-- | interp/constrextern.mli | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/interp/constrextern.ml b/interp/constrextern.ml index 40e0901be..fc4056962 100644 --- a/interp/constrextern.ml +++ b/interp/constrextern.ml @@ -959,6 +959,14 @@ let extern_type goal_concl_style env sigma t = let extern_sort s = extern_glob_sort (detype_sort s) +let extern_closed_glob ?lax goal_concl_style env sigma t = + let avoid = if goal_concl_style then ids_of_context env else [] in + let r = + Detyping.detype_closed_glob ?lax goal_concl_style avoid env sigma t + in + let vars = vars_of_env env in + extern false (None,[]) vars r + (******************************************************************) (* Main translation function from pattern -> constr_expr *) diff --git a/interp/constrextern.mli b/interp/constrextern.mli index 804795480..581ea4c5d 100644 --- a/interp/constrextern.mli +++ b/interp/constrextern.mli @@ -28,6 +28,7 @@ val extern_glob_constr : Id.Set.t -> glob_constr -> constr_expr val extern_glob_type : Id.Set.t -> glob_constr -> constr_expr val extern_constr_pattern : names_context -> Evd.evar_map -> constr_pattern -> constr_expr +val extern_closed_glob : ?lax:bool -> bool -> env -> Evd.evar_map -> closed_glob_constr -> constr_expr (** If [b=true] in [extern_constr b env c] then the variables in the first level of quantification clashing with the variables in [env] are renamed. |