]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/ng_kernel/nCicTypeChecker.ml
graph generation phase fixed
[helm.git] / helm / software / components / ng_kernel / nCicTypeChecker.ml
index 690cd59005f8334a9789b58d4e019102cd64786f..4b00edd05b2878ccea79ea6712540c2cfaf7db2a 100644 (file)
@@ -1013,17 +1013,12 @@ and split_prods ~subst context n te =
 and is_really_smaller ~subst ~metasenv (context, recfuns, x, safes as k) te =
  match R.whd ~subst context te with
  | C.Rel m when List.mem m safes -> true
- | C.Rel _ -> false
- | C.LetIn _ -> raise (AssertFailure (lazy "letin after whd"))
- | C.Sort _ | C.Implicit _ | C.Prod _ | C.Lambda _ 
- | C.Const (Ref.Ref (_,_,(Ref.Decl | Ref.Def | Ref.Ind _ | Ref.CoFix _))) ->
-    raise (AssertFailure (lazy "not a constructor"))
- | C.Appl ([]|[_]) -> raise (AssertFailure (lazy "empty/unary appl"))
+ | C.Lambda (name, s, t) ->
+     is_really_smaller ~subst ~metasenv (shift_k (name, C.Decl s) k) t
  | C.Appl (he::_) ->
-    (*CSC: sulla coda ci vogliono dei controlli? secondo noi no, ma *)
-    (*CSC: solo perche' non abbiamo trovato controesempi            *)
-    (*TASSI: da capire soprattutto se he รจ un altro fix che non ha ridotto...*)
-    is_really_smaller ~subst ~metasenv k he
+     is_really_smaller ~subst ~metasenv k he
+ | C.Appl _
+ | C.Rel _ 
  | C.Const (Ref.Ref (_,_,Ref.Con _)) -> false
  | C.Const (Ref.Ref (_,_,Ref.Fix _)) -> assert false
    (*| C.Fix (_, fl) ->
@@ -1044,9 +1039,7 @@ and is_really_smaller ~subst ~metasenv (context, recfuns, x, safes as k) te =
             is_really_smaller ~subst (tys@context) n_plus_len nn_plus_len kl
              x_plus_len safes' bo
          ) fl true*)
- | C.Meta _ -> 
-     true (* XXX if this check is repeated when the user completes the
-             definition *)
+ | C.Meta _ -> true 
  | C.Match (Ref.Ref (_,uri,_) as ref,outtype,term,pl) ->
     (match term with
     | C.Rel m | C.Appl (C.Rel m :: _ ) when List.mem m safes || m = x ->
@@ -1062,6 +1055,7 @@ and is_really_smaller ~subst ~metasenv (context, recfuns, x, safes as k) te =
              is_really_smaller ~subst ~metasenv k e)
            pl cl
     | _ -> List.for_all (is_really_smaller ~subst ~metasenv k) pl)
+ | _ -> assert false
 
 and returns_a_coinductive ~subst context ty =
   match R.whd ~subst context ty with