author | wenzelm |
Tue, 13 Sep 2005 22:19:47 +0200 | |
changeset 17362 | c089fa02c1e5 |
parent 17114 | 8638a0a0a668 |
child 17476 | 315cb57e3dd7 |
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 |
|
17362 | 8 |
(*if true then some tools will OMIT some proofs*) |
9 |
val quick_and_dirty = ref false; |
|
10 |
||
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
11 |
signature SKIP_PROOF = |
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
12 |
sig |
11892 | 13 |
val make_thm: theory -> term -> thm |
14 |
val cheat_tac: theory -> tactic |
|
11972 | 15 |
val prove: theory -> string list -> term list -> term -> (thm list -> 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 |
|
11892 | 23 |
exception SkipProof of term; |
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
24 |
|
17362 | 25 |
fun skip_proof (_, SkipProof prop) = |
26 |
if ! quick_and_dirty then prop |
|
12318
72348ff7d4a0
skip_proof: do not require quick_and_dirty in interactive mode;
wenzelm
parents:
12244
diff
changeset
|
27 |
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
|
28 |
|
15831 | 29 |
val _ = Context.add_setup [Theory.add_oracle ("skip_proof", skip_proof)]; |
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
30 |
|
11892 | 31 |
|
11972 | 32 |
(* basic cheating *) |
11892 | 33 |
|
17362 | 34 |
fun make_thm thy prop = |
35 |
Thm.invoke_oracle_i thy "Pure.skip_proof" (thy, SkipProof prop); |
|
11892 | 36 |
|
8539 | 37 |
fun cheat_tac thy st = |
11892 | 38 |
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
|
39 |
|
11972 | 40 |
fun prove thy xs asms prop tac = |
16842 | 41 |
Tactic.prove thy xs asms prop |
11972 | 42 |
(if ! quick_and_dirty then (K (cheat_tac thy)) else tac); |
43 |
||
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
diff
changeset
|
44 |
end; |