CookBook/Readme.thy
author Christian Urban <urbanc@in.tum.de>
Fri, 28 Nov 2008 05:56:28 +0100
changeset 52 a04bdee4fb1e
parent 49 a0edabf14457
child 53 0c3580c831a4
permissions -rw-r--r--
tuned
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     1
theory Readme
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     2
imports Base
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     3
begin
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     4
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     5
chapter {* Comments for Authors of the Cookbook *}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     6
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     7
text {*
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     8
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
     9
  \begin{itemize}
49
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    10
  \item You can include references to other Isabelle manuals using the 
47
4daf913fdbe1 hakked latex so that it does not display ML {* *}; general tuning
Christian Urban <urbanc@in.tum.de>
parents: 44
diff changeset
    11
  reference names from those manuals. To do this the following
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    12
  four latex commands are defined:
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    13
  
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    14
  \begin{center}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    15
  \begin{tabular}{l|c|c}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    16
   & Chapters & Sections\\\hline
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    17
  Implementation Manual & @{ML_text "\\ichcite{\<dots>}"} & @{ML_text "\\isccite{\<dots>}"}\\
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    18
  Isar Reference Manual & @{ML_text "\\rchcite{\<dots>}"} & @{ML_text "\\rsccite{\<dots>}"}\\
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    19
  \end{tabular}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    20
  \end{center}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    21
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    22
  So @{ML_text "\\ichcite{ch:logic}"} results in a reference for the chapter about logic 
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    23
  in the implementation manual, namely \ichcite{ch:logic}.
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    24
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    25
  \item There are various document antiquotations defined for the 
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    26
  cookbook. This allows to check the written text against the current
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    27
  Isabelle code and also that responses of the ML-compiler can be shown.
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    28
  Therefore authors are strongly encouraged to use antiquotations wherever
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    29
  it is appropriate.
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    30
  
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    31
  The following antiquotations are in use:
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    32
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    33
  \begin{itemize}
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    34
  \item[$\bullet$] {\bf @{text "@{ML \"\<dots>\"}"}} Should be used for value
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    35
  computations. It checks whether the ML-expression is valid ML-code, but only
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    36
  works for closed expression.
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    37
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    38
  \item[$\bullet$] {\bf @{text "@{ML_open \"\<dots>\" for \<dots>}"}} Works like @{ML_text
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    39
  ML}-antiquotation except, that it can also deal with open expressions and
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    40
  expressions that need to be evaluated inside structures. The free variables
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    41
  or structures need to be listed after the @{ML_text "for"}. For example
49
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    42
  @{text "@{ML_open \"a + b\" for a b}"}.
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    43
49
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    44
  \item[$\bullet$] {\bf @{text "@{ML_response \"\<dots>\" \"\<dots>\"}"}} The first
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    45
  expression is checked like in the antiquotation @{text "@{ML \"\<dots>\"}"}; the
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    46
  second is a pattern that specifies the result the first expression
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    47
  produces. This specification can contain @{text [quotes] "\<dots>"} for parts that
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    48
  can be omitted. The actual response will be checked against the
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    49
  specification. For example @{text "@{ML_response \"(1+2,3)\"
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    50
  \"(3,\<dots>)\"}"}. This antiquotation can only be used when the result can be
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    51
  constructed. It does not work when the code produces an exception or is an
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    52
  abstract datatype (like @{ML_type thm} or @{ML_type cterm}).
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    53
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    54
  \item[$\bullet$] {\bf @{text "@{ML_response_fake \"\<dots>\" \"\<dots>\"}"}} Works like
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    55
  the @{ML_text ML_response}-anti\-quotation, except that the
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    56
  result-specification is not checked.
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    57
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    58
  \item[$\bullet$] {\bf @{text "@{ML_file \"\<dots>\"}"}} Should be used when
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    59
  referring to a file. It checks whether the file exists.  
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    60
  \end{itemize}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    61
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    62
49
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    63
  \item Functions and value bindings cannot be defined inside antiquotations; they need
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    64
  to be included inside \isacommand{ML} \isa{\isacharverbatimopen \ldots \isacharverbatimclose}
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    65
  environments. Some \LaTeX-hack, however, does not print the environment markers.
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    66
52
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    67
  \item Line numbers for code can be shown using 
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    68
  \isacommand{ML} \isa{\%linenumbers} \isa{\isacharverbatimopen \ldots \isacharverbatimclose}.
Christian Urban <urbanc@in.tum.de>
parents: 49
diff changeset
    69
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    70
  \end{itemize}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    71
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    72
*}
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    73
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    74
49
a0edabf14457 added more material
Christian Urban <urbanc@in.tum.de>
parents: 47
diff changeset
    75
44
dee4b3e66dfe added a readme chapter for prospective authors; added commands for referring to the Isar Reference Manual
Christian Urban <urbanc@in.tum.de>
parents:
diff changeset
    76
end