src/Pure/Isar/skip_proof.ML
author wenzelm
Sat Sep 17 19:17:35 2005 +0200 (2005-09-17 ago)
changeset 17476 315cb57e3dd7
parent 17362 c089fa02c1e5
child 17956 369e2af8ee45
permissions -rw-r--r--
moved quick_and_dirty to Pure/ROOT.ML;
     1 (*  Title:      Pure/Isar/skip_proof.ML
     2     ID:         $Id$
     3     Author:     Markus Wenzel, TU Muenchen
     4 
     5 Skipping proofs -- quick_and_dirty mode.
     6 *)
     7 
     8 signature SKIP_PROOF =
     9 sig
    10   val make_thm: theory -> term -> thm
    11   val cheat_tac: theory -> tactic
    12   val prove: theory -> string list -> term list -> term -> (thm list -> tactic) -> thm
    13 end;
    14 
    15 structure SkipProof: SKIP_PROOF =
    16 struct
    17 
    18 (* oracle setup *)
    19 
    20 exception SkipProof of term;
    21 
    22 fun skip_proof (_, SkipProof prop) =
    23   if ! quick_and_dirty then prop
    24   else error "Proof may be skipped in quick_and_dirty mode only!";
    25 
    26 val _ = Context.add_setup [Theory.add_oracle ("skip_proof", skip_proof)];
    27 
    28 
    29 (* basic cheating *)
    30 
    31 fun make_thm thy prop =
    32   Thm.invoke_oracle_i thy "Pure.skip_proof" (thy, SkipProof prop);
    33 
    34 fun cheat_tac thy st =
    35   ALLGOALS (Tactic.rtac (make_thm thy (Var (("A", 0), propT)))) st;
    36 
    37 fun prove thy xs asms prop tac =
    38   Tactic.prove thy xs asms prop
    39     (if ! quick_and_dirty then (K (cheat_tac thy)) else tac);
    40 
    41 end;