39 val is_keyword: keywords -> string -> bool |
41 val is_keyword: keywords -> string -> bool |
40 val is_command: keywords -> string -> bool |
42 val is_command: keywords -> string -> bool |
41 val is_literal: keywords -> string -> bool |
43 val is_literal: keywords -> string -> bool |
42 val command_files: keywords -> string -> Path.T -> Path.T list |
44 val command_files: keywords -> string -> Path.T -> Path.T list |
43 val command_tags: keywords -> string -> string list |
45 val command_tags: keywords -> string -> string list |
|
46 val is_vacuous: keywords -> string -> bool |
44 val is_diag: keywords -> string -> bool |
47 val is_diag: keywords -> string -> bool |
45 val is_heading: keywords -> string -> bool |
48 val is_document_heading: keywords -> string -> bool |
|
49 val is_document_body: keywords -> string -> bool |
|
50 val is_document_raw: keywords -> string -> bool |
46 val is_theory_begin: keywords -> string -> bool |
51 val is_theory_begin: keywords -> string -> bool |
47 val is_theory_load: keywords -> string -> bool |
52 val is_theory_load: keywords -> string -> bool |
48 val is_theory: keywords -> string -> bool |
53 val is_theory: keywords -> string -> bool |
49 val is_theory_body: keywords -> string -> bool |
54 val is_theory_body: keywords -> string -> bool |
50 val is_proof: keywords -> string -> bool |
55 val is_proof: keywords -> string -> bool |
62 (** keyword classification **) |
67 (** keyword classification **) |
63 |
68 |
64 (* kinds *) |
69 (* kinds *) |
65 |
70 |
66 val diag = "diag"; |
71 val diag = "diag"; |
67 val heading = "heading"; |
72 val document_heading = "document_heading"; |
|
73 val document_body = "document_body"; |
|
74 val document_raw = "document_raw"; |
68 val thy_begin = "thy_begin"; |
75 val thy_begin = "thy_begin"; |
69 val thy_end = "thy_end"; |
76 val thy_end = "thy_end"; |
70 val thy_decl = "thy_decl"; |
77 val thy_decl = "thy_decl"; |
71 val thy_decl_block = "thy_decl_block"; |
78 val thy_decl_block = "thy_decl_block"; |
72 val thy_load = "thy_load"; |
79 val thy_load = "thy_load"; |
85 val prf_asm_goal = "prf_asm_goal"; |
92 val prf_asm_goal = "prf_asm_goal"; |
86 val prf_asm_goal_script = "prf_asm_goal_script"; |
93 val prf_asm_goal_script = "prf_asm_goal_script"; |
87 val prf_script = "prf_script"; |
94 val prf_script = "prf_script"; |
88 |
95 |
89 val kinds = |
96 val kinds = |
90 [diag, heading, thy_begin, thy_end, thy_load, thy_decl, thy_decl_block, thy_goal, |
97 [diag, document_heading, document_body, document_raw, thy_begin, thy_end, thy_load, thy_decl, |
91 qed, qed_script, qed_block, qed_global, prf_goal, prf_block, prf_open, prf_close, |
98 thy_decl_block, thy_goal, qed, qed_script, qed_block, qed_global, prf_goal, prf_block, prf_open, |
92 prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_asm_goal_script, prf_script]; |
99 prf_close, prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_asm_goal_script, prf_script]; |
93 |
100 |
94 |
101 |
95 (* specifications *) |
102 (* specifications *) |
96 |
103 |
97 type T = |
104 type T = |
194 (case command_kind keywords name of |
201 (case command_kind keywords name of |
195 NONE => false |
202 NONE => false |
196 | SOME {kind, ...} => Symtab.defined tab kind); |
203 | SOME {kind, ...} => Symtab.defined tab kind); |
197 in pred end; |
204 in pred end; |
198 |
205 |
|
206 val is_vacuous = command_category [diag, document_heading, document_body, document_raw]; |
|
207 |
199 val is_diag = command_category [diag]; |
208 val is_diag = command_category [diag]; |
200 |
209 |
201 val is_heading = command_category [heading]; |
210 val is_document_heading = command_category [document_heading]; |
|
211 val is_document_body = command_category [document_body]; |
|
212 val is_document_raw = command_category [document_raw]; |
|
213 val is_document = command_category [document_heading, document_body, document_raw]; |
202 |
214 |
203 val is_theory_begin = command_category [thy_begin]; |
215 val is_theory_begin = command_category [thy_begin]; |
204 |
216 |
205 val is_theory_load = command_category [thy_load]; |
217 val is_theory_load = command_category [thy_load]; |
206 |
218 |
213 val is_proof = command_category |
225 val is_proof = command_category |
214 [qed, qed_script, qed_block, qed_global, prf_goal, prf_block, prf_open, prf_close, |
226 [qed, qed_script, qed_block, qed_global, prf_goal, prf_block, prf_open, prf_close, |
215 prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_asm_goal_script, prf_script]; |
227 prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_asm_goal_script, prf_script]; |
216 |
228 |
217 val is_proof_body = command_category |
229 val is_proof_body = command_category |
218 [diag, heading, prf_block, prf_open, prf_close, prf_chain, prf_decl, prf_asm, |
230 [diag, document_heading, document_body, document_raw, prf_block, prf_open, prf_close, |
219 prf_asm_goal, prf_asm_goal_script, prf_script]; |
231 prf_chain, prf_decl, prf_asm, prf_asm_goal, prf_asm_goal_script, prf_script]; |
220 |
232 |
221 val is_theory_goal = command_category [thy_goal]; |
233 val is_theory_goal = command_category [thy_goal]; |
222 val is_proof_goal = command_category [prf_goal, prf_asm_goal, prf_asm_goal_script]; |
234 val is_proof_goal = command_category [prf_goal, prf_asm_goal, prf_asm_goal_script]; |
223 val is_qed = command_category [qed, qed_script, qed_block]; |
235 val is_qed = command_category [qed, qed_script, qed_block]; |
224 val is_qed_global = command_category [qed_global]; |
236 val is_qed_global = command_category [qed_global]; |