author | wenzelm |
Sat, 10 Jan 2009 21:32:30 +0100 | |
changeset 29435 | a5f84ac14609 |
parent 29088 | 95a239a5e055 |
child 29448 | 34b9652b2f45 |
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 |
ID: $Id$ |
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
3 |
Author: Markus Wenzel, TU Muenchen |
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
4 |
|
8539 | 5 |
Skipping proofs -- quick_and_dirty 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 |
11892 | 10 |
val make_thm: theory -> term -> thm |
11 |
val cheat_tac: theory -> tactic |
|
20289 | 12 |
val prove: Proof.context -> string list -> term list -> term -> |
13 |
({prems: thm list, context: Proof.context} -> tactic) -> thm |
|
26530 | 14 |
val prove_global: theory -> string list -> term list -> term -> |
26711 | 15 |
({prems: thm list, context: Proof.context} -> tactic) -> thm |
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
16 |
end; |
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
17 |
|
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
18 |
structure SkipProof: SKIP_PROOF = |
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
19 |
struct |
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
20 |
|
11892 | 21 |
(* oracle setup *) |
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
22 |
|
28290 | 23 |
val (_, skip_proof) = Context.>>> (Context.map_theory_result |
24 |
(Thm.add_oracle ("skip_proof", fn (thy, prop) => |
|
25 |
if ! quick_and_dirty then Thm.cterm_of thy prop |
|
26 |
else error "Proof may be skipped in quick_and_dirty mode only!"))); |
|
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
27 |
|
11892 | 28 |
|
11972 | 29 |
(* basic cheating *) |
11892 | 30 |
|
28290 | 31 |
fun make_thm thy prop = skip_proof (thy, prop); |
11892 | 32 |
|
8539 | 33 |
fun cheat_tac thy st = |
11892 | 34 |
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
|
35 |
|
20049 | 36 |
fun prove ctxt xs asms prop tac = |
29435
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
29088
diff
changeset
|
37 |
(if Future.enabled () andalso ! Goal.parallel_proofs then Goal.prove_future else Goal.prove) |
a5f84ac14609
added parallel_proofs flag (default true, cf. usedir option -Q), which can be disabled in low-memory situations;
wenzelm
parents:
29088
diff
changeset
|
38 |
ctxt xs asms prop |
28365 | 39 |
(fn args => fn st => |
40 |
if ! quick_and_dirty |
|
41 |
then setmp quick_and_dirty true (cheat_tac (ProofContext.theory_of ctxt)) st |
|
42 |
else tac args st); |
|
11972 | 43 |
|
26530 | 44 |
fun prove_global thy xs asms prop tac = |
26711 | 45 |
Drule.standard (prove (ProofContext.init thy) xs asms prop tac); |
26530 | 46 |
|
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
47 |
end; |