aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-01-24 16:24:23 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-01-24 16:24:23 +0000
commit9995a348f823bfcc0b36b105016c0457cc747121 (patch)
tree9ac75364c65b09dc6fdd997d7f27d0ddd7430241 /kernel
parent2678739dcac301102dfeba7dfb9958d67f1cce0e (diff)
Ajout global_vars_decl
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1269 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/term.ml6
-rw-r--r--kernel/term.mli4
2 files changed, 9 insertions, 1 deletions
diff --git a/kernel/term.ml b/kernel/term.ml
index 7a3c7e053..ee98a7054 100644
--- a/kernel/term.ml
+++ b/kernel/term.ml
@@ -1375,7 +1375,11 @@ let rec global_varsl l constr = match kind_of_term constr with
| IsVar id -> id::l
| _ -> fold_constr global_varsl l constr
-let global_vars constr = global_varsl [] constr
+let global_vars = global_varsl []
+
+let global_vars_decl = function
+ | (_, None, t) -> global_vars t
+ | (_, Some c, t) -> (global_vars c)@(global_vars t)
let global_vars_set constr =
let rec filtrec acc c = match kind_of_term c with
diff --git a/kernel/term.mli b/kernel/term.mli
index bbd02b6e6..e3f6b4463 100644
--- a/kernel/term.mli
+++ b/kernel/term.mli
@@ -463,6 +463,10 @@ val subst1_decl : constr -> named_declaration -> named_declaration
(* [global_vars c] returns the list of [id]'s occurring as [VAR id] in [c] *)
val global_vars : constr -> identifier list
+(* [global_vars_decl d] returns the list of [id]'s occurring as [VAR
+ id] in declaration [d] (type and body if any) *)
+val global_vars_decl : named_declaration -> identifier list
+
val global_vars_set : constr -> Idset.t
val replace_vars : (identifier * constr) list -> constr -> constr
val subst_var : identifier -> constr -> constr