src/Pure/Isar/isar_syn.ML
changeset 15596 8665d08085df
parent 15570 8d8c70b41bab
child 15598 4ab52355bb53
equal deleted inserted replaced
15595:dc8a41c7cefc 15596:8665d08085df
   308   OuterSyntax.command "locale" "define named proof context" K.thy_decl
   308   OuterSyntax.command "locale" "define named proof context" K.thy_decl
   309     ((P.opt_keyword "open" >> not) -- P.name
   309     ((P.opt_keyword "open" >> not) -- P.name
   310         -- Scan.optional (P.$$$ "=" |-- P.!!! locale_val) (Locale.empty, [])
   310         -- Scan.optional (P.$$$ "=" |-- P.!!! locale_val) (Locale.empty, [])
   311       >> (Toplevel.theory o IsarThy.add_locale o (fn ((x, y), (z, w)) => (x, y, z, w))));
   311       >> (Toplevel.theory o IsarThy.add_locale o (fn ((x, y), (z, w)) => (x, y, z, w))));
   312 
   312 
       
   313 val uterm = P.underscore >> K NONE || P.term >> SOME;
       
   314 
       
   315 val view_val =
       
   316   Scan.optional (P.$$$ "[" |-- Scan.repeat1 uterm --| P.$$$ "]") [];
       
   317 
       
   318 val registrationP =
       
   319   OuterSyntax.command "registration"
       
   320   "prove and register instance of locale expression" K.thy_goal
       
   321   ((P.opt_thm_name ":" -- P.locale_expr -- P.!!! view_val
       
   322      >> IsarThy.register_globally)
       
   323    >> (Toplevel.print oo Toplevel.theory_to_proof));
   313 
   324 
   314 
   325 
   315 (** proof commands **)
   326 (** proof commands **)
   316 
   327 
   317 (* statements *)
   328 (* statements *)
   577 val print_localesP =
   588 val print_localesP =
   578   OuterSyntax.improper_command "print_locales" "print locales of this theory" K.diag
   589   OuterSyntax.improper_command "print_locales" "print locales of this theory" K.diag
   579     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_locales));
   590     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_locales));
   580 
   591 
   581 val print_localeP =
   592 val print_localeP =
   582   OuterSyntax.improper_command "print_locale" "print named locale of this theory" K.diag
   593   OuterSyntax.improper_command "print_locale" "print locale expression in this theory" K.diag
   583     (locale_val >> (Toplevel.no_timing oo IsarCmd.print_locale));
   594     (locale_val >> (Toplevel.no_timing oo IsarCmd.print_locale));
       
   595 
       
   596 val print_registrationsP =
       
   597   OuterSyntax.improper_command "print_registrations"
       
   598     "print registrations of named locale in this theory" K.diag
       
   599     (P.xname >> (Toplevel.no_timing oo IsarCmd.print_registrations));
   584 
   600 
   585 val print_attributesP =
   601 val print_attributesP =
   586   OuterSyntax.improper_command "print_attributes" "print attributes of this theory" K.diag
   602   OuterSyntax.improper_command "print_attributes" "print attributes of this theory" K.diag
   587     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_attributes));
   603     (Scan.succeed (Toplevel.no_timing o IsarCmd.print_attributes));
   588 
   604 
   782   assumeP, presumeP, defP, obtainP, letP, caseP, thenP, fromP, withP,
   798   assumeP, presumeP, defP, obtainP, letP, caseP, thenP, fromP, withP,
   783   noteP, usingP, beginP, endP, nextP, qedP, terminal_proofP,
   799   noteP, usingP, beginP, endP, nextP, qedP, terminal_proofP,
   784   default_proofP, immediate_proofP, done_proofP, skip_proofP,
   800   default_proofP, immediate_proofP, done_proofP, skip_proofP,
   785   forget_proofP, deferP, preferP, applyP, apply_endP, proofP, alsoP,
   801   forget_proofP, deferP, preferP, applyP, apply_endP, proofP, alsoP,
   786   finallyP, moreoverP, ultimatelyP, backP, cannot_undoP, clear_undosP,
   802   finallyP, moreoverP, ultimatelyP, backP, cannot_undoP, clear_undosP,
   787   redoP, undos_proofP, undoP, killP, instantiateP,
   803   redoP, undos_proofP, undoP, killP, registrationP, instantiateP,
   788   (*diagnostic commands*)
   804   (*diagnostic commands*)
   789   pretty_setmarginP, print_commandsP, print_contextP, print_theoryP,
   805   pretty_setmarginP, print_commandsP, print_contextP, print_theoryP,
   790   print_syntaxP, print_theoremsP, print_localesP, print_localeP,
   806   print_syntaxP, print_theoremsP, print_localesP, print_localeP,
       
   807   print_registrationsP,
   791   print_attributesP, print_rulesP, print_induct_rulesP,
   808   print_attributesP, print_rulesP, print_induct_rulesP,
   792   print_trans_rulesP, print_methodsP, print_antiquotationsP,
   809   print_trans_rulesP, print_methodsP, print_antiquotationsP,
   793   thms_containingP, thm_depsP, print_bindsP, print_lthmsP,
   810   thms_containingP, thm_depsP, print_bindsP, print_lthmsP,
   794   print_casesP, print_introsP, print_thmsP, print_prfsP, print_full_prfsP,
   811   print_casesP, print_introsP, print_thmsP, print_prfsP, print_full_prfsP,
   795   print_propP, print_termP, print_typeP,
   812   print_propP, print_termP, print_typeP,