lib: provide warning suppression for Eisbach methods

Contexts have the "visible" flag that determine whether warnings such
as duplicate rewrite rules are shown or not. Make setting this flag to
false available in Eisbach methods.

Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Gerwin Klein 2024-01-13 09:24:38 +11:00 committed by Achim D. Brucker
parent 2b17160c2b
commit cddd42ae76
1 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,17 @@ imports
Local_Method
begin
section \<open>Warnings\<close>
method_setup not_visible =
\<open>Method.text_closure >> (fn m => fn ctxt => fn facts =>
let
val ctxt' = Context_Position.set_visible false ctxt
fun tac st' = method_evaluate m ctxt' facts st'
in SIMPLE_METHOD tac facts end)\<close>
\<open>set context visibility to false for suppressing warnings in method execution\<close>
section \<open>Debugging methods\<close>
method print_concl = (match conclusion in P for P \<Rightarrow> \<open>print_term P\<close>)