aboutsummaryrefslogtreecommitdiffhomepage
path: root/kernel
diff options
context:
space:
mode:
authorGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-11-20 23:04:25 +0000
committerGravatar herbelin <herbelin@85f007b7-540e-0410-9357-904b9bb8a0f7>2001-11-20 23:04:25 +0000
commit109414970c8ce6a7f7fdb9d9819ef39a8095cf2e (patch)
tree489824920c82ffbef3803699e0e12aeada51598d /kernel
parentd9e83b3701f9c90542810feb212aea3a6aa0f141 (diff)
Ajout mkArity
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@2218 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sign.ml7
-rw-r--r--kernel/sign.mli1
2 files changed, 6 insertions, 2 deletions
diff --git a/kernel/sign.ml b/kernel/sign.ml
index 05038840d..83474f122 100644
--- a/kernel/sign.ml
+++ b/kernel/sign.ml
@@ -104,8 +104,9 @@ let it_mkLambda_or_LetIn = List.fold_left (fun c d -> mkLambda_or_LetIn d c)
type arity = rel_context * sorts
-(* Transforms a product term (x1:T1)..(xn:Tn)T into the pair
- ([(xn,Tn);...;(x1,T1)],T), where T is not a product *)
+(* Decompose an arity (i.e. a product of the form (x1:T1)..(xn:Tn)s
+ with s a sort) into the pair ([(xn,Tn);...;(x1,T1)],s) *)
+
let destArity =
let rec prodec_rec l c =
match kind_of_term c with
@@ -117,6 +118,8 @@ let destArity =
in
prodec_rec []
+let mkArity (sign,s) = it_mkProd_or_LetIn (mkSort s) sign
+
let rec isArity c =
match kind_of_term c with
| Prod (_,_,c) -> isArity c
diff --git a/kernel/sign.mli b/kernel/sign.mli
index fbc682e35..6667b598c 100644
--- a/kernel/sign.mli
+++ b/kernel/sign.mli
@@ -69,6 +69,7 @@ val it_mkProd_or_LetIn : types -> rel_context -> types
(* Destructs a term of the form $(x_1:T_1)..(x_n:T_n)s$ into the pair *)
type arity = rel_context * sorts
val destArity : types -> arity
+val mkArity : arity -> types
val isArity : types -> bool
(* Transforms a product term $(x_1:T_1)..(x_n:T_n)T$ including letins