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