From aeb1ef32feac2aff81715cc4755b705743fb4f1e Mon Sep 17 00:00:00 2001 From: glondu Date: Tue, 5 Oct 2010 10:03:00 +0000 Subject: Reintroduce kind_of_type (used by Presburger contrib) This partially reverts commit r13467. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@13497 85f007b7-540e-0410-9357-904b9bb8a0f7 --- kernel/term.ml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'kernel/term.ml') diff --git a/kernel/term.ml b/kernel/term.ml index 844ffa62c..5c1fcabf8 100644 --- a/kernel/term.ml +++ b/kernel/term.ml @@ -102,6 +102,24 @@ type ('constr, 'types) kind_of_term = | Fix of ('constr, 'types) pfixpoint | CoFix of ('constr, 'types) pcofixpoint +(* Experimental, used in Presburger contrib *) +type ('constr, 'types) kind_of_type = + | SortType of sorts + | CastType of 'types * 'types + | ProdType of name * 'types * 'types + | LetInType of name * 'constr * 'types * 'types + | AtomicType of 'constr * 'constr array + +let kind_of_type = function + | Sort s -> SortType s + | Cast (c,_,t) -> CastType (c, t) + | Prod (na,t,c) -> ProdType (na, t, c) + | LetIn (na,b,t,c) -> LetInType (na, b, t, c) + | App (c,l) -> AtomicType (c, l) + | (Rel _ | Meta _ | Var _ | Evar _ | Const _ | Case _ | Fix _ | CoFix _ | Ind _ as c) + -> AtomicType (c,[||]) + | (Lambda _ | Construct _) -> failwith "Not a type" + (* constr is the fixpoint of the previous type. Requires option -rectypes of the Caml compiler to be set *) type constr = (constr,constr) kind_of_term -- cgit v1.2.3