aboutsummaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/declarations.ml4
-rw-r--r--kernel/declarations.mli1
2 files changed, 5 insertions, 0 deletions
diff --git a/kernel/declarations.ml b/kernel/declarations.ml
index 000305ebe5..4811716520 100644
--- a/kernel/declarations.ml
+++ b/kernel/declarations.ml
@@ -76,6 +76,10 @@ let dest_subterms p =
let (_,cstrs) = Rtree.dest_node p in
Array.map (fun t -> Array.to_list (snd (Rtree.dest_node t))) cstrs
+let recarg_length p j =
+ let (_,cstrs) = Rtree.dest_node p in
+ Array.length (snd (Rtree.dest_node cstrs.(j-1)))
+
let subst_wf_paths sub p = Rtree.smartmap (subst_recarg sub) p
(* [mind_typename] is the name of the inductive; [mind_arity] is
diff --git a/kernel/declarations.mli b/kernel/declarations.mli
index 70bd8bb89b..452cbc972c 100644
--- a/kernel/declarations.mli
+++ b/kernel/declarations.mli
@@ -51,6 +51,7 @@ val mk_norec : wf_paths
val mk_paths : recarg -> wf_paths list array -> wf_paths
val dest_recarg : wf_paths -> recarg
val dest_subterms : wf_paths -> wf_paths list array
+val recarg_length : wf_paths -> int -> int
val subst_wf_paths : substitution -> wf_paths -> wf_paths