]> matita.cs.unibo.it Git - helm.git/commitdiff
fixed check, if 0 constructors then no List.nth is allowed
authorEnrico Tassi <enrico.tassi@inria.fr>
Wed, 30 Jul 2008 22:41:05 +0000 (22:41 +0000)
committerEnrico Tassi <enrico.tassi@inria.fr>
Wed, 30 Jul 2008 22:41:05 +0000 (22:41 +0000)
helm/software/components/cic_proof_checking/cicTypeChecker.ml

index 111d20126e0bba1f59272d61c493e452d7a3ccf9..7fed3ddf3b8b0aa1582b76cb7b9a8c0b6f1aba2a 100644 (file)
@@ -1174,14 +1174,17 @@ and check_allowed_sort_elimination ~subst ~metasenv ~logger context uri i
              let non_informative,ugraph =
               if cl_len = 0 then true,ugraph
               else
-               is_non_informative ~logger [Some (C.Name name,C.Decl ty)]
-                paramsno (snd (List.nth cl 0)) ugraph
+               let b, ug =
+                is_non_informative ~logger [Some (C.Name name,C.Decl ty)]
+                 paramsno (snd (List.nth cl 0)) ugraph
+               in
+                b && 
+               does_not_occur [Some (C.Name name,C.Decl ty)] 0 1
+                (debrujin_constructor uri 1 [] (snd (List.nth cl 0))), ug
              in
               (* is it a singleton or empty non recursive and non informative
                  definition? *)
-              non_informative &&
-               does_not_occur [Some (C.Name name,C.Decl ty)] 0 1
-                (debrujin_constructor uri 1 [] (snd (List.nth cl 0))), ugraph
+              non_informative, ugraph
             else
               false,ugraph
          | _ ->