src/HOL/Tools/BNF/bnf_gfp_rec_sugar.ML
changeset 57303 498a62e65f5f
parent 56945 3d1ead21a055
child 57397 5004aca20821
equal deleted inserted replaced
57302:58f02fbaa764 57303:498a62e65f5f
   237 
   237 
   238 fun massage_nested_corec_call ctxt has_call raw_massage_call bound_Ts U t =
   238 fun massage_nested_corec_call ctxt has_call raw_massage_call bound_Ts U t =
   239   let
   239   let
   240     fun check_no_call t = if has_call t then unexpected_corec_call ctxt t else ();
   240     fun check_no_call t = if has_call t then unexpected_corec_call ctxt t else ();
   241 
   241 
   242     val build_map_Inl = build_map ctxt (uncurry Inl_const o dest_sumT o snd);
   242     val build_map_Inl = build_map ctxt [] (uncurry Inl_const o dest_sumT o snd);
   243 
   243 
   244     fun massage_mutual_call bound_Ts U T t =
   244     fun massage_mutual_call bound_Ts U T t =
   245       if has_call t then
   245       if has_call t then
   246         (case try dest_sumT U of
   246         (case try dest_sumT U of
   247           SOME (U1, U2) => if U1 = T then raw_massage_call bound_Ts T U2 t else invalid_map ctxt t
   247           SOME (U1, U2) => if U1 = T then raw_massage_call bound_Ts T U2 t else invalid_map ctxt t