10253
|
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>
|
10282
|
25 |
|
10253
|
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
|
10282
|
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
|
10253
|
36 |
theory, such as <tt>Foobar</tt> accompanied by
|
|
37 |
<tt>Foobar_Examples</tt>.
|
|
38 |
|
|
39 |
<dt><strong>Theory names</strong>
|
10282
|
40 |
|
10253
|
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>
|
10282
|
47 |
|
10253
|
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>\<oplus></tt>), but leave these for user applications.
|
|
60 |
|
|
61 |
<dt><strong>Global context declarations</strong>
|
10282
|
62 |
|
10253
|
63 |
<dd>Only items introduced in the present theory should be declared
|
10282
|
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.
|
10253
|
67 |
|
|
68 |
<dt><strong>Mathematical symbols</strong>
|
10282
|
69 |
|
|
70 |
<dd>Non-ASCII symbols should be used as appropriate, with some
|
|
71 |
care. In particular, avoid unreadable arrows: <tt>==></tt> should
|
|
72 |
be preferred over <tt>\<Longrightarrow></tt>. Use <tt>isatool
|
|
73 |
unsymbolize</tt> to clean up the sources.
|
10253
|
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>\<forall></tt>),
|
|
80 |
<tt>EX</tt> (or <tt>\<exists></tt>), <tt>EX!</tt> (or
|
10282
|
81 |
<tt>\<exists>!</tt>), <tt>\<lambda></tt>, respectively.
|
10253
|
82 |
Note that bracket notation <tt>[| |]</tt> looks bad in LaTeX
|
|
83 |
output.
|
|
84 |
|
|
85 |
<p>
|
|
86 |
|
|
87 |
Some additional mathematical symbols are quite suitable for both
|
10282
|
88 |
readable sources and the output document:
|
10253
|
89 |
<tt>\<Inter></tt>,
|
|
90 |
<tt>\<Union></tt>,
|
|
91 |
<tt>\<and></tt>,
|
|
92 |
<tt>\<in></tt>,
|
|
93 |
<tt>\<inter></tt>,
|
10334
|
94 |
<tt>\<le></tt>,
|
10253
|
95 |
<tt>\<not></tt>,
|
|
96 |
<tt>\<noteq></tt>,
|
|
97 |
<tt>\<notin></tt>,
|
|
98 |
<tt>\<or></tt>,
|
|
99 |
<tt>\<subset></tt>,
|
|
100 |
<tt>\<subseteq></tt>,
|
|
101 |
<tt>\<times></tt>,
|
|
102 |
<tt>\<union></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>[| |]</tt>); do not attempt to simulate table markup with
|
|
115 |
spaces, avoid ``hanging'' indentations.
|
|
116 |
|
|
117 |
</dl>
|
|
118 |
|
|
119 |
</body>
|
|
120 |
</html>
|