equal
deleted
inserted
replaced
2002 in globals @ locals end; |
2002 in globals @ locals end; |
2003 (* FIXME: proper varification *) |
2003 (* FIXME: proper varification *) |
2004 |
2004 |
2005 in |
2005 in |
2006 |
2006 |
2007 fun intro_locales_tac (ctxt, eager) facts st = |
2007 fun intro_locales_tac eager ctxt facts st = |
2008 let |
2008 let |
2009 val wits = all_witnesses ctxt |> map Thm.varifyT; |
2009 val wits = all_witnesses ctxt |> map Thm.varifyT; |
2010 val thy = ProofContext.theory_of ctxt; |
2010 val thy = ProofContext.theory_of ctxt; |
2011 val intros = locale_base_intros thy @ (if eager then locale_assm_intros thy else []); |
2011 val intros = locale_base_intros thy @ (if eager then locale_assm_intros thy else []); |
2012 in |
2012 in |
2015 THEN Tactic.distinct_subgoals_tac) st |
2015 THEN Tactic.distinct_subgoals_tac) st |
2016 end; |
2016 end; |
2017 |
2017 |
2018 val _ = Context.add_setup (Method.add_methods |
2018 val _ = Context.add_setup (Method.add_methods |
2019 [("intro_locales", |
2019 [("intro_locales", |
2020 fn src => fn ctxt => Method.METHOD (intro_locales_tac |
2020 Method.ctxt_args (fn ctxt => Method.METHOD (intro_locales_tac false ctxt)), |
2021 (Method.syntax (Scan.lift (Scan.optional (Args.bang >> K false) true)) src ctxt)), |
2021 "back-chain introduction rules of locales without unfolding predicates"), |
2022 "back-chain introduction rules of locales and discharge goals with interpretations")]); |
2022 ("unfold_locales", |
|
2023 Method.ctxt_args (fn ctxt => Method.METHOD (intro_locales_tac true ctxt)), |
|
2024 "back-chain all introduction rules of locales")]); |
2023 |
2025 |
2024 end; |
2026 end; |
2025 |
2027 |
2026 |
2028 |
2027 (** Interpretation commands **) |
2029 (** Interpretation commands **) |