src/HOL/Library/README.html
author wenzelm
Wed Oct 25 18:33:40 2000 +0200 (2000-10-25)
changeset 10334 e5e6070fcef5
parent 10282 b7d96e94796f
child 15283 f21466450330
permissions -rw-r--r--
add \<le> to list of "good" symbols;
     1 <html>
     2 
     3 <!-- $Id$ -->
     4 
     5 <head><title>HOL-Library/README</title></head>
     6 
     7 <body>
     8 
     9 <h1>HOL-Library: supplemental theories for main Isabelle/HOL</h1>
    10 
    11 This is a collection of generic theories that may be used together
    12 with main Isabelle/HOL.  Note that theory loader path already includes
    13 this directory by default.
    14 
    15 <p>
    16 
    17 Addition of new theories should be done with some care, as the
    18 ``module system'' of Isabelle is rather simplistic.  The following
    19 guidelines may be helpful to achieve maximum re-usability and minimum
    20 clashes with existing developments.
    21 
    22 <dl>
    23 
    24 <dt><strong>Files</strong>
    25 
    26 <dd>Avoid unnecessary scattering of theories over several files.  Use
    27 new-style theories only, as old ones tend to clutter the file space
    28 with separate <tt>.thy</tt> and <tt>.ML</tt> files.
    29 
    30 <dt><strong>Examples</strong>
    31 
    32 <dd>Theories should be as ``generic'' as is sensible.  Unused (or
    33 rather unusable?) theories should be avoided; common applications
    34 should actually refer to the present theory.  Small example uses may
    35 be included in the library as well, but should be put in a separate
    36 theory, such as <tt>Foobar</tt> accompanied by
    37 <tt>Foobar_Examples</tt>.
    38 
    39 <dt><strong>Theory names</strong>
    40 
    41 <dd>The theory loader name space is <em>flat</em>, so use sufficiently
    42 long and descriptive names to reduce the danger of clashes with the
    43 user's own theories.  The convention for theory names is as follows:
    44 <tt>Foobar_Doobar</tt> (this looks best in LaTeX output).
    45 
    46 <dt><strong>Names of logical items</strong>
    47 
    48 <dd>There are separate hierarchically structured name spaces for
    49 types, constants, theorems etc.  Nevertheless, some care should be
    50 taken, as the name spaces are always ``open''.  Use adequate names;
    51 avoid unreadable abbreviations.  The general naming convention is to
    52 separate word constituents by underscores, as in <tt>foo_bar</tt> or
    53 <tt>Foo_Bar</tt> (this looks best in LaTeX output).
    54 
    55 <p>
    56 
    57 Note that syntax is <em>global</em>; qualified names loose syntax on
    58 output.  Do not use ``exotic'' symbols for syntax (such as
    59 <tt>\&lt;oplus&gt;</tt>), but leave these for user applications.
    60 
    61 <dt><strong>Global context declarations</strong>
    62 
    63 <dd>Only items introduced in the present theory should be declared
    64 globally (e.g. as Simplifier rules).  Note that adding and deleting
    65 rules from parent theories may result in strange behavior later,
    66 depending on the user's arrangement of import lists.
    67 
    68 <dt><strong>Mathematical symbols</strong>
    69 
    70 <dd>Non-ASCII symbols should be used as appropriate, with some
    71 care. In particular, avoid unreadable arrows: <tt>==&gt;</tt> should
    72 be preferred over <tt>\&lt;Longrightarrow&gt;</tt>. Use <tt>isatool
    73 unsymbolize</tt> to clean up the sources.
    74 
    75 <p>
    76 
    77 The following ASCII symbols of HOL should be generally avoided:
    78 <tt>@</tt>, <tt>!</tt>, <tt>?</tt>, <tt>?!</tt>, <tt>%</tt>, better
    79 use <tt>SOME</tt>, <tt>ALL</tt> (or <tt>\&lt;forall&gt;</tt>),
    80 <tt>EX</tt> (or <tt>\&lt;exists&gt;</tt>), <tt>EX!</tt> (or
    81 <tt>\&lt;exists&gt;!</tt>), <tt>\&lt;lambda&gt;</tt>, respectively.
    82 Note that bracket notation <tt>[|&nbsp;|]</tt> looks bad in LaTeX
    83 output.
    84 
    85 <p>
    86 
    87 Some additional mathematical symbols are quite suitable for both
    88 readable sources and the output document:
    89 <tt>\&lt;Inter&gt;</tt>,
    90 <tt>\&lt;Union&gt;</tt>,
    91 <tt>\&lt;and&gt;</tt>,
    92 <tt>\&lt;in&gt;</tt>,
    93 <tt>\&lt;inter&gt;</tt>,
    94 <tt>\&lt;le&gt;</tt>,
    95 <tt>\&lt;not&gt;</tt>,
    96 <tt>\&lt;noteq&gt;</tt>,
    97 <tt>\&lt;notin&gt;</tt>,
    98 <tt>\&lt;or&gt;</tt>,
    99 <tt>\&lt;subset&gt;</tt>,
   100 <tt>\&lt;subseteq&gt;</tt>,
   101 <tt>\&lt;times&gt;</tt>,
   102 <tt>\&lt;union&gt;</tt>.
   103 
   104 <dt><strong>Spacing</strong>
   105 
   106 <dd>Isabelle is able to produce a high-quality LaTeX document from the
   107 theory sources, provided some minor issues are taken care of.  In
   108 particular, spacing and line breaks are directly taken from source
   109 text.  Incidently, output looks very good common type-setting
   110 conventions are observed: put a single space <em>after</em> each
   111 punctuation character ("<tt>,</tt>", "<tt>.</tt>", etc.), but none
   112 before it; do not extra spaces inside of parentheses, unless the
   113 delimiters are composed of multiple symbols (as in
   114 <tt>[|&nbsp;|]</tt>); do not attempt to simulate table markup with
   115 spaces, avoid ``hanging'' indentations.
   116 
   117 </dl>
   118 
   119 </body>
   120 </html>