src/HOL/Tools/Function/scnp_reconstruct.ML
changeset 59582 0fbed69ff081
parent 59498 50b60f501b05
child 59584 4517e9a96ace
equal deleted inserted replaced
59580:cbc38731d42f 59582:0fbed69ff081
   156 
   156 
   157     fun get_desc_thm cidx m1 m2 bStrict =
   157     fun get_desc_thm cidx m1 m2 bStrict =
   158       (case Termination.get_descent D (nth cs cidx) m1 m2 of
   158       (case Termination.get_descent D (nth cs cidx) m1 m2 of
   159         SOME (Termination.Less thm) =>
   159         SOME (Termination.Less thm) =>
   160           if bStrict then thm
   160           if bStrict then thm
   161           else (thm COMP (Thm.lift_rule (cprop_of thm) @{thm less_imp_le}))
   161           else (thm COMP (Thm.lift_rule (Thm.cprop_of thm) @{thm less_imp_le}))
   162       | SOME (Termination.LessEq (thm, _))  =>
   162       | SOME (Termination.LessEq (thm, _))  =>
   163           if not bStrict then thm
   163           if not bStrict then thm
   164           else raise Fail "get_desc_thm"
   164           else raise Fail "get_desc_thm"
   165       | _ => raise Fail "get_desc_thm")
   165       | _ => raise Fail "get_desc_thm")
   166 
   166 
   270       Abs ("x", Termination.get_types D p, mk_set nat_pairT (map (tag_pair p) lm))
   270       Abs ("x", Termination.get_types D p, mk_set nat_pairT (map (tag_pair p) lm))
   271 
   271 
   272     val level_mapping =
   272     val level_mapping =
   273       map_index pt_lev lev
   273       map_index pt_lev lev
   274         |> Termination.mk_sumcases D (setT nat_pairT)
   274         |> Termination.mk_sumcases D (setT nat_pairT)
   275         |> cterm_of thy
   275         |> Thm.cterm_of thy
   276     in
   276     in
   277       PROFILE "Proof Reconstruction"
   277       PROFILE "Proof Reconstruction"
   278         (CONVERSION (Conv.arg_conv (Conv.arg_conv (Function_Lib.regroup_union_conv sl))) 1
   278         (CONVERSION (Conv.arg_conv (Conv.arg_conv (Function_Lib.regroup_union_conv sl))) 1
   279          THEN (rtac @{thm reduction_pair_lemma} 1)
   279          THEN (rtac @{thm reduction_pair_lemma} 1)
   280          THEN (rtac @{thm rp_inv_image_rp} 1)
   280          THEN (rtac @{thm rp_inv_image_rp} 1)