src/HOL/Tools/BNF/bnf_lfp_rec_sugar.ML
changeset 73977 2d8a0f8e30ec
parent 71214 5727bcc3c47c
child 74561 8e6c973003c8
equal deleted inserted replaced
73976:a5212df98387 73977:2d8a0f8e30ec
   364                    | NONE => subst_comb t))
   364                    | NONE => subst_comb t))
   365                 | NONE => subst_comb t)
   365                 | NONE => subst_comb t)
   366               end)
   366               end)
   367         end
   367         end
   368       | subst bound_Ts (Abs (v, T, b)) = Abs (v, T, subst (T :: bound_Ts) b)
   368       | subst bound_Ts (Abs (v, T, b)) = Abs (v, T, subst (T :: bound_Ts) b)
   369       | subst _ t = t
   369       | subst bound_Ts t = try_nested_rec bound_Ts (head_of t) t |> the_default t;
   370 
   370 
   371     fun subst' t =
   371     fun subst' t =
   372       if has_call t then rec_call_not_apply_to_ctr_arg ctxt [] t
   372       if has_call t then rec_call_not_apply_to_ctr_arg ctxt [] t
   373       else try_nested_rec [] (head_of t) t |> the_default t;
   373       else try_nested_rec [] (head_of t) t |> the_default t;
   374   in
   374   in