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