aboutsummaryrefslogtreecommitdiff
path: root/kernel/typeops.ml
diff options
context:
space:
mode:
authorfilliatr1999-12-01 17:34:36 +0000
committerfilliatr1999-12-01 17:34:36 +0000
commit74f6dceaab0146085e8ac48f9976665026099555 (patch)
tree17aa9e493ac73397fd214b13e46e7f7204f814e1 /kernel/typeops.ml
parent11b3d7716aa730a6b299e813ef6a711c82dadb5a (diff)
poursuite de Vernacentries
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@178 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel/typeops.ml')
-rw-r--r--kernel/typeops.ml24
1 files changed, 24 insertions, 0 deletions
diff --git a/kernel/typeops.ml b/kernel/typeops.ml
index 0d2d5cba50..0824c192cf 100644
--- a/kernel/typeops.ml
+++ b/kernel/typeops.ml
@@ -937,3 +937,27 @@ let type_fixpoint env sigma lna lar vdefj =
(Array.map (fun j -> j.uj_type) vdefj) (Array.map body_of_type lar)
with IllBranch i ->
error_ill_typed_rec_body CCI env i lna vdefj lar
+
+
+(* A function which checks that a term well typed verifies both
+ syntaxic conditions *)
+
+let control_only_guard env sigma =
+ let rec control_rec = function
+ | Rel(p) -> ()
+ | VAR _ -> ()
+ | DOP0(_) -> ()
+ | DOPN(CoFix(_),cl) as cofix ->
+ check_cofix env sigma cofix;
+ Array.iter control_rec cl
+ | DOPN(Fix(_),cl) as fix ->
+ check_fix env sigma fix;
+ Array.iter control_rec cl
+ | DOPN(_,cl) -> Array.iter control_rec cl
+ | DOPL(_,cl) -> List.iter control_rec cl
+ | DOP1(_,c) -> control_rec c
+ | DOP2(_,c1,c2) -> control_rec c1; control_rec c2
+ | DLAM(_,c) -> control_rec c
+ | DLAMV(_,v) -> Array.iter control_rec v
+ in
+ control_rec