| author | wenzelm | 
| Wed, 05 Dec 2012 20:24:49 +0100 | |
| changeset 50377 | fe4bc5b2abb4 | 
| parent 46045 | 332cb37cfcee | 
| permissions | -rw-r--r-- | 
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 1 | (* Title: Pure/Isar/skip_proof.ML | 
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 2 | Author: Markus Wenzel, TU Muenchen | 
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 3 | |
| 32970 
fbd2bb2489a8
operations of structure Skip_Proof (formerly SkipProof) no longer require quick_and_dirty mode;
 wenzelm parents: 
32966diff
changeset | 4 | Skipping proofs -- via oracle (in quick and dirty mode) or by forking | 
| 
fbd2bb2489a8
operations of structure Skip_Proof (formerly SkipProof) no longer require quick_and_dirty mode;
 wenzelm parents: 
32966diff
changeset | 5 | (parallel mode). | 
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 6 | *) | 
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 7 | |
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 8 | signature SKIP_PROOF = | 
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 9 | sig | 
| 42409 | 10 | val make_thm_cterm: cterm -> thm | 
| 11892 | 11 | val make_thm: theory -> term -> thm | 
| 12 | val cheat_tac: theory -> tactic | |
| 20289 | 13 | val prove: Proof.context -> string list -> term list -> term -> | 
| 14 |     ({prems: thm list, context: Proof.context} -> tactic) -> thm
 | |
| 26530 | 15 | val prove_global: theory -> string list -> term list -> term -> | 
| 26711 | 16 |     ({prems: thm list, context: Proof.context} -> tactic) -> thm
 | 
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 17 | end; | 
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 18 | |
| 32970 
fbd2bb2489a8
operations of structure Skip_Proof (formerly SkipProof) no longer require quick_and_dirty mode;
 wenzelm parents: 
32966diff
changeset | 19 | structure Skip_Proof: SKIP_PROOF = | 
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 20 | struct | 
| 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 21 | |
| 11892 | 22 | (* oracle setup *) | 
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 23 | |
| 42409 | 24 | val (_, make_thm_cterm) = | 
| 25 | Context.>>> (Context.map_theory_result (Thm.add_oracle (Binding.name "skip_proof", I))); | |
| 26 | ||
| 27 | fun make_thm thy prop = make_thm_cterm (Thm.cterm_of thy prop); | |
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 28 | |
| 11892 | 29 | |
| 11972 | 30 | (* basic cheating *) | 
| 11892 | 31 | |
| 8539 | 32 | fun cheat_tac thy st = | 
| 11892 | 33 |   ALLGOALS (Tactic.rtac (make_thm thy (Var (("A", 0), propT)))) st;
 | 
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 34 | |
| 20049 | 35 | fun prove ctxt xs asms prop tac = | 
| 46045 | 36 | if ! quick_and_dirty then | 
| 37 | Goal.prove ctxt xs asms prop (fn _ => cheat_tac (Proof_Context.theory_of ctxt)) | |
| 38 | else (if Goal.future_enabled () then Goal.prove_future else Goal.prove) ctxt xs asms prop tac; | |
| 11972 | 39 | |
| 26530 | 40 | fun prove_global thy xs asms prop tac = | 
| 42360 | 41 | Drule.export_without_context (prove (Proof_Context.init_global thy) xs asms prop tac); | 
| 26530 | 42 | |
| 6888 
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
 wenzelm parents: diff
changeset | 43 | end; |