src/HOL/Tools/Function/mutual.ML
changeset 45403 7a0b8debef77
parent 42497 89acb654d8eb
child 46909 3c73a121a387
equal deleted inserted replaced
45402:1fac64bbdb4f 45403:7a0b8debef77
   174   in
   174   in
   175     F ctxt (f, qs, gs, args, rhs) import export
   175     F ctxt (f, qs, gs, args, rhs) import export
   176   end
   176   end
   177 
   177 
   178 fun recover_mutual_psimp all_orig_fdefs parts ctxt (fname, _, _, args, rhs)
   178 fun recover_mutual_psimp all_orig_fdefs parts ctxt (fname, _, _, args, rhs)
   179   import (export : thm -> thm) sum_psimp_eq =
   179     import (export : thm -> thm) sum_psimp_eq =
   180   let
   180   let
   181     val (MutualPart {f=SOME f, ...}) = get_part fname parts
   181     val (MutualPart {f=SOME f, ...}) = get_part fname parts
   182 
   182 
   183     val psimp = import sum_psimp_eq
   183     val psimp = import sum_psimp_eq
   184     val (simp, restore_cond) =
   184     val (simp, restore_cond) =
   188       | _ => raise General.Fail "Too many conditions"
   188       | _ => raise General.Fail "Too many conditions"
   189 
   189 
   190   in
   190   in
   191     Goal.prove ctxt [] []
   191     Goal.prove ctxt [] []
   192       (HOLogic.Trueprop $ HOLogic.mk_eq (list_comb (f, args), rhs))
   192       (HOLogic.Trueprop $ HOLogic.mk_eq (list_comb (f, args), rhs))
   193       (fn _ => (Local_Defs.unfold_tac ctxt all_orig_fdefs)
   193       (fn _ =>
   194          THEN EqSubst.eqsubst_tac ctxt [0] [simp] 1
   194         Local_Defs.unfold_tac ctxt all_orig_fdefs
   195          THEN (simp_tac (simpset_of ctxt)) 1) (* FIXME: global simpset?!! *)
   195           THEN EqSubst.eqsubst_tac ctxt [0] [simp] 1
       
   196           THEN (simp_tac (simpset_of ctxt)) 1)
   196     |> restore_cond
   197     |> restore_cond
   197     |> export
   198     |> export
   198   end
   199   end
   199 
   200 
   200 fun mk_applied_form ctxt caTs thm =
   201 fun mk_applied_form ctxt caTs thm =