112 |
112 |
113 text \<open> |
113 text \<open> |
114 \begin{matharray}{rcll} |
114 \begin{matharray}{rcll} |
115 @{command_def "context"} & : & @{text "theory \<rightarrow> local_theory"} \\ |
115 @{command_def "context"} & : & @{text "theory \<rightarrow> local_theory"} \\ |
116 @{command_def (local) "end"} & : & @{text "local_theory \<rightarrow> theory"} \\ |
116 @{command_def (local) "end"} & : & @{text "local_theory \<rightarrow> theory"} \\ |
|
117 @{keyword_def "private"} \\ |
117 \end{matharray} |
118 \end{matharray} |
118 |
119 |
119 A local theory target is a specification context that is managed |
120 A local theory target is a specification context that is managed |
120 separately within the enclosing theory. Contexts may introduce parameters |
121 separately within the enclosing theory. Contexts may introduce parameters |
121 (fixed variables) and assumptions (hypotheses). Definitions and theorems |
122 (fixed variables) and assumptions (hypotheses). Definitions and theorems |
158 \item @{command (local) "end"} concludes the current local theory, |
159 \item @{command (local) "end"} concludes the current local theory, |
159 according to the nesting of contexts. Note that a global @{command |
160 according to the nesting of contexts. Note that a global @{command |
160 (global) "end"} has a different meaning: it concludes the theory |
161 (global) "end"} has a different meaning: it concludes the theory |
161 itself (\secref{sec:begin-thy}). |
162 itself (\secref{sec:begin-thy}). |
162 |
163 |
|
164 \item @{keyword "private"} may be given as a modifier to any local theory |
|
165 command (before the command keyword). This limits name space accesses to |
|
166 the current local scope, as determined by the enclosing @{command |
|
167 "context"}~@{keyword "begin"}~\dots~@{command "end"} block. Neither a |
|
168 global theory nor a locale target have such a local scope by themselves: |
|
169 an extra unnamed context is required to use @{keyword "private"} here. |
|
170 |
163 \item @{text "("}@{keyword_def "in"}~@{text "c)"} given after any local |
171 \item @{text "("}@{keyword_def "in"}~@{text "c)"} given after any local |
164 theory command specifies an immediate target, e.g.\ ``@{command |
172 theory command specifies an immediate target, e.g.\ ``@{command |
165 "definition"}~@{text "(\<IN> c)"}'' or ``@{command "theorem"}~@{text |
173 "definition"}~@{text "(\<IN> c)"}'' or ``@{command "theorem"}~@{text |
166 "(\<IN> c)"}''. This works both in a local or global theory context; the |
174 "(\<IN> c)"}''. This works both in a local or global theory context; the |
167 current target context will be suspended for this command only. Note that |
175 current target context will be suspended for this command only. Note that |