1309 |
1309 |
1310 section \<open>Name spaces\<close> |
1310 section \<open>Name spaces\<close> |
1311 |
1311 |
1312 text \<open> |
1312 text \<open> |
1313 \begin{matharray}{rcl} |
1313 \begin{matharray}{rcl} |
|
1314 @{command_def "alias"} & : & \<open>local_theory \<rightarrow> local_theory\<close> \\ |
|
1315 @{command_def "type_alias"} & : & \<open>local_theory \<rightarrow> local_theory\<close> \\ |
1314 @{command_def "hide_class"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1316 @{command_def "hide_class"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1315 @{command_def "hide_type"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1317 @{command_def "hide_type"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1316 @{command_def "hide_const"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1318 @{command_def "hide_const"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1317 @{command_def "hide_fact"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1319 @{command_def "hide_fact"} & : & \<open>theory \<rightarrow> theory\<close> \\ |
1318 \end{matharray} |
1320 \end{matharray} |
1319 |
1321 |
1320 @{rail \<open> |
1322 @{rail \<open> |
1321 ( @{command hide_class} | @{command hide_type} | |
1323 (@{command alias} | @{command type_alias}) @{syntax name} '=' @{syntax name} |
1322 @{command hide_const} | @{command hide_fact} ) ('(' @'open' ')')? (@{syntax name} + ) |
1324 ; |
|
1325 (@{command hide_class} | @{command hide_type} | |
|
1326 @{command hide_const} | @{command hide_fact}) ('(' @'open' ')')? (@{syntax name} + ) |
1323 \<close>} |
1327 \<close>} |
1324 |
1328 |
1325 Isabelle organizes any kind of name declarations (of types, constants, |
1329 Isabelle organizes any kind of name declarations (of types, constants, |
1326 theorems etc.) by separate hierarchically structured name spaces. Normally |
1330 theorems etc.) by separate hierarchically structured name spaces. Normally |
1327 the user does not have to control the behaviour of name spaces by hand, yet |
1331 the user does not have to control the behaviour of name spaces by hand, yet |
1328 the following commands provide some way to do so. |
1332 the following commands provide some way to do so. |
1329 |
1333 |
|
1334 \<^descr> \<^theory_text>\<open>alias\<close> and \<^theory_text>\<open>type_alias\<close> introduce aliases for constants and type |
|
1335 constructors, respectively. This allows adhoc changes to name-space |
|
1336 accesses. |
|
1337 |
|
1338 \<^descr> \<^theory_text>\<open>type_alias b = c\<close> introduces an alias for an existing type constructor. |
|
1339 |
1330 \<^descr> \<^theory_text>\<open>hide_class names\<close> fully removes class declarations from a given name |
1340 \<^descr> \<^theory_text>\<open>hide_class names\<close> fully removes class declarations from a given name |
1331 space; with the \<open>(open)\<close> option, only the unqualified base name is hidden. |
1341 space; with the \<open>(open)\<close> option, only the unqualified base name is hidden. |
1332 |
1342 |
1333 Note that hiding name space accesses has no impact on logical declarations |
1343 Note that hiding name space accesses has no impact on logical declarations |
1334 --- they remain valid internally. Entities that are no longer accessible to |
1344 --- they remain valid internally. Entities that are no longer accessible to |