src/Tools/8bit/doc/manual.itex
changeset 1986 36f6bbf41477
parent 1907 d069f23e941f
child 2392 2fb9659d30ca
equal deleted inserted replaced
1985:84cf16192e03 1986:36f6bbf41477
    55 an alternative formulation of the bounded universal quantifier within the 
    55 an alternative formulation of the bounded universal quantifier within the 
    56 set theory of \bt{HOL}.
    56 set theory of \bt{HOL}.
    57 
    57 
    58 \label{ex}
    58 \label{ex}
    59 Without graphical characters, the operator is defined as follows.
    59 Without graphical characters, the operator is defined as follows.
       
    60 
       
    61 \pagebreak
       
    62 
    60 \I@isa
    63 \I@isa
    61 consts	
    64 consts	
    62     	Ball	:: "'a set => ('a => bool) => bool"
    65     	Ball	:: "'a set => ('a => bool) => bool"
    63 syntax
    66 syntax
    64 	"@Ball"	:: "pttrn => 'a set => bool => bool"	("(3!_:_./ _)" 10)
    67 	"@Ball"	:: "pttrn => 'a set => bool => bool"
       
    68 						("(3!_:_./ _)" 10)
    65 translations
    69 translations
    66 		"!x:A. P" == "Ball A (%x. P)"
    70 		"!x:A. P" == "Ball A (%x. P)"
    67 defs
    71 defs
    68      Ball_def	"Ball A P == ! x. x:A --> P x"
    72      Ball_def	"Ball A P == ! x. x:A --> P x"
    69 \I@isa
    73 \I@isa
    73 
    77 
    74 \I@isa
    78 \I@isa
    75 consts
    79 consts
    76 	Ball	:: "'a set ë ('a ë bool) ë bool"
    80 	Ball	:: "'a set ë ('a ë bool) ë bool"
    77 syntax
    81 syntax
    78 	"GBall"	:: "pttrn ë 'a set ë bool ë bool"	("(3Â_Î_./ _)" 10)
    82 	"GBall"	:: "pttrn ë 'a set ë bool ë bool"
       
    83 						("(3Â_Î_./ _)" 10)
    79 translations
    84 translations
    80 		"ÂxÎA. P" == "Ball A (³x. P)"
    85 		"ÂxÎA. P" == "Ball A (³x. P)"
    81 defs
    86 defs
    82      Ball_def	"Ball A P Ú Âx. xÎA çè P x"
    87      Ball_def	"Ball A P Ú Âx. xÎA çè P x"
    83 \I@isa
    88 \I@isa
    97 In the example given above, the ASCII formulation of the quantifier can be
   102 In the example given above, the ASCII formulation of the quantifier can be
    98 augmented with a graphical version by the following definition.
   103 augmented with a graphical version by the following definition.
    99 
   104 
   100 \I@isa
   105 \I@isa
   101 syntax
   106 syntax
   102 	"GBall"	:: "pttrn => 'a set => bool => bool"	("(3Â_Î_./ _)" 10)
   107 	"GBall"	:: "pttrn => 'a set => bool => bool"
       
   108 						("(3Â_Î_./ _)" 10)
   103 translations
   109 translations
   104 		"ÂxÎA. P" == "!x:A. P"
   110 		"ÂxÎA. P" == "!x:A. P"
   105 \I@isa
   111 \I@isa
   106 
   112 
   107 With this approach, the operators can still be entered in ASCII form, which is
   113 With this approach, the operators can still be entered in ASCII form, which is
   108 important for the usability of old (pure ASCII) Isabelle files, while they are
   114 important for the usability of old (pure ASCII) Isabelle files, while they are
   109 displayed in the new graphical form. The additional level of syntax 
   115 displayed in the new graphical form. The additional level of syntax 
   110 translations introduced in this way may interfere with other translation rules
   116 translations introduced in this way may interfere with other translation rules
   111 and should therefore be designed carefully.
   117 and should therefore be designed carefully.
   112 
   118 
       
   119 
       
   120 \pagebreak
   113 
   121 
   114 \subsection{User commands}
   122 \subsection{User commands}
   115 \label{commands}
   123 \label{commands}
   116 
   124 
   117 
   125 
   213 appropriate \LaTeX\ commands, and handing through the rest (almost) verbatim.
   221 appropriate \LaTeX\ commands, and handing through the rest (almost) verbatim.
   214 
   222 
   215 For example, this manual itself is converted to a \bt{.tex} file by \\
   223 For example, this manual itself is converted to a \bt{.tex} file by \\
   216 \bt{isa2latex -x -e -o manual.tex doc/manual.itex}
   224 \bt{isa2latex -x -e -o manual.tex doc/manual.itex}
   217 
   225 
       
   226 \pagebreak
       
   227 
   218 \subsection{Conversion modes}
   228 \subsection{Conversion modes}
   219 
   229 
   220 To handle the different parts of an input file, \bt{isa2latex} has several 
   230 To handle the different parts of an input file, \bt{isa2latex} has several 
   221 conversion modes, namely
   231 conversion modes, namely
   222 \begin{itemize}
   232 \begin{itemize}
   271    ^
   281    ^
   272    |------ \I\E@\E@@isa -->  ISA  <-- \E\E@\E@@ -->  ESC
   282    |------ \I\E@\E@@isa -->  ISA  <-- \E\E@\E@@ -->  ESC
   273 \I@isa
   283 \I@isa
   274 
   284 
   275 
   285 
       
   286 \pagebreak
       
   287 
   276 \subsection{Ambiguity problems}
   288 \subsection{Ambiguity problems}
   277 \label{ambig}
   289 \label{ambig}
   278 
   290 
   279 As \bt{isa2latex} converts its input files on a lexical level, it has limited
   291 As \bt{isa2latex} converts its input files on a lexical level, it has limited
   280 capability of dealing with ambiguities that are caused by using the same 
   292 capability of dealing with ambiguities that are caused by using the same 
   289 character. Thus to enforce a conversion, append a blank character behind it, and
   301 character. Thus to enforce a conversion, append a blank character behind it, and
   290 to prohibit it even if a blank character follows, you may insert a double 
   302 to prohibit it even if a blank character follows, you may insert a double 
   291 \I@\E\E@\E@@\I@, i.e. the string becomes `\I@|\E\E@\E@@\E\E@\E@@ \I@'. 
   303 \I@\E\E@\E@@\I@, i.e. the string becomes `\I@|\E\E@\E@@\E\E@\E@@ \I@'. 
   292 
   304 
   293 You may also redefine the critical entries of the conversion tables in the file
   305 You may also redefine the critical entries of the conversion tables in the file
   294 \bt{config/conv-tables.inp}. The entry for the `\I@|\I@' character
   306 \bt{config/conv-tables.inp}. The entry for the `\I@|\I@' character, for example,
   295 looks like
   307 looks like
   296 \I@isa
   308 \I@isa
   297 >  "\|\ "		"|"		"\mbox{$\vee$}" 
   309 >  "\|\ "		"|"		"\mbox{$\vee$}" 
   298 \I@isa
   310 \I@isa
   299 The first string, which (as described by the verbose comments in that file)
   311 The first string, which (as described by the verbose comments in that file)
   300 is the lex expression for the ASCII input, could be adapted to require an 
   312 is the lex expression for the ASCII input, could be adapted to require an 
   301 additional blank character before the `\I@|\I@', for example.
   313 additional blank character before the `\I@|\I@'.
   302 
   314 
   303 Most of these amibiguity problems can be avoided if you decide to employ the
   315 Most of these amibiguity problems can be avoided if you decide to employ the
   304 graphical font for your Isabelle source files. In this case, we recommend 
   316 graphical font for your Isabelle source files. In this case, we recommend 
   305 using this font as early as possible, in order to avoid later conversions.
   317 using this font as early as possible, in order to avoid later conversions.
   306 For the conversion of old files, the tool \bt{a2isa} is provided. It
   318 For the conversion of old files, the tool \bt{a2isa} is provided. It
   316 \bt{a2isa} and then \bt{isa2latex} without option \bt{-A}. For example, type\\
   328 \bt{a2isa} and then \bt{isa2latex} without option \bt{-A}. For example, type\\
   317 \bt{a2isa Set2.thy | isa2latex -s -o doc/Set2a.tex}\\
   329 \bt{a2isa Set2.thy | isa2latex -s -o doc/Set2a.tex}\\
   318 to generate a better output than in the example conversion given in subsection
   330 to generate a better output than in the example conversion given in subsection
   319 \ref{conv}.
   331 \ref{conv}.
   320 
   332 
       
   333 \pagebreak
   321 
   334 
   322 \section{Technical issues}
   335 \section{Technical issues}
   323 
   336 
   324 \subsection{Preparations}
   337 \subsection{Preparations}
   325 
   338 
   360 (\bt{gmake} is the gnu version of \bt{make}) and then \bt{gmake}.
   373 (\bt{gmake} is the gnu version of \bt{make}) and then \bt{gmake}.
   361 
   374 
   362 If you want to adapt the configuration of the font (keyboard bindings or
   375 If you want to adapt the configuration of the font (keyboard bindings or
   363 conversion tables used by \bt{isa2latex}), change directory to\\
   376 conversion tables used by \bt{isa2latex}), change directory to\\
   364 \bt{\$ISABELLE8BIT/config} ,
   377 \bt{\$ISABELLE8BIT/config} ,
   365 edit the files \bt{key-table.inp} respectively \bt{conv-tables.inp},
   378 edit the files \bt{key-table.inp} and \bt{conv-tables.inp} 
       
   379 as described below, 
   366 and run \bt{gmake} in this directory to generate new versions of 
   380 and run \bt{gmake} in this directory to generate new versions of 
   367 \bt{isa2latex}, editor support, and documentation.
   381 \bt{isa2latex}, editor support, and documentation.
   368 
   382 
   369 For adapting the conversion table of \bt{a2isa}, change directory to \\
   383 For adapting the conversion table of \bt{a2isa}, change directory to \\
   370 \bt{\$ISABELLE8BIT/c-sources/a2isa}, edit the file \bt{lex.x}
   384 \bt{\$ISABELLE8BIT/c-sources/a2isa}, edit the file \bt{lex.x}
   371 accordingly, and run \bt{gmake} there.
   385 accordingly, and run \bt{gmake} there.
       
   386 
       
   387 %%%% FRANZ
       
   388 \subsubsection{Configuring conversion tables and keyboard bindings}
       
   389 %\label{subsub:gens}
       
   390 
       
   391 The 8bit package comes along with several perl%
       
   392 \footnote{the scripts are written in perl4. In order to run them with later
       
   393   versions of perl, you have to patch the scripts in some places since perl4
       
   394   and later versions differ in the way they expand backslashes.} scripts that
       
   395 allow you to configure the package for your own needs in a convenient way.
       
   396 
       
   397 Keyboard bindings and the major behaviour of the converter \bt{isa2latex} are
       
   398 controlled by the two configuration files \bt{key-table.inp} and
       
   399 \bt{conv-tables.inp} which reside in the directory \bt{\$ISABELLE8BIT/config}.
       
   400 As these files contain a lot of comments, their formats are rather 
       
   401 self explanatory.
       
   402 
       
   403 To change the conversions performed by \bt{isa2latex}, you just
       
   404 have to alter the file \bt{conv-tables.inp}. This file mainly contains the
       
   405 conversion tables for single characters in the code ranges 32 -- 127 and
       
   406 (usually) 161 -- 255.  The last part of the configuration file describes how the
       
   407 lexical analyser of the converter \bt{isa2latex} treats special character
       
   408 sequences. It is most likely that you change this part of the configuration
       
   409 file. 
       
   410 In order to activate your changes, you have to run the Makefile with \bt{gmake}.
       
   411 This invokes the perl script \bt{gen-isa2latex} with \bt{conv-tables.inp} as
       
   412 an argument. See the man page on \bt{gen-isa2latex} for more details about
       
   413 command line arguments. According to the configuration file, the perl script
       
   414 patches specific portions of the C source of the 
       
   415 converter in the directory \bt{\$ISABELLE8BIT/c-sources/isa2latex} and
       
   416 calls the C compiler to generate a new binary for \bt{isa2latex}.
       
   417 
       
   418 If you want to alter the keyboard bindings for the various editors and the
       
   419 terminal, you have to change the configuration file \bt{key-table.inp}. 
       
   420 The file contains as its main part a table relating keystrokes to the 
       
   421 keyboard codes to be generated. Then run the Makefile with \bt{gmake}.
       
   422 For every editor that the 8bit package supports, \bt{gmake} starts a perl script
       
   423 that patches the start up file for the specific editor. For example, for the 
       
   424 \bt{vim} editor the script \bt{gen-isavim} is started, which patches the shell 
       
   425 script
       
   426 \bt{\$ISABELLE8BIT/vim/isavim}.  As the last action, the perl script
       
   427 \bt{gen-isadoc} is invoked which generates some \bt{.dvi} files for reference
       
   428 cards which document the new keyboard mapping.
       
   429 %%%% FRANZ
   372 
   430 
   373 \subsection{Management of alternative sources}
   431 \subsection{Management of alternative sources}
   374 
   432 
   375 If you retain ASCII versions of logical operators for compatibility reasons,
   433 If you retain ASCII versions of logical operators for compatibility reasons,
   376 as described in subsection \ref{compat}, you may want to export versions of your
   434 as described in subsection \ref{compat}, you may want to export versions of your
   377 Isabelle theories that contain no 8bit characters. To support this, a patching
   435 Isabelle theories that contain no 8bit characters. To support this, a patching
   378 mechanism is provided as follows. Encapsulate each section of your files dealing
   436 mechanism is provided as follows. Encapsulate each section of your files dealing
   379 solely with the 8bit font with suitable begin and end pragmas (some pair of 
   437 solely with the 8bit font with suitable begin and end pragmas (some pair of 
   380 unique comment lines) and configure three configuration files analogously to\\
   438 unique comment lines) and configure three configuration files analogously to\\
   381 \bt{\$ISABELLE8BIT/isa-patches/HOL/\{extract|clean|add\}-HOL.cfg}.
   439 \bt{\$ISABELLE8BIT/isa-patches/HOL/\{extract|clean|add\}-HOL.cfg}.
   382 Then you can call the \bt{patcher} with the first file to extract and store to
   440 You can call the \bt{patcher} than with the first file to extract and store to
   383 a file, the second to remove, and the third to re-add the 8bit section of the
   441 a file, the second to remove, and the third to re-add the 8bit section of the
   384 Isabelle files. See also the man page of \bt{patcher}.
   442 Isabelle files. See also the man page of \bt{patcher}.
   385 
   443 
   386 
       
   387 \end{document}
   444 \end{document}
   388 
   445 
   389 
   446