author | wenzelm |
Sat, 13 Aug 2011 20:49:41 +0200 | |
changeset 44187 | 88d770052bac |
parent 44186 | 806f0ec1a43d |
child 44192 | a32ca9165928 |
permissions | -rw-r--r-- |
5832 | 1 |
(* Title: Pure/Isar/isar_syn.ML |
2 |
Author: Markus Wenzel, TU Muenchen |
|
3 |
||
6353 | 4 |
Isar/Pure outer syntax. |
5832 | 5 |
*) |
6 |
||
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
7 |
structure Isar_Syn: sig end = |
5832 | 8 |
struct |
9 |
||
24868 | 10 |
(** keywords **) |
11 |
||
12 |
(*keep keywords consistent with the parsers, otherwise be prepared for |
|
13 |
unexpected errors*) |
|
14 |
||
36950 | 15 |
val _ = List.app Keyword.keyword |
24868 | 16 |
["!!", "!", "%", "(", ")", "+", ",", "--", ":", "::", ";", "<", "<=", |
17 |
"=", "==", "=>", "?", "[", "\\<equiv>", "\\<leftharpoondown>", |
|
18 |
"\\<rightharpoonup>", "\\<rightleftharpoons>", "\\<subseteq>", "]", |
|
26888 | 19 |
"advanced", "and", "assumes", "attach", "begin", "binder", |
24868 | 20 |
"constrains", "defines", "fixes", "for", "identifier", "if", |
28721 | 21 |
"imports", "in", "infix", "infixl", "infixr", "is", |
33456
fbd47f9b9b12
allow "pervasive" local theory declarations, which are applied the background theory;
wenzelm
parents:
33390
diff
changeset
|
22 |
"notes", "obtains", "open", "output", "overloaded", "pervasive", |
fbd47f9b9b12
allow "pervasive" local theory declarations, which are applied the background theory;
wenzelm
parents:
33390
diff
changeset
|
23 |
"shows", "structure", "unchecked", "uses", "where", "|"]; |
fbd47f9b9b12
allow "pervasive" local theory declarations, which are applied the background theory;
wenzelm
parents:
33390
diff
changeset
|
24 |
|
24868 | 25 |
|
26 |
||
5832 | 27 |
(** init and exit **) |
28 |
||
24868 | 29 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
30 |
Outer_Syntax.command "theory" "begin theory" (Keyword.tag_theory Keyword.thy_begin) |
37977
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37949
diff
changeset
|
31 |
(Thy_Header.args >> (fn (name, imports, uses) => |
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37949
diff
changeset
|
32 |
Toplevel.print o |
44187
88d770052bac
simplified Toplevel.init_theory: discontinued special name argument;
wenzelm
parents:
44186
diff
changeset
|
33 |
Toplevel.init_theory |
44186
806f0ec1a43d
simplified Toplevel.init_theory: discontinued special master argument;
wenzelm
parents:
43947
diff
changeset
|
34 |
(fn () => |
806f0ec1a43d
simplified Toplevel.init_theory: discontinued special master argument;
wenzelm
parents:
43947
diff
changeset
|
35 |
Thy_Info.toplevel_begin_theory (Thy_Load.get_master_path ()) |
806f0ec1a43d
simplified Toplevel.init_theory: discontinued special master argument;
wenzelm
parents:
43947
diff
changeset
|
36 |
name imports (map (apfst Path.explode) uses)))); |
5832 | 37 |
|
24868 | 38 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
39 |
Outer_Syntax.command "end" "end (local) theory" (Keyword.tag_theory Keyword.thy_end) |
40960 | 40 |
(Scan.succeed |
41 |
(Toplevel.exit o Toplevel.end_local_theory o Toplevel.end_proof (K Proof.end_notepad))); |
|
6687 | 42 |
|
5832 | 43 |
|
30142
8d6145694bb5
moved find_theorems.ML and find_consts.ML to Pure/Tools, collecting main implementation in one place each;
wenzelm
parents:
29882
diff
changeset
|
44 |
|
7749 | 45 |
(** markup commands **) |
5832 | 46 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
47 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "header" "theory header" Keyword.diag |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
48 |
(Parse.doc_source >> Isar_Cmd.header_markup); |
6353 | 49 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
50 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "chapter" "chapter heading" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
51 |
Keyword.thy_heading (Parse.opt_target -- Parse.doc_source >> Isar_Cmd.local_theory_markup); |
5958 | 52 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
53 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "section" "section heading" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
54 |
Keyword.thy_heading (Parse.opt_target -- Parse.doc_source >> Isar_Cmd.local_theory_markup); |
5958 | 55 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
56 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "subsection" "subsection heading" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
57 |
Keyword.thy_heading (Parse.opt_target -- Parse.doc_source >> Isar_Cmd.local_theory_markup); |
5958 | 58 |
|
24868 | 59 |
val _ = |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
60 |
Outer_Syntax.markup_command Thy_Output.Markup "subsubsection" "subsubsection heading" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
61 |
Keyword.thy_heading (Parse.opt_target -- Parse.doc_source >> Isar_Cmd.local_theory_markup); |
5832 | 62 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
63 |
val _ = Outer_Syntax.markup_command Thy_Output.MarkupEnv "text" "formal comment (theory)" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
64 |
Keyword.thy_decl (Parse.opt_target -- Parse.doc_source >> Isar_Cmd.local_theory_markup); |
7172 | 65 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
66 |
val _ = Outer_Syntax.markup_command Thy_Output.Verbatim "text_raw" "raw document preparation text" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
67 |
Keyword.thy_decl (Parse.opt_target -- Parse.doc_source >> Isar_Cmd.local_theory_markup); |
7172 | 68 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
69 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "sect" "formal comment (proof)" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
70 |
(Keyword.tag_proof Keyword.prf_heading) (Parse.doc_source >> Isar_Cmd.proof_markup); |
7172 | 71 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
72 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "subsect" "formal comment (proof)" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
73 |
(Keyword.tag_proof Keyword.prf_heading) (Parse.doc_source >> Isar_Cmd.proof_markup); |
7172 | 74 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
75 |
val _ = Outer_Syntax.markup_command Thy_Output.Markup "subsubsect" "formal comment (proof)" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
76 |
(Keyword.tag_proof Keyword.prf_heading) (Parse.doc_source >> Isar_Cmd.proof_markup); |
7172 | 77 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
78 |
val _ = Outer_Syntax.markup_command Thy_Output.MarkupEnv "txt" "formal comment (proof)" |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
79 |
(Keyword.tag_proof Keyword.prf_decl) (Parse.doc_source >> Isar_Cmd.proof_markup); |
7172 | 80 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
81 |
val _ = Outer_Syntax.markup_command Thy_Output.Verbatim "txt_raw" |
36950 | 82 |
"raw document preparation text (proof)" (Keyword.tag_proof Keyword.prf_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
83 |
(Parse.doc_source >> Isar_Cmd.proof_markup); |
7775 | 84 |
|
5832 | 85 |
|
6886 | 86 |
|
30142
8d6145694bb5
moved find_theorems.ML and find_consts.ML to Pure/Tools, collecting main implementation in one place each;
wenzelm
parents:
29882
diff
changeset
|
87 |
(** theory commands **) |
6886 | 88 |
|
5832 | 89 |
(* classes and sorts *) |
90 |
||
24868 | 91 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
92 |
Outer_Syntax.command "classes" "declare type classes" Keyword.thy_decl |
36950 | 93 |
(Scan.repeat1 (Parse.binding -- Scan.optional ((Parse.$$$ "\\<subseteq>" || Parse.$$$ "<") |-- |
94 |
Parse.!!! (Parse.list1 Parse.xname)) []) |
|
95 |
>> (Toplevel.theory o fold AxClass.axiomatize_class_cmd)); |
|
5832 | 96 |
|
24868 | 97 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
98 |
Outer_Syntax.command "classrel" "state inclusion of type classes (axiomatic!)" Keyword.thy_decl |
36950 | 99 |
(Parse.and_list1 (Parse.xname -- ((Parse.$$$ "\\<subseteq>" || Parse.$$$ "<") |
100 |
|-- Parse.!!! Parse.xname)) |
|
24932
86ef9a828a9e
AxClass.axiomatize and Specification: renamed XXX_i to XXX, and XXX to XXX_cmd;
wenzelm
parents:
24914
diff
changeset
|
101 |
>> (Toplevel.theory o AxClass.axiomatize_classrel_cmd)); |
5832 | 102 |
|
24868 | 103 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
104 |
Outer_Syntax.local_theory "default_sort" "declare default sort for explicit type variables" |
36950 | 105 |
Keyword.thy_decl |
106 |
(Parse.sort >> (fn s => fn lthy => Local_Theory.set_defsort (Syntax.read_sort lthy s) lthy)); |
|
5832 | 107 |
|
108 |
||
109 |
(* types *) |
|
110 |
||
24868 | 111 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
112 |
Outer_Syntax.local_theory "typedecl" "type declaration" Keyword.thy_decl |
36950 | 113 |
(Parse.type_args -- Parse.binding -- Parse.opt_mixfix |
35835 | 114 |
>> (fn ((args, a), mx) => Typedecl.typedecl (a, map (rpair dummyS) args, mx) #> snd)); |
5832 | 115 |
|
41249
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
116 |
val type_abbrev = |
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
117 |
Parse.type_args -- Parse.binding -- |
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
118 |
(Parse.$$$ "=" |-- Parse.!!! (Parse.typ -- Parse.opt_mixfix')); |
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
119 |
|
24868 | 120 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
121 |
Outer_Syntax.local_theory "types" "declare type abbreviations" Keyword.thy_decl |
41249
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
122 |
(Scan.repeat1 type_abbrev >> (fn specs => fn lthy => |
43227 | 123 |
(legacy_feature "Old 'types' command -- use 'type_synonym' instead"; |
41249
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
124 |
fold (fn ((args, a), (rhs, mx)) => snd o Typedecl.abbrev_cmd (a, args, mx) rhs) specs lthy))); |
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
125 |
|
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
126 |
val _ = |
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
127 |
Outer_Syntax.local_theory "type_synonym" "declare type abbreviation" Keyword.thy_decl |
26f12f98f50a
Command 'type_synonym' (with single argument) supersedes 'types' (legacy feature);
wenzelm
parents:
41229
diff
changeset
|
128 |
(type_abbrev >> (fn ((args, a), (rhs, mx)) => snd o Typedecl.abbrev_cmd (a, args, mx) rhs)); |
5832 | 129 |
|
24868 | 130 |
val _ = |
41229
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
wenzelm
parents:
40965
diff
changeset
|
131 |
Outer_Syntax.command "nonterminal" |
d797baa3d57c
replaced command 'nonterminals' by slightly modernized version 'nonterminal';
wenzelm
parents:
40965
diff
changeset
|
132 |
"declare syntactic type constructors (grammar nonterminal symbols)" Keyword.thy_decl |
42375
774df7c59508
report Name_Space.declare/define, relatively to context;
wenzelm
parents:
42359
diff
changeset
|
133 |
(Parse.and_list1 Parse.binding >> (Toplevel.theory o Sign.add_nonterminals_global)); |
5832 | 134 |
|
24868 | 135 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
136 |
Outer_Syntax.command "arities" "state type arities (axiomatic!)" Keyword.thy_decl |
36950 | 137 |
(Scan.repeat1 Parse.arity >> (Toplevel.theory o fold AxClass.axiomatize_arity_cmd)); |
5832 | 138 |
|
139 |
||
140 |
(* consts and syntax *) |
|
141 |
||
24868 | 142 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
143 |
Outer_Syntax.command "judgment" "declare object-logic judgment" Keyword.thy_decl |
36950 | 144 |
(Parse.const_binding >> (Toplevel.theory o Object_Logic.add_judgment_cmd)); |
8227 | 145 |
|
24868 | 146 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
147 |
Outer_Syntax.command "consts" "declare constants" Keyword.thy_decl |
36950 | 148 |
(Scan.repeat1 Parse.const_binding >> (Toplevel.theory o Sign.add_consts)); |
5832 | 149 |
|
36950 | 150 |
val opt_overloaded = Parse.opt_keyword "overloaded"; |
14223
0ee05eef881b
Added support for making constants final, that is, ensuring that no
skalberg
parents:
13802
diff
changeset
|
151 |
|
24868 | 152 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
153 |
Outer_Syntax.command "finalconsts" "declare constants as final" Keyword.thy_decl |
36950 | 154 |
(opt_overloaded -- Scan.repeat1 Parse.term >> (uncurry (Toplevel.theory oo Theory.add_finals))); |
9731 | 155 |
|
12142 | 156 |
val mode_spec = |
36950 | 157 |
(Parse.$$$ "output" >> K ("", false)) || |
158 |
Parse.name -- Scan.optional (Parse.$$$ "output" >> K false) true; |
|
9731 | 159 |
|
14900 | 160 |
val opt_mode = |
36950 | 161 |
Scan.optional (Parse.$$$ "(" |-- Parse.!!! (mode_spec --| Parse.$$$ ")")) Syntax.mode_default; |
5832 | 162 |
|
24868 | 163 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
164 |
Outer_Syntax.command "syntax" "declare syntactic constants" Keyword.thy_decl |
42299 | 165 |
(opt_mode -- Scan.repeat1 Parse.const_decl >> (Toplevel.theory o uncurry Sign.add_modesyntax)); |
5832 | 166 |
|
24868 | 167 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
168 |
Outer_Syntax.command "no_syntax" "delete syntax declarations" Keyword.thy_decl |
42299 | 169 |
(opt_mode -- Scan.repeat1 Parse.const_decl >> (Toplevel.theory o uncurry Sign.del_modesyntax)); |
15748 | 170 |
|
5832 | 171 |
|
172 |
(* translations *) |
|
173 |
||
174 |
val trans_pat = |
|
42326 | 175 |
Scan.optional |
176 |
(Parse.$$$ "(" |-- Parse.!!! (Parse.xname --| Parse.$$$ ")")) "logic" |
|
177 |
-- Parse.inner_syntax Parse.string; |
|
5832 | 178 |
|
179 |
fun trans_arrow toks = |
|
42204 | 180 |
((Parse.$$$ "\\<rightharpoonup>" || Parse.$$$ "=>") >> K Syntax.Parse_Rule || |
181 |
(Parse.$$$ "\\<leftharpoondown>" || Parse.$$$ "<=") >> K Syntax.Print_Rule || |
|
182 |
(Parse.$$$ "\\<rightleftharpoons>" || Parse.$$$ "==") >> K Syntax.Parse_Print_Rule) toks; |
|
5832 | 183 |
|
184 |
val trans_line = |
|
36950 | 185 |
trans_pat -- Parse.!!! (trans_arrow -- trans_pat) |
5832 | 186 |
>> (fn (left, (arr, right)) => arr (left, right)); |
187 |
||
24868 | 188 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
189 |
Outer_Syntax.command "translations" "declare syntax translation rules" Keyword.thy_decl |
42204 | 190 |
(Scan.repeat1 trans_line >> (Toplevel.theory o Isar_Cmd.translations)); |
5832 | 191 |
|
24868 | 192 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
193 |
Outer_Syntax.command "no_translations" "remove syntax translation rules" Keyword.thy_decl |
42204 | 194 |
(Scan.repeat1 trans_line >> (Toplevel.theory o Isar_Cmd.no_translations)); |
19260 | 195 |
|
5832 | 196 |
|
197 |
(* axioms and definitions *) |
|
198 |
||
24868 | 199 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
200 |
Outer_Syntax.command "axioms" "state arbitrary propositions (axiomatic!)" Keyword.thy_decl |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
201 |
(Scan.repeat1 Parse_Spec.spec >> |
37861 | 202 |
(fn spec => Toplevel.theory (fn thy => |
203 |
(legacy_feature "Old 'axioms' command -- use 'axiomatization' instead"; |
|
204 |
Isar_Cmd.add_axioms spec thy)))); |
|
5832 | 205 |
|
19631 | 206 |
val opt_unchecked_overloaded = |
36950 | 207 |
Scan.optional (Parse.$$$ "(" |-- Parse.!!! |
208 |
(((Parse.$$$ "unchecked" >> K true) -- Scan.optional (Parse.$$$ "overloaded" >> K true) false || |
|
209 |
Parse.$$$ "overloaded" >> K (false, true)) --| Parse.$$$ ")")) (false, false); |
|
19631 | 210 |
|
24868 | 211 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
212 |
Outer_Syntax.command "defs" "define constants" Keyword.thy_decl |
35852
4e3fe0b8687b
minor renovation of old-style 'axioms' -- make it an alias of iterated 'axiomatization';
wenzelm
parents:
35835
diff
changeset
|
213 |
(opt_unchecked_overloaded -- |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
214 |
Scan.repeat1 (Parse_Spec.thm_name ":" -- Parse.prop >> (fn ((x, y), z) => ((x, z), y))) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
215 |
>> (Toplevel.theory o Isar_Cmd.add_defs)); |
6370 | 216 |
|
14642 | 217 |
|
21601
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21527
diff
changeset
|
218 |
(* constant definitions and abbreviations *) |
6588b947d631
simplified syntax for 'definition', 'abbreviation';
wenzelm
parents:
21527
diff
changeset
|
219 |
|
24868 | 220 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
221 |
Outer_Syntax.local_theory "definition" "constant definition" Keyword.thy_decl |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
222 |
(Parse_Spec.constdef >> (fn args => #2 o Specification.definition_cmd args)); |
18780 | 223 |
|
24868 | 224 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
225 |
Outer_Syntax.local_theory "abbreviation" "constant abbreviation" Keyword.thy_decl |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
226 |
(opt_mode -- (Scan.option Parse_Spec.constdecl -- Parse.prop) |
36950 | 227 |
>> (fn (mode, args) => Specification.abbreviation_cmd mode args)); |
19659 | 228 |
|
24868 | 229 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
230 |
Outer_Syntax.local_theory "type_notation" "add concrete syntax for type constructors" |
36950 | 231 |
Keyword.thy_decl |
42300
0d1cbc1fe579
notation: proper markup for type constructor / constant;
wenzelm
parents:
42299
diff
changeset
|
232 |
(opt_mode -- Parse.and_list1 (Parse.type_const -- Parse.mixfix) |
36950 | 233 |
>> (fn (mode, args) => Specification.type_notation_cmd true mode args)); |
35413 | 234 |
|
235 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
236 |
Outer_Syntax.local_theory "no_type_notation" "delete concrete syntax for type constructors" |
36950 | 237 |
Keyword.thy_decl |
42300
0d1cbc1fe579
notation: proper markup for type constructor / constant;
wenzelm
parents:
42299
diff
changeset
|
238 |
(opt_mode -- Parse.and_list1 (Parse.type_const -- Parse.mixfix) |
36950 | 239 |
>> (fn (mode, args) => Specification.type_notation_cmd false mode args)); |
35413 | 240 |
|
241 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
242 |
Outer_Syntax.local_theory "notation" "add concrete syntax for constants / fixed variables" |
36950 | 243 |
Keyword.thy_decl |
42300
0d1cbc1fe579
notation: proper markup for type constructor / constant;
wenzelm
parents:
42299
diff
changeset
|
244 |
(opt_mode -- Parse.and_list1 (Parse.const -- Parse_Spec.locale_mixfix) |
36950 | 245 |
>> (fn (mode, args) => Specification.notation_cmd true mode args)); |
24950 | 246 |
|
247 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
248 |
Outer_Syntax.local_theory "no_notation" "delete concrete syntax for constants / fixed variables" |
36950 | 249 |
Keyword.thy_decl |
42300
0d1cbc1fe579
notation: proper markup for type constructor / constant;
wenzelm
parents:
42299
diff
changeset
|
250 |
(opt_mode -- Parse.and_list1 (Parse.const -- Parse_Spec.locale_mixfix) |
36950 | 251 |
>> (fn (mode, args) => Specification.notation_cmd false mode args)); |
19076 | 252 |
|
5832 | 253 |
|
18616 | 254 |
(* constant specifications *) |
255 |
||
24868 | 256 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
257 |
Outer_Syntax.command "axiomatization" "axiomatic constant specification" Keyword.thy_decl |
36950 | 258 |
(Scan.optional Parse.fixes [] -- |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
259 |
Scan.optional (Parse.where_ |-- Parse.!!! (Parse.and_list1 Parse_Spec.specs)) [] |
36950 | 260 |
>> (fn (x, y) => Toplevel.theory (#2 o Specification.axiomatization_cmd x y))); |
18616 | 261 |
|
262 |
||
5914 | 263 |
(* theorems *) |
264 |
||
26988
742e26213212
more uniform treatment of OuterSyntax.local_theory commands;
wenzelm
parents:
26888
diff
changeset
|
265 |
fun theorems kind = |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
266 |
Parse_Spec.name_facts >> (fn args => #2 o Specification.theorems_cmd kind args); |
12712 | 267 |
|
24868 | 268 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
269 |
Outer_Syntax.local_theory "theorems" "define theorems" Keyword.thy_decl (theorems Thm.theoremK); |
5914 | 270 |
|
24868 | 271 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
272 |
Outer_Syntax.local_theory "lemmas" "define lemmas" Keyword.thy_decl (theorems Thm.lemmaK); |
5914 | 273 |
|
24868 | 274 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
275 |
Outer_Syntax.local_theory "declare" "declare theorems" Keyword.thy_decl |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
276 |
(Parse.and_list1 Parse_Spec.xthms1 |
28965 | 277 |
>> (fn args => #2 o Specification.theorems_cmd "" [(Attrib.empty_binding, flat args)])); |
9589 | 278 |
|
5914 | 279 |
|
5832 | 280 |
(* name space entry path *) |
281 |
||
36176
3fe7e97ccca8
replaced generic 'hide' command by more conventional 'hide_class', 'hide_type', 'hide_const', 'hide_fact' -- frees some popular keywords;
wenzelm
parents:
36174
diff
changeset
|
282 |
fun hide_names name hide what = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
283 |
Outer_Syntax.command name ("hide " ^ what ^ " from name space") Keyword.thy_decl |
36950 | 284 |
((Parse.opt_keyword "open" >> not) -- Scan.repeat1 Parse.xname >> |
36176
3fe7e97ccca8
replaced generic 'hide' command by more conventional 'hide_class', 'hide_type', 'hide_const', 'hide_fact' -- frees some popular keywords;
wenzelm
parents:
36174
diff
changeset
|
285 |
(Toplevel.theory o uncurry hide)); |
3fe7e97ccca8
replaced generic 'hide' command by more conventional 'hide_class', 'hide_type', 'hide_const', 'hide_fact' -- frees some popular keywords;
wenzelm
parents:
36174
diff
changeset
|
286 |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
287 |
val _ = hide_names "hide_class" Isar_Cmd.hide_class "classes"; |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
288 |
val _ = hide_names "hide_type" Isar_Cmd.hide_type "types"; |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
289 |
val _ = hide_names "hide_const" Isar_Cmd.hide_const "constants"; |
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
290 |
val _ = hide_names "hide_fact" Isar_Cmd.hide_fact "facts"; |
5832 | 291 |
|
292 |
||
293 |
(* use ML text *) |
|
294 |
||
24868 | 295 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
296 |
Outer_Syntax.command "use" "ML text from file" (Keyword.tag_ml Keyword.thy_decl) |
37949
48a874444164
moved management of auxiliary theory source files to Thy_Load -- as theory data instead of accidental loader state;
wenzelm
parents:
37873
diff
changeset
|
297 |
(Parse.path >> (fn path => Toplevel.generic_theory (Thy_Load.exec_ml path))); |
7891 | 298 |
|
24868 | 299 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
300 |
Outer_Syntax.command "ML" "ML text within theory or local theory" |
36950 | 301 |
(Keyword.tag_ml Keyword.thy_decl) |
302 |
(Parse.ML_source >> (fn (txt, pos) => |
|
30579
4169ddbfe1f9
command 'use', 'ML': apply ML environment to theory and target as well;
wenzelm
parents:
30576
diff
changeset
|
303 |
Toplevel.generic_theory |
37949
48a874444164
moved management of auxiliary theory source files to Thy_Load -- as theory data instead of accidental loader state;
wenzelm
parents:
37873
diff
changeset
|
304 |
(ML_Context.exec (fn () => ML_Context.eval_text true pos txt) #> |
48a874444164
moved management of auxiliary theory source files to Thy_Load -- as theory data instead of accidental loader state;
wenzelm
parents:
37873
diff
changeset
|
305 |
Local_Theory.propagate_ml_env))); |
30579
4169ddbfe1f9
command 'use', 'ML': apply ML environment to theory and target as well;
wenzelm
parents:
30576
diff
changeset
|
306 |
|
4169ddbfe1f9
command 'use', 'ML': apply ML environment to theory and target as well;
wenzelm
parents:
30576
diff
changeset
|
307 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
308 |
Outer_Syntax.command "ML_prf" "ML text within proof" (Keyword.tag_proof Keyword.prf_decl) |
36950 | 309 |
(Parse.ML_source >> (fn (txt, pos) => |
28269 | 310 |
Toplevel.proof (Proof.map_context (Context.proof_map |
37949
48a874444164
moved management of auxiliary theory source files to Thy_Load -- as theory data instead of accidental loader state;
wenzelm
parents:
37873
diff
changeset
|
311 |
(ML_Context.exec (fn () => ML_Context.eval_text true pos txt))) #> Proof.propagate_ml_env))); |
28269 | 312 |
|
313 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
314 |
Outer_Syntax.command "ML_val" "diagnostic ML text" (Keyword.tag_ml Keyword.diag) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
315 |
(Parse.ML_source >> Isar_Cmd.ml_diag true); |
26396 | 316 |
|
317 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
318 |
Outer_Syntax.command "ML_command" "diagnostic ML text (silent)" (Keyword.tag_ml Keyword.diag) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
319 |
(Parse.ML_source >> (Toplevel.no_timing oo Isar_Cmd.ml_diag false)); |
5832 | 320 |
|
24868 | 321 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
322 |
Outer_Syntax.command "setup" "ML theory setup" (Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
323 |
(Parse.ML_source >> (Toplevel.theory o Isar_Cmd.global_setup)); |
30461 | 324 |
|
325 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
326 |
Outer_Syntax.local_theory "local_setup" "ML local theory setup" (Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
327 |
(Parse.ML_source >> Isar_Cmd.local_setup); |
5832 | 328 |
|
24868 | 329 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
330 |
Outer_Syntax.command "attribute_setup" "define attribute in ML" (Keyword.tag_ml Keyword.thy_decl) |
42813
6c841fa92fa2
optional description for 'attribute_setup' and 'method_setup';
wenzelm
parents:
42496
diff
changeset
|
331 |
(Parse.position Parse.name -- |
6c841fa92fa2
optional description for 'attribute_setup' and 'method_setup';
wenzelm
parents:
42496
diff
changeset
|
332 |
Parse.!!! (Parse.$$$ "=" |-- Parse.ML_source -- Scan.optional Parse.text "") |
36950 | 333 |
>> (fn (name, (txt, cmt)) => Toplevel.theory (Attrib.attribute_setup name txt cmt))); |
30526 | 334 |
|
335 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
336 |
Outer_Syntax.command "method_setup" "define proof method in ML" (Keyword.tag_ml Keyword.thy_decl) |
42813
6c841fa92fa2
optional description for 'attribute_setup' and 'method_setup';
wenzelm
parents:
42496
diff
changeset
|
337 |
(Parse.position Parse.name -- |
6c841fa92fa2
optional description for 'attribute_setup' and 'method_setup';
wenzelm
parents:
42496
diff
changeset
|
338 |
Parse.!!! (Parse.$$$ "=" |-- Parse.ML_source -- Scan.optional Parse.text "") |
36950 | 339 |
>> (fn (name, (txt, cmt)) => Toplevel.theory (Method.method_setup name txt cmt))); |
9197 | 340 |
|
24868 | 341 |
val _ = |
40784 | 342 |
Outer_Syntax.local_theory "declaration" "generic ML declaration" |
343 |
(Keyword.tag_ml Keyword.thy_decl) |
|
344 |
(Parse.opt_keyword "pervasive" -- Parse.ML_source |
|
345 |
>> (fn (pervasive, txt) => Isar_Cmd.declaration {syntax = false, pervasive = pervasive} txt)); |
|
346 |
||
347 |
val _ = |
|
348 |
Outer_Syntax.local_theory "syntax_declaration" "generic ML declaration" |
|
349 |
(Keyword.tag_ml Keyword.thy_decl) |
|
350 |
(Parse.opt_keyword "pervasive" -- Parse.ML_source |
|
351 |
>> (fn (pervasive, txt) => Isar_Cmd.declaration {syntax = true, pervasive = pervasive} txt)); |
|
22088 | 352 |
|
24868 | 353 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
354 |
Outer_Syntax.local_theory "simproc_setup" "define simproc in ML" (Keyword.tag_ml Keyword.thy_decl) |
42464 | 355 |
(Parse.position Parse.name -- |
36950 | 356 |
(Parse.$$$ "(" |-- Parse.enum1 "|" Parse.term --| Parse.$$$ ")" --| Parse.$$$ "=") -- |
357 |
Parse.ML_source -- Scan.optional (Parse.$$$ "identifier" |-- Scan.repeat1 Parse.xname) [] |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
358 |
>> (fn (((a, b), c), d) => Isar_Cmd.simproc_setup a b c d)); |
22202 | 359 |
|
5832 | 360 |
|
361 |
(* translation functions *) |
|
362 |
||
36950 | 363 |
val trfun = Parse.opt_keyword "advanced" -- Parse.ML_source; |
14642 | 364 |
|
24868 | 365 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
366 |
Outer_Syntax.command "parse_ast_translation" "install parse ast translation functions" |
36950 | 367 |
(Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
368 |
(trfun >> (Toplevel.theory o Isar_Cmd.parse_ast_translation)); |
5832 | 369 |
|
24868 | 370 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
371 |
Outer_Syntax.command "parse_translation" "install parse translation functions" |
36950 | 372 |
(Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
373 |
(trfun >> (Toplevel.theory o Isar_Cmd.parse_translation)); |
5832 | 374 |
|
24868 | 375 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
376 |
Outer_Syntax.command "print_translation" "install print translation functions" |
36950 | 377 |
(Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
378 |
(trfun >> (Toplevel.theory o Isar_Cmd.print_translation)); |
5832 | 379 |
|
24868 | 380 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
381 |
Outer_Syntax.command "typed_print_translation" "install typed print translation functions" |
36950 | 382 |
(Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
383 |
(trfun >> (Toplevel.theory o Isar_Cmd.typed_print_translation)); |
5832 | 384 |
|
24868 | 385 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
386 |
Outer_Syntax.command "print_ast_translation" "install print ast translation functions" |
36950 | 387 |
(Keyword.tag_ml Keyword.thy_decl) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
388 |
(trfun >> (Toplevel.theory o Isar_Cmd.print_ast_translation)); |
5832 | 389 |
|
390 |
||
391 |
(* oracles *) |
|
392 |
||
24868 | 393 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
394 |
Outer_Syntax.command "oracle" "declare oracle" (Keyword.tag_ml Keyword.thy_decl) |
36950 | 395 |
(Parse.position Parse.name -- (Parse.$$$ "=" |-- Parse.ML_source) >> |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
396 |
(fn (x, y) => Toplevel.theory (Isar_Cmd.oracle x y))); |
5832 | 397 |
|
398 |
||
21306
7ab6e95e6b0b
turned 'context' into plain thy_decl, discontinued thy_switch;
wenzelm
parents:
21269
diff
changeset
|
399 |
(* local theories *) |
7ab6e95e6b0b
turned 'context' into plain thy_decl, discontinued thy_switch;
wenzelm
parents:
21269
diff
changeset
|
400 |
|
24868 | 401 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
402 |
Outer_Syntax.command "context" "enter local theory context" Keyword.thy_decl |
36950 | 403 |
(Parse.name --| Parse.begin >> (fn name => |
38350
480b2de9927c
renamed Theory_Target to the more appropriate Named_Target
haftmann
parents:
38348
diff
changeset
|
404 |
Toplevel.print o Toplevel.begin_local_theory true (Named_Target.context_cmd name))); |
21306
7ab6e95e6b0b
turned 'context' into plain thy_decl, discontinued thy_switch;
wenzelm
parents:
21269
diff
changeset
|
405 |
|
7ab6e95e6b0b
turned 'context' into plain thy_decl, discontinued thy_switch;
wenzelm
parents:
21269
diff
changeset
|
406 |
|
12061 | 407 |
(* locales *) |
408 |
||
12758 | 409 |
val locale_val = |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
410 |
Parse_Spec.locale_expression false -- |
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
411 |
Scan.optional (Parse.$$$ "+" |-- Parse.!!! (Scan.repeat1 Parse_Spec.context_element)) [] || |
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
412 |
Scan.repeat1 Parse_Spec.context_element >> pair ([], []); |
12061 | 413 |
|
24868 | 414 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
415 |
Outer_Syntax.command "locale" "define named proof context" Keyword.thy_decl |
36950 | 416 |
(Parse.binding -- |
417 |
Scan.optional (Parse.$$$ "=" |-- Parse.!!! locale_val) (([], []), []) -- Parse.opt_begin |
|
27681 | 418 |
>> (fn ((name, (expr, elems)), begin) => |
21843 | 419 |
(begin ? Toplevel.print) o Toplevel.begin_local_theory begin |
41585
45d7da4e4ccf
added before_exit continuation for named targets (locale, class etc.), e.g. for final check/cleanup as in VC management;
wenzelm
parents:
41536
diff
changeset
|
420 |
(Expression.add_locale_cmd I name Binding.empty expr elems #> snd))); |
28085
914183e229e9
Interpretation commands no longer accept interpretation attributes.
ballarin
parents:
28084
diff
changeset
|
421 |
|
41270 | 422 |
fun parse_interpretation_arguments mandatory = |
423 |
Parse.!!! (Parse_Spec.locale_expression mandatory) -- |
|
424 |
Scan.optional |
|
425 |
(Parse.where_ |-- Parse.and_list1 (Parse_Spec.opt_thm_name ":" -- Parse.prop)) []; |
|
426 |
||
24868 | 427 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
428 |
Outer_Syntax.command "sublocale" |
36950 | 429 |
"prove sublocale relation between a locale and a locale expression" Keyword.thy_goal |
430 |
(Parse.xname --| (Parse.$$$ "\\<subseteq>" || Parse.$$$ "<") -- |
|
41270 | 431 |
parse_interpretation_arguments false |
432 |
>> (fn (loc, (expr, equations)) => |
|
41585
45d7da4e4ccf
added before_exit continuation for named targets (locale, class etc.), e.g. for final check/cleanup as in VC management;
wenzelm
parents:
41536
diff
changeset
|
433 |
Toplevel.print o Toplevel.theory_to_proof (Expression.sublocale_cmd I loc expr equations))); |
28895 | 434 |
|
435 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
436 |
Outer_Syntax.command "interpretation" |
36950 | 437 |
"prove interpretation of locale expression in theory" Keyword.thy_goal |
41270 | 438 |
(parse_interpretation_arguments true |
30727
519f8f0fcbf3
interpretation/interpret: prefixes within locale expression are mandatory by default;
wenzelm
parents:
30703
diff
changeset
|
439 |
>> (fn (expr, equations) => Toplevel.print o |
519f8f0fcbf3
interpretation/interpret: prefixes within locale expression are mandatory by default;
wenzelm
parents:
30703
diff
changeset
|
440 |
Toplevel.theory_to_proof (Expression.interpretation_cmd expr equations))); |
29223 | 441 |
|
442 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
443 |
Outer_Syntax.command "interpret" |
29223 | 444 |
"prove interpretation of locale expression in proof context" |
36950 | 445 |
(Keyword.tag_proof Keyword.prf_goal) |
41270 | 446 |
(parse_interpretation_arguments true |
38108 | 447 |
>> (fn (expr, equations) => Toplevel.print o |
448 |
Toplevel.proof' (Expression.interpret_cmd expr equations))); |
|
29223 | 449 |
|
15703 | 450 |
|
22299 | 451 |
(* classes *) |
452 |
||
24868 | 453 |
val class_val = |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
454 |
Parse_Spec.class_expr -- |
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
455 |
Scan.optional (Parse.$$$ "+" |-- Parse.!!! (Scan.repeat1 Parse_Spec.context_element)) [] || |
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
456 |
Scan.repeat1 Parse_Spec.context_element >> pair []; |
22299 | 457 |
|
24868 | 458 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
459 |
Outer_Syntax.command "class" "define type class" Keyword.thy_decl |
36950 | 460 |
(Parse.binding -- Scan.optional (Parse.$$$ "=" |-- class_val) ([], []) -- Parse.opt_begin |
26516 | 461 |
>> (fn ((name, (supclasses, elems)), begin) => |
24938 | 462 |
(begin ? Toplevel.print) o Toplevel.begin_local_theory begin |
41585
45d7da4e4ccf
added before_exit continuation for named targets (locale, class etc.), e.g. for final check/cleanup as in VC management;
wenzelm
parents:
41536
diff
changeset
|
463 |
(Class_Declaration.class_cmd I name supclasses elems #> snd))); |
22299 | 464 |
|
24868 | 465 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
466 |
Outer_Syntax.local_theory_to_proof "subclass" "prove a subclass relation" Keyword.thy_goal |
41585
45d7da4e4ccf
added before_exit continuation for named targets (locale, class etc.), e.g. for final check/cleanup as in VC management;
wenzelm
parents:
41536
diff
changeset
|
467 |
(Parse.xname >> Class_Declaration.subclass_cmd I); |
24914
95cda5dd58d5
added proper subclass concept; improved class target
haftmann
parents:
24871
diff
changeset
|
468 |
|
95cda5dd58d5
added proper subclass concept; improved class target
haftmann
parents:
24871
diff
changeset
|
469 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
470 |
Outer_Syntax.command "instantiation" "instantiate and prove type arity" Keyword.thy_decl |
36950 | 471 |
(Parse.multi_arity --| Parse.begin |
25462 | 472 |
>> (fn arities => Toplevel.print o |
38348
cf7b2121ad9d
moved instantiation target formally to class_target.ML
haftmann
parents:
38342
diff
changeset
|
473 |
Toplevel.begin_local_theory true (Class.instantiation_cmd arities))); |
24589 | 474 |
|
25485 | 475 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
476 |
Outer_Syntax.command "instance" "prove type arity or subclass relation" Keyword.thy_goal |
36950 | 477 |
((Parse.xname -- ((Parse.$$$ "\\<subseteq>" || Parse.$$$ "<") |-- Parse.!!! Parse.xname) |
478 |
>> Class.classrel_cmd || |
|
479 |
Parse.multi_arity >> Class.instance_arity_cmd) |
|
480 |
>> (Toplevel.print oo Toplevel.theory_to_proof) || |
|
481 |
Scan.succeed |
|
482 |
(Toplevel.print o Toplevel.local_theory_to_proof NONE (Class.instantiation_instance I))); |
|
22299 | 483 |
|
484 |
||
25519 | 485 |
(* arbitrary overloading *) |
486 |
||
487 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
488 |
Outer_Syntax.command "overloading" "overloaded definitions" Keyword.thy_decl |
36950 | 489 |
(Scan.repeat1 (Parse.name --| (Parse.$$$ "\\<equiv>" || Parse.$$$ "==") -- Parse.term -- |
490 |
Scan.optional (Parse.$$$ "(" |-- (Parse.$$$ "unchecked" >> K false) --| Parse.$$$ ")") true |
|
491 |
>> Parse.triple1) --| Parse.begin |
|
25519 | 492 |
>> (fn operations => Toplevel.print o |
38342
09d4a04d5c2e
moved overloading target formally to overloading.ML
haftmann
parents:
38108
diff
changeset
|
493 |
Toplevel.begin_local_theory true (Overloading.overloading_cmd operations))); |
25519 | 494 |
|
495 |
||
22866 | 496 |
(* code generation *) |
497 |
||
24868 | 498 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
499 |
Outer_Syntax.command "code_datatype" "define set of code datatype constructors" Keyword.thy_decl |
36950 | 500 |
(Scan.repeat1 Parse.term >> (Toplevel.theory o Code.add_datatype_cmd)); |
22866 | 501 |
|
502 |
||
5832 | 503 |
|
504 |
(** proof commands **) |
|
505 |
||
506 |
(* statements *) |
|
507 |
||
36317
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
508 |
fun gen_theorem schematic kind = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
509 |
Outer_Syntax.local_theory_to_proof' |
36317
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
510 |
(if schematic then "schematic_" ^ kind else kind) |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
511 |
("state " ^ (if schematic then "schematic " ^ kind else kind)) |
36950 | 512 |
(if schematic then Keyword.thy_schematic_goal else Keyword.thy_goal) |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
513 |
(Scan.optional (Parse_Spec.opt_thm_name ":" --| |
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
514 |
Scan.ahead (Parse_Spec.locale_keyword || Parse_Spec.statement_keyword)) Attrib.empty_binding -- |
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
515 |
Parse_Spec.general_statement >> (fn (a, (elems, concl)) => |
36317
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
516 |
((if schematic then Specification.schematic_theorem_cmd else Specification.theorem_cmd) |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
517 |
kind NONE (K I) a elems concl))); |
5832 | 518 |
|
36317
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
519 |
val _ = gen_theorem false Thm.theoremK; |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
520 |
val _ = gen_theorem false Thm.lemmaK; |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
521 |
val _ = gen_theorem false Thm.corollaryK; |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
522 |
val _ = gen_theorem true Thm.theoremK; |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
523 |
val _ = gen_theorem true Thm.lemmaK; |
506d732cb522
explicit 'schematic_theorem' etc. for schematic theorem statements;
wenzelm
parents:
36178
diff
changeset
|
524 |
val _ = gen_theorem true Thm.corollaryK; |
5832 | 525 |
|
24868 | 526 |
val _ = |
40960 | 527 |
Outer_Syntax.local_theory_to_proof "notepad" |
528 |
"Isar proof state as formal notepad, without any result" Keyword.thy_decl |
|
529 |
(Parse.begin >> K Proof.begin_notepad); |
|
530 |
||
531 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
532 |
Outer_Syntax.command "have" "state local goal" |
36950 | 533 |
(Keyword.tag_proof Keyword.prf_goal) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
534 |
(Parse_Spec.statement >> ((Toplevel.print oo Toplevel.proof') o Isar_Cmd.have)); |
17353 | 535 |
|
24868 | 536 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
537 |
Outer_Syntax.command "hence" "abbreviates \"then have\"" |
36950 | 538 |
(Keyword.tag_proof Keyword.prf_goal) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
539 |
(Parse_Spec.statement >> ((Toplevel.print oo Toplevel.proof') o Isar_Cmd.hence)); |
17353 | 540 |
|
24868 | 541 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
542 |
Outer_Syntax.command "show" "state local goal, solving current obligation" |
36950 | 543 |
(Keyword.tag_proof Keyword.prf_asm_goal) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
544 |
(Parse_Spec.statement >> ((Toplevel.print oo Toplevel.proof') o Isar_Cmd.show)); |
5832 | 545 |
|
24868 | 546 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
547 |
Outer_Syntax.command "thus" "abbreviates \"then show\"" |
36950 | 548 |
(Keyword.tag_proof Keyword.prf_asm_goal) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
549 |
(Parse_Spec.statement >> ((Toplevel.print oo Toplevel.proof') o Isar_Cmd.thus)); |
6501 | 550 |
|
5832 | 551 |
|
5914 | 552 |
(* facts *) |
5832 | 553 |
|
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
554 |
val facts = Parse.and_list1 Parse_Spec.xthms1; |
9197 | 555 |
|
24868 | 556 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
557 |
Outer_Syntax.command "then" "forward chaining" |
36950 | 558 |
(Keyword.tag_proof Keyword.prf_chain) |
17900 | 559 |
(Scan.succeed (Toplevel.print o Toplevel.proof Proof.chain)); |
5832 | 560 |
|
24868 | 561 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
562 |
Outer_Syntax.command "from" "forward chaining from given facts" |
36950 | 563 |
(Keyword.tag_proof Keyword.prf_chain) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
564 |
(facts >> (Toplevel.print oo (Toplevel.proof o Proof.from_thmss_cmd))); |
5914 | 565 |
|
24868 | 566 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
567 |
Outer_Syntax.command "with" "forward chaining from given and current facts" |
36950 | 568 |
(Keyword.tag_proof Keyword.prf_chain) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
569 |
(facts >> (Toplevel.print oo (Toplevel.proof o Proof.with_thmss_cmd))); |
6878 | 570 |
|
24868 | 571 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
572 |
Outer_Syntax.command "note" "define facts" |
36950 | 573 |
(Keyword.tag_proof Keyword.prf_decl) |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
574 |
(Parse_Spec.name_facts >> (Toplevel.print oo (Toplevel.proof o Proof.note_thmss_cmd))); |
5832 | 575 |
|
24868 | 576 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
577 |
Outer_Syntax.command "using" "augment goal facts" |
36950 | 578 |
(Keyword.tag_proof Keyword.prf_decl) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
579 |
(facts >> (Toplevel.print oo (Toplevel.proof o Proof.using_cmd))); |
18544 | 580 |
|
24868 | 581 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
582 |
Outer_Syntax.command "unfolding" "unfold definitions in goal and facts" |
36950 | 583 |
(Keyword.tag_proof Keyword.prf_decl) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
584 |
(facts >> (Toplevel.print oo (Toplevel.proof o Proof.unfolding_cmd))); |
12926 | 585 |
|
5832 | 586 |
|
587 |
(* proof context *) |
|
588 |
||
24868 | 589 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
590 |
Outer_Syntax.command "fix" "fix local variables (Skolem constants)" |
36950 | 591 |
(Keyword.tag_proof Keyword.prf_asm) |
592 |
(Parse.fixes >> (Toplevel.print oo (Toplevel.proof o Proof.fix_cmd))); |
|
11890 | 593 |
|
24868 | 594 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
595 |
Outer_Syntax.command "assume" "assume propositions" |
36950 | 596 |
(Keyword.tag_proof Keyword.prf_asm) |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
597 |
(Parse_Spec.statement >> (Toplevel.print oo (Toplevel.proof o Proof.assume_cmd))); |
5832 | 598 |
|
24868 | 599 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
600 |
Outer_Syntax.command "presume" "assume propositions, to be established later" |
36950 | 601 |
(Keyword.tag_proof Keyword.prf_asm) |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
602 |
(Parse_Spec.statement >> (Toplevel.print oo (Toplevel.proof o Proof.presume_cmd))); |
6850 | 603 |
|
24868 | 604 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
605 |
Outer_Syntax.command "def" "local definition" |
36950 | 606 |
(Keyword.tag_proof Keyword.prf_asm) |
607 |
(Parse.and_list1 |
|
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
608 |
(Parse_Spec.opt_thm_name ":" -- |
36950 | 609 |
((Parse.binding -- Parse.opt_mixfix) -- |
610 |
((Parse.$$$ "\\<equiv>" || Parse.$$$ "==") |-- Parse.!!! Parse.termp))) |
|
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
611 |
>> (Toplevel.print oo (Toplevel.proof o Proof.def_cmd))); |
6953 | 612 |
|
24868 | 613 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
614 |
Outer_Syntax.command "obtain" "generalized existence" |
36950 | 615 |
(Keyword.tag_proof Keyword.prf_asm_goal) |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
616 |
(Parse.parname -- Scan.optional (Parse.fixes --| Parse.where_) [] -- Parse_Spec.statement |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
617 |
>> (fn ((x, y), z) => Toplevel.print o Toplevel.proof' (Obtain.obtain_cmd x y z))); |
5832 | 618 |
|
24868 | 619 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
620 |
Outer_Syntax.command "guess" "wild guessing (unstructured)" |
36950 | 621 |
(Keyword.tag_proof Keyword.prf_asm_goal) |
622 |
(Scan.optional Parse.fixes [] >> (Toplevel.print oo (Toplevel.proof' o Obtain.guess_cmd))); |
|
17854 | 623 |
|
24868 | 624 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
625 |
Outer_Syntax.command "let" "bind text variables" |
36950 | 626 |
(Keyword.tag_proof Keyword.prf_decl) |
627 |
(Parse.and_list1 (Parse.and_list1 Parse.term -- (Parse.$$$ "=" |-- Parse.term)) |
|
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
628 |
>> (Toplevel.print oo (Toplevel.proof o Proof.let_bind_cmd))); |
5832 | 629 |
|
36505
79c1d2bbe5a9
ProofContext.read_const: allow for type constraint (for fixed variable);
wenzelm
parents:
36452
diff
changeset
|
630 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
631 |
Outer_Syntax.command "write" "add concrete syntax for constants / fixed variables" |
36950 | 632 |
(Keyword.tag_proof Keyword.prf_decl) |
42300
0d1cbc1fe579
notation: proper markup for type constructor / constant;
wenzelm
parents:
42299
diff
changeset
|
633 |
(opt_mode -- Parse.and_list1 (Parse.const -- Parse_Spec.locale_mixfix) |
36505
79c1d2bbe5a9
ProofContext.read_const: allow for type constraint (for fixed variable);
wenzelm
parents:
36452
diff
changeset
|
634 |
>> (fn (mode, args) => Toplevel.print o Toplevel.proof (Proof.write_cmd mode args))); |
79c1d2bbe5a9
ProofContext.read_const: allow for type constraint (for fixed variable);
wenzelm
parents:
36452
diff
changeset
|
635 |
|
11793
5f0ab6f5c280
support impromptu terminology of cases parameters;
wenzelm
parents:
11742
diff
changeset
|
636 |
val case_spec = |
36950 | 637 |
(Parse.$$$ "(" |-- |
42496 | 638 |
Parse.!!! (Parse.xname -- Scan.repeat1 (Parse.maybe Parse.binding) --| Parse.$$$ ")") || |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
639 |
Parse.xname >> rpair []) -- Parse_Spec.opt_attribs >> Parse.triple1; |
11793
5f0ab6f5c280
support impromptu terminology of cases parameters;
wenzelm
parents:
11742
diff
changeset
|
640 |
|
24868 | 641 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
642 |
Outer_Syntax.command "case" "invoke local context" |
36950 | 643 |
(Keyword.tag_proof Keyword.prf_asm) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
644 |
(case_spec >> (Toplevel.print oo (Toplevel.proof o Proof.invoke_case_cmd))); |
8370 | 645 |
|
5832 | 646 |
|
647 |
(* proof structure *) |
|
648 |
||
24868 | 649 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
650 |
Outer_Syntax.command "{" "begin explicit proof block" |
36950 | 651 |
(Keyword.tag_proof Keyword.prf_open) |
17900 | 652 |
(Scan.succeed (Toplevel.print o Toplevel.proof Proof.begin_block)); |
5832 | 653 |
|
24868 | 654 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
655 |
Outer_Syntax.command "}" "end explicit proof block" |
36950 | 656 |
(Keyword.tag_proof Keyword.prf_close) |
20305 | 657 |
(Scan.succeed (Toplevel.print o Toplevel.proof Proof.end_block)); |
6687 | 658 |
|
24868 | 659 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
660 |
Outer_Syntax.command "next" "enter next proof block" |
36950 | 661 |
(Keyword.tag_proof Keyword.prf_block) |
17900 | 662 |
(Scan.succeed (Toplevel.print o Toplevel.proof Proof.next_block)); |
5832 | 663 |
|
664 |
||
665 |
(* end proof *) |
|
666 |
||
24868 | 667 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
668 |
Outer_Syntax.command "qed" "conclude (sub-)proof" |
36950 | 669 |
(Keyword.tag_proof Keyword.qed_block) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
670 |
(Scan.option Method.parse >> Isar_Cmd.qed); |
5832 | 671 |
|
24868 | 672 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
673 |
Outer_Syntax.command "by" "terminal backward proof" |
36950 | 674 |
(Keyword.tag_proof Keyword.qed) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
675 |
(Method.parse -- Scan.option Method.parse >> Isar_Cmd.terminal_proof); |
6404 | 676 |
|
24868 | 677 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
678 |
Outer_Syntax.command ".." "default proof" |
36950 | 679 |
(Keyword.tag_proof Keyword.qed) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
680 |
(Scan.succeed Isar_Cmd.default_proof); |
8966 | 681 |
|
24868 | 682 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
683 |
Outer_Syntax.command "." "immediate proof" |
36950 | 684 |
(Keyword.tag_proof Keyword.qed) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
685 |
(Scan.succeed Isar_Cmd.immediate_proof); |
6404 | 686 |
|
24868 | 687 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
688 |
Outer_Syntax.command "done" "done proof" |
36950 | 689 |
(Keyword.tag_proof Keyword.qed) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
690 |
(Scan.succeed Isar_Cmd.done_proof); |
5832 | 691 |
|
24868 | 692 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
693 |
Outer_Syntax.command "sorry" "skip proof (quick-and-dirty mode only!)" |
36950 | 694 |
(Keyword.tag_proof Keyword.qed) |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
695 |
(Scan.succeed Isar_Cmd.skip_proof); |
6888
d0c68ebdabc5
skip_proof feature 'sorry' (for quick_and_dirty mode only);
wenzelm
parents:
6886
diff
changeset
|
696 |
|
24868 | 697 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
698 |
Outer_Syntax.command "oops" "forget proof" |
36950 | 699 |
(Keyword.tag_proof Keyword.qed_global) |
18561 | 700 |
(Scan.succeed Toplevel.forget_proof); |
8210 | 701 |
|
5832 | 702 |
|
703 |
(* proof steps *) |
|
704 |
||
24868 | 705 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
706 |
Outer_Syntax.command "defer" "shuffle internal proof state" |
36950 | 707 |
(Keyword.tag_proof Keyword.prf_script) |
708 |
(Scan.option Parse.nat >> (Toplevel.print oo (Toplevel.proofs o Proof.defer))); |
|
8165 | 709 |
|
24868 | 710 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
711 |
Outer_Syntax.command "prefer" "shuffle internal proof state" |
36950 | 712 |
(Keyword.tag_proof Keyword.prf_script) |
713 |
(Parse.nat >> (Toplevel.print oo (Toplevel.proofs o Proof.prefer))); |
|
8165 | 714 |
|
24868 | 715 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
716 |
Outer_Syntax.command "apply" "initial refinement step (unstructured)" |
36950 | 717 |
(Keyword.tag_proof Keyword.prf_script) |
22117 | 718 |
(Method.parse >> (Toplevel.print oo (Toplevel.proofs o Proof.apply))); |
5832 | 719 |
|
24868 | 720 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
721 |
Outer_Syntax.command "apply_end" "terminal refinement (unstructured)" |
36950 | 722 |
(Keyword.tag_proof Keyword.prf_script) |
22117 | 723 |
(Method.parse >> (Toplevel.print oo (Toplevel.proofs o Proof.apply_end))); |
5832 | 724 |
|
24868 | 725 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
726 |
Outer_Syntax.command "proof" "backward proof" |
36950 | 727 |
(Keyword.tag_proof Keyword.prf_block) |
22117 | 728 |
(Scan.option Method.parse >> (fn m => Toplevel.print o |
33390 | 729 |
Toplevel.actual_proof (Proof_Node.applys (Proof.proof m)) o |
27563 | 730 |
Toplevel.skip_proof (fn i => i + 1))); |
5832 | 731 |
|
732 |
||
6773 | 733 |
(* calculational proof commands *) |
734 |
||
6878 | 735 |
val calc_args = |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
736 |
Scan.option (Parse.$$$ "(" |-- Parse.!!! ((Parse_Spec.xthms1 --| Parse.$$$ ")"))); |
6878 | 737 |
|
24868 | 738 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
739 |
Outer_Syntax.command "also" "combine calculation and current facts" |
36950 | 740 |
(Keyword.tag_proof Keyword.prf_decl) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
741 |
(calc_args >> (Toplevel.proofs' o Calculation.also_cmd)); |
6773 | 742 |
|
24868 | 743 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
744 |
Outer_Syntax.command "finally" "combine calculation and current facts, exhibit result" |
36950 | 745 |
(Keyword.tag_proof Keyword.prf_chain) |
36323
655e2d74de3a
modernized naming conventions of main Isar proof elements;
wenzelm
parents:
36317
diff
changeset
|
746 |
(calc_args >> (Toplevel.proofs' o Calculation.finally_cmd)); |
6773 | 747 |
|
24868 | 748 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
749 |
Outer_Syntax.command "moreover" "augment calculation by current facts" |
36950 | 750 |
(Keyword.tag_proof Keyword.prf_decl) |
17900 | 751 |
(Scan.succeed (Toplevel.proof' Calculation.moreover)); |
8562 | 752 |
|
24868 | 753 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
754 |
Outer_Syntax.command "ultimately" "augment calculation by current facts, exhibit result" |
36950 | 755 |
(Keyword.tag_proof Keyword.prf_chain) |
17900 | 756 |
(Scan.succeed (Toplevel.proof' Calculation.ultimately)); |
8588 | 757 |
|
6773 | 758 |
|
6742 | 759 |
(* proof navigation *) |
5944 | 760 |
|
24868 | 761 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
762 |
Outer_Syntax.command "back" "backtracking of proof command" |
36950 | 763 |
(Keyword.tag_proof Keyword.prf_script) |
33390 | 764 |
(Scan.succeed (Toplevel.print o Toplevel.actual_proof Proof_Node.back o Toplevel.skip_proof I)); |
6742 | 765 |
|
22744
5cbe966d67a2
Isar definitions are now added explicitly to code theorem table
haftmann
parents:
22573
diff
changeset
|
766 |
|
27614
f38c25d106a7
renamed IsarCmd.nested_command to OuterSyntax.prepare_command;
wenzelm
parents:
27575
diff
changeset
|
767 |
(* nested commands *) |
25578 | 768 |
|
29309 | 769 |
val props_text = |
43775
b361c7d184e7
added Parse.properties (again) -- allow empty list like Parse_Value.properties but unlike Parse.properties of ef86de9c98aa;
wenzelm
parents:
43227
diff
changeset
|
770 |
Scan.optional Parse.properties [] -- Parse.position Parse.string |
36950 | 771 |
>> (fn (props, (str, pos)) => |
772 |
(Position.of_properties (Position.default_properties pos props), str)); |
|
29309 | 773 |
|
25578 | 774 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
775 |
Outer_Syntax.improper_command "Isabelle.command" "nested Isabelle command" Keyword.control |
29309 | 776 |
(props_text :|-- (fn (pos, str) => |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
777 |
(case Outer_Syntax.parse pos str of |
27838
0340fd7cccc3
Isabelle.command: inline former OuterSyntax.prepare_command;
wenzelm
parents:
27831
diff
changeset
|
778 |
[tr] => Scan.succeed (K tr) |
43947
9b00f09f7721
defer evaluation of Scan.message, for improved performance in the frequent situation where failure is handled later (e.g. via ||);
wenzelm
parents:
43775
diff
changeset
|
779 |
| _ => Scan.fail_with (K (fn () => "exactly one command expected"))) |
9b00f09f7721
defer evaluation of Scan.message, for improved performance in the frequent situation where failure is handled later (e.g. via ||);
wenzelm
parents:
43775
diff
changeset
|
780 |
handle ERROR msg => Scan.fail_with (K (fn () => msg)))); |
25578 | 781 |
|
782 |
||
22744
5cbe966d67a2
Isar definitions are now added explicitly to code theorem table
haftmann
parents:
22573
diff
changeset
|
783 |
|
5832 | 784 |
(** diagnostic commands (for interactive mode only) **) |
785 |
||
36950 | 786 |
val opt_modes = |
787 |
Scan.optional (Parse.$$$ "(" |-- Parse.!!! (Scan.repeat1 Parse.xname --| Parse.$$$ ")")) []; |
|
788 |
||
789 |
val opt_bang = Scan.optional (Parse.$$$ "!" >> K true) false; |
|
8464 | 790 |
|
24868 | 791 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
792 |
Outer_Syntax.improper_command "pretty_setmargin" "change default margin for pretty printing" |
38870 | 793 |
Keyword.diag (Parse.nat >> |
794 |
(fn n => Toplevel.no_timing o Toplevel.imperative (fn () => Pretty.margin_default := n))); |
|
7124 | 795 |
|
24868 | 796 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
797 |
Outer_Syntax.improper_command "help" "print outer syntax commands" Keyword.diag |
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
798 |
(Scan.succeed (Toplevel.no_timing o Toplevel.imperative Outer_Syntax.print_outer_syntax)); |
21714 | 799 |
|
24868 | 800 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
801 |
Outer_Syntax.improper_command "print_commands" "print outer syntax commands" Keyword.diag |
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
802 |
(Scan.succeed (Toplevel.no_timing o Toplevel.imperative Outer_Syntax.print_outer_syntax)); |
5832 | 803 |
|
24868 | 804 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
805 |
Outer_Syntax.improper_command "print_configs" "print configuration options" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
806 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_configs)); |
23989 | 807 |
|
24868 | 808 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
809 |
Outer_Syntax.improper_command "print_context" "print theory context name" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
810 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_context)); |
7308 | 811 |
|
24868 | 812 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
813 |
Outer_Syntax.improper_command "print_theory" "print logical theory contents (verbose!)" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
814 |
Keyword.diag (opt_bang >> (Toplevel.no_timing oo Isar_Cmd.print_theory)); |
5832 | 815 |
|
24868 | 816 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
817 |
Outer_Syntax.improper_command "print_syntax" "print inner syntax of context (verbose!)" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
818 |
Keyword.diag (Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_syntax)); |
5832 | 819 |
|
24868 | 820 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
821 |
Outer_Syntax.improper_command "print_abbrevs" "print constant abbreviation of context" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
822 |
Keyword.diag (Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_abbrevs)); |
21726 | 823 |
|
24868 | 824 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
825 |
Outer_Syntax.improper_command "print_theorems" |
36950 | 826 |
"print theorems of local theory or proof context" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
827 |
(opt_bang >> (Toplevel.no_timing oo Isar_Cmd.print_theorems)); |
5881 | 828 |
|
24868 | 829 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
830 |
Outer_Syntax.improper_command "print_locales" "print locales of this theory" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
831 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_locales)); |
12061 | 832 |
|
24868 | 833 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
834 |
Outer_Syntax.improper_command "print_classes" "print classes of this theory" Keyword.diag |
42359 | 835 |
(Scan.succeed (Toplevel.no_timing o Toplevel.unknown_theory o |
836 |
Toplevel.keep (Class.print_classes o Toplevel.context_of))); |
|
22744
5cbe966d67a2
Isar definitions are now added explicitly to code theorem table
haftmann
parents:
22573
diff
changeset
|
837 |
|
24868 | 838 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
839 |
Outer_Syntax.improper_command "print_locale" "print locale of this theory" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
840 |
(opt_bang -- Parse.xname >> (Toplevel.no_timing oo Isar_Cmd.print_locale)); |
12061 | 841 |
|
24868 | 842 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
843 |
Outer_Syntax.improper_command "print_interps" |
41435 | 844 |
"print interpretations of locale for this theory or proof context" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
845 |
(Parse.xname >> (Toplevel.no_timing oo Isar_Cmd.print_registrations)); |
32804
ca430e6aee1c
Propagation of mixins for interpretation; reactivated diagnostic command print_interps.
ballarin
parents:
31869
diff
changeset
|
846 |
|
ca430e6aee1c
Propagation of mixins for interpretation; reactivated diagnostic command print_interps.
ballarin
parents:
31869
diff
changeset
|
847 |
val _ = |
41435 | 848 |
Outer_Syntax.improper_command "print_dependencies" |
849 |
"print dependencies of locale expression" Keyword.diag |
|
850 |
(opt_bang -- Parse_Spec.locale_expression true >> |
|
851 |
(Toplevel.no_timing oo Isar_Cmd.print_dependencies)); |
|
852 |
||
853 |
val _ = |
|
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
854 |
Outer_Syntax.improper_command "print_attributes" "print attributes of this theory" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
855 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_attributes)); |
5832 | 856 |
|
24868 | 857 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
858 |
Outer_Syntax.improper_command "print_simpset" "print context of Simplifier" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
859 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_simpset)); |
16027 | 860 |
|
24868 | 861 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
862 |
Outer_Syntax.improper_command "print_rules" "print intro/elim rules" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
863 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_rules)); |
12383 | 864 |
|
24868 | 865 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
866 |
Outer_Syntax.improper_command "print_trans_rules" "print transitivity rules" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
867 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_trans_rules)); |
9221 | 868 |
|
24868 | 869 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
870 |
Outer_Syntax.improper_command "print_methods" "print methods of this theory" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
871 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_methods)); |
5832 | 872 |
|
24868 | 873 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
874 |
Outer_Syntax.improper_command "print_antiquotations" "print antiquotations (global)" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
875 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_antiquotations)); |
9221 | 876 |
|
24868 | 877 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
878 |
Outer_Syntax.improper_command "thy_deps" "visualize theory dependencies" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
879 |
Keyword.diag (Scan.succeed (Toplevel.no_timing o Isar_Cmd.thy_deps)); |
22485 | 880 |
|
24868 | 881 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
882 |
Outer_Syntax.improper_command "class_deps" "visualize class dependencies" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
883 |
Keyword.diag (Scan.succeed (Toplevel.no_timing o Isar_Cmd.class_deps)); |
20574 | 884 |
|
24868 | 885 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
886 |
Outer_Syntax.improper_command "thm_deps" "visualize theorem dependencies" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
887 |
Keyword.diag (Parse_Spec.xthms1 >> (Toplevel.no_timing oo Isar_Cmd.thm_deps)); |
9454 | 888 |
|
24868 | 889 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
890 |
Outer_Syntax.improper_command "print_binds" "print term bindings of proof context" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
891 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_binds)); |
5832 | 892 |
|
24868 | 893 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
894 |
Outer_Syntax.improper_command "print_facts" "print facts of proof context" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
895 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_facts)); |
5832 | 896 |
|
24868 | 897 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
898 |
Outer_Syntax.improper_command "print_cases" "print cases of proof context" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
899 |
(Scan.succeed (Toplevel.no_timing o Isar_Cmd.print_cases)); |
8370 | 900 |
|
24868 | 901 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
902 |
Outer_Syntax.improper_command "print_statement" "print theorems as long statements" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
903 |
(opt_modes -- Parse_Spec.xthms1 >> (Toplevel.no_timing oo Isar_Cmd.print_stmts)); |
19269 | 904 |
|
24868 | 905 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
906 |
Outer_Syntax.improper_command "thm" "print theorems" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
907 |
(opt_modes -- Parse_Spec.xthms1 >> (Toplevel.no_timing oo Isar_Cmd.print_thms)); |
5832 | 908 |
|
24868 | 909 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
910 |
Outer_Syntax.improper_command "prf" "print proof terms of theorems" Keyword.diag |
36952
338c3f8229e4
renamed structure SpecParse to Parse_Spec, keeping the old name as alias for some time;
wenzelm
parents:
36951
diff
changeset
|
911 |
(opt_modes -- Scan.option Parse_Spec.xthms1 |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
912 |
>> (Toplevel.no_timing oo Isar_Cmd.print_prfs false)); |
11524
197f2e14a714
Added functions for printing primitive proof terms.
berghofe
parents:
11101
diff
changeset
|
913 |
|
24868 | 914 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
915 |
Outer_Syntax.improper_command "full_prf" "print full proof terms of theorems" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
916 |
(opt_modes -- Scan.option Parse_Spec.xthms1 >> (Toplevel.no_timing oo Isar_Cmd.print_prfs true)); |
11524
197f2e14a714
Added functions for printing primitive proof terms.
berghofe
parents:
11101
diff
changeset
|
917 |
|
24868 | 918 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
919 |
Outer_Syntax.improper_command "prop" "read and print proposition" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
920 |
(opt_modes -- Parse.term >> (Toplevel.no_timing oo Isar_Cmd.print_prop)); |
5832 | 921 |
|
24868 | 922 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
923 |
Outer_Syntax.improper_command "term" "read and print term" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
924 |
(opt_modes -- Parse.term >> (Toplevel.no_timing oo Isar_Cmd.print_term)); |
5832 | 925 |
|
24868 | 926 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
927 |
Outer_Syntax.improper_command "typ" "read and print type" Keyword.diag |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
928 |
(opt_modes -- Parse.typ >> (Toplevel.no_timing oo Isar_Cmd.print_type)); |
5832 | 929 |
|
24868 | 930 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
931 |
Outer_Syntax.improper_command "print_codesetup" "print code generator setup" Keyword.diag |
22744
5cbe966d67a2
Isar definitions are now added explicitly to code theorem table
haftmann
parents:
22573
diff
changeset
|
932 |
(Scan.succeed |
5cbe966d67a2
Isar definitions are now added explicitly to code theorem table
haftmann
parents:
22573
diff
changeset
|
933 |
(Toplevel.no_timing o Toplevel.unknown_theory o Toplevel.keep |
24219 | 934 |
(Code.print_codesetup o Toplevel.theory_of))); |
5832 | 935 |
|
26184 | 936 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
937 |
Outer_Syntax.improper_command "unused_thms" "find unused theorems" Keyword.diag |
36950 | 938 |
(Scan.option ((Scan.repeat1 (Scan.unless Parse.minus Parse.name) --| Parse.minus) -- |
939 |
Scan.option (Scan.repeat1 (Scan.unless Parse.minus Parse.name))) >> |
|
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
940 |
(Toplevel.no_timing oo Isar_Cmd.unused_thms)); |
26184 | 941 |
|
5832 | 942 |
|
30142
8d6145694bb5
moved find_theorems.ML and find_consts.ML to Pure/Tools, collecting main implementation in one place each;
wenzelm
parents:
29882
diff
changeset
|
943 |
|
5832 | 944 |
(** system commands (for interactive mode only) **) |
945 |
||
24868 | 946 |
val _ = |
40395
4985aaade799
mark 'cd' and 'commit' as control command -- not usable in asynchronous document model, likely to cause confusion in Proof General;
wenzelm
parents:
39214
diff
changeset
|
947 |
Outer_Syntax.improper_command "cd" "change current working directory" Keyword.control |
4985aaade799
mark 'cd' and 'commit' as control command -- not usable in asynchronous document model, likely to cause confusion in Proof General;
wenzelm
parents:
39214
diff
changeset
|
948 |
(Parse.path >> (fn path => Toplevel.no_timing o Toplevel.imperative (fn () => File.cd path))); |
5832 | 949 |
|
24868 | 950 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
951 |
Outer_Syntax.improper_command "pwd" "print current working directory" Keyword.diag |
40395
4985aaade799
mark 'cd' and 'commit' as control command -- not usable in asynchronous document model, likely to cause confusion in Proof General;
wenzelm
parents:
39214
diff
changeset
|
952 |
(Scan.succeed (Toplevel.no_timing o |
41944
b97091ae583a
Path.print is the official way to show file-system paths to users -- note that Path.implode often indicates violation of the abstract datatype;
wenzelm
parents:
41585
diff
changeset
|
953 |
Toplevel.imperative (fn () => writeln (Path.print (File.pwd ()))))); |
5832 | 954 |
|
24868 | 955 |
val _ = |
37987
aac4eb1fa1d8
explicit Keyword.control markup for various control commands -- to prevent them from occurring in proof documents;
wenzelm
parents:
37981
diff
changeset
|
956 |
Outer_Syntax.improper_command "use_thy" "use theory file" Keyword.control |
36950 | 957 |
(Parse.name >> (fn name => |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
958 |
Toplevel.no_timing o Toplevel.imperative (fn () => Thy_Info.use_thy name))); |
5832 | 959 |
|
24868 | 960 |
val _ = |
37987
aac4eb1fa1d8
explicit Keyword.control markup for various control commands -- to prevent them from occurring in proof documents;
wenzelm
parents:
37981
diff
changeset
|
961 |
Outer_Syntax.improper_command "remove_thy" "remove theory from loader database" Keyword.control |
36950 | 962 |
(Parse.name >> (fn name => |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
963 |
Toplevel.no_timing o Toplevel.imperative (fn () => Thy_Info.remove_thy name))); |
7102 | 964 |
|
24868 | 965 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
966 |
Outer_Syntax.improper_command "kill_thy" "kill theory -- try to remove from loader database" |
37987
aac4eb1fa1d8
explicit Keyword.control markup for various control commands -- to prevent them from occurring in proof documents;
wenzelm
parents:
37981
diff
changeset
|
967 |
Keyword.control (Parse.name >> (fn name => |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
968 |
Toplevel.no_timing o Toplevel.imperative (fn () => Thy_Info.kill_thy name))); |
7931 | 969 |
|
24868 | 970 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
971 |
Outer_Syntax.improper_command "display_drafts" "display raw source files with symbols" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
972 |
Keyword.diag (Scan.repeat1 Parse.path >> (Toplevel.no_timing oo Isar_Cmd.display_drafts)); |
14934 | 973 |
|
24868 | 974 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
975 |
Outer_Syntax.improper_command "print_drafts" "print raw source files with symbols" |
37216
3165bc303f66
modernized some structure names, keeping a few legacy aliases;
wenzelm
parents:
37198
diff
changeset
|
976 |
Keyword.diag (Scan.repeat1 Parse.path >> (Toplevel.no_timing oo Isar_Cmd.print_drafts)); |
14934 | 977 |
|
39165 | 978 |
val _ = (* FIXME tty only *) |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
979 |
Outer_Syntax.improper_command "pr" "print current proof state (if present)" Keyword.diag |
39165 | 980 |
(opt_modes -- Scan.option Parse.nat >> (fn (modes, limit) => |
981 |
Toplevel.no_timing o Toplevel.keep (fn state => |
|
982 |
(case limit of NONE => () | SOME n => Goal_Display.goals_limit_default := n; |
|
983 |
Toplevel.quiet := false; |
|
984 |
Print_Mode.with_modes modes (Toplevel.print_state true) state)))); |
|
7199 | 985 |
|
24868 | 986 |
val _ = |
37987
aac4eb1fa1d8
explicit Keyword.control markup for various control commands -- to prevent them from occurring in proof documents;
wenzelm
parents:
37981
diff
changeset
|
987 |
Outer_Syntax.improper_command "disable_pr" "disable printing of toplevel state" Keyword.control |
39165 | 988 |
(Scan.succeed (Toplevel.no_timing o Toplevel.imperative (fn () => Toplevel.quiet := true))); |
5832 | 989 |
|
24868 | 990 |
val _ = |
37987
aac4eb1fa1d8
explicit Keyword.control markup for various control commands -- to prevent them from occurring in proof documents;
wenzelm
parents:
37981
diff
changeset
|
991 |
Outer_Syntax.improper_command "enable_pr" "enable printing of toplevel state" Keyword.control |
39165 | 992 |
(Scan.succeed (Toplevel.no_timing o Toplevel.imperative (fn () => Toplevel.quiet := false))); |
7222 | 993 |
|
24868 | 994 |
val _ = |
40395
4985aaade799
mark 'cd' and 'commit' as control command -- not usable in asynchronous document model, likely to cause confusion in Proof General;
wenzelm
parents:
39214
diff
changeset
|
995 |
Outer_Syntax.improper_command "commit" "commit current session to ML database" Keyword.control |
36950 | 996 |
(Parse.opt_unit >> K (Toplevel.no_timing o Toplevel.imperative Secure.commit)); |
5832 | 997 |
|
24868 | 998 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
999 |
Outer_Syntax.improper_command "quit" "quit Isabelle" Keyword.control |
37977
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37949
diff
changeset
|
1000 |
(Parse.opt_unit >> (Toplevel.no_timing oo K (Toplevel.imperative quit))); |
5832 | 1001 |
|
24868 | 1002 |
val _ = |
36953
2af1ad9aa1a3
renamed structure OuterSyntax to Outer_Syntax, keeping the old name as alias for some time;
wenzelm
parents:
36952
diff
changeset
|
1003 |
Outer_Syntax.improper_command "exit" "exit Isar loop" Keyword.control |
37977
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37949
diff
changeset
|
1004 |
(Scan.succeed |
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37949
diff
changeset
|
1005 |
(Toplevel.no_timing o Toplevel.keep (fn state => |
3ceccd415145
simplified/clarified theory loader: more explicit task management, kill old versions at start, commit results only in the very end, non-optional master dependency, do not store text in deps;
wenzelm
parents:
37949
diff
changeset
|
1006 |
(Context.set_thread_data (try Toplevel.generic_theory_of state); |
38888
8248cda328de
moved Toplevel.run_command to Pure/PIDE/document.ML;
wenzelm
parents:
38870
diff
changeset
|
1007 |
raise Runtime.TERMINATE)))); |
5832 | 1008 |
|
1009 |
end; |
|
27614
f38c25d106a7
renamed IsarCmd.nested_command to OuterSyntax.prepare_command;
wenzelm
parents:
27575
diff
changeset
|
1010 |