diff options
author | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2005-01-31 14:34:14 +0000 |
---|---|---|
committer | Samuel Mimram <samuel.mimram@ens-lyon.org> | 2005-01-31 14:34:14 +0000 |
commit | 6497f27021fec4e01f2182014f2bb1989b4707f9 (patch) | |
tree | 473be7e63895a42966970ab6a70998113bc1bd59 /toplevel/class.ml | |
parent | 6b649aba925b6f7462da07599fe67ebb12a3460e (diff) |
Imported Upstream version 8.0pl2upstream/8.0pl2
Diffstat (limited to 'toplevel/class.ml')
-rw-r--r-- | toplevel/class.ml | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/toplevel/class.ml b/toplevel/class.ml index 429469b1..f5493929 100644 --- a/toplevel/class.ml +++ b/toplevel/class.ml @@ -6,7 +6,7 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -(* $Id: class.ml,v 1.44.2.2 2004/07/16 19:31:47 herbelin Exp $ *) +(* $Id: class.ml,v 1.44.2.3 2004/11/26 18:06:54 herbelin Exp $ *) open Util open Pp @@ -92,15 +92,13 @@ let explain_coercion_error g = function (* Verifications pour l'ajout d'une classe *) -let rec arity_sort a = match kind_of_term a with - | Sort (Prop _ | Type _) -> 0 - | Prod (_,_,c) -> (arity_sort c) +1 - | LetIn (_,_,_,c) -> arity_sort c (* Utile ?? *) - | Cast (c,_) -> arity_sort c +let rec arity_sort (ctx,a) = match kind_of_term a with + | Sort (Prop _ | Type _) -> List.length ctx | _ -> raise Not_found let check_reference_arity ref = - try arity_sort (Global.type_of_global ref) + let t = Global.type_of_global ref in + try arity_sort (Reductionops.splay_prod (Global.env()) Evd.empty t) with Not_found -> raise (CoercionError (NotAClass ref)) let check_arity = function |