src/Pure/skip_proof.ML
changeset 51551 88d1d19fb74f
parent 46045 332cb37cfcee
child 51552 c713c9505f68
equal deleted inserted replaced
51550:cec08df2c030 51551:88d1d19fb74f
       
     1 (*  Title:      Pure/skip_proof.ML
       
     2     Author:     Makarius
       
     3 
       
     4 Skip proof via oracle invocation.
       
     5 *)
       
     6 
       
     7 signature SKIP_PROOF =
       
     8 sig
       
     9   val report: Proof.context -> unit
       
    10   val make_thm_cterm: cterm -> thm
       
    11   val make_thm: theory -> term -> thm
       
    12   val cheat_tac: theory -> tactic
       
    13 end;
       
    14 
       
    15 structure Skip_Proof: SKIP_PROOF =
       
    16 struct
       
    17 
       
    18 (* report *)
       
    19 
       
    20 fun report ctxt =
       
    21   Context_Position.if_visible ctxt Output.report
       
    22     (Markup.markup Markup.bad "Skipped proof");
       
    23 
       
    24 
       
    25 (* oracle setup *)
       
    26 
       
    27 val (_, make_thm_cterm) =
       
    28   Context.>>> (Context.map_theory_result (Thm.add_oracle (Binding.name "skip_proof", I)));
       
    29 
       
    30 fun make_thm thy prop = make_thm_cterm (Thm.cterm_of thy prop);
       
    31 
       
    32 
       
    33 (* cheat_tac *)
       
    34 
       
    35 fun cheat_tac thy st =
       
    36   ALLGOALS (rtac (make_thm thy (Var (("A", 0), propT)))) st;
       
    37 
       
    38 end;