diff options
author | glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-10-05 10:03:00 +0000 |
---|---|---|
committer | glondu <glondu@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2010-10-05 10:03:00 +0000 |
commit | aeb1ef32feac2aff81715cc4755b705743fb4f1e (patch) | |
tree | 481d9447fffe467594bc911f79f2c2e535c79fa5 | |
parent | 700bbf17a9fb585f6890cd1fd71a8ced8551cd16 (diff) |
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
-rw-r--r-- | kernel/term.ml | 18 | ||||
-rw-r--r-- | kernel/term.mli | 10 |
2 files changed, 28 insertions, 0 deletions
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 diff --git a/kernel/term.mli b/kernel/term.mli index 4b9b5fdcc..875ac8989 100644 --- a/kernel/term.mli +++ b/kernel/term.mli @@ -216,6 +216,16 @@ type ('constr, 'types) kind_of_term = val kind_of_term : constr -> (constr, types) kind_of_term +(** 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 + +val kind_of_type : types -> (constr, types) kind_of_type + (** {6 Simple term case analysis. } *) val isRel : constr -> bool |