| author | paulson | 
| Wed, 30 Apr 1997 13:40:40 +0200 | |
| changeset 3086 | a2de0be6e14d | 
| parent 2392 | 2fb9659d30ca | 
| permissions | -rw-r--r-- | 
| 1826 | 1 | \documentclass[]{article}
 | 
| 2 | \usepackage{latexsym,amssymb,isa2latex}
 | |
| 3 | ||
| 4 | \newcommand{\bt}[1]{{\tt #1}}
 | |
| 5 | ||
| 6 | \title{The Isabelle 8bit Package}
 | |
| 7 | \author{
 | |
| 8 | David von Oheimb and Franz Regensburger\\ | |
| 9 | Technical University of Munich, Germany\\ | |
| 10 | E-mail: \bt{\{oheimb|regensbu\}@informatik.tu-muenchen.de}
 | |
| 11 | } | |
| 12 | \date{\today}
 | |
| 13 | ||
| 14 | \begin{document}
 | |
| 15 | \maketitle | |
| 16 | ||
| 17 | ||
| 18 | ||
| 19 | ||
| 20 | \section{Introduction}
 | |
| 21 | ||
| 22 | The 8bit package enables you to view, edit and print Isabelle files and perform | |
| 23 | proofs in a quite pleasant form. | |
| 24 | ||
| 25 | Instead of representing logical operators with ASCII character sequences, | |
| 1858 | 26 | a special graphical character font, and alternatively a \LaTeX{} 
 | 
| 1826 | 27 | command format, is provided. There are editors and a terminal | 
| 28 | capable of inputting and displaying the graphical characters, and converters | |
| 29 | between the different representations. The graphical font extends the normal | |
| 30 | ASCII 7bit character coding with (non-standard) character codes having the | |
| 31 | 8th bit set. All this is described in section \ref{graph} of this manual.
 | |
| 32 | ||
| 33 | Even without employing the 8bit font, the \LaTeX{} output for 
 | |
| 34 | Isabelle files can be used for manuals, papers etc. This is the focus of | |
| 35 | section \ref{latex}.
 | |
| 36 | ||
| 37 | ||
| 38 | ||
| 39 | ||
| 40 | \section{Graphical Isabelle}
 | |
| 41 | \label{graph}
 | |
| 42 | ||
| 43 | This section describes the main purpose of the 8bit package, which is to provide | |
| 44 | an extension to the ASCII character set that allows to formulate and display | |
| 45 | many logical operators as graphical symbols. | |
| 46 | ||
| 47 | \subsection{Usage}
 | |
| 48 | ||
| 49 | To employ the graphical font within Isabelle, just (re-)formulate the | |
| 50 | logical operators of your Isabelle theory (and proof) files using this font. | |
| 51 | A graphical terminal and suitable editors are described in subsection | |
| 52 | \ref{commands}.
 | |
| 53 | ||
| 54 | As a typical example, consider the following fragment of an Isabelle theory, | |
| 55 | an alternative formulation of the bounded universal quantifier within the | |
| 56 | set theory of \bt{HOL}.
 | |
| 57 | ||
| 58 | \label{ex}
 | |
| 59 | Without graphical characters, the operator is defined as follows. | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 60 | |
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 61 | \pagebreak | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 62 | |
| 1826 | 63 | \I@isa | 
| 64 | consts | |
| 65 |     	Ball	:: "'a set => ('a => bool) => bool"
 | |
| 66 | syntax | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 67 | "@Ball" :: "pttrn => 'a set => bool => bool" | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 68 | 						("(3!_:_./ _)" 10)
 | 
| 1826 | 69 | translations | 
| 70 | "!x:A. P" == "Ball A (%x. P)" | |
| 71 | defs | |
| 72 | Ball_def "Ball A P == ! x. x:A --> P x" | |
| 73 | \I@isa | |
| 74 | ||
| 75 | Using the graphical font (and assuming a corresponding re-formulation of | |
| 76 | \bt{HOL} operators), the definition of the operator can be improved to the following.
 | |
| 77 | ||
| 78 | \I@isa | |
| 79 | consts | |
| 80 | 	Ball	:: "'a set ë ('a ë bool) ë bool"
 | |
| 81 | syntax | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 82 | "GBall" :: "pttrn ë 'a set ë bool ë bool" | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 83 | 						("(3Â_Î_./ _)" 10)
 | 
| 1826 | 84 | translations | 
| 85 | "ÂxÎA. P" == "Ball A (³x. P)" | |
| 86 | defs | |
| 87 | Ball_def "Ball A P Ú Âx. xÎA çè P x" | |
| 88 | \I@isa | |
| 89 | ||
| 90 | Note the appearance of the graphical characters, which makes the code much more | |
| 91 | legible. | |
| 92 | ||
| 93 | \label{compat}
 | |
| 94 | It is also possible to retain pure ASCII versions of the logical operators while | |
| 95 | offering the possibility of graphical input and output. | |
| 96 | This may be necessary for compatibility reasons or for providing | |
| 97 | graphical versions of the meta logic \I@Pure\I@ or object logics already | |
| 98 | defined. In these cases, the graphical syntax can be supplied additionally with | |
| 99 | appropriate \I@types\I@, \I@syntax\I@, and \I@translations\I@ sections, as done | |
| 100 | for example in the Isabelle distribution of \bt{HOL}.
 | |
| 101 | ||
| 102 | In the example given above, the ASCII formulation of the quantifier can be | |
| 103 | augmented with a graphical version by the following definition. | |
| 104 | ||
| 105 | \I@isa | |
| 106 | syntax | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 107 | "GBall" :: "pttrn => 'a set => bool => bool" | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 108 | 						("(3Â_Î_./ _)" 10)
 | 
| 1826 | 109 | translations | 
| 110 | "ÂxÎA. P" == "!x:A. P" | |
| 111 | \I@isa | |
| 112 | ||
| 113 | With this approach, the operators can still be entered in ASCII form, which is | |
| 114 | important for the usability of old (pure ASCII) Isabelle files, while they are | |
| 115 | displayed in the new graphical form. The additional level of syntax | |
| 116 | translations introduced in this way may interfere with other translation rules | |
| 117 | and should therefore be designed carefully. | |
| 118 | ||
| 119 | ||
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 120 | \pagebreak | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 121 | |
| 1826 | 122 | \subsection{User commands}
 | 
| 123 | \label{commands}
 | |
| 124 | ||
| 125 | ||
| 126 | A number of commands for manipulating files with graphical characters are | |
| 127 | available, as described in this subsection. | |
| 128 | ||
| 129 | \subsubsection{Editors}
 | |
| 130 | ||
| 131 | The first group of commands includes versions of the most common editors that | |
| 132 | can handle the graphical font for both keyboard input and display input. | |
| 133 | See the files \bt{doc/\{fontindex|keyindex|fkmatrix\}.dvi} for the keystrokes
 | |
| 134 | defined for inputting the special characters. The editors are | |
| 135 | ||
| 136 | \begin{itemize}
 | |
| 137 | \item \bt{isa\_xemacs}		replaces \bt{xemacs}. You may provide a 
 | |
| 138 | specific init file called | |
| 139 | 				\bt{.emacs\_isa\_xemacs} (in your home directory)
 | |
| 140 | 				that is executed after the \bt{.emacs} file.
 | |
| 141 | \item \bt{isa\_gnu\_emacs}	replaces \bt{emacs}. You may provide a 
 | |
| 142 | specific init file called | |
| 143 | 				\bt{.emacs\_isa\_gnu\_emacs} (in your home 
 | |
| 144 | directory) that is executed after the | |
| 145 | 				\bt{.emacs} file.
 | |
| 146 | \item \bt{isaaxe}		replaces \bt{axe}
 | |
| 147 | \item \bt{isavim}		replaces \bt{vim}
 | |
| 148 | \end{itemize}
 | |
| 149 | ||
| 150 | For example, as \bt{emacs} user you may type
 | |
| 151 | \bt{isa\_xemacs doc/Set2g.thy \&} to view and edit
 | |
| 152 | the above sample theory fragment. | |
| 153 | ||
| 154 | \subsubsection{Display commands}
 | |
| 155 | ||
| 156 | The next group of commands is used to display files using the graphical font. | |
| 157 | With the terminal, of course also input is possible, using the same keystrokes | |
| 158 | as with the editors. | |
| 159 | ||
| 160 | \begin{itemize}
 | |
| 161 | \item \bt{isaterm} 		replaces \bt{xterm}. This is used as terminal
 | |
| 162 | for your ML interpreter running Isabelle with | |
| 163 | theories and proofs containing graphical | |
| 164 | characters. This terminal is also useful if | |
| 165 | 				you want to \bt{cat} or \bt{grep} the Isabelle
 | |
| 166 | files within your shell, and as | |
| 167 | 				environment for commands like \bt{isapal}.
 | |
| 168 | \item \bt{isapal}		shows the palette of available graphical 
 | |
| 169 | characters. A man page is available. | |
| 170 | \item \bt{codetable}		prints all 8bit characters with their codes
 | |
| 171 | \item \bt{isa\_xmosaic}	replaces \bt{xmosaic}. This is useful for
 | |
| 172 | browsing the index files of Isabelle theories | |
| 173 | (with graphical operators) that are generated | |
| 174 | if \I@make_html\I@ is set to \I@true\I@. | |
| 175 | \end{itemize}
 | |
| 176 | ||
| 177 | \subsubsection{Converters}
 | |
| 178 | \label{conv}
 | |
| 179 | ||
| 180 | The last group of commands is built to enable conversion between ASCII, 8bit | |
| 181 | font and | |
| 182 | \LaTeX\ representations of the graphical characters within papers, manuals, | |
| 183 | and Isabelle theory and proof files. For the options of the converters, see | |
| 184 | the corresponding man pages. | |
| 185 | ||
| 186 | \begin{itemize}
 | |
| 187 | \item \bt{isa2latex}	converts a file with 8bit characters to a LaTeX
 | |
| 188 | source. Pure ASCII input and conversion of 8bit | |
| 189 | characters to their ASCII representations is also | |
| 190 | possible. | |
| 191 | \item \bt{a2isa}	converts Isabelle files, from ASCII to 8bit characters.
 | |
| 192 | It is used mainly to convert old files. | |
| 193 | \end{itemize}
 | |
| 194 | ||
| 195 | In order to output the first theory fragment (formulated without the 8bit | |
| 196 | font) in subsection \ref{ex} as LaTeX\ source using suitable graphical 
 | |
| 197 | characters, type\\ | |
| 198 | \bt{isa2latex -s -A -o Set2.tex doc/Set2\_a.thy}.\\
 | |
| 199 | (It was necessary to insert some blank characters in the file \bt{Set2\_a.thy} 
 | |
| 200 | that enable \bt{isa2latex} to recognize all the operators intended to be 
 | |
| 201 | printed with graphical characters, as discussed in subsection \ref{ambig}.)
 | |
| 202 | ||
| 203 | For conversion of \bt{Set2.thy} to 8bit characters, type\\
 | |
| 204 | \bt{a2isa -o Set2\_g.thy doc/Set2.thy}.
 | |
| 205 | ||
| 206 | Further explanations of the use of the converter \bt{isa2latex} are given
 | |
| 207 | in section \ref{latex}.
 | |
| 208 | ||
| 209 | ||
| 210 | ||
| 211 | ||
| 212 | \section{\LaTeX\ output}
 | |
| 213 | \label{latex}
 | |
| 214 | ||
| 215 | Independently of whether Isabelle files are formulated with the graphical font | |
| 216 | or not, they can be converted to \LaTeX\ source using \bt{isa2latex}
 | |
| 217 | and in this way (pretty-)printed with the familiar symbols for quantification, | |
| 218 | intersection, etc. The tool \bt{isa2latex} can also convert \LaTeX\ source
 | |
| 219 | files containing Isabelle source to pure \LaTeX\ | |
| 220 | files, by converting the special character sequences of the Isabelle parts to | |
| 221 | appropriate \LaTeX\ commands, and handing through the rest (almost) verbatim. | |
| 222 | ||
| 223 | For example, this manual itself is converted to a \bt{.tex} file by \\
 | |
| 224 | \bt{isa2latex -x -e -o manual.tex doc/manual.itex}
 | |
| 225 | ||
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 226 | \pagebreak | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 227 | |
| 1826 | 228 | \subsection{Conversion modes}
 | 
| 229 | ||
| 230 | To handle the different parts of an input file, \bt{isa2latex} has several 
 | |
| 231 | conversion modes, namely | |
| 232 | \begin{itemize}
 | |
| 233 | \item \bt{LATEX}: The input is is literally copied to the output,
 | |
| 234 | without conversion of any characters. This mode is used for the \LaTeX\ parts | |
| 235 | of the input document. | |
| 236 | ||
| 237 | \item \bt{INLINE}: The conversion of characters and scanning for 
 | |
| 238 | multi character sequences is active, while newline and tab characters are | |
| 239 | treated as single blank character. | |
| 240 | Use this mode for inserting small parts of Isabelle source within | |
| 241 | a line of text. | |
| 242 | ||
| 243 | \item \bt{ISA}: The conversion of characters and scanning for 
 | |
| 244 | multi character sequences is active, while newline and tab characters are | |
| 245 | treated according to an open tabbing environment. | |
| 246 | This mode is used for displaying multiple lines of Isabelle source. | |
| 247 | ||
| 248 | \item \bt{ESC}: In this mode the input is literally copied to the output.
 | |
| 249 | This mode is intended as an escape mode from the \bt{INLINE} and \bt{ESC} modes.
 | |
| 250 | \end{itemize}
 | |
| 251 | ||
| 252 | Upon entrance of the conversion modes, \bt{isa2latex} generates the \LaTeX\ 
 | |
| 253 | commands \bt{\mbox{$\backslash$}isamode} for \bt{ISA}, 
 | |
| 254 | \bt{\mbox{$\backslash$}isainline} for \bt{INLINE}, 
 | |
| 255 | and \bt{\mbox{$\backslash$}isaescape} for the \bt{ESC} mode. These act as
 | |
| 256 | environment delimiters and may also set the appropriate fonts, styles etc. The | |
| 257 | commands | |
| 258 | are defined in the file \bt{latex/isa2latex.sty} and may be adapted as desired.
 | |
| 259 | ||
| 260 | \subsection{Conversion mode switching}
 | |
| 261 | ||
| 262 | The initial conversion mode of \bt{isa2latex} and the set of available modes 
 | |
| 263 | depend on the options given on the command line. Switching of the modes | |
| 264 | relies on special toggles (like \I@\I\E@\E@@isa\I@, within the input | |
| 265 | file) that indicate the beginning and end of the different parts of the input. | |
| 266 | ||
| 267 | The following diagrams show the initial mode (enclosed in sqare brackets), | |
| 268 | the available mode switches (in the arrow symbols) | |
| 269 | and the modes reachable with them. | |
| 270 | ||
| 271 | If the \bt{-x} option is not given:
 | |
| 272 | ||
| 273 | \I@isa | |
| 274 | [ISA] <-- \E\E@\E@@ --> ESC | |
| 275 | \I@isa | |
| 276 | ||
| 277 | If the \bt{-x} option is given:
 | |
| 278 | ||
| 279 | \I@isa | |
| 280 | [LATEX] <-- \I\E@\E@@ --> INLINE <-- \E\E@\E@@ --> ESC | |
| 281 | ^ | |
| 282 | |------ \I\E@\E@@isa --> ISA <-- \E\E@\E@@ --> ESC | |
| 283 | \I@isa | |
| 284 | ||
| 285 | ||
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 286 | \pagebreak | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 287 | |
| 1826 | 288 | \subsection{Ambiguity problems}
 | 
| 289 | \label{ambig}
 | |
| 290 | ||
| 291 | As \bt{isa2latex} converts its input files on a lexical level, it has limited
 | |
| 292 | capability of dealing with ambiguities that are caused by using the same | |
| 293 | characters for different operators. A typical examle | |
| 294 | is the `\I@|\I@' character, which is used within the object logic \bt{HOL} both
 | |
| 295 | as disjunction operator and as separator within \I@case\I@ expressions. In the | |
| 296 | former case, it should be converted to `\I@Á\I@', and in the latter case | |
| 297 | retained as `\I@|\I@'. | |
| 298 | ||
| 299 | As a workaround, in the current version of \bt{isa2latex},
 | |
| 300 | such ``dangerous'' characters are converted only if followed by a blank | |
| 301 | character. Thus to enforce a conversion, append a blank character behind it, and | |
| 302 | to prohibit it even if a blank character follows, you may insert a double | |
| 303 | \I@\E\E@\E@@\I@, i.e. the string becomes `\I@|\E\E@\E@@\E\E@\E@@ \I@'. | |
| 304 | ||
| 305 | You may also redefine the critical entries of the conversion tables in the file | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 306 | \bt{config/conv-tables.inp}. The entry for the `\I@|\I@' character, for example,
 | 
| 1826 | 307 | looks like | 
| 308 | \I@isa | |
| 309 | >  "\|\ "		"|"		"\mbox{$\vee$}" 
 | |
| 310 | \I@isa | |
| 311 | The first string, which (as described by the verbose comments in that file) | |
| 312 | is the lex expression for the ASCII input, could be adapted to require an | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 313 | additional blank character before the `\I@|\I@'. | 
| 1826 | 314 | |
| 315 | Most of these amibiguity problems can be avoided if you decide to employ the | |
| 316 | graphical font for your Isabelle source files. In this case, we recommend | |
| 317 | using this font as early as possible, in order to avoid later conversions. | |
| 318 | For the conversion of old files, the tool \bt{a2isa} is provided. It
 | |
| 319 | normally requires no changes of the original files and only minor corrections | |
| 320 | of the files it produces. Thus the preferred way is to apply \bt{a2isa} once and
 | |
| 321 | for all on the source files, correct all conversion mistakes, and then use the | |
| 322 | new files with the graphical font. With these files, the ambiguity problems | |
| 323 | should have gone. | |
| 324 | ||
| 325 | As the converter \bt{a2isa} is a bit smarter than \bt{isa2latex} in converting
 | |
| 326 | ASCII input, it is also useful if you do not employ the 8bit font directly. To | |
| 327 | convert a problematic ASCII file containing Isabelle source, first apply | |
| 328 | \bt{a2isa} and then \bt{isa2latex} without option \bt{-A}. For example, type\\
 | |
| 329 | \bt{a2isa Set2.thy | isa2latex -s -o doc/Set2a.tex}\\
 | |
| 330 | to generate a better output than in the example conversion given in subsection | |
| 331 | \ref{conv}.
 | |
| 332 | ||
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 333 | \pagebreak | 
| 1826 | 334 | |
| 335 | \section{Technical issues}
 | |
| 336 | ||
| 337 | \subsection{Preparations}
 | |
| 338 | ||
| 1907 | 339 | To use the 8bit package, you have to set (respectively extend) the content of | 
| 340 | the following environment variables and export them: | |
| 1826 | 341 | |
| 342 | \begin{itemize}
 | |
| 343 | \item \bt{ISABELLE8BIT}: set the directory of the Isabelle 8bit package,\\
 | |
| 344 | 	e.g.  \bt{/usr/proj/isabelle/src/Tools/8bit}
 | |
| 345 | ||
| 346 | \item \bt{PATH}: add the absolute path of the executables,\\
 | |
| 347 | 	e.g.  \bt{\$ISABELLE8BIT/bin}
 | |
| 348 | ||
| 349 | \item \bt{MANPATH}: add the absolute path of the manual pages,\\
 | |
| 350 | 	e.g.  \bt{\$ISABELLE8BIT/man}
 | |
| 351 | ||
| 352 | \item \bt{TEXINPUTS}: add the absolute path of special LaTeX style files
 | |
| 353 | used by the 8bit package (if necessary), | |
| 354 | 	e.g. \bt{\$ISABELLE8BIT/latex:}\\
 | |
| 355 |                 the trailing `\bt{:}' makes latex search subdirectories!\\
 | |
| 356 | The 8bit package uses | |
| 357 | 	\begin{itemize}
 | |
| 358 | \item the AMSFONT package | |
| 359 | \item the supertab style (clarkson) | |
| 360 |         \item the special style \bt{isa2latex.sty}
 | |
| 361 | 	\end{itemize}
 | |
| 362 | Some of them are contained in that directory. | |
| 363 | \end{itemize}
 | |
| 364 | ||
| 365 | Before the first use of any executable of subdirectory {\tt bin}, call
 | |
| 366 | the scripts \bt{fonts/install} and \bt{keyboard/install}. This is done best
 | |
| 367 | in your \bt{.login} file.
 | |
| 368 | ||
| 369 | \subsection{Installation and Configuration}
 | |
| 370 | ||
| 1858 | 371 | To install the 8bit package, change directory to \bt{\$ISABELLE8BIT}.
 | 
| 372 | Configure the \bt{Makefile} there, then run \bt{gmake clean} 
 | |
| 373 | (\bt{gmake} is the gnu version of \bt{make}) and then \bt{gmake}.
 | |
| 1826 | 374 | |
| 375 | If you want to adapt the configuration of the font (keyboard bindings or | |
| 376 | conversion tables used by \bt{isa2latex}), change directory to\\
 | |
| 377 | \bt{\$ISABELLE8BIT/config} ,
 | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 378 | edit the files \bt{key-table.inp} and \bt{conv-tables.inp} 
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 379 | as described below, | 
| 1826 | 380 | and run \bt{gmake} in this directory to generate new versions of 
 | 
| 381 | \bt{isa2latex}, editor support, and documentation.
 | |
| 382 | ||
| 383 | For adapting the conversion table of \bt{a2isa}, change directory to \\
 | |
| 384 | \bt{\$ISABELLE8BIT/c-sources/a2isa}, edit the file \bt{lex.x}
 | |
| 385 | accordingly, and run \bt{gmake} there.
 | |
| 386 | ||
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 387 | %%%% FRANZ | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 388 | \subsubsection{Configuring conversion tables and keyboard bindings}
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 389 | %\label{subsub:gens}
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 390 | |
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 391 | The 8bit package comes along with several perl% | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 392 | \footnote{the scripts are written in perl4. In order to run them with later
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 393 | versions of perl, you have to patch the scripts in some places since perl4 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 394 | and later versions differ in the way they expand backslashes.} scripts that | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 395 | allow you to configure the package for your own needs in a convenient way. | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 396 | |
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 397 | Keyboard bindings and the major behaviour of the converter \bt{isa2latex} are
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 398 | controlled by the two configuration files \bt{key-table.inp} and
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 399 | \bt{conv-tables.inp} which reside in the directory \bt{\$ISABELLE8BIT/config}.
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 400 | As these files contain a lot of comments, their formats are rather | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 401 | self explanatory. | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 402 | |
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 403 | To change the conversions performed by \bt{isa2latex}, you just
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 404 | have to alter the file \bt{conv-tables.inp}. This file mainly contains the
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 405 | conversion tables for single characters in the code ranges 32 -- 127 and | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 406 | (usually) 161 -- 255. The last part of the configuration file describes how the | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 407 | lexical analyser of the converter \bt{isa2latex} treats special character
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 408 | sequences. It is most likely that you change this part of the configuration | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 409 | file. | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 410 | In order to activate your changes, you have to run the Makefile with \bt{gmake}.
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 411 | This invokes the perl script \bt{gen-isa2latex} with \bt{conv-tables.inp} as
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 412 | an argument. See the man page on \bt{gen-isa2latex} for more details about
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 413 | command line arguments. According to the configuration file, the perl script | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 414 | patches specific portions of the C source of the | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 415 | converter in the directory \bt{\$ISABELLE8BIT/c-sources/isa2latex} and
 | 
| 2392 | 416 | calls the C compiler to generate a new binary for \bt{isa2latex}\footnote{
 | 
| 417 | The \bt{Makefile} uses the lexical analyzer \bt{flex}. Make sure that you
 | |
| 418 | use a recent version of it.}. | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 419 | |
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 420 | If you want to alter the keyboard bindings for the various editors and the | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 421 | terminal, you have to change the configuration file \bt{key-table.inp}. 
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 422 | The file contains as its main part a table relating keystrokes to the | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 423 | keyboard codes to be generated. Then run the Makefile with \bt{gmake}.
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 424 | For every editor that the 8bit package supports, \bt{gmake} starts a perl script
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 425 | that patches the start up file for the specific editor. For example, for the | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 426 | \bt{vim} editor the script \bt{gen-isavim} is started, which patches the shell 
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 427 | script | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 428 | \bt{\$ISABELLE8BIT/vim/isavim}.  As the last action, the perl script
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 429 | \bt{gen-isadoc} is invoked which generates some \bt{.dvi} files for reference
 | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 430 | cards which document the new keyboard mapping. | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 431 | %%%% FRANZ | 
| 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 432 | |
| 1826 | 433 | \subsection{Management of alternative sources}
 | 
| 434 | ||
| 435 | If you retain ASCII versions of logical operators for compatibility reasons, | |
| 436 | as described in subsection \ref{compat}, you may want to export versions of your
 | |
| 437 | Isabelle theories that contain no 8bit characters. To support this, a patching | |
| 438 | mechanism is provided as follows. Encapsulate each section of your files dealing | |
| 439 | solely with the 8bit font with suitable begin and end pragmas (some pair of | |
| 440 | unique comment lines) and configure three configuration files analogously to\\ | |
| 441 | \bt{\$ISABELLE8BIT/isa-patches/HOL/\{extract|clean|add\}-HOL.cfg}.
 | |
| 1986 
36f6bbf41477
new \subsubsection{Configuring conversion tables and keyboard bindings}
 oheimb parents: 
1907diff
changeset | 442 | You can call the \bt{patcher} than with the first file to extract and store to
 | 
| 1826 | 443 | a file, the second to remove, and the third to re-add the 8bit section of the | 
| 444 | Isabelle files. See also the man page of \bt{patcher}.
 | |
| 445 | ||
| 446 | \end{document}
 | |
| 447 | ||
| 448 |