src/Pure/Isar/skip_proof.ML
changeset 28290 4cc2b6046258
parent 26711 3a478bfa1650
child 28365 6249297461cb
equal deleted inserted replaced
28289:efd53393412b 28290:4cc2b6046258
    18 structure SkipProof: SKIP_PROOF =
    18 structure SkipProof: SKIP_PROOF =
    19 struct
    19 struct
    20 
    20 
    21 (* oracle setup *)
    21 (* oracle setup *)
    22 
    22 
    23 exception SkipProof of term;
    23 val (_, skip_proof) = Context.>>> (Context.map_theory_result
    24 
    24   (Thm.add_oracle ("skip_proof", fn (thy, prop) =>
    25 fun skip_proof (_, SkipProof prop) =
    25     if ! quick_and_dirty then Thm.cterm_of thy prop
    26   if ! quick_and_dirty then prop
    26     else error "Proof may be skipped in quick_and_dirty mode only!")));
    27   else error "Proof may be skipped in quick_and_dirty mode only!";
       
    28 
       
    29 val _ = Context.>> (Context.map_theory
       
    30   (Theory.add_oracle ("skip_proof", skip_proof)));
       
    31 
    27 
    32 
    28 
    33 (* basic cheating *)
    29 (* basic cheating *)
    34 
    30 
    35 fun make_thm thy prop =
    31 fun make_thm thy prop = skip_proof (thy, prop);
    36   Thm.invoke_oracle_i thy "Pure.skip_proof" (thy, SkipProof prop);
       
    37 
    32 
    38 fun cheat_tac thy st =
    33 fun cheat_tac thy st =
    39   ALLGOALS (Tactic.rtac (make_thm thy (Var (("A", 0), propT)))) st;
    34   ALLGOALS (Tactic.rtac (make_thm thy (Var (("A", 0), propT)))) st;
    40 
    35 
    41 fun prove ctxt xs asms prop tac =
    36 fun prove ctxt xs asms prop tac =