src/HOL/Tools/Predicate_Compile/predicate_compile_core.ML
changeset 66012 59bf29d2b3a1
parent 63239 d562c9948dee
child 66251 cd935b7cb3fb
equal deleted inserted replaced
66011:f10bbfe07c41 66012:59bf29d2b3a1
  1083                     if null outargs then Free("y", HOLogic.unitT) else HOLogic.mk_tuple outargs))
  1083                     if null outargs then Free("y", HOLogic.unitT) else HOLogic.mk_tuple outargs))
  1084     val funpropI = HOLogic.mk_Trueprop (Predicate_Comp_Funs.mk_Eval (list_comb (funtrm, inargs),
  1084     val funpropI = HOLogic.mk_Trueprop (Predicate_Comp_Funs.mk_Eval (list_comb (funtrm, inargs),
  1085                      HOLogic.mk_tuple outargs))
  1085                      HOLogic.mk_tuple outargs))
  1086     val introtrm = Logic.list_implies (predpropI :: param_eqs, funpropI)
  1086     val introtrm = Logic.list_implies (predpropI :: param_eqs, funpropI)
  1087     val simprules =
  1087     val simprules =
  1088       [defthm, @{thm eval_pred},
  1088       [defthm, @{thm pred.sel},
  1089         @{thm "split_beta"}, @{thm "fst_conv"}, @{thm "snd_conv"}, @{thm prod.collapse}]
  1089         @{thm "split_beta"}, @{thm "fst_conv"}, @{thm "snd_conv"}, @{thm prod.collapse}]
  1090     val unfolddef_tac =
  1090     val unfolddef_tac =
  1091       Simplifier.asm_full_simp_tac (put_simpset HOL_basic_ss ctxt addsimps simprules) 1
  1091       Simplifier.asm_full_simp_tac (put_simpset HOL_basic_ss ctxt addsimps simprules) 1
  1092     val introthm = Goal.prove ctxt
  1092     val introthm = Goal.prove ctxt
  1093       (argnames @ hoarg_names' @ ["y"]) [] introtrm (fn _ => unfolddef_tac)
  1093       (argnames @ hoarg_names' @ ["y"]) [] introtrm (fn _ => unfolddef_tac)
  1345             val rhs = @{term Predicate.holds} $ (list_comb (predfun, args))
  1345             val rhs = @{term Predicate.holds} $ (list_comb (predfun, args))
  1346             val eq_term = HOLogic.mk_Trueprop
  1346             val eq_term = HOLogic.mk_Trueprop
  1347               (HOLogic.mk_eq (list_comb (Const (predname, T), args), rhs))
  1347               (HOLogic.mk_eq (list_comb (Const (predname, T), args), rhs))
  1348             val def = Core_Data.predfun_definition_of ctxt predname full_mode
  1348             val def = Core_Data.predfun_definition_of ctxt predname full_mode
  1349             val tac = fn _ => Simplifier.simp_tac
  1349             val tac = fn _ => Simplifier.simp_tac
  1350               (put_simpset HOL_basic_ss ctxt addsimps [def, @{thm holds_eq}, @{thm eval_pred}]) 1
  1350               (put_simpset HOL_basic_ss ctxt addsimps [def, @{thm holds_eq}, @{thm pred.sel}]) 1
  1351             val eq = Goal.prove ctxt arg_names [] eq_term tac
  1351             val eq = Goal.prove ctxt arg_names [] eq_term tac
  1352           in
  1352           in
  1353             (pred, result_thms @ [eq])
  1353             (pred, result_thms @ [eq])
  1354           end
  1354           end
  1355         else
  1355         else