@@ -15,7 +15,6 @@ open EConstr
1515open Vars
1616open Context
1717open Declarations
18- open Declareops
1918open Environ
2019open Reductionops
2120open Context.Rel.Declaration
@@ -116,24 +115,22 @@ let dest_subterms p = match Rtree.Kind.kind p with
116115| Rtree.Kind. Var _ -> assert false
117116
118117let mis_is_recursive mip =
119- let one_is_rec rvec =
120- Array. exists (fun ra ->
121- match dest_recarg ra with
122- | Mrec (RecArgInd ind ) -> true
123- | Mrec (RecArgPrim _ ) | Norec -> false
124- ) rvec
125- in
126- Array. exists one_is_rec (dest_subterms @@ Rtree.Kind. make mip.mind_recargs)
118+ let ra = mip.mind_automaton in
119+ let trans = Rtree.Automaton. transitions ra (Rtree.Automaton. initial ra) in
120+ let check tr = match Rtree.Automaton. data ra tr with Mrec _ -> true | Norec -> false in
121+ Array. exists (fun v -> Array. exists check v) trans
127122
128123let mis_is_nested kn mib =
129124 Array. exists (fun mip ->
125+ let ra = mip.mind_automaton in
126+ let trans = Rtree.Automaton. transitions ra (Rtree.Automaton. initial ra) in
130127 Array. exists (fun rvec ->
131- Array. exists (fun ra ->
132- match dest_recarg ra with
128+ Array. exists (fun tr ->
129+ match Rtree.Automaton. data ra tr with
133130 | Mrec (RecArgInd (kni , _ )) -> not @@ MutInd.CanOrd. equal kn kni
134131 | Mrec (RecArgPrim _ ) | Norec -> false
135132 ) rvec
136- ) (dest_subterms @@ Rtree.Kind. make mip.mind_recargs)
133+ ) trans
137134 ) mib.mind_packets
138135
139136let mis_nf_constructor_type ((_ ,j ),u ) (mib ,mip ) =
@@ -239,12 +236,6 @@ let constructor_alltags env (ind,j) =
239236 let (mib,mip) = Inductive. lookup_mind_specif env ind in
240237 Context.Rel. to_tags (fst mip.mind_nf_lc.(j-1 ))
241238
242- let constructor_has_local_defs env (indsp ,j ) =
243- let (mib,mip) = Inductive. lookup_mind_specif env indsp in
244- let l1 = mip.mind_consnrealdecls.(j-1 ) + Context.Rel. length (mib.mind_params_ctxt) in
245- let l2 = recarg_length mip.mind_recargs j + mib.mind_nparams in
246- not (Int. equal l1 l2)
247-
248239let inductive_has_local_defs env ind =
249240 let (mib,mip) = Inductive. lookup_mind_specif env ind in
250241 let l1 = Context.Rel. length (mib.mind_params_ctxt) + mip.mind_nrealdecls in
0 commit comments