diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/sign.ml | 7 | ||||
-rw-r--r-- | kernel/sign.mli | 1 |
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 |