aboutsummaryrefslogtreecommitdiff
path: root/plugins/funind
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/funind')
-rw-r--r--plugins/funind/indfun.ml2
-rw-r--r--plugins/funind/indfun_common.ml5
-rw-r--r--plugins/funind/recdef.ml13
3 files changed, 7 insertions, 13 deletions
diff --git a/plugins/funind/indfun.ml b/plugins/funind/indfun.ml
index 850234c3bd..69e22da43d 100644
--- a/plugins/funind/indfun.ml
+++ b/plugins/funind/indfun.ml
@@ -460,7 +460,7 @@ let register_mes fname rec_impls wf_mes_expr wf_rel_expr_opt wf_arg using_lemmas
match wf_rel_expr_opt with
| None ->
let ltof =
- let make_dir l = Dir_path.make (List.map Id.of_string (List.rev l)) in
+ let make_dir l = Dir_path.make (List.rev_map Id.of_string l) in
Libnames.Qualid (Loc.ghost,Libnames.qualid_of_path
(Libnames.make_path (make_dir ["Arith";"Wf_nat"]) (Id.of_string "ltof")))
in
diff --git a/plugins/funind/indfun_common.ml b/plugins/funind/indfun_common.ml
index a041205bf5..e89e2f8946 100644
--- a/plugins/funind/indfun_common.ml
+++ b/plugins/funind/indfun_common.ml
@@ -132,9 +132,8 @@ let coq_constant s =
Coqlib.init_modules s;;
let find_reference sl s =
- (Nametab.locate (make_qualid(Names.Dir_path.make
- (List.map Id.of_string (List.rev sl)))
- (Id.of_string s)));;
+ let dp = Names.Dir_path.make (List.rev_map Id.of_string sl) in
+ Nametab.locate (make_qualid dp (Id.of_string s))
let eq = lazy(coq_constant "eq")
let refl_equal = lazy(coq_constant "eq_refl")
diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml
index 8816d960f9..addce6b1c9 100644
--- a/plugins/funind/recdef.ml
+++ b/plugins/funind/recdef.ml
@@ -50,10 +50,8 @@ let coq_base_constant s =
(Coqlib.init_modules @ [["Coq";"Arith";"Le"];["Coq";"Arith";"Lt"]]) s;;
let find_reference sl s =
- (locate (make_qualid(Names.Dir_path.make
- (List.map Id.of_string (List.rev sl)))
- (Id.of_string s)));;
-
+ let dp = Names.Dir_path.make (List.rev_map Id.of_string sl) in
+ locate (make_qualid dp (Id.of_string s))
let (declare_fun : Id.t -> logical_kind -> constr -> global_reference) =
fun f_id kind value ->
@@ -84,11 +82,8 @@ let type_of_const t =
|_ -> assert false
-let constant sl s =
- constr_of_global
- (locate (make_qualid(Names.Dir_path.make
- (List.map Id.of_string (List.rev sl)))
- (Id.of_string s)));;
+let constant sl s = constr_of_global (find_reference sl s)
+
let const_of_ref = function
ConstRef kn -> kn
| _ -> anomaly (Pp.str "ConstRef expected")