]> matita.cs.unibo.it Git - helm.git/blobdiff - components/tactics/inversion.ml
This is only a temporary patch. The typecheker raises a
[helm.git] / components / tactics / inversion.ml
index 74117f7109dd596602e0d1ee26a23c7a1cd132da..e381b3003d7b4940eba1b0886c007922066211d0 100644 (file)
@@ -306,14 +306,17 @@ let inversion_tac ~term =
   let (_,metasenv,_,_) = proof in
   let (_,context,goalty) = CicUtil.lookup_meta goal metasenv in
   let termty,_ = T.type_of_aux' metasenv context term CicUniv.empty_ugraph in
-  let uri = baseuri_of_term termty in  
+  let uri, typeno = 
+    match termty with
+      | Cic.MutInd (uri,typeno,_) 
+      | Cic.Appl(Cic.MutInd (uri,typeno,_)::_) -> uri,typeno
+      | _ -> assert false
+  in
+  (* let uri = baseuri_of_term termty in *)
   let obj,_ = CicEnvironment.get_obj CicUniv.empty_ugraph uri in
   let name,nleft,arity,cons_list =
    match obj with
     Cic.InductiveDefinition (tys,_,nleft,_) ->
-     (*we suppose there is only one inductiveType in the definition, 
-     so typeno=0 identically *)
-     let typeno = 0 in
      let (name,_,arity,cons_list) = List.nth tys typeno in 
         (name,nleft,arity,cons_list)
    |_ -> assert false