From f2da732ffd5db2b93a2c8120c668f8b2f6068d3b Mon Sep 17 00:00:00 2001 From: filliatr Date: Tue, 7 Dec 1999 14:56:36 +0000 Subject: debuggage inductifs (suite) / compilation Dhyp et Auto (mais pas linkes git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@220 85f007b7-540e-0410-9357-904b9bb8a0f7 --- kernel/typeops.ml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'kernel/typeops.ml') diff --git a/kernel/typeops.ml b/kernel/typeops.ml index 255e8d7aa5..46dd750781 100644 --- a/kernel/typeops.ml +++ b/kernel/typeops.ml @@ -954,3 +954,19 @@ let control_only_guard env sigma = | DLAMV(_,v) -> Array.iter control_rec v in control_rec + +(* [keep_hyps sign ids] keeps the part of the signature [sign] which + contains the variables of the set [ids], and recursively the variables + contained in the types of the needed variables. *) + +let keep_hyps sign needed = + rev_sign + (fst (it_sign + (fun ((hyps,globs) as sofar) id a -> + if Idset.mem id globs then + (add_sign (id,a) hyps, + Idset.union (global_vars_set a.body) globs) + else + sofar) + (nil_sign,needed) sign)) + -- cgit v1.2.3