17 OuterSyntax.command "theory" "begin theory" (K.tag_theory K.thy_begin) |
17 OuterSyntax.command "theory" "begin theory" (K.tag_theory K.thy_begin) |
18 (ThyHeader.args >> (Toplevel.print oo IsarThy.theory)); |
18 (ThyHeader.args >> (Toplevel.print oo IsarThy.theory)); |
19 |
19 |
20 val endP = |
20 val endP = |
21 OuterSyntax.command "end" "end (local) theory" (K.tag_theory K.thy_end) |
21 OuterSyntax.command "end" "end (local) theory" (K.tag_theory K.thy_end) |
22 (Scan.succeed (Toplevel.print o Toplevel.exit o Toplevel.exit_local_theory)); |
22 (Scan.succeed (Toplevel.exit o Toplevel.exit_local_theory)); |
23 |
23 |
24 val contextP = |
24 val contextP = |
25 OuterSyntax.improper_command "context" "switch (local) theory context" |
25 OuterSyntax.improper_command "context" "switch (local) theory context" |
26 (K.tag_theory K.thy_switch) |
26 (K.tag_theory K.thy_switch) |
27 (P.name >> (Toplevel.print oo IsarThy.context)); |
27 (P.name --| P.begin >> (fn name => |
28 |
28 Toplevel.print o IsarThy.context name o |
|
29 Toplevel.begin_local_theory true (TheoryTarget.init (SOME name)))); |
29 |
30 |
30 |
31 |
31 (** markup commands **) |
32 (** markup commands **) |
32 |
33 |
33 val headerP = OuterSyntax.markup_command IsarOutput.Markup "header" "theory header" K.diag |
34 val headerP = OuterSyntax.markup_command IsarOutput.Markup "header" "theory header" K.diag |
355 OuterSyntax.command "locale" "define named proof context" K.thy_decl |
356 OuterSyntax.command "locale" "define named proof context" K.thy_decl |
356 ((P.opt_keyword "open" >> not) -- P.name |
357 ((P.opt_keyword "open" >> not) -- P.name |
357 -- Scan.optional (P.$$$ "=" |-- P.!!! locale_val) (Locale.empty, []) |
358 -- Scan.optional (P.$$$ "=" |-- P.!!! locale_val) (Locale.empty, []) |
358 -- P.opt_begin |
359 -- P.opt_begin |
359 >> (fn (((is_open, name), (expr, elems)), begin) => |
360 >> (fn (((is_open, name), (expr, elems)), begin) => |
360 Toplevel.begin_local_theory begin (Locale.add_locale is_open name expr elems))); |
361 Toplevel.begin_local_theory begin |
|
362 (Locale.add_locale is_open name expr elems #-> TheoryTarget.begin))); |
361 |
363 |
362 val interpretationP = |
364 val interpretationP = |
363 OuterSyntax.command "interpretation" |
365 OuterSyntax.command "interpretation" |
364 "prove and register interpretation of locale expression in theory or locale" K.thy_goal |
366 "prove and register interpretation of locale expression in theory or locale" K.thy_goal |
365 (P.xname --| (P.$$$ "\\<subseteq>" || P.$$$ "<") -- P.!!! P.locale_expr |
367 (P.xname --| (P.$$$ "\\<subseteq>" || P.$$$ "<") -- P.!!! P.locale_expr |
915 assumeP, presumeP, defP, obtainP, guessP, letP, caseP, thenP, fromP, |
913 assumeP, presumeP, defP, obtainP, guessP, letP, caseP, thenP, fromP, |
916 withP, noteP, usingP, unfoldingP, begin_blockP, end_blockP, nextP, |
914 withP, noteP, usingP, unfoldingP, begin_blockP, end_blockP, nextP, |
917 qedP, terminal_proofP, default_proofP, immediate_proofP, |
915 qedP, terminal_proofP, default_proofP, immediate_proofP, |
918 done_proofP, skip_proofP, forget_proofP, deferP, preferP, applyP, |
916 done_proofP, skip_proofP, forget_proofP, deferP, preferP, applyP, |
919 apply_endP, proofP, alsoP, finallyP, moreoverP, ultimatelyP, backP, |
917 apply_endP, proofP, alsoP, finallyP, moreoverP, ultimatelyP, backP, |
920 cannot_undoP, undo_endP, clear_undosP, redoP, undos_proofP, undoP, |
918 cannot_undoP, clear_undosP, redoP, undos_proofP, undoP, killP, |
921 killP, interpretationP, interpretP, |
919 interpretationP, interpretP, |
922 (*diagnostic commands*) |
920 (*diagnostic commands*) |
923 pretty_setmarginP, print_commandsP, print_contextP, print_theoryP, |
921 pretty_setmarginP, print_commandsP, print_contextP, print_theoryP, |
924 print_syntaxP, print_theoremsP, print_localesP, print_localeP, |
922 print_syntaxP, print_theoremsP, print_localesP, print_localeP, |
925 print_registrationsP, print_attributesP, print_simpsetP, |
923 print_registrationsP, print_attributesP, print_simpsetP, |
926 print_rulesP, print_induct_rulesP, print_trans_rulesP, |
924 print_rulesP, print_induct_rulesP, print_trans_rulesP, |