]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/ocaml/cic_proof_checking/cicTypeChecker.ml
removed no longer used METAs
[helm.git] / helm / ocaml / cic_proof_checking / cicTypeChecker.ml
index 239bd44155dc08261221c0c13d60042db04af85a..951f68dbd84b28043a100fe3c72c114d4f5927a7 100644 (file)
@@ -23,6 +23,8 @@
  * http://cs.unibo.it/helm/.
  *)
 
+(* $Id$ *)
+
 (* TODO factorize functions to frequent errors (e.g. "Unknwon mutual inductive
  * ...") *)
 
@@ -42,7 +44,7 @@ let debug t context =
    raise (TypeCheckerFailure (lazy (List.fold_right debug_aux (t::context) "")))
 ;;
 
-let debug_print = fun _ -> () ;;
+let debug_print = fun _ -> ();;
 
 let rec split l n =
  match (l,n) with
@@ -52,10 +54,11 @@ let rec split l n =
       raise (TypeCheckerFailure (lazy "Parameters number < left parameters number"))
 ;;
 
-let debrujin_constructor uri number_of_types =
- let rec aux k =
+let debrujin_constructor ?(cb=fun _ _ -> ()) uri number_of_types =
+ let rec aux k =
   let module C = Cic in
-   function
+  let res =
+   match t with
       C.Rel n as t when n <= k -> t
     | C.Rel _ ->
         raise (TypeCheckerFailure (lazy "unbound variable found in constructor type"))
@@ -114,6 +117,9 @@ let debrujin_constructor uri number_of_types =
           fl
        in
         C.CoFix (i, liftedfl)
+  in
+   cb t res;
+   res
  in
   aux 0
 ;;
@@ -2053,7 +2059,10 @@ let typecheck_obj0 ~logger uri ugraph =
       let b,ugraph = (CicReduction.are_convertible [] ty_te ty ugraph) in
        if not b then
          raise (TypeCheckerFailure
-          (lazy "the type of the body is not the one expected"))
+          (lazy
+            ("the type of the body is not the one expected:\n" ^
+             CicPp.ppterm ty_te ^ "\nvs\n" ^
+             CicPp.ppterm ty)))
        else
         ugraph
    | C.Constant (_,None,ty,_,_) ->