src/HOL/Nominal/nominal_inductive.ML
changeset 26939 1035c89b4c02
parent 26711 3a478bfa1650
child 27153 56b6cdce22f1
equal deleted inserted replaced
26938:64e850c3da9e 26939:1035c89b4c02
   612       (HOLogic.dest_conj (HOLogic.dest_Trueprop t));
   612       (HOLogic.dest_conj (HOLogic.dest_Trueprop t));
   613     fun eqvt_tac pi (intr, vs) st =
   613     fun eqvt_tac pi (intr, vs) st =
   614       let
   614       let
   615         fun eqvt_err s = error
   615         fun eqvt_err s = error
   616           ("Could not prove equivariance for introduction rule\n" ^
   616           ("Could not prove equivariance for introduction rule\n" ^
   617            Sign.string_of_term (theory_of_thm intr)
   617            Syntax.string_of_term_global (theory_of_thm intr)
   618              (Logic.unvarify (prop_of intr)) ^ "\n" ^ s);
   618              (Logic.unvarify (prop_of intr)) ^ "\n" ^ s);
   619         val res = SUBPROOF (fn {prems, params, ...} =>
   619         val res = SUBPROOF (fn {prems, params, ...} =>
   620           let
   620           let
   621             val prems' = map (fn th => the_default th (map_thm ctxt
   621             val prems' = map (fn th => the_default th (map_thm ctxt
   622               (split_conj (K I) names) (etac conjunct2 1) monos NONE th)) prems;
   622               (split_conj (K I) names) (etac conjunct2 1) monos NONE th)) prems;
   628           in (rtac intr' THEN_ALL_NEW (TRY o resolve_tac prems'')) 1
   628           in (rtac intr' THEN_ALL_NEW (TRY o resolve_tac prems'')) 1
   629           end) ctxt 1 st
   629           end) ctxt 1 st
   630       in
   630       in
   631         case (Seq.pull res handle THM (s, _, _) => eqvt_err s) of
   631         case (Seq.pull res handle THM (s, _, _) => eqvt_err s) of
   632           NONE => eqvt_err ("Rule does not match goal\n" ^
   632           NONE => eqvt_err ("Rule does not match goal\n" ^
   633             Sign.string_of_term (theory_of_thm st) (hd (prems_of st)))
   633             Syntax.string_of_term_global (theory_of_thm st) (hd (prems_of st)))
   634         | SOME (th, _) => Seq.single th
   634         | SOME (th, _) => Seq.single th
   635       end;
   635       end;
   636     val thss = map (fn atom =>
   636     val thss = map (fn atom =>
   637       let val pi' = Free (pi, NominalAtoms.mk_permT (Type (atom, [])))
   637       let val pi' = Free (pi, NominalAtoms.mk_permT (Type (atom, [])))
   638       in map (fn th => zero_var_indexes (th RS mp))
   638       in map (fn th => zero_var_indexes (th RS mp))