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