src/HOL/Tools/Function/induction_schema.ML
changeset 59970 e9f73d87d904
parent 59627 bb1e4a35d506
child 60695 757549b4bbe6
equal deleted inserted replaced
59969:bcccad156236 59970:e9f73d87d904
   186   end
   186   end
   187 
   187 
   188 
   188 
   189 fun mk_ind_goal ctxt branches =
   189 fun mk_ind_goal ctxt branches =
   190   let
   190   let
   191     val thy = Proof_Context.theory_of ctxt
       
   192 
       
   193     fun brnch (SchemeBranch { P, xs, ws, Cs, ... }) =
   191     fun brnch (SchemeBranch { P, xs, ws, Cs, ... }) =
   194       HOLogic.mk_Trueprop (list_comb (P, map Free xs))
   192       HOLogic.mk_Trueprop (list_comb (P, map Free xs))
   195       |> fold_rev (curry Logic.mk_implies) Cs
   193       |> fold_rev (curry Logic.mk_implies) Cs
   196       |> fold_rev (Logic.all o Free) ws
   194       |> fold_rev (Logic.all o Free) ws
   197       |> term_conv ctxt (ind_atomize ctxt)
   195       |> term_conv ctxt (ind_atomize ctxt)
   198       |> Object_Logic.drop_judgment thy
   196       |> Object_Logic.drop_judgment ctxt
   199       |> HOLogic.tupled_lambda (foldr1 HOLogic.mk_prod (map Free xs))
   197       |> HOLogic.tupled_lambda (foldr1 HOLogic.mk_prod (map Free xs))
   200   in
   198   in
   201     Sum_Tree.mk_sumcases HOLogic.boolT (map brnch branches)
   199     Sum_Tree.mk_sumcases HOLogic.boolT (map brnch branches)
   202   end
   200   end
   203 
   201