aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tactics/hipattern.ml8
-rw-r--r--tactics/hipattern.mli5
2 files changed, 13 insertions, 0 deletions
diff --git a/tactics/hipattern.ml b/tactics/hipattern.ml
index ccc073b1a5..703bfb7786 100644
--- a/tactics/hipattern.ml
+++ b/tactics/hipattern.ml
@@ -55,6 +55,14 @@ let (squeleton_stock : (int list * constr) Stock.stock) =
let put_squel = Stock.stock squeleton_stock
let get_squel_core = Stock.retrieve squeleton_stock
+(* Sera mieux avec des noms qualifiés *)
+let get_reference mods s =
+ if list_subset mods (Library.loaded_modules()) then
+ try Declare.global_reference CCI (id_of_string s)
+ with Not_found ->
+ error ("get_reference: "^s^"is not defined in the given modules")
+ else error "The required modules are not open"
+
(*
let dest_somatch n pat =
let _,m = get_pat pat in
diff --git a/tactics/hipattern.mli b/tactics/hipattern.mli
index ddba560af5..3ec63908fe 100644
--- a/tactics/hipattern.mli
+++ b/tactics/hipattern.mli
@@ -69,6 +69,11 @@ val put_squel : module_mark -> string -> marked_term
val raw_sopattern_of_compattern : Environ.env -> Coqast.t -> constr
i*)
+(* [get_reference mods id] interprets [id] as a global identifier
+ assuming defined in the modules listed in [mods] *)
+
+val get_reference : string list -> string -> constr
+
(*s Second part : Given a term with second-order variables in it,
represented by Meta's, and possibly applied using \verb!XTRA[$SOAPP]! to
terms, this function will perform second-order, binding-preserving,