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