diff -r d9e3161080f9 -r 6fefd6c602fa src/Doc/Isar_Ref/Spec.thy --- a/src/Doc/Isar_Ref/Spec.thy Fri Oct 04 13:22:35 2024 +0200 +++ b/src/Doc/Isar_Ref/Spec.thy Fri Oct 04 13:29:33 2024 +0200 @@ -211,10 +211,12 @@ \begin{matharray}{rcl} @{command_def "bundle"} & : & \local_theory \ local_theory\ \\ @{command "bundle"} & : & \theory \ local_theory\ \\ + @{command_def "unbundle"} & : & \local_theory \ local_theory\ \\ @{command_def "print_bundles"}\\<^sup>*\ & : & \context \\ \\ @{command_def "include"} & : & \proof(state) \ proof(state)\ \\ @{command_def "including"} & : & \proof(prove) \ proof(prove)\ \\ @{keyword_def "includes"} & : & syntax \\ + @{keyword_def "opening"} & : & syntax \\ \end{matharray} The outer syntax of fact expressions (\secref{sec:syn-att}) involves @@ -234,15 +236,17 @@ (@@{command bundle} | @@{command open_bundle}) @{syntax name} \ ( '=' @{syntax thms} @{syntax for_fixes} | @'begin') ; + @@{command unbundle} @{syntax bundles} + ; @@{command print_bundles} ('!'?) ; - (@@{command include} | @@{command including}) (@{syntax name}+) + (@@{command include} | @@{command including}) @{syntax bundles} ; - @{syntax_def "includes"}: @'includes' (@{syntax name}+) + @{syntax_def "includes"}: @'includes' @{syntax bundles} ; - @{syntax_def "opening"}: @'opening' (@{syntax name}+) + @{syntax_def "opening"}: @'opening' @{syntax bundles} ; - @@{command unbundle} (@{syntax name}+) + @{syntax bundles}: @{syntax name} + @'and' \ \<^descr> \<^theory_text>\bundle b = decls\ defines a bundle of declarations in the current @@ -259,32 +263,31 @@ bindings are not recorded in the bundle. \<^descr> \<^theory_text>\open_bundle b\ is like \<^theory_text>\bundle b\ followed by \<^theory_text>\unbundle b\, so its - declarations are applied immediately, but also named for later re-use. + declarations are activated immediately, but also named for later re-use. + + \<^descr> \<^theory_text>\unbundle \<^vec>b\ activates the declarations from the given bundles in + the current local theory context. This is analogous to \<^theory_text>\lemmas\ + (\secref{sec:theorems}) with the expanded bundles. \<^descr> \<^theory_text>\print_bundles\ prints the named bundles that are available in the current context; the ``\!\'' option indicates extra verbosity. - \<^descr> \<^theory_text>\include b\<^sub>1 \ b\<^sub>n\ activates the declarations from the given bundles - in a proof body (forward mode). This is analogous to \<^theory_text>\note\ + \<^descr> \<^theory_text>\include \<^vec>b\ activates the declarations from the given bundles in a + proof body (forward mode). This is analogous to \<^theory_text>\note\ + (\secref{sec:proof-facts}) with the expanded bundles. + + \<^descr> \<^theory_text>\including \<^vec>b\ is similar to \<^theory_text>\include\, but works in proof + refinement (backward mode). This is analogous to \<^theory_text>\using\ (\secref{sec:proof-facts}) with the expanded bundles. - \<^descr> \<^theory_text>\including b\<^sub>1 \ b\<^sub>n\ is similar to \<^theory_text>\include\, but works in proof refinement - (backward mode). This is analogous to \<^theory_text>\using\ (\secref{sec:proof-facts}) - with the expanded bundles. - - \<^descr> \<^theory_text>\includes b\<^sub>1 \ b\<^sub>n\ is similar to \<^theory_text>\include\, but applies to a - confined specification context: unnamed \<^theory_text>\context\s and - long statements of \<^theory_text>\theorem\. + \<^descr> \<^theory_text>\includes \<^vec>b\ is similar to \<^theory_text>\include\, but applies to a confined + specification context: unnamed \<^theory_text>\context\s and long statements of + \<^theory_text>\theorem\. - \<^descr> \<^theory_text>\opening b\<^sub>1 \ b\<^sub>n\ is similar to \<^theory_text>\includes\, but applies to - a named specification context: \<^theory_text>\locale\s, \<^theory_text>\class\es and - named \<^theory_text>\context\s. The effect is confined to the surface context within the - specification block itself and the corresponding \<^theory_text>\begin\ / \<^theory_text>\end\ block. - - \<^descr> \<^theory_text>\unbundle b\<^sub>1 \ b\<^sub>n\ activates the declarations from the given bundles in - the current local theory context. This is analogous to \<^theory_text>\lemmas\ - (\secref{sec:theorems}) with the expanded bundles. - + \<^descr> \<^theory_text>\opening \<^vec>b\ is similar to \<^theory_text>\includes\, but applies to a named + specification context: \<^theory_text>\locale\s, \<^theory_text>\class\es and named \<^theory_text>\context\s. The + effect is confined to the surface context within the specification block + itself and the corresponding \<^theory_text>\begin\ / \<^theory_text>\end\ block. Here is an artificial example of bundling various configuration options: \