made tactic more robust
authortraytel
Thu, 31 Mar 2016 21:19:45 +0200
changeset 62778 f0e8ed202ce5
parent 62777 596baa1a3251
child 62779 7737e26cd3c6
made tactic more robust
src/HOL/Tools/BNF/bnf_fp_n2m_tactics.ML
--- a/src/HOL/Tools/BNF/bnf_fp_n2m_tactics.ML	Thu Mar 31 08:38:50 2016 +0200
+++ b/src/HOL/Tools/BNF/bnf_fp_n2m_tactics.ML	Thu Mar 31 21:19:45 2016 +0200
@@ -38,6 +38,8 @@
         |> op RS
         |> unfold)
       folded_C_IHs rel_monos unfolds;
+
+    val sym_nested_rel_eqs = map mk_sym nesting_rel_eqs;
   in
     unfold_thms_tac ctxt vimage2p_unfolds THEN
     HEADGOAL (CONJ_WRAP_GEN' (rtac ctxt @{thm context_conjI})
@@ -45,7 +47,10 @@
          REPEAT_ALL_NEW (FIRST' [eresolve_tac ctxt C_IHs, eresolve_tac ctxt C_IH_monos,
            SELECT_GOAL (unfold_thms_tac ctxt nesting_rel_eqs) THEN' rtac ctxt @{thm order_refl},
            assume_tac ctxt, resolve_tac ctxt co_inducts,
-           resolve_tac ctxt C_IH_monos THEN' REPEAT_ALL_NEW (eresolve_tac ctxt nesting_rel_monos)])))
+           resolve_tac ctxt C_IH_monos THEN_ALL_NEW (TRY o FIRST'
+             [SELECT_GOAL (unfold_thms_tac ctxt sym_nested_rel_eqs) THEN' assume_tac ctxt,
+              rtac ctxt @{thm order_refl},
+              REPEAT_ALL_NEW (eresolve_tac ctxt nesting_rel_monos)])])))
     co_inducts)
   end;