changed HTML documentation
authorclasohm
Fri Dec 01 12:27:09 1995 +0100 (1995-12-01)
changeset 13802f8055af9c04
parent 1379 8f693d2ffb59
child 1381 57777949b2f8
changed HTML documentation
doc-src/Ref/theories.tex
     1.1 --- a/doc-src/Ref/theories.tex	Fri Dec 01 12:26:42 1995 +0100
     1.2 +++ b/doc-src/Ref/theories.tex	Fri Dec 01 12:27:09 1995 +0100
     1.3 @@ -84,7 +84,7 @@
     1.4  
     1.5  \item[$constDecl$]
     1.6    is a series of constant declarations.  Each new constant $name$ is given
     1.7 -  the type specified by the $string$.  The optional $mixfix$ annotations may
     1.8 +  the specified type.  The optional $mixfix$ annotations may
     1.9    attach concrete syntax to the constant. A variant of {\tt consts} is the
    1.10    {\tt syntax} section\index{*syntax section}, which adds just syntax without
    1.11    declaring logical constants.
    1.12 @@ -455,99 +455,111 @@
    1.13  \end{ttdescription}
    1.14  
    1.15  
    1.16 -\section{Viewing theories as HTML documents}
    1.17 +\section{Generating HTML documents}
    1.18  \index{HTML|bold} 
    1.19  
    1.20  Isabelle is able to make HTML documents that show a theory's
    1.21  definition, the theorems proved in its ML file and the relationship
    1.22  with its ancestors and descendants. HTML stands for Hypertext Markup
    1.23  Language and is used in the World Wide Web to represent text
    1.24 -containing images and links to other documents. Web browsers like the
    1.25 -ones from Mosaic or Netscape are used to view these documents.
    1.26 +containing images and links to other documents. Web browsers like
    1.27 +{\tt xmosaic} or {\tt netscape} are used to view these documents.
    1.28  
    1.29  Besides the three HTML files that are made for every theory
    1.30  (definition and theorems, ancestors, descendants), Isabelle stores
    1.31  links to all theories in an index file. These indexes are themself
    1.32 -linked with other indexes.
    1.33 +linked with other indexes to represent the hierarchic structure of
    1.34 +Isabelle's logics.
    1.35  
    1.36  To make HTML files for logics that are part of the Isabelle
    1.37 -distribution, simply set the environment variable {\tt MAKE_HTML}
    1.38 -before compiling a logic. The entry point to all logics is the {\tt
    1.39 -index.html} file located in Isabelle's main directory. You also can
    1.40 -access a HTML version of the Isabelle distribution package at
    1.41 +distribution, simply set the shell environment variable {\tt
    1.42 +MAKE_HTML} before compiling a logic. This works for single logics as
    1.43 +well as for the shell script {\tt make-all} (see
    1.44 +\ref{sec:shell-scripts}). To make HTML files for {\tt FOL} using a
    1.45 +{\tt csh} style shell, the following commands can be used:
    1.46 +
    1.47 +\begin{ttbox}
    1.48 +cd FOL
    1.49 +setenv MAKE_HTML
    1.50 +make
    1.51 +\end{ttbox}
    1.52 +
    1.53 +As some of Isabelle's logics are based on others (e.g. {\tt ZF} on
    1.54 +{\tt FOL}) and because the HTML files list a theory's ancestors, you
    1.55 +should not make HTML files for a logic if the HTML files for the base
    1.56 +logic do not exist. Otherwise some of the hypertext links might point
    1.57 +to non-existing documents.
    1.58 +
    1.59 +The entry point to all logics is the {\tt index.html} file located in
    1.60 +Isabelle's main directory. You can also access a HTML version of the
    1.61 +distribution package at
    1.62  
    1.63  \begin{ttbox}
    1.64  http://www4.informatik.tu-muenchen.de/~nipkow/isabelle
    1.65  \end{ttbox}
    1.66  
    1.67 -Internally the HTML generation is controlled by
    1.68 +
    1.69 +\subsection*{Manual HTML generation}
    1.70 +
    1.71 +To manually activate and deactivate the generation of HTML files the
    1.72 +following commands and reference variables are used:
    1.73  
    1.74  \begin{ttbox}
    1.75 -index_path  : string ref
    1.76 -gif_path    : string ref
    1.77 -base_path   : string ref
    1.78  init_html   : unit -> unit
    1.79  make_html   : bool ref
    1.80  finish_html : unit -> unit
    1.81  \end{ttbox}
    1.82  
    1.83  \begin{ttdescription}
    1.84 -\item[\ttindexbold{base_path}]
    1.85 -contains the absolute path of Isabelle's main directory. To make them
    1.86 -independent from their storage place, the HTML files only contain
    1.87 -relative paths which are derived from absolute ones like the current
    1.88 -working directory, {\tt index_path} or {\tt base_path}.
    1.89 -
    1.90 -As {\tt base_path} and {\tt gif_path} are set at the time when the
    1.91 -{\tt Pure} database is made, they are not valid if you use someone
    1.92 -else's database to read theories stored in your private directory. In
    1.93 -that case you first have to set {\tt base_path} to the value of {\em
    1.94 -your} Isabelle main directory, i.e. the directory that contains the
    1.95 -subdirectories where logics like {\tt FOL}, {\tt HOL} etc. are
    1.96 -stored. Besides you have to set the next variable:
    1.97 -
    1.98 -\item[\ttindexbold{gif_path}]
    1.99 -contains the absolute path of two GIF images used in the HTML
   1.100 -documents. Normally it points to the {\tt Tools} subdirectory of
   1.101 -Isabelle's main directory. As with {\tt base_path} you have to set it
   1.102 -manually if you use someone else's database.
   1.103 -
   1.104  \item[\ttindexbold{init_html}]
   1.105  activates the HTML facility. It stores the current working directory
   1.106 -in {\tt index_path} which is were the {\tt index.html} file for all
   1.107 -theories loaded afterwards will be placed.
   1.108 +as the place where the {\tt index.html} file for all theories loaded
   1.109 +afterwards will be stored.
   1.110  
   1.111  \item[\ttindexbold{make_html}]
   1.112 -is a variable read by {\tt use_thy} to decide whether HTML files
   1.113 -should be made or not. After you have used {\tt init_html} you can
   1.114 -manually change {\tt make_html}'s value to temporarily disable HTML
   1.115 -generation.
   1.116 +is a boolean reference variable read by {\tt use_thy} and other
   1.117 +functions to decide whether HTML files should be made. After you have
   1.118 +used {\tt init_html} you can manually change {\tt make_html}'s value
   1.119 +to temporarily disable HTML generation.
   1.120  
   1.121  \item[\ttindexbold{finish_html}]
   1.122  has to be called after all theories have been read that should be
   1.123 -contained in the current {\tt index.html} file. It reads a temporary
   1.124 +listed in the current {\tt index.html} file. It reads a temporary
   1.125  file with information about the theories read since the last use of
   1.126  {\tt init_html} and makes the {\tt index.html} file. If {\tt
   1.127  make_html} is {\tt false} nothing is done.
   1.128  
   1.129  The indexes made by this function also contain a link to the {\tt
   1.130  README} file if there exists one in the directory were the index is
   1.131 -stored. If there's a {\tt README.html} file it's used instead of the
   1.132 -{\tt README} file.
   1.133 +stored. If there's a {\tt README.html} file it is used instead of
   1.134 +{\tt README}.
   1.135  
   1.136  \end{ttdescription}
   1.137  
   1.138 -Please note that the HTML facility was developed to make HTML
   1.139 -documents for a stable version of a logic. It is not intended to make
   1.140 -these documents for a logic were theories are changed and only a part
   1.141 -of the logic is reread.
   1.142 +The above functions could be used in the following way:
   1.143 +
   1.144 +\begin{ttbox}
   1.145 +init_html();
   1.146 +{\out Setting path for index.html to "/home/stud/clasohm/isabelle/HOL"}
   1.147 +use_thy "List";
   1.148 +\dots
   1.149 +finish_html();
   1.150 +\end{ttbox}
   1.151  
   1.152 -If you add new subdirectories to Isabelle's logics (or add a completly
   1.153 -new logic), you would have to call {\tt init_html} at the start of the
   1.154 +Please note that HTML files are made only for those theories that are
   1.155 +read while {\tt make_html} is {\tt true}. These files may contain
   1.156 +links to theories that were read with a {\tt false} {\tt make_html}
   1.157 +and therefore point to non-existing files.
   1.158 +
   1.159 +
   1.160 +\subsection*{Extending or adding a logic}
   1.161 +
   1.162 +If you add a new subdirectory to Isabelle's logics (or add a completly
   1.163 +new logic), you would have to call {\tt init_html} at the start of every
   1.164  directory's {\tt ROOT.ML} file and {\tt finish_html} at the end of
   1.165  it. This is automatically done if you use
   1.166  
   1.167 -\begin{ttbox}
   1.168 +\begin{ttbox}\index{use_dir}
   1.169  use_dir : string -> unit
   1.170  \end{ttbox}
   1.171  
   1.172 @@ -558,6 +570,66 @@
   1.173  linked to the first index found in the (recursively searched)
   1.174  superdirectories.
   1.175  
   1.176 +Instead of adding something like
   1.177 +
   1.178 +\begin{ttbox}
   1.179 +use"ex/ROOT.ML";
   1.180 +\end{ttbox}
   1.181 +
   1.182 +to the logic's makefile you have to use this:
   1.183 +
   1.184 +\begin{ttbox}
   1.185 +use_dir"ex";
   1.186 +\end{ttbox}
   1.187 +
   1.188 +Since {\tt use_dir} calls {\tt init_html} only if {\tt make_html} is
   1.189 +{\tt true} the generation of HTML files depends on the value this
   1.190 +reference variable has. It can either be inherited from the used \ML{}
   1.191 +database or set in the makefile before {\tt use_dir} is invoked,
   1.192 +e.g. to set it's value according to the environment variable {\tt
   1.193 +MAKE_HTML}.
   1.194 +
   1.195 +The generated HTML files contain all theorems that were proved in the
   1.196 +theory's \ML{} file with {\tt qed}, {\tt qed_goal} and {\tt qed_goalw},
   1.197 +or stored with {\tt bind_thm} and {\tt store_thm}. Additionally there
   1.198 +is a hypertext link to the whole \ML{} file.
   1.199 +
   1.200 +
   1.201 +\subsection*{Using someone else's database}
   1.202 +
   1.203 +To make them independent from their storage place, the HTML files only
   1.204 +contain relative paths which are derived from absolute ones like the
   1.205 +current working directory, {\tt gif_path} or {\tt base_path}. The
   1.206 +latter two are reference variables which are initialized at the time
   1.207 +when the {\tt Pure} database is made. Because you need write access
   1.208 +for the current directory to make HTML files and therefore (probably)
   1.209 +generate them in your home directory, the absolute {\tt base_path} is
   1.210 +not correct if you use someone else's database or a database derived
   1.211 +from it.
   1.212 +
   1.213 +In that case you first have to set {\tt base_path} to the value of
   1.214 +{\em your} Isabelle main directory, i.e. the directory that contains
   1.215 +the subdirectories where standard logics like {\tt FOL} and {\tt HOL}
   1.216 +or your own logics are stored.
   1.217 +
   1.218 +It's also a good idea to set {\tt gif_path} which points to the
   1.219 +directory containing two GIF images used in the HTML
   1.220 +documents. Normally this is the {\tt Tools} subdirectory of Isabelle's
   1.221 +main directory. While its value in general is still valid, your HTML
   1.222 +files would depend on files not owned by you. This prevents you from
   1.223 +changing the location of the HTML files (as they contain relative
   1.224 +paths) and also causes trouble if the database's maker (re)moves the
   1.225 +GIFs.
   1.226 +
   1.227 +Here's what you have to do before invoking {\tt init_html} using
   1.228 +someone else's \ML{} database:
   1.229 +
   1.230 +\begin{ttbox}
   1.231 +base_path := "/home/smith/isabelle";
   1.232 +gif_path := "/home/smith/isabelle/Tools";
   1.233 +init_html();
   1.234 +\dots
   1.235 +\end{ttbox}
   1.236  
   1.237  \section{Terms}
   1.238  \index{terms|bold}