doc-src/IsarRef/Thy/document/Generic.tex
author wenzelm
Tue, 09 Aug 2011 15:41:00 +0200
changeset 44965 f7bbfdf4b4a7
parent 44238 3f1469de9e47
child 45782 884d27ede438
permissions -rw-r--r--
updated documentation of method "split" according to e6a4bb832b46;
wenzelm@26782
     1
%
wenzelm@26782
     2
\begin{isabellebody}%
wenzelm@26782
     3
\def\isabellecontext{Generic}%
wenzelm@26782
     4
%
wenzelm@26782
     5
\isadelimtheory
wenzelm@26782
     6
%
wenzelm@26782
     7
\endisadelimtheory
wenzelm@26782
     8
%
wenzelm@26782
     9
\isatagtheory
wenzelm@26782
    10
\isacommand{theory}\isamarkupfalse%
wenzelm@26782
    11
\ Generic\isanewline
wenzelm@43522
    12
\isakeyword{imports}\ Base\ Main\isanewline
wenzelm@26782
    13
\isakeyword{begin}%
wenzelm@26782
    14
\endisatagtheory
wenzelm@26782
    15
{\isafoldtheory}%
wenzelm@26782
    16
%
wenzelm@26782
    17
\isadelimtheory
wenzelm@26782
    18
%
wenzelm@26782
    19
\endisadelimtheory
wenzelm@26782
    20
%
wenzelm@26782
    21
\isamarkupchapter{Generic tools and packages \label{ch:gen-tools}%
wenzelm@26782
    22
}
wenzelm@26782
    23
\isamarkuptrue%
wenzelm@26782
    24
%
wenzelm@43526
    25
\isamarkupsection{Configuration options \label{sec:config}%
wenzelm@26782
    26
}
wenzelm@26782
    27
\isamarkuptrue%
wenzelm@26782
    28
%
wenzelm@26782
    29
\begin{isamarkuptext}%
wenzelm@40537
    30
Isabelle/Pure maintains a record of named configuration
wenzelm@40537
    31
  options within the theory or proof context, with values of type
wenzelm@40537
    32
  \verb|bool|, \verb|int|, \verb|real|, or \verb|string|.  Tools may declare options in ML, and then refer to these
wenzelm@40537
    33
  values (relative to the context).  Thus global reference variables
wenzelm@40537
    34
  are easily avoided.  The user may change the value of a
wenzelm@40537
    35
  configuration option by means of an associated attribute of the same
wenzelm@40537
    36
  name.  This form of context declaration works particularly well with
wenzelm@43526
    37
  commands such as \hyperlink{command.declare}{\mbox{\isa{\isacommand{declare}}}} or \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}} like
wenzelm@43526
    38
  this:%
wenzelm@43526
    39
\end{isamarkuptext}%
wenzelm@43526
    40
\isamarkuptrue%
wenzelm@43526
    41
\isacommand{declare}\isamarkupfalse%
wenzelm@43526
    42
\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5B}{\isacharbrackleft}}show{\isaliteral{5F}{\isacharunderscore}}main{\isaliteral{5F}{\isacharunderscore}}goal\ {\isaliteral{3D}{\isacharequal}}\ false{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{5D}{\isacharbrackright}}\isanewline
wenzelm@43526
    43
\isanewline
wenzelm@43526
    44
\isacommand{notepad}\isamarkupfalse%
wenzelm@43526
    45
\isanewline
wenzelm@43526
    46
\isakeyword{begin}\isanewline
wenzelm@43526
    47
%
wenzelm@43526
    48
\isadelimproof
wenzelm@43526
    49
\ \ %
wenzelm@43526
    50
\endisadelimproof
wenzelm@43526
    51
%
wenzelm@43526
    52
\isatagproof
wenzelm@43526
    53
\isacommand{note}\isamarkupfalse%
wenzelm@43526
    54
\ {\isaliteral{5B}{\isacharbrackleft}}{\isaliteral{5B}{\isacharbrackleft}}show{\isaliteral{5F}{\isacharunderscore}}main{\isaliteral{5F}{\isacharunderscore}}goal\ {\isaliteral{3D}{\isacharequal}}\ true{\isaliteral{5D}{\isacharbrackright}}{\isaliteral{5D}{\isacharbrackright}}%
wenzelm@43526
    55
\endisatagproof
wenzelm@43526
    56
{\isafoldproof}%
wenzelm@43526
    57
%
wenzelm@43526
    58
\isadelimproof
wenzelm@43526
    59
\isanewline
wenzelm@43526
    60
%
wenzelm@43526
    61
\endisadelimproof
wenzelm@43526
    62
\isacommand{end}\isamarkupfalse%
wenzelm@43526
    63
%
wenzelm@43526
    64
\begin{isamarkuptext}%
wenzelm@43526
    65
For historical reasons, some tools cannot take the full proof
wenzelm@26782
    66
  context into account and merely refer to the background theory.
wenzelm@26782
    67
  This is accommodated by configuration options being declared as
wenzelm@26782
    68
  ``global'', which may not be changed within a local context.
wenzelm@26782
    69
wenzelm@26782
    70
  \begin{matharray}{rcll}
wenzelm@40685
    71
    \indexdef{}{command}{print\_configs}\hypertarget{command.print-configs}{\hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}configs}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
wenzelm@26782
    72
  \end{matharray}
wenzelm@26782
    73
wenzelm@43467
    74
  \begin{railoutput}
wenzelm@43535
    75
\rail@begin{6}{}
wenzelm@43467
    76
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
    77
\rail@bar
wenzelm@43467
    78
\rail@nextbar{1}
wenzelm@43467
    79
\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
wenzelm@43467
    80
\rail@bar
wenzelm@43467
    81
\rail@term{\isa{true}}[]
wenzelm@43467
    82
\rail@nextbar{2}
wenzelm@43467
    83
\rail@term{\isa{false}}[]
wenzelm@43467
    84
\rail@nextbar{3}
wenzelm@43467
    85
\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
wenzelm@43467
    86
\rail@nextbar{4}
wenzelm@43467
    87
\rail@nont{\hyperlink{syntax.float}{\mbox{\isa{float}}}}[]
wenzelm@43467
    88
\rail@nextbar{5}
wenzelm@43467
    89
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
    90
\rail@endbar
wenzelm@43467
    91
\rail@endbar
wenzelm@43467
    92
\rail@end
wenzelm@43467
    93
\end{railoutput}
wenzelm@43467
    94
wenzelm@26782
    95
wenzelm@28788
    96
  \begin{description}
wenzelm@26782
    97
  
wenzelm@40685
    98
  \item \hyperlink{command.print-configs}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}configs}}}} prints the available configuration
wenzelm@28788
    99
  options, with names, types, and current values.
wenzelm@26782
   100
  
wenzelm@40685
   101
  \item \isa{{\isaliteral{22}{\isachardoublequote}}name\ {\isaliteral{3D}{\isacharequal}}\ value{\isaliteral{22}{\isachardoublequote}}} as an attribute expression modifies the
wenzelm@28788
   102
  named option, with the syntax of the value depending on the option's
wenzelm@28788
   103
  type.  For \verb|bool| the default value is \isa{true}.  Any
wenzelm@28788
   104
  attempt to change a global option in a local context is ignored.
wenzelm@26782
   105
wenzelm@28788
   106
  \end{description}%
wenzelm@26782
   107
\end{isamarkuptext}%
wenzelm@26782
   108
\isamarkuptrue%
wenzelm@26782
   109
%
wenzelm@27042
   110
\isamarkupsection{Basic proof tools%
wenzelm@26782
   111
}
wenzelm@26782
   112
\isamarkuptrue%
wenzelm@26782
   113
%
wenzelm@26782
   114
\isamarkupsubsection{Miscellaneous methods and attributes \label{sec:misc-meth-att}%
wenzelm@26782
   115
}
wenzelm@26782
   116
\isamarkuptrue%
wenzelm@26782
   117
%
wenzelm@26782
   118
\begin{isamarkuptext}%
wenzelm@26782
   119
\begin{matharray}{rcl}
wenzelm@28788
   120
    \indexdef{}{method}{unfold}\hypertarget{method.unfold}{\hyperlink{method.unfold}{\mbox{\isa{unfold}}}} & : & \isa{method} \\
wenzelm@28788
   121
    \indexdef{}{method}{fold}\hypertarget{method.fold}{\hyperlink{method.fold}{\mbox{\isa{fold}}}} & : & \isa{method} \\
wenzelm@28788
   122
    \indexdef{}{method}{insert}\hypertarget{method.insert}{\hyperlink{method.insert}{\mbox{\isa{insert}}}} & : & \isa{method} \\[0.5ex]
wenzelm@40685
   123
    \indexdef{}{method}{erule}\hypertarget{method.erule}{\hyperlink{method.erule}{\mbox{\isa{erule}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   124
    \indexdef{}{method}{drule}\hypertarget{method.drule}{\hyperlink{method.drule}{\mbox{\isa{drule}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   125
    \indexdef{}{method}{frule}\hypertarget{method.frule}{\hyperlink{method.frule}{\mbox{\isa{frule}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@44236
   126
    \indexdef{}{method}{intro}\hypertarget{method.intro}{\hyperlink{method.intro}{\mbox{\isa{intro}}}} & : & \isa{method} \\
wenzelm@44236
   127
    \indexdef{}{method}{elim}\hypertarget{method.elim}{\hyperlink{method.elim}{\mbox{\isa{elim}}}} & : & \isa{method} \\
wenzelm@28788
   128
    \indexdef{}{method}{succeed}\hypertarget{method.succeed}{\hyperlink{method.succeed}{\mbox{\isa{succeed}}}} & : & \isa{method} \\
wenzelm@28788
   129
    \indexdef{}{method}{fail}\hypertarget{method.fail}{\hyperlink{method.fail}{\mbox{\isa{fail}}}} & : & \isa{method} \\
wenzelm@26782
   130
  \end{matharray}
wenzelm@26782
   131
wenzelm@43467
   132
  \begin{railoutput}
wenzelm@43535
   133
\rail@begin{3}{}
wenzelm@43467
   134
\rail@bar
wenzelm@43467
   135
\rail@term{\hyperlink{method.fold}{\mbox{\isa{fold}}}}[]
wenzelm@43467
   136
\rail@nextbar{1}
wenzelm@43467
   137
\rail@term{\hyperlink{method.unfold}{\mbox{\isa{unfold}}}}[]
wenzelm@43467
   138
\rail@nextbar{2}
wenzelm@43467
   139
\rail@term{\hyperlink{method.insert}{\mbox{\isa{insert}}}}[]
wenzelm@43467
   140
\rail@endbar
wenzelm@43467
   141
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   142
\rail@end
wenzelm@43535
   143
\rail@begin{3}{}
wenzelm@43467
   144
\rail@bar
wenzelm@43467
   145
\rail@term{\hyperlink{method.erule}{\mbox{\isa{erule}}}}[]
wenzelm@43467
   146
\rail@nextbar{1}
wenzelm@43467
   147
\rail@term{\hyperlink{method.drule}{\mbox{\isa{drule}}}}[]
wenzelm@43467
   148
\rail@nextbar{2}
wenzelm@43467
   149
\rail@term{\hyperlink{method.frule}{\mbox{\isa{frule}}}}[]
wenzelm@43467
   150
\rail@endbar
wenzelm@43467
   151
\rail@bar
wenzelm@43467
   152
\rail@nextbar{1}
wenzelm@43467
   153
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
   154
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@43467
   155
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
   156
\rail@endbar
wenzelm@43467
   157
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   158
\rail@end
wenzelm@44236
   159
\rail@begin{2}{}
wenzelm@44236
   160
\rail@bar
wenzelm@44236
   161
\rail@term{\hyperlink{method.intro}{\mbox{\isa{intro}}}}[]
wenzelm@44236
   162
\rail@nextbar{1}
wenzelm@44236
   163
\rail@term{\hyperlink{method.elim}{\mbox{\isa{elim}}}}[]
wenzelm@44236
   164
\rail@endbar
wenzelm@44236
   165
\rail@bar
wenzelm@44236
   166
\rail@nextbar{1}
wenzelm@44236
   167
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@44236
   168
\rail@endbar
wenzelm@44236
   169
\rail@end
wenzelm@43467
   170
\end{railoutput}
wenzelm@43467
   171
wenzelm@26782
   172
wenzelm@28788
   173
  \begin{description}
wenzelm@26782
   174
  
wenzelm@40685
   175
  \item \hyperlink{method.unfold}{\mbox{\isa{unfold}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} and \hyperlink{method.fold}{\mbox{\isa{fold}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} expand (or fold back) the given definitions throughout
wenzelm@28788
   176
  all goals; any chained facts provided are inserted into the goal and
wenzelm@28788
   177
  subject to rewriting as well.
wenzelm@26782
   178
wenzelm@40685
   179
  \item \hyperlink{method.insert}{\mbox{\isa{insert}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} inserts theorems as facts
wenzelm@28788
   180
  into all goals of the proof state.  Note that current facts
wenzelm@28788
   181
  indicated for forward chaining are ignored.
wenzelm@26782
   182
wenzelm@40685
   183
  \item \hyperlink{method.erule}{\mbox{\isa{erule}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}, \hyperlink{method.drule}{\mbox{\isa{drule}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}, and \hyperlink{method.frule}{\mbox{\isa{frule}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} are similar to the basic \hyperlink{method.rule}{\mbox{\isa{rule}}}
wenzelm@30397
   184
  method (see \secref{sec:pure-meth-att}), but apply rules by
wenzelm@30397
   185
  elim-resolution, destruct-resolution, and forward-resolution,
wenzelm@30397
   186
  respectively \cite{isabelle-implementation}.  The optional natural
wenzelm@30397
   187
  number argument (default 0) specifies additional assumption steps to
wenzelm@30397
   188
  be performed here.
wenzelm@26782
   189
wenzelm@26782
   190
  Note that these methods are improper ones, mainly serving for
wenzelm@26782
   191
  experimentation and tactic script emulation.  Different modes of
wenzelm@26782
   192
  basic rule application are usually expressed in Isar at the proof
wenzelm@26782
   193
  language level, rather than via implicit proof state manipulations.
wenzelm@26782
   194
  For example, a proper single-step elimination would be done using
wenzelm@26902
   195
  the plain \hyperlink{method.rule}{\mbox{\isa{rule}}} method, with forward chaining of current
wenzelm@26782
   196
  facts.
wenzelm@26782
   197
wenzelm@44236
   198
  \item \hyperlink{method.intro}{\mbox{\isa{intro}}} and \hyperlink{method.elim}{\mbox{\isa{elim}}} repeatedly refine some goal
wenzelm@44236
   199
  by intro- or elim-resolution, after having inserted any chained
wenzelm@44236
   200
  facts.  Exactly the rules given as arguments are taken into account;
wenzelm@44236
   201
  this allows fine-tuned decomposition of a proof problem, in contrast
wenzelm@44236
   202
  to common automated tools.
wenzelm@44236
   203
wenzelm@28788
   204
  \item \hyperlink{method.succeed}{\mbox{\isa{succeed}}} yields a single (unchanged) result; it is
wenzelm@40685
   205
  the identity of the ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2C}{\isacharcomma}}{\isaliteral{22}{\isachardoublequote}}}'' method combinator (cf.\
wenzelm@28788
   206
  \secref{sec:proof-meth}).
wenzelm@26782
   207
wenzelm@28788
   208
  \item \hyperlink{method.fail}{\mbox{\isa{fail}}} yields an empty result sequence; it is the
wenzelm@40685
   209
  identity of the ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{7C}{\isacharbar}}{\isaliteral{22}{\isachardoublequote}}}'' method combinator (cf.\
wenzelm@28788
   210
  \secref{sec:proof-meth}).
wenzelm@26782
   211
wenzelm@28788
   212
  \end{description}
wenzelm@26782
   213
wenzelm@26782
   214
  \begin{matharray}{rcl}
wenzelm@28788
   215
    \indexdef{}{attribute}{tagged}\hypertarget{attribute.tagged}{\hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}} & : & \isa{attribute} \\
wenzelm@28788
   216
    \indexdef{}{attribute}{untagged}\hypertarget{attribute.untagged}{\hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}} & : & \isa{attribute} \\[0.5ex]
wenzelm@28788
   217
    \indexdef{}{attribute}{THEN}\hypertarget{attribute.THEN}{\hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}} & : & \isa{attribute} \\
wenzelm@28788
   218
    \indexdef{}{attribute}{COMP}\hypertarget{attribute.COMP}{\hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}} & : & \isa{attribute} \\[0.5ex]
wenzelm@28788
   219
    \indexdef{}{attribute}{unfolded}\hypertarget{attribute.unfolded}{\hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}} & : & \isa{attribute} \\
wenzelm@28788
   220
    \indexdef{}{attribute}{folded}\hypertarget{attribute.folded}{\hyperlink{attribute.folded}{\mbox{\isa{folded}}}} & : & \isa{attribute} \\[0.5ex]
wenzelm@28788
   221
    \indexdef{}{attribute}{rotated}\hypertarget{attribute.rotated}{\hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}} & : & \isa{attribute} \\
wenzelm@40685
   222
    \indexdef{Pure}{attribute}{elim\_format}\hypertarget{attribute.Pure.elim-format}{\hyperlink{attribute.Pure.elim-format}{\mbox{\isa{elim{\isaliteral{5F}{\isacharunderscore}}format}}}} & : & \isa{attribute} \\
wenzelm@40685
   223
    \indexdef{}{attribute}{standard}\hypertarget{attribute.standard}{\hyperlink{attribute.standard}{\mbox{\isa{standard}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{attribute} \\
wenzelm@40685
   224
    \indexdef{}{attribute}{no\_vars}\hypertarget{attribute.no-vars}{\hyperlink{attribute.no-vars}{\mbox{\isa{no{\isaliteral{5F}{\isacharunderscore}}vars}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{attribute} \\
wenzelm@26782
   225
  \end{matharray}
wenzelm@26782
   226
wenzelm@43467
   227
  \begin{railoutput}
wenzelm@43535
   228
\rail@begin{1}{}
wenzelm@43467
   229
\rail@term{\hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}}[]
wenzelm@43467
   230
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   231
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   232
\rail@end
wenzelm@43535
   233
\rail@begin{1}{}
wenzelm@43467
   234
\rail@term{\hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}}[]
wenzelm@43467
   235
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   236
\rail@end
wenzelm@43535
   237
\rail@begin{2}{}
wenzelm@43467
   238
\rail@bar
wenzelm@43467
   239
\rail@term{\hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}}[]
wenzelm@43467
   240
\rail@nextbar{1}
wenzelm@43467
   241
\rail@term{\hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}}[]
wenzelm@43467
   242
\rail@endbar
wenzelm@43467
   243
\rail@bar
wenzelm@43467
   244
\rail@nextbar{1}
wenzelm@43467
   245
\rail@term{\isa{{\isaliteral{5B}{\isacharbrackleft}}}}[]
wenzelm@43467
   246
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@43467
   247
\rail@term{\isa{{\isaliteral{5D}{\isacharbrackright}}}}[]
wenzelm@43467
   248
\rail@endbar
wenzelm@43467
   249
\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
wenzelm@43467
   250
\rail@end
wenzelm@43535
   251
\rail@begin{2}{}
wenzelm@43467
   252
\rail@bar
wenzelm@43467
   253
\rail@term{\hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}}[]
wenzelm@43467
   254
\rail@nextbar{1}
wenzelm@43467
   255
\rail@term{\hyperlink{attribute.folded}{\mbox{\isa{folded}}}}[]
wenzelm@43467
   256
\rail@endbar
wenzelm@43467
   257
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   258
\rail@end
wenzelm@43535
   259
\rail@begin{2}{}
wenzelm@43467
   260
\rail@term{\hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}}[]
wenzelm@43467
   261
\rail@bar
wenzelm@43467
   262
\rail@nextbar{1}
wenzelm@43467
   263
\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
wenzelm@43467
   264
\rail@endbar
wenzelm@43467
   265
\rail@end
wenzelm@43467
   266
\end{railoutput}
wenzelm@43467
   267
wenzelm@26782
   268
wenzelm@28788
   269
  \begin{description}
wenzelm@26782
   270
wenzelm@40685
   271
  \item \hyperlink{attribute.tagged}{\mbox{\isa{tagged}}}~\isa{{\isaliteral{22}{\isachardoublequote}}name\ value{\isaliteral{22}{\isachardoublequote}}} and \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}}~\isa{name} add and remove \emph{tags} of some theorem.
wenzelm@26782
   272
  Tags may be any list of string pairs that serve as formal comment.
wenzelm@28788
   273
  The first string is considered the tag name, the second its value.
wenzelm@28788
   274
  Note that \hyperlink{attribute.untagged}{\mbox{\isa{untagged}}} removes any tags of the same name.
wenzelm@26782
   275
wenzelm@28788
   276
  \item \hyperlink{attribute.THEN}{\mbox{\isa{THEN}}}~\isa{a} and \hyperlink{attribute.COMP}{\mbox{\isa{COMP}}}~\isa{a}
wenzelm@26902
   277
  compose rules by resolution.  \hyperlink{attribute.THEN}{\mbox{\isa{THEN}}} resolves with the
wenzelm@26782
   278
  first premise of \isa{a} (an alternative position may be also
wenzelm@26902
   279
  specified); the \hyperlink{attribute.COMP}{\mbox{\isa{COMP}}} version skips the automatic
wenzelm@30463
   280
  lifting process that is normally intended (cf.\ \verb|op RS| and
wenzelm@30463
   281
  \verb|op COMP| in \cite{isabelle-implementation}).
wenzelm@26782
   282
  
wenzelm@40685
   283
  \item \hyperlink{attribute.unfolded}{\mbox{\isa{unfolded}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} and \hyperlink{attribute.folded}{\mbox{\isa{folded}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} expand and fold back again the given
wenzelm@28788
   284
  definitions throughout a rule.
wenzelm@26782
   285
wenzelm@28788
   286
  \item \hyperlink{attribute.rotated}{\mbox{\isa{rotated}}}~\isa{n} rotate the premises of a
wenzelm@26782
   287
  theorem by \isa{n} (default 1).
wenzelm@26782
   288
wenzelm@40685
   289
  \item \hyperlink{attribute.Pure.elim-format}{\mbox{\isa{elim{\isaliteral{5F}{\isacharunderscore}}format}}} turns a destruction rule into
wenzelm@40685
   290
  elimination rule format, by resolving with the rule \isa{{\isaliteral{22}{\isachardoublequote}}PROP\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}PROP\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ PROP\ B{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ PROP\ B{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@26782
   291
  
wenzelm@26782
   292
  Note that the Classical Reasoner (\secref{sec:classical}) provides
wenzelm@26782
   293
  its own version of this operation.
wenzelm@26782
   294
wenzelm@28788
   295
  \item \hyperlink{attribute.standard}{\mbox{\isa{standard}}} puts a theorem into the standard form of
wenzelm@28788
   296
  object-rules at the outermost theory level.  Note that this
wenzelm@26782
   297
  operation violates the local proof context (including active
wenzelm@26782
   298
  locales).
wenzelm@26782
   299
wenzelm@40685
   300
  \item \hyperlink{attribute.no-vars}{\mbox{\isa{no{\isaliteral{5F}{\isacharunderscore}}vars}}} replaces schematic variables by free
wenzelm@26782
   301
  ones; this is mainly for tuning output of pretty printed theorems.
wenzelm@26782
   302
wenzelm@28788
   303
  \end{description}%
wenzelm@26782
   304
\end{isamarkuptext}%
wenzelm@26782
   305
\isamarkuptrue%
wenzelm@26782
   306
%
wenzelm@27047
   307
\isamarkupsubsection{Low-level equational reasoning%
wenzelm@27047
   308
}
wenzelm@27047
   309
\isamarkuptrue%
wenzelm@27047
   310
%
wenzelm@27047
   311
\begin{isamarkuptext}%
wenzelm@27047
   312
\begin{matharray}{rcl}
wenzelm@28788
   313
    \indexdef{}{method}{subst}\hypertarget{method.subst}{\hyperlink{method.subst}{\mbox{\isa{subst}}}} & : & \isa{method} \\
wenzelm@28788
   314
    \indexdef{}{method}{hypsubst}\hypertarget{method.hypsubst}{\hyperlink{method.hypsubst}{\mbox{\isa{hypsubst}}}} & : & \isa{method} \\
wenzelm@28788
   315
    \indexdef{}{method}{split}\hypertarget{method.split}{\hyperlink{method.split}{\mbox{\isa{split}}}} & : & \isa{method} \\
wenzelm@27047
   316
  \end{matharray}
wenzelm@27047
   317
wenzelm@43467
   318
  \begin{railoutput}
wenzelm@43575
   319
\rail@begin{6}{}
wenzelm@43467
   320
\rail@term{\hyperlink{method.subst}{\mbox{\isa{subst}}}}[]
wenzelm@43467
   321
\rail@bar
wenzelm@43467
   322
\rail@nextbar{1}
wenzelm@43467
   323
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
   324
\rail@term{\isa{asm}}[]
wenzelm@43467
   325
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
   326
\rail@endbar
wenzelm@43575
   327
\rail@cr{3}
wenzelm@43467
   328
\rail@bar
wenzelm@43575
   329
\rail@nextbar{4}
wenzelm@43467
   330
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
   331
\rail@plus
wenzelm@43467
   332
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@43575
   333
\rail@nextplus{5}
wenzelm@43467
   334
\rail@endplus
wenzelm@43467
   335
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
   336
\rail@endbar
wenzelm@43467
   337
\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
wenzelm@43467
   338
\rail@end
wenzelm@44965
   339
\rail@begin{1}{}
wenzelm@43467
   340
\rail@term{\hyperlink{method.split}{\mbox{\isa{split}}}}[]
wenzelm@43467
   341
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   342
\rail@end
wenzelm@43467
   343
\end{railoutput}
wenzelm@43467
   344
wenzelm@27047
   345
wenzelm@27047
   346
  These methods provide low-level facilities for equational reasoning
wenzelm@27047
   347
  that are intended for specialized applications only.  Normally,
wenzelm@27047
   348
  single step calculations would be performed in a structured text
wenzelm@27047
   349
  (see also \secref{sec:calculation}), while the Simplifier methods
wenzelm@27047
   350
  provide the canonical way for automated normalization (see
wenzelm@27047
   351
  \secref{sec:simplifier}).
wenzelm@27047
   352
wenzelm@28788
   353
  \begin{description}
wenzelm@27047
   354
wenzelm@28788
   355
  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{eq} performs a single substitution step
wenzelm@28788
   356
  using rule \isa{eq}, which may be either a meta or object
wenzelm@27047
   357
  equality.
wenzelm@27047
   358
wenzelm@40685
   359
  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}asm{\isaliteral{29}{\isacharparenright}}\ eq{\isaliteral{22}{\isachardoublequote}}} substitutes in an
wenzelm@27047
   360
  assumption.
wenzelm@27047
   361
wenzelm@40685
   362
  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}i\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ j{\isaliteral{29}{\isacharparenright}}\ eq{\isaliteral{22}{\isachardoublequote}}} performs several
wenzelm@27047
   363
  substitutions in the conclusion. The numbers \isa{i} to \isa{j}
wenzelm@27047
   364
  indicate the positions to substitute at.  Positions are ordered from
wenzelm@27047
   365
  the top of the term tree moving down from left to right. For
wenzelm@40685
   366
  example, in \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}a\ {\isaliteral{2B}{\isacharplus}}\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{2B}{\isacharplus}}\ {\isaliteral{28}{\isacharparenleft}}c\ {\isaliteral{2B}{\isacharplus}}\ d{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} there are three positions
wenzelm@40685
   367
  where commutativity of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2B}{\isacharplus}}{\isaliteral{22}{\isachardoublequote}}} is applicable: 1 refers to \isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{2B}{\isacharplus}}\ b{\isaliteral{22}{\isachardoublequote}}}, 2 to the whole term, and 3 to \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{2B}{\isacharplus}}\ d{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@27047
   368
wenzelm@40685
   369
  If the positions in the list \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}i\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ j{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} are non-overlapping
wenzelm@40685
   370
  (e.g.\ \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isadigit{2}}\ {\isadigit{3}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} in \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}a\ {\isaliteral{2B}{\isacharplus}}\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{2B}{\isacharplus}}\ {\isaliteral{28}{\isacharparenleft}}c\ {\isaliteral{2B}{\isacharplus}}\ d{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}) you may
wenzelm@27047
   371
  assume all substitutions are performed simultaneously.  Otherwise
wenzelm@27047
   372
  the behaviour of \isa{subst} is not specified.
wenzelm@27047
   373
wenzelm@40685
   374
  \item \hyperlink{method.subst}{\mbox{\isa{subst}}}~\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}asm{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{28}{\isacharparenleft}}i\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ j{\isaliteral{29}{\isacharparenright}}\ eq{\isaliteral{22}{\isachardoublequote}}} performs the
wenzelm@27072
   375
  substitutions in the assumptions. The positions refer to the
wenzelm@27072
   376
  assumptions in order from left to right.  For example, given in a
wenzelm@40685
   377
  goal of the form \isa{{\isaliteral{22}{\isachardoublequote}}P\ {\isaliteral{28}{\isacharparenleft}}a\ {\isaliteral{2B}{\isacharplus}}\ b{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ {\isaliteral{28}{\isacharparenleft}}c\ {\isaliteral{2B}{\isacharplus}}\ d{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{22}{\isachardoublequote}}}, position 1 of
wenzelm@40685
   378
  commutativity of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{2B}{\isacharplus}}{\isaliteral{22}{\isachardoublequote}}} is the subterm \isa{{\isaliteral{22}{\isachardoublequote}}a\ {\isaliteral{2B}{\isacharplus}}\ b{\isaliteral{22}{\isachardoublequote}}} and
wenzelm@40685
   379
  position 2 is the subterm \isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{2B}{\isacharplus}}\ d{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@27047
   380
wenzelm@28788
   381
  \item \hyperlink{method.hypsubst}{\mbox{\isa{hypsubst}}} performs substitution using some
wenzelm@40685
   382
  assumption; this only works for equations of the form \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3D}{\isacharequal}}\ t{\isaliteral{22}{\isachardoublequote}}} where \isa{x} is a free or bound variable.
wenzelm@27047
   383
wenzelm@40685
   384
  \item \hyperlink{method.split}{\mbox{\isa{split}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} performs single-step case
wenzelm@44965
   385
  splitting using the given rules.  Splitting is performed in the
wenzelm@44965
   386
  conclusion or some assumption of the subgoal, depending of the
wenzelm@44965
   387
  structure of the rule.
wenzelm@27047
   388
  
wenzelm@27047
   389
  Note that the \hyperlink{method.simp}{\mbox{\isa{simp}}} method already involves repeated
wenzelm@44965
   390
  application of split rules as declared in the current context, using
wenzelm@44965
   391
  \hyperlink{attribute.split}{\mbox{\isa{split}}}, for example.
wenzelm@27047
   392
wenzelm@28788
   393
  \end{description}%
wenzelm@27047
   394
\end{isamarkuptext}%
wenzelm@27047
   395
\isamarkuptrue%
wenzelm@27047
   396
%
wenzelm@26782
   397
\isamarkupsubsection{Further tactic emulations \label{sec:tactics}%
wenzelm@26782
   398
}
wenzelm@26782
   399
\isamarkuptrue%
wenzelm@26782
   400
%
wenzelm@26782
   401
\begin{isamarkuptext}%
wenzelm@26782
   402
The following improper proof methods emulate traditional tactics.
wenzelm@26782
   403
  These admit direct access to the goal state, which is normally
wenzelm@26782
   404
  considered harmful!  In particular, this may involve both numbered
wenzelm@26782
   405
  goal addressing (default 1), and dynamic instantiation within the
wenzelm@26782
   406
  scope of some subgoal.
wenzelm@26782
   407
wenzelm@26782
   408
  \begin{warn}
wenzelm@26782
   409
    Dynamic instantiations refer to universally quantified parameters
wenzelm@26782
   410
    of a subgoal (the dynamic context) rather than fixed variables and
wenzelm@26782
   411
    term abbreviations of a (static) Isar context.
wenzelm@26782
   412
  \end{warn}
wenzelm@26782
   413
wenzelm@26782
   414
  Tactic emulation methods, unlike their ML counterparts, admit
wenzelm@26782
   415
  simultaneous instantiation from both dynamic and static contexts.
wenzelm@26782
   416
  If names occur in both contexts goal parameters hide locally fixed
wenzelm@26782
   417
  variables.  Likewise, schematic variables refer to term
wenzelm@26782
   418
  abbreviations, if present in the static context.  Otherwise the
wenzelm@26782
   419
  schematic variable is interpreted as a schematic variable and left
wenzelm@26782
   420
  to be solved by unification with certain parts of the subgoal.
wenzelm@26782
   421
wenzelm@26782
   422
  Note that the tactic emulation proof methods in Isabelle/Isar are
wenzelm@40685
   423
  consistently named \isa{foo{\isaliteral{5F}{\isacharunderscore}}tac}.  Note also that variable names
wenzelm@26782
   424
  occurring on left hand sides of instantiations must be preceded by a
wenzelm@26782
   425
  question mark if they coincide with a keyword or contain dots.  This
wenzelm@26902
   426
  is consistent with the attribute \hyperlink{attribute.where}{\mbox{\isa{where}}} (see
wenzelm@26782
   427
  \secref{sec:pure-meth-att}).
wenzelm@26782
   428
wenzelm@26782
   429
  \begin{matharray}{rcl}
wenzelm@40685
   430
    \indexdef{}{method}{rule\_tac}\hypertarget{method.rule-tac}{\hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   431
    \indexdef{}{method}{erule\_tac}\hypertarget{method.erule-tac}{\hyperlink{method.erule-tac}{\mbox{\isa{erule{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   432
    \indexdef{}{method}{drule\_tac}\hypertarget{method.drule-tac}{\hyperlink{method.drule-tac}{\mbox{\isa{drule{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   433
    \indexdef{}{method}{frule\_tac}\hypertarget{method.frule-tac}{\hyperlink{method.frule-tac}{\mbox{\isa{frule{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   434
    \indexdef{}{method}{cut\_tac}\hypertarget{method.cut-tac}{\hyperlink{method.cut-tac}{\mbox{\isa{cut{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   435
    \indexdef{}{method}{thin\_tac}\hypertarget{method.thin-tac}{\hyperlink{method.thin-tac}{\mbox{\isa{thin{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   436
    \indexdef{}{method}{subgoal\_tac}\hypertarget{method.subgoal-tac}{\hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   437
    \indexdef{}{method}{rename\_tac}\hypertarget{method.rename-tac}{\hyperlink{method.rename-tac}{\mbox{\isa{rename{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   438
    \indexdef{}{method}{rotate\_tac}\hypertarget{method.rotate-tac}{\hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isaliteral{5F}{\isacharunderscore}}tac}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   439
    \indexdef{}{method}{tactic}\hypertarget{method.tactic}{\hyperlink{method.tactic}{\mbox{\isa{tactic}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@40685
   440
    \indexdef{}{method}{raw\_tactic}\hypertarget{method.raw-tactic}{\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isaliteral{5F}{\isacharunderscore}}tactic}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{method} \\
wenzelm@26782
   441
  \end{matharray}
wenzelm@26782
   442
wenzelm@43467
   443
  \begin{railoutput}
wenzelm@43575
   444
\rail@begin{9}{}
wenzelm@43467
   445
\rail@bar
wenzelm@43467
   446
\rail@term{\hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   447
\rail@nextbar{1}
wenzelm@43467
   448
\rail@term{\hyperlink{method.erule-tac}{\mbox{\isa{erule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   449
\rail@nextbar{2}
wenzelm@43467
   450
\rail@term{\hyperlink{method.drule-tac}{\mbox{\isa{drule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   451
\rail@nextbar{3}
wenzelm@43467
   452
\rail@term{\hyperlink{method.frule-tac}{\mbox{\isa{frule{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   453
\rail@nextbar{4}
wenzelm@43467
   454
\rail@term{\hyperlink{method.cut-tac}{\mbox{\isa{cut{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   455
\rail@nextbar{5}
wenzelm@43467
   456
\rail@term{\hyperlink{method.thin-tac}{\mbox{\isa{thin{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   457
\rail@endbar
wenzelm@43467
   458
\rail@bar
wenzelm@43467
   459
\rail@nextbar{1}
wenzelm@43576
   460
\rail@nont{\hyperlink{syntax.goal-spec}{\mbox{\isa{goal{\isaliteral{5F}{\isacharunderscore}}spec}}}}[]
wenzelm@43467
   461
\rail@endbar
wenzelm@43575
   462
\rail@cr{7}
wenzelm@43467
   463
\rail@bar
wenzelm@43488
   464
\rail@nont{\isa{dynamic{\isaliteral{5F}{\isacharunderscore}}insts}}[]
wenzelm@43488
   465
\rail@term{\isa{\isakeyword{in}}}[]
wenzelm@43467
   466
\rail@nont{\hyperlink{syntax.thmref}{\mbox{\isa{thmref}}}}[]
wenzelm@43575
   467
\rail@nextbar{8}
wenzelm@43467
   468
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   469
\rail@endbar
wenzelm@43467
   470
\rail@end
wenzelm@43535
   471
\rail@begin{2}{}
wenzelm@43467
   472
\rail@term{\hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   473
\rail@bar
wenzelm@43467
   474
\rail@nextbar{1}
wenzelm@43576
   475
\rail@nont{\hyperlink{syntax.goal-spec}{\mbox{\isa{goal{\isaliteral{5F}{\isacharunderscore}}spec}}}}[]
wenzelm@43467
   476
\rail@endbar
wenzelm@43467
   477
\rail@plus
wenzelm@43467
   478
\rail@nont{\hyperlink{syntax.prop}{\mbox{\isa{prop}}}}[]
wenzelm@43467
   479
\rail@nextplus{1}
wenzelm@43467
   480
\rail@endplus
wenzelm@43467
   481
\rail@end
wenzelm@43535
   482
\rail@begin{2}{}
wenzelm@43467
   483
\rail@term{\hyperlink{method.rename-tac}{\mbox{\isa{rename{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   484
\rail@bar
wenzelm@43467
   485
\rail@nextbar{1}
wenzelm@43576
   486
\rail@nont{\hyperlink{syntax.goal-spec}{\mbox{\isa{goal{\isaliteral{5F}{\isacharunderscore}}spec}}}}[]
wenzelm@43467
   487
\rail@endbar
wenzelm@43467
   488
\rail@plus
wenzelm@43467
   489
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   490
\rail@nextplus{1}
wenzelm@43467
   491
\rail@endplus
wenzelm@43467
   492
\rail@end
wenzelm@43535
   493
\rail@begin{2}{}
wenzelm@43467
   494
\rail@term{\hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isaliteral{5F}{\isacharunderscore}}tac}}}}[]
wenzelm@43467
   495
\rail@bar
wenzelm@43467
   496
\rail@nextbar{1}
wenzelm@43576
   497
\rail@nont{\hyperlink{syntax.goal-spec}{\mbox{\isa{goal{\isaliteral{5F}{\isacharunderscore}}spec}}}}[]
wenzelm@43467
   498
\rail@endbar
wenzelm@43467
   499
\rail@bar
wenzelm@43467
   500
\rail@nextbar{1}
wenzelm@43467
   501
\rail@nont{\hyperlink{syntax.int}{\mbox{\isa{int}}}}[]
wenzelm@43467
   502
\rail@endbar
wenzelm@43467
   503
\rail@end
wenzelm@43535
   504
\rail@begin{2}{}
wenzelm@43467
   505
\rail@bar
wenzelm@43467
   506
\rail@term{\hyperlink{method.tactic}{\mbox{\isa{tactic}}}}[]
wenzelm@43467
   507
\rail@nextbar{1}
wenzelm@43467
   508
\rail@term{\hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isaliteral{5F}{\isacharunderscore}}tactic}}}}[]
wenzelm@43467
   509
\rail@endbar
wenzelm@43467
   510
\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
wenzelm@43467
   511
\rail@end
wenzelm@43488
   512
\rail@begin{2}{\isa{dynamic{\isaliteral{5F}{\isacharunderscore}}insts}}
wenzelm@43467
   513
\rail@plus
wenzelm@43467
   514
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   515
\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
wenzelm@43467
   516
\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
wenzelm@43467
   517
\rail@nextplus{1}
wenzelm@43467
   518
\rail@cterm{\isa{\isakeyword{and}}}[]
wenzelm@43467
   519
\rail@endplus
wenzelm@43467
   520
\rail@end
wenzelm@43467
   521
\end{railoutput}
wenzelm@43488
   522
wenzelm@26782
   523
wenzelm@28788
   524
\begin{description}
wenzelm@26782
   525
wenzelm@40685
   526
  \item \hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}} etc. do resolution of rules with explicit
wenzelm@30397
   527
  instantiation.  This works the same way as the ML tactics \verb|res_inst_tac| etc. (see \cite{isabelle-implementation})
wenzelm@26782
   528
wenzelm@26782
   529
  Multiple rules may be only given if there is no instantiation; then
wenzelm@40685
   530
  \hyperlink{method.rule-tac}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}tac}}} is the same as \verb|resolve_tac| in ML (see
wenzelm@30397
   531
  \cite{isabelle-implementation}).
wenzelm@26782
   532
wenzelm@40685
   533
  \item \hyperlink{method.cut-tac}{\mbox{\isa{cut{\isaliteral{5F}{\isacharunderscore}}tac}}} inserts facts into the proof state as
wenzelm@27210
   534
  assumption of a subgoal, see also \verb|Tactic.cut_facts_tac| in
wenzelm@30397
   535
  \cite{isabelle-implementation}.  Note that the scope of schematic
wenzelm@26782
   536
  variables is spread over the main goal statement.  Instantiations
wenzelm@28788
   537
  may be given as well, see also ML tactic \verb|cut_inst_tac| in
wenzelm@30397
   538
  \cite{isabelle-implementation}.
wenzelm@26782
   539
wenzelm@40685
   540
  \item \hyperlink{method.thin-tac}{\mbox{\isa{thin{\isaliteral{5F}{\isacharunderscore}}tac}}}~\isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} deletes the specified assumption
wenzelm@40685
   541
  from a subgoal; note that \isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} may contain schematic variables.
wenzelm@30397
   542
  See also \verb|thin_tac| in \cite{isabelle-implementation}.
wenzelm@28788
   543
wenzelm@40685
   544
  \item \hyperlink{method.subgoal-tac}{\mbox{\isa{subgoal{\isaliteral{5F}{\isacharunderscore}}tac}}}~\isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} adds \isa{{\isaliteral{5C3C7068693E}{\isasymphi}}} as an
wenzelm@30397
   545
  assumption to a subgoal.  See also \verb|subgoal_tac| and \verb|subgoals_tac| in \cite{isabelle-implementation}.
wenzelm@26782
   546
wenzelm@40685
   547
  \item \hyperlink{method.rename-tac}{\mbox{\isa{rename{\isaliteral{5F}{\isacharunderscore}}tac}}}~\isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} renames parameters of a
wenzelm@40685
   548
  goal according to the list \isa{{\isaliteral{22}{\isachardoublequote}}x\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ x\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}, which refers to the
wenzelm@28788
   549
  \emph{suffix} of variables.
wenzelm@26782
   550
wenzelm@40685
   551
  \item \hyperlink{method.rotate-tac}{\mbox{\isa{rotate{\isaliteral{5F}{\isacharunderscore}}tac}}}~\isa{n} rotates the assumptions of a
wenzelm@26782
   552
  goal by \isa{n} positions: from right to left if \isa{n} is
wenzelm@26782
   553
  positive, and from left to right if \isa{n} is negative; the
wenzelm@26782
   554
  default value is 1.  See also \verb|rotate_tac| in
wenzelm@30397
   555
  \cite{isabelle-implementation}.
wenzelm@26782
   556
wenzelm@40685
   557
  \item \hyperlink{method.tactic}{\mbox{\isa{tactic}}}~\isa{{\isaliteral{22}{\isachardoublequote}}text{\isaliteral{22}{\isachardoublequote}}} produces a proof method from
wenzelm@26782
   558
  any ML text of type \verb|tactic|.  Apart from the usual ML
wenzelm@27224
   559
  environment and the current proof context, the ML code may refer to
wenzelm@27224
   560
  the locally bound values \verb|facts|, which indicates any
wenzelm@27224
   561
  current facts used for forward-chaining.
wenzelm@26782
   562
wenzelm@40685
   563
  \item \hyperlink{method.raw-tactic}{\mbox{\isa{raw{\isaliteral{5F}{\isacharunderscore}}tactic}}} is similar to \hyperlink{method.tactic}{\mbox{\isa{tactic}}}, but
wenzelm@27224
   564
  presents the goal state in its raw internal form, where simultaneous
wenzelm@27224
   565
  subgoals appear as conjunction of the logical framework instead of
wenzelm@27224
   566
  the usual split into several subgoals.  While feature this is useful
wenzelm@27224
   567
  for debugging of complex method definitions, it should not never
wenzelm@27224
   568
  appear in production theories.
wenzelm@26782
   569
wenzelm@28788
   570
  \end{description}%
wenzelm@26782
   571
\end{isamarkuptext}%
wenzelm@26782
   572
\isamarkuptrue%
wenzelm@26782
   573
%
wenzelm@27042
   574
\isamarkupsection{The Simplifier \label{sec:simplifier}%
wenzelm@26782
   575
}
wenzelm@26782
   576
\isamarkuptrue%
wenzelm@26782
   577
%
wenzelm@27042
   578
\isamarkupsubsection{Simplification methods%
wenzelm@26782
   579
}
wenzelm@26782
   580
\isamarkuptrue%
wenzelm@26782
   581
%
wenzelm@26782
   582
\begin{isamarkuptext}%
wenzelm@26782
   583
\begin{matharray}{rcl}
wenzelm@28788
   584
    \indexdef{}{method}{simp}\hypertarget{method.simp}{\hyperlink{method.simp}{\mbox{\isa{simp}}}} & : & \isa{method} \\
wenzelm@40685
   585
    \indexdef{}{method}{simp\_all}\hypertarget{method.simp-all}{\hyperlink{method.simp-all}{\mbox{\isa{simp{\isaliteral{5F}{\isacharunderscore}}all}}}} & : & \isa{method} \\
wenzelm@26782
   586
  \end{matharray}
wenzelm@26782
   587
wenzelm@43467
   588
  \begin{railoutput}
wenzelm@43535
   589
\rail@begin{2}{}
wenzelm@43467
   590
\rail@bar
wenzelm@43467
   591
\rail@term{\hyperlink{method.simp}{\mbox{\isa{simp}}}}[]
wenzelm@43467
   592
\rail@nextbar{1}
wenzelm@43467
   593
\rail@term{\hyperlink{method.simp-all}{\mbox{\isa{simp{\isaliteral{5F}{\isacharunderscore}}all}}}}[]
wenzelm@43467
   594
\rail@endbar
wenzelm@43467
   595
\rail@bar
wenzelm@43467
   596
\rail@nextbar{1}
wenzelm@43467
   597
\rail@nont{\isa{opt}}[]
wenzelm@43467
   598
\rail@endbar
wenzelm@43467
   599
\rail@plus
wenzelm@43467
   600
\rail@nextplus{1}
wenzelm@43467
   601
\rail@cnont{\hyperlink{syntax.simpmod}{\mbox{\isa{simpmod}}}}[]
wenzelm@43467
   602
\rail@endplus
wenzelm@43467
   603
\rail@end
wenzelm@43467
   604
\rail@begin{4}{\isa{opt}}
wenzelm@43467
   605
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
   606
\rail@bar
wenzelm@43467
   607
\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm}}[]
wenzelm@43467
   608
\rail@nextbar{1}
wenzelm@43467
   609
\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}simp}}[]
wenzelm@43467
   610
\rail@nextbar{2}
wenzelm@43467
   611
\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}use}}[]
wenzelm@43467
   612
\rail@nextbar{3}
wenzelm@43467
   613
\rail@term{\isa{asm{\isaliteral{5F}{\isacharunderscore}}lr}}[]
wenzelm@43467
   614
\rail@endbar
wenzelm@43467
   615
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
   616
\rail@end
wenzelm@43467
   617
\rail@begin{9}{\indexdef{}{syntax}{simpmod}\hypertarget{syntax.simpmod}{\hyperlink{syntax.simpmod}{\mbox{\isa{simpmod}}}}}
wenzelm@43467
   618
\rail@bar
wenzelm@43467
   619
\rail@term{\isa{add}}[]
wenzelm@43467
   620
\rail@nextbar{1}
wenzelm@43467
   621
\rail@term{\isa{del}}[]
wenzelm@43467
   622
\rail@nextbar{2}
wenzelm@43467
   623
\rail@term{\isa{only}}[]
wenzelm@43467
   624
\rail@nextbar{3}
wenzelm@43467
   625
\rail@term{\isa{cong}}[]
wenzelm@43467
   626
\rail@bar
wenzelm@43467
   627
\rail@nextbar{4}
wenzelm@43467
   628
\rail@term{\isa{add}}[]
wenzelm@43467
   629
\rail@nextbar{5}
wenzelm@43467
   630
\rail@term{\isa{del}}[]
wenzelm@43467
   631
\rail@endbar
wenzelm@43467
   632
\rail@nextbar{6}
wenzelm@43467
   633
\rail@term{\isa{split}}[]
wenzelm@43467
   634
\rail@bar
wenzelm@43467
   635
\rail@nextbar{7}
wenzelm@43467
   636
\rail@term{\isa{add}}[]
wenzelm@43467
   637
\rail@nextbar{8}
wenzelm@43467
   638
\rail@term{\isa{del}}[]
wenzelm@43467
   639
\rail@endbar
wenzelm@43467
   640
\rail@endbar
wenzelm@43467
   641
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
wenzelm@43467
   642
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   643
\rail@end
wenzelm@43467
   644
\end{railoutput}
wenzelm@26782
   645
wenzelm@26782
   646
wenzelm@28788
   647
  \begin{description}
wenzelm@26782
   648
wenzelm@28788
   649
  \item \hyperlink{method.simp}{\mbox{\isa{simp}}} invokes the Simplifier, after declaring
wenzelm@26782
   650
  additional rules according to the arguments given.  Note that the
wenzelm@43467
   651
  \isa{only} modifier first removes all other rewrite rules,
wenzelm@26782
   652
  congruences, and looper tactics (including splits), and then behaves
wenzelm@43467
   653
  like \isa{add}.
wenzelm@26782
   654
wenzelm@43467
   655
  \medskip The \isa{cong} modifiers add or delete Simplifier
wenzelm@26782
   656
  congruence rules (see also \cite{isabelle-ref}), the default is to
wenzelm@26782
   657
  add.
wenzelm@26782
   658
wenzelm@43467
   659
  \medskip The \isa{split} modifiers add or delete rules for the
wenzelm@26782
   660
  Splitter (see also \cite{isabelle-ref}), the default is to add.
wenzelm@26782
   661
  This works only if the Simplifier method has been properly setup to
wenzelm@26782
   662
  include the Splitter (all major object logics such HOL, HOLCF, FOL,
wenzelm@26782
   663
  ZF do this already).
wenzelm@26782
   664
wenzelm@40685
   665
  \item \hyperlink{method.simp-all}{\mbox{\isa{simp{\isaliteral{5F}{\isacharunderscore}}all}}} is similar to \hyperlink{method.simp}{\mbox{\isa{simp}}}, but acts on
wenzelm@26782
   666
  all goals (backwards from the last to the first one).
wenzelm@26782
   667
wenzelm@28788
   668
  \end{description}
wenzelm@26782
   669
wenzelm@26782
   670
  By default the Simplifier methods take local assumptions fully into
wenzelm@26782
   671
  account, using equational assumptions in the subsequent
wenzelm@26782
   672
  normalization process, or simplifying assumptions themselves (cf.\
wenzelm@30397
   673
  \verb|asm_full_simp_tac| in \cite{isabelle-ref}).  In structured
wenzelm@30397
   674
  proofs this is usually quite well behaved in practice: just the
wenzelm@30397
   675
  local premises of the actual goal are involved, additional facts may
wenzelm@30397
   676
  be inserted via explicit forward-chaining (via \hyperlink{command.then}{\mbox{\isa{\isacommand{then}}}},
wenzelm@35613
   677
  \hyperlink{command.from}{\mbox{\isa{\isacommand{from}}}}, \hyperlink{command.using}{\mbox{\isa{\isacommand{using}}}} etc.).
wenzelm@26782
   678
wenzelm@26782
   679
  Additional Simplifier options may be specified to tune the behavior
wenzelm@26782
   680
  further (mostly for unstructured scripts with many accidental local
wenzelm@40685
   681
  facts): ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' means assumptions are ignored
wenzelm@40685
   682
  completely (cf.\ \verb|simp_tac|), ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}simp{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' means
wenzelm@26782
   683
  assumptions are used in the simplification of the conclusion but are
wenzelm@40685
   684
  not themselves simplified (cf.\ \verb|asm_simp_tac|), and ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}use{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' means assumptions are simplified but are not used
wenzelm@26782
   685
  in the simplification of each other or the conclusion (cf.\ \verb|full_simp_tac|).  For compatibility reasons, there is also an option
wenzelm@40685
   686
  ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}asm{\isaliteral{5F}{\isacharunderscore}}lr{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'', which means that an assumption is only used
wenzelm@26782
   687
  for simplifying assumptions which are to the right of it (cf.\ \verb|asm_lr_simp_tac|).
wenzelm@26782
   688
wenzelm@40685
   689
  The configuration option \isa{{\isaliteral{22}{\isachardoublequote}}depth{\isaliteral{5F}{\isacharunderscore}}limit{\isaliteral{22}{\isachardoublequote}}} limits the number of
wenzelm@26782
   690
  recursive invocations of the simplifier during conditional
wenzelm@26782
   691
  rewriting.
wenzelm@26782
   692
wenzelm@26782
   693
  \medskip The Splitter package is usually configured to work as part
wenzelm@40685
   694
  of the Simplifier.  The effect of repeatedly applying \verb|split_tac| can be simulated by ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}simp\ only{\isaliteral{3A}{\isacharcolon}}\ split{\isaliteral{3A}{\isacharcolon}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}''.  There is also a separate \isa{split}
wenzelm@26782
   695
  method available for single-step case splitting.%
wenzelm@26782
   696
\end{isamarkuptext}%
wenzelm@26782
   697
\isamarkuptrue%
wenzelm@26782
   698
%
wenzelm@27042
   699
\isamarkupsubsection{Declaring rules%
wenzelm@26782
   700
}
wenzelm@26782
   701
\isamarkuptrue%
wenzelm@26782
   702
%
wenzelm@26782
   703
\begin{isamarkuptext}%
wenzelm@26782
   704
\begin{matharray}{rcl}
wenzelm@40685
   705
    \indexdef{}{command}{print\_simpset}\hypertarget{command.print-simpset}{\hyperlink{command.print-simpset}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}simpset}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
wenzelm@28788
   706
    \indexdef{}{attribute}{simp}\hypertarget{attribute.simp}{\hyperlink{attribute.simp}{\mbox{\isa{simp}}}} & : & \isa{attribute} \\
wenzelm@28788
   707
    \indexdef{}{attribute}{cong}\hypertarget{attribute.cong}{\hyperlink{attribute.cong}{\mbox{\isa{cong}}}} & : & \isa{attribute} \\
wenzelm@28788
   708
    \indexdef{}{attribute}{split}\hypertarget{attribute.split}{\hyperlink{attribute.split}{\mbox{\isa{split}}}} & : & \isa{attribute} \\
wenzelm@26782
   709
  \end{matharray}
wenzelm@26782
   710
wenzelm@43467
   711
  \begin{railoutput}
wenzelm@43535
   712
\rail@begin{3}{}
wenzelm@43467
   713
\rail@bar
wenzelm@43467
   714
\rail@term{\hyperlink{attribute.simp}{\mbox{\isa{simp}}}}[]
wenzelm@43467
   715
\rail@nextbar{1}
wenzelm@43467
   716
\rail@term{\hyperlink{attribute.cong}{\mbox{\isa{cong}}}}[]
wenzelm@43467
   717
\rail@nextbar{2}
wenzelm@43467
   718
\rail@term{\hyperlink{attribute.split}{\mbox{\isa{split}}}}[]
wenzelm@43467
   719
\rail@endbar
wenzelm@43467
   720
\rail@bar
wenzelm@43467
   721
\rail@nextbar{1}
wenzelm@43467
   722
\rail@term{\isa{add}}[]
wenzelm@43467
   723
\rail@nextbar{2}
wenzelm@43467
   724
\rail@term{\isa{del}}[]
wenzelm@43467
   725
\rail@endbar
wenzelm@43467
   726
\rail@end
wenzelm@43467
   727
\end{railoutput}
wenzelm@43467
   728
wenzelm@26782
   729
wenzelm@28788
   730
  \begin{description}
wenzelm@26782
   731
wenzelm@40685
   732
  \item \hyperlink{command.print-simpset}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}simpset}}}} prints the collection of rules
wenzelm@26782
   733
  declared to the Simplifier, which is also known as ``simpset''
wenzelm@26782
   734
  internally \cite{isabelle-ref}.
wenzelm@26782
   735
wenzelm@28788
   736
  \item \hyperlink{attribute.simp}{\mbox{\isa{simp}}} declares simplification rules.
wenzelm@26782
   737
wenzelm@28788
   738
  \item \hyperlink{attribute.cong}{\mbox{\isa{cong}}} declares congruence rules.
wenzelm@26782
   739
wenzelm@28788
   740
  \item \hyperlink{attribute.split}{\mbox{\isa{split}}} declares case split rules.
wenzelm@26782
   741
wenzelm@28788
   742
  \end{description}%
wenzelm@26782
   743
\end{isamarkuptext}%
wenzelm@26782
   744
\isamarkuptrue%
wenzelm@26782
   745
%
wenzelm@27042
   746
\isamarkupsubsection{Simplification procedures%
wenzelm@26782
   747
}
wenzelm@26782
   748
\isamarkuptrue%
wenzelm@26782
   749
%
wenzelm@26782
   750
\begin{isamarkuptext}%
wenzelm@44129
   751
Simplification procedures are ML functions that produce proven
wenzelm@44129
   752
  rewrite rules on demand.  They are associated with higher-order
wenzelm@44129
   753
  patterns that approximate the left-hand sides of equations.  The
wenzelm@44129
   754
  Simplifier first matches the current redex against one of the LHS
wenzelm@44129
   755
  patterns; if this succeeds, the corresponding ML function is
wenzelm@44129
   756
  invoked, passing the Simplifier context and redex term.  Thus rules
wenzelm@44129
   757
  may be specifically fashioned for particular situations, resulting
wenzelm@44129
   758
  in a more powerful mechanism than term rewriting by a fixed set of
wenzelm@44129
   759
  rules.
wenzelm@44129
   760
wenzelm@44129
   761
  Any successful result needs to be a (possibly conditional) rewrite
wenzelm@44129
   762
  rule \isa{{\isaliteral{22}{\isachardoublequote}}t\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ u{\isaliteral{22}{\isachardoublequote}}} that is applicable to the current redex.  The
wenzelm@44129
   763
  rule will be applied just as any ordinary rewrite rule.  It is
wenzelm@44129
   764
  expected to be already in \emph{internal form}, bypassing the
wenzelm@44129
   765
  automatic preprocessing of object-level equivalences.
wenzelm@44129
   766
wenzelm@44129
   767
  \begin{matharray}{rcl}
wenzelm@40685
   768
    \indexdef{}{command}{simproc\_setup}\hypertarget{command.simproc-setup}{\hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isaliteral{5F}{\isacharunderscore}}setup}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}local{\isaliteral{5F}{\isacharunderscore}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ local{\isaliteral{5F}{\isacharunderscore}}theory{\isaliteral{22}{\isachardoublequote}}} \\
wenzelm@28788
   769
    simproc & : & \isa{attribute} \\
wenzelm@26782
   770
  \end{matharray}
wenzelm@26782
   771
wenzelm@43467
   772
  \begin{railoutput}
wenzelm@43535
   773
\rail@begin{6}{}
wenzelm@43467
   774
\rail@term{\hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isaliteral{5F}{\isacharunderscore}}setup}}}}}[]
wenzelm@43467
   775
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   776
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
   777
\rail@plus
wenzelm@43467
   778
\rail@nont{\hyperlink{syntax.term}{\mbox{\isa{term}}}}[]
wenzelm@43467
   779
\rail@nextplus{1}
wenzelm@43467
   780
\rail@cterm{\isa{{\isaliteral{7C}{\isacharbar}}}}[]
wenzelm@43467
   781
\rail@endplus
wenzelm@43467
   782
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
   783
\rail@term{\isa{{\isaliteral{3D}{\isacharequal}}}}[]
wenzelm@43467
   784
\rail@nont{\hyperlink{syntax.text}{\mbox{\isa{text}}}}[]
wenzelm@43467
   785
\rail@cr{3}
wenzelm@43467
   786
\rail@bar
wenzelm@43467
   787
\rail@nextbar{4}
wenzelm@43467
   788
\rail@term{\isa{\isakeyword{identifier}}}[]
wenzelm@43467
   789
\rail@plus
wenzelm@43467
   790
\rail@nont{\hyperlink{syntax.nameref}{\mbox{\isa{nameref}}}}[]
wenzelm@43467
   791
\rail@nextplus{5}
wenzelm@43467
   792
\rail@endplus
wenzelm@43467
   793
\rail@endbar
wenzelm@43467
   794
\rail@end
wenzelm@43535
   795
\rail@begin{3}{}
wenzelm@43467
   796
\rail@term{\hyperlink{attribute.simproc}{\mbox{\isa{simproc}}}}[]
wenzelm@43467
   797
\rail@bar
wenzelm@43467
   798
\rail@bar
wenzelm@43467
   799
\rail@nextbar{1}
wenzelm@43467
   800
\rail@term{\isa{add}}[]
wenzelm@43467
   801
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
wenzelm@43467
   802
\rail@endbar
wenzelm@43467
   803
\rail@nextbar{2}
wenzelm@43467
   804
\rail@term{\isa{del}}[]
wenzelm@43467
   805
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
wenzelm@43467
   806
\rail@endbar
wenzelm@43467
   807
\rail@plus
wenzelm@43467
   808
\rail@nont{\hyperlink{syntax.name}{\mbox{\isa{name}}}}[]
wenzelm@43467
   809
\rail@nextplus{1}
wenzelm@43467
   810
\rail@endplus
wenzelm@43467
   811
\rail@end
wenzelm@43467
   812
\end{railoutput}
wenzelm@26782
   813
wenzelm@26782
   814
wenzelm@28788
   815
  \begin{description}
wenzelm@26782
   816
wenzelm@40685
   817
  \item \hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isaliteral{5F}{\isacharunderscore}}setup}}}} defines a named simplification
wenzelm@26782
   818
  procedure that is invoked by the Simplifier whenever any of the
wenzelm@26782
   819
  given term patterns match the current redex.  The implementation,
wenzelm@30270
   820
  which is provided as ML source text, needs to be of type \verb|morphism -> simpset -> cterm -> thm option|, where the \verb|cterm| represents the current redex \isa{r} and the result is
wenzelm@40685
   821
  supposed to be some proven rewrite rule \isa{{\isaliteral{22}{\isachardoublequote}}r\ {\isaliteral{5C3C65717569763E}{\isasymequiv}}\ r{\isaliteral{27}{\isacharprime}}{\isaliteral{22}{\isachardoublequote}}} (or a
wenzelm@26782
   822
  generalized version), or \verb|NONE| to indicate failure.  The
wenzelm@26782
   823
  \verb|simpset| argument holds the full context of the current
wenzelm@26782
   824
  Simplifier invocation, including the actual Isar proof context.  The
wenzelm@26782
   825
  \verb|morphism| informs about the difference of the original
wenzelm@26782
   826
  compilation context wrt.\ the one of the actual application later
wenzelm@26902
   827
  on.  The optional \hyperlink{keyword.identifier}{\mbox{\isa{\isakeyword{identifier}}}} specifies theorems that
wenzelm@26782
   828
  represent the logical content of the abstract theory of this
wenzelm@26782
   829
  simproc.
wenzelm@26782
   830
wenzelm@26782
   831
  Morphisms and identifiers are only relevant for simprocs that are
wenzelm@26782
   832
  defined within a local target context, e.g.\ in a locale.
wenzelm@26782
   833
wenzelm@40685
   834
  \item \isa{{\isaliteral{22}{\isachardoublequote}}simproc\ add{\isaliteral{3A}{\isacharcolon}}\ name{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}simproc\ del{\isaliteral{3A}{\isacharcolon}}\ name{\isaliteral{22}{\isachardoublequote}}}
wenzelm@26782
   835
  add or delete named simprocs to the current Simplifier context.  The
wenzelm@40685
   836
  default is to add a simproc.  Note that \hyperlink{command.simproc-setup}{\mbox{\isa{\isacommand{simproc{\isaliteral{5F}{\isacharunderscore}}setup}}}}
wenzelm@26782
   837
  already adds the new simproc to the subsequent context.
wenzelm@26782
   838
wenzelm@28788
   839
  \end{description}%
wenzelm@26782
   840
\end{isamarkuptext}%
wenzelm@26782
   841
\isamarkuptrue%
wenzelm@26782
   842
%
wenzelm@44129
   843
\isamarkupsubsubsection{Example%
wenzelm@44129
   844
}
wenzelm@44129
   845
\isamarkuptrue%
wenzelm@44129
   846
%
wenzelm@44129
   847
\begin{isamarkuptext}%
wenzelm@44129
   848
The following simplification procedure for \isa{{\isaliteral{28}{\isacharparenleft}}{\isaliteral{3F}{\isacharquery}}u{\isaliteral{5C3C436F6C6F6E3E}{\isasymColon}}unit{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{29}{\isacharparenright}}} in HOL performs fine-grained
wenzelm@44129
   849
  control over rule application, beyond higher-order pattern matching.
wenzelm@44129
   850
  Declaring \isa{unit{\isaliteral{5F}{\isacharunderscore}}eq} as \hyperlink{attribute.simp}{\mbox{\isa{simp}}} directly would make
wenzelm@44129
   851
  the simplifier loop!  Note that a version of this simplification
wenzelm@44129
   852
  procedure is already active in Isabelle/HOL.%
wenzelm@44129
   853
\end{isamarkuptext}%
wenzelm@44129
   854
\isamarkuptrue%
wenzelm@44129
   855
%
wenzelm@44129
   856
\isadelimML
wenzelm@44129
   857
%
wenzelm@44129
   858
\endisadelimML
wenzelm@44129
   859
%
wenzelm@44129
   860
\isatagML
wenzelm@44129
   861
\isacommand{simproc{\isaliteral{5F}{\isacharunderscore}}setup}\isamarkupfalse%
wenzelm@44129
   862
\ unit\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{22}{\isachardoublequoteopen}}x{\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}unit{\isaliteral{22}{\isachardoublequoteclose}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{7B2A}{\isacharverbatimopen}}\isanewline
wenzelm@44129
   863
\ \ fn\ {\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ {\isaliteral{5F}{\isacharunderscore}}\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\ fn\ ct\ {\isaliteral{3D}{\isacharequal}}{\isaliteral{3E}{\isachargreater}}\isanewline
wenzelm@44129
   864
\ \ \ \ if\ HOLogic{\isaliteral{2E}{\isachardot}}is{\isaliteral{5F}{\isacharunderscore}}unit\ {\isaliteral{28}{\isacharparenleft}}term{\isaliteral{5F}{\isacharunderscore}}of\ ct{\isaliteral{29}{\isacharparenright}}\ then\ NONE\isanewline
wenzelm@44129
   865
\ \ \ \ else\ SOME\ {\isaliteral{28}{\isacharparenleft}}mk{\isaliteral{5F}{\isacharunderscore}}meta{\isaliteral{5F}{\isacharunderscore}}eq\ %
wenzelm@44129
   866
\isaantiq
wenzelm@44129
   867
thm\ unit{\isaliteral{5F}{\isacharunderscore}}eq{}%
wenzelm@44129
   868
\endisaantiq
wenzelm@44129
   869
{\isaliteral{29}{\isacharparenright}}\isanewline
wenzelm@44129
   870
{\isaliteral{2A7D}{\isacharverbatimclose}}%
wenzelm@44129
   871
\endisatagML
wenzelm@44129
   872
{\isafoldML}%
wenzelm@44129
   873
%
wenzelm@44129
   874
\isadelimML
wenzelm@44129
   875
%
wenzelm@44129
   876
\endisadelimML
wenzelm@44129
   877
%
wenzelm@44129
   878
\begin{isamarkuptext}%
wenzelm@44129
   879
Since the Simplifier applies simplification procedures
wenzelm@44129
   880
  frequently, it is important to make the failure check in ML
wenzelm@44129
   881
  reasonably fast.%
wenzelm@44129
   882
\end{isamarkuptext}%
wenzelm@44129
   883
\isamarkuptrue%
wenzelm@44129
   884
%
wenzelm@27042
   885
\isamarkupsubsection{Forward simplification%
wenzelm@26782
   886
}
wenzelm@26782
   887
\isamarkuptrue%
wenzelm@26782
   888
%
wenzelm@26782
   889
\begin{isamarkuptext}%
wenzelm@26782
   890
\begin{matharray}{rcl}
wenzelm@28788
   891
    \indexdef{}{attribute}{simplified}\hypertarget{attribute.simplified}{\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}} & : & \isa{attribute} \\
wenzelm@26782
   892
  \end{matharray}
wenzelm@26782
   893
wenzelm@43467
   894
  \begin{railoutput}
wenzelm@43535
   895
\rail@begin{2}{}
wenzelm@43467
   896
\rail@term{\hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}}[]
wenzelm@43467
   897
\rail@bar
wenzelm@43467
   898
\rail@nextbar{1}
wenzelm@43467
   899
\rail@nont{\isa{opt}}[]
wenzelm@43467
   900
\rail@endbar
wenzelm@43467
   901
\rail@bar
wenzelm@43467
   902
\rail@nextbar{1}
wenzelm@43467
   903
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
   904
\rail@endbar
wenzelm@43467
   905
\rail@end
wenzelm@43467
   906
\rail@begin{3}{\isa{opt}}
wenzelm@43467
   907
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
   908
\rail@bar
wenzelm@43467
   909
\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm}}[]
wenzelm@43467
   910
\rail@nextbar{1}
wenzelm@43467
   911
\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}simp}}[]
wenzelm@43467
   912
\rail@nextbar{2}
wenzelm@43467
   913
\rail@term{\isa{no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{5F}{\isacharunderscore}}use}}[]
wenzelm@43467
   914
\rail@endbar
wenzelm@43467
   915
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
   916
\rail@end
wenzelm@43467
   917
\end{railoutput}
wenzelm@26782
   918
wenzelm@26782
   919
wenzelm@28788
   920
  \begin{description}
wenzelm@26782
   921
  
wenzelm@40685
   922
  \item \hyperlink{attribute.simplified}{\mbox{\isa{simplified}}}~\isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} causes a theorem to
wenzelm@40685
   923
  be simplified, either by exactly the specified rules \isa{{\isaliteral{22}{\isachardoublequote}}a\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ a\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}, or the implicit Simplifier context if no arguments are given.
wenzelm@28788
   924
  The result is fully simplified by default, including assumptions and
wenzelm@40685
   925
  conclusion; the options \isa{no{\isaliteral{5F}{\isacharunderscore}}asm} etc.\ tune the Simplifier in
wenzelm@28788
   926
  the same way as the for the \isa{simp} method.
wenzelm@26782
   927
wenzelm@26782
   928
  Note that forward simplification restricts the simplifier to its
wenzelm@26782
   929
  most basic operation of term rewriting; solver and looper tactics
wenzelm@26782
   930
  \cite{isabelle-ref} are \emph{not} involved here.  The \isa{simplified} attribute should be only rarely required under normal
wenzelm@26782
   931
  circumstances.
wenzelm@26782
   932
wenzelm@28788
   933
  \end{description}%
wenzelm@26782
   934
\end{isamarkuptext}%
wenzelm@26782
   935
\isamarkuptrue%
wenzelm@26782
   936
%
wenzelm@27042
   937
\isamarkupsection{The Classical Reasoner \label{sec:classical}%
wenzelm@26782
   938
}
wenzelm@26782
   939
\isamarkuptrue%
wenzelm@26782
   940
%
wenzelm@44134
   941
\isamarkupsubsection{Basic concepts%
wenzelm@44131
   942
}
wenzelm@44131
   943
\isamarkuptrue%
wenzelm@44131
   944
%
wenzelm@44131
   945
\begin{isamarkuptext}%
wenzelm@44131
   946
Although Isabelle is generic, many users will be working in
wenzelm@44131
   947
  some extension of classical first-order logic.  Isabelle/ZF is built
wenzelm@44131
   948
  upon theory FOL, while Isabelle/HOL conceptually contains
wenzelm@44131
   949
  first-order logic as a fragment.  Theorem-proving in predicate logic
wenzelm@44131
   950
  is undecidable, but many automated strategies have been developed to
wenzelm@44131
   951
  assist in this task.
wenzelm@44131
   952
wenzelm@44131
   953
  Isabelle's classical reasoner is a generic package that accepts
wenzelm@44131
   954
  certain information about a logic and delivers a suite of automatic
wenzelm@44131
   955
  proof tools, based on rules that are classified and declared in the
wenzelm@44131
   956
  context.  These proof procedures are slow and simplistic compared
wenzelm@44131
   957
  with high-end automated theorem provers, but they can save
wenzelm@44131
   958
  considerable time and effort in practice.  They can prove theorems
wenzelm@44131
   959
  such as Pelletier's \cite{pelletier86} problems 40 and 41 in a few
wenzelm@44131
   960
  milliseconds (including full proof reconstruction):%
wenzelm@44131
   961
\end{isamarkuptext}%
wenzelm@44131
   962
\isamarkuptrue%
wenzelm@44131
   963
\isacommand{lemma}\isamarkupfalse%
wenzelm@44131
   964
\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}y{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ F\ x\ y\ {\isaliteral{5C3C6C6F6E676C65667472696768746172726F773E}{\isasymlongleftrightarrow}}\ F\ x\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}y{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}z{\isaliteral{2E}{\isachardot}}\ F\ z\ y\ {\isaliteral{5C3C6C6F6E676C65667472696768746172726F773E}{\isasymlongleftrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ F\ z\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
wenzelm@44131
   965
%
wenzelm@44131
   966
\isadelimproof
wenzelm@44131
   967
\ \ %
wenzelm@44131
   968
\endisadelimproof
wenzelm@44131
   969
%
wenzelm@44131
   970
\isatagproof
wenzelm@44131
   971
\isacommand{by}\isamarkupfalse%
wenzelm@44131
   972
\ blast%
wenzelm@44131
   973
\endisatagproof
wenzelm@44131
   974
{\isafoldproof}%
wenzelm@44131
   975
%
wenzelm@44131
   976
\isadelimproof
wenzelm@44131
   977
\isanewline
wenzelm@44131
   978
%
wenzelm@44131
   979
\endisadelimproof
wenzelm@44131
   980
\isanewline
wenzelm@44131
   981
\isacommand{lemma}\isamarkupfalse%
wenzelm@44131
   982
\ {\isaliteral{22}{\isachardoublequoteopen}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}z{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}y{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ f\ x\ y\ {\isaliteral{5C3C6C6F6E676C65667472696768746172726F773E}{\isasymlongleftrightarrow}}\ f\ x\ z\ {\isaliteral{5C3C616E643E}{\isasymand}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ f\ x\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}z{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ f\ x\ z{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequoteclose}}\isanewline
wenzelm@44131
   983
%
wenzelm@44131
   984
\isadelimproof
wenzelm@44131
   985
\ \ %
wenzelm@44131
   986
\endisadelimproof
wenzelm@44131
   987
%
wenzelm@44131
   988
\isatagproof
wenzelm@44131
   989
\isacommand{by}\isamarkupfalse%
wenzelm@44131
   990
\ blast%
wenzelm@44131
   991
\endisatagproof
wenzelm@44131
   992
{\isafoldproof}%
wenzelm@44131
   993
%
wenzelm@44131
   994
\isadelimproof
wenzelm@44131
   995
%
wenzelm@44131
   996
\endisadelimproof
wenzelm@44131
   997
%
wenzelm@44131
   998
\begin{isamarkuptext}%
wenzelm@44131
   999
The proof tools are generic.  They are not restricted to
wenzelm@44131
  1000
  first-order logic, and have been heavily used in the development of
wenzelm@44131
  1001
  the Isabelle/HOL library and applications.  The tactics can be
wenzelm@44131
  1002
  traced, and their components can be called directly; in this manner,
wenzelm@44131
  1003
  any proof can be viewed interactively.%
wenzelm@44131
  1004
\end{isamarkuptext}%
wenzelm@44131
  1005
\isamarkuptrue%
wenzelm@44131
  1006
%
wenzelm@44131
  1007
\isamarkupsubsubsection{The sequent calculus%
wenzelm@44131
  1008
}
wenzelm@44131
  1009
\isamarkuptrue%
wenzelm@44131
  1010
%
wenzelm@44131
  1011
\begin{isamarkuptext}%
wenzelm@44131
  1012
Isabelle supports natural deduction, which is easy to use for
wenzelm@44131
  1013
  interactive proof.  But natural deduction does not easily lend
wenzelm@44131
  1014
  itself to automation, and has a bias towards intuitionism.  For
wenzelm@44131
  1015
  certain proofs in classical logic, it can not be called natural.
wenzelm@44131
  1016
  The \emph{sequent calculus}, a generalization of natural deduction,
wenzelm@44131
  1017
  is easier to automate.
wenzelm@44131
  1018
wenzelm@44131
  1019
  A \textbf{sequent} has the form \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{22}{\isachardoublequote}}}, where \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}{\isaliteral{22}{\isachardoublequote}}}
wenzelm@44131
  1020
  and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{22}{\isachardoublequote}}} are sets of formulae.\footnote{For first-order
wenzelm@44131
  1021
  logic, sequents can equivalently be made from lists or multisets of
wenzelm@44131
  1022
  formulae.} The sequent \isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} is
wenzelm@44131
  1023
  \textbf{valid} if \isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C616E643E}{\isasymand}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C616E643E}{\isasymand}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{22}{\isachardoublequote}}} implies \isa{{\isaliteral{22}{\isachardoublequote}}Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C6F723E}{\isasymor}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.  Thus \isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub m{\isaliteral{22}{\isachardoublequote}}} represent assumptions, each of which
wenzelm@44131
  1024
  is true, while \isa{{\isaliteral{22}{\isachardoublequote}}Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} represent alternative goals.  A
wenzelm@44131
  1025
  sequent is \textbf{basic} if its left and right sides have a common
wenzelm@44131
  1026
  formula, as in \isa{{\isaliteral{22}{\isachardoublequote}}P{\isaliteral{2C}{\isacharcomma}}\ Q\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ Q{\isaliteral{2C}{\isacharcomma}}\ R{\isaliteral{22}{\isachardoublequote}}}; basic sequents are trivially
wenzelm@44131
  1027
  valid.
wenzelm@44131
  1028
wenzelm@44131
  1029
  Sequent rules are classified as \textbf{right} or \textbf{left},
wenzelm@44131
  1030
  indicating which side of the \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}{\isaliteral{22}{\isachardoublequote}}} symbol they operate on.
wenzelm@44131
  1031
  Rules that operate on the right side are analogous to natural
wenzelm@44131
  1032
  deduction's introduction rules, and left rules are analogous to
wenzelm@44131
  1033
  elimination rules.  The sequent calculus analogue of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}I{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}
wenzelm@44131
  1034
  is the rule
wenzelm@44131
  1035
  \[
wenzelm@44131
  1036
  \infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{22}{\isachardoublequote}}}}{\isa{{\isaliteral{22}{\isachardoublequote}}P{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ Q{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1037
  \]
wenzelm@44131
  1038
  Applying the rule backwards, this breaks down some implication on
wenzelm@44131
  1039
  the right side of a sequent; \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{22}{\isachardoublequote}}} stand for
wenzelm@44131
  1040
  the sets of formulae that are unaffected by the inference.  The
wenzelm@44131
  1041
  analogue of the pair \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}I{\isadigit{1}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}I{\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} is the
wenzelm@44131
  1042
  single rule
wenzelm@44131
  1043
  \[
wenzelm@44131
  1044
  \infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q{\isaliteral{22}{\isachardoublequote}}}}{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ P{\isaliteral{2C}{\isacharcomma}}\ Q{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1045
  \]
wenzelm@44131
  1046
  This breaks down some disjunction on the right side, replacing it by
wenzelm@44131
  1047
  both disjuncts.  Thus, the sequent calculus is a kind of
wenzelm@44131
  1048
  multiple-conclusion logic.
wenzelm@44131
  1049
wenzelm@44131
  1050
  To illustrate the use of multiple formulae on the right, let us
wenzelm@44131
  1051
  prove the classical theorem \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6F723E}{\isasymor}}\ {\isaliteral{28}{\isacharparenleft}}Q\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.  Working
wenzelm@44131
  1052
  backwards, we reduce this formula to a basic sequent:
wenzelm@44131
  1053
  \[
wenzelm@44131
  1054
  \infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C6F723E}{\isasymor}}\ {\isaliteral{28}{\isacharparenleft}}Q\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1055
    {\infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{28}{\isacharparenleft}}Q\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1056
      {\infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}P\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ Q{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{28}{\isacharparenleft}}Q\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1057
        {\isa{{\isaliteral{22}{\isachardoublequote}}P{\isaliteral{2C}{\isacharcomma}}\ Q\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ Q{\isaliteral{2C}{\isacharcomma}}\ P{\isaliteral{22}{\isachardoublequote}}}}}}
wenzelm@44131
  1058
  \]
wenzelm@44131
  1059
wenzelm@44131
  1060
  This example is typical of the sequent calculus: start with the
wenzelm@44131
  1061
  desired theorem and apply rules backwards in a fairly arbitrary
wenzelm@44131
  1062
  manner.  This yields a surprisingly effective proof procedure.
wenzelm@44131
  1063
  Quantifiers add only few complications, since Isabelle handles
wenzelm@44131
  1064
  parameters and schematic variables.  See \cite[Chapter
wenzelm@44131
  1065
  10]{paulson-ml2} for further discussion.%
wenzelm@44131
  1066
\end{isamarkuptext}%
wenzelm@44131
  1067
\isamarkuptrue%
wenzelm@44131
  1068
%
wenzelm@44131
  1069
\isamarkupsubsubsection{Simulating sequents by natural deduction%
wenzelm@44131
  1070
}
wenzelm@44131
  1071
\isamarkuptrue%
wenzelm@44131
  1072
%
wenzelm@44131
  1073
\begin{isamarkuptext}%
wenzelm@44131
  1074
Isabelle can represent sequents directly, as in the
wenzelm@44131
  1075
  object-logic LK.  But natural deduction is easier to work with, and
wenzelm@44131
  1076
  most object-logics employ it.  Fortunately, we can simulate the
wenzelm@44131
  1077
  sequent \isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}} by the Isabelle formula
wenzelm@44131
  1078
  \isa{{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} where the order of
wenzelm@44131
  1079
  the assumptions and the choice of \isa{{\isaliteral{22}{\isachardoublequote}}Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}} are arbitrary.
wenzelm@44131
  1080
  Elim-resolution plays a key role in simulating sequent proofs.
wenzelm@44131
  1081
wenzelm@44131
  1082
  We can easily handle reasoning on the left.  Elim-resolution with
wenzelm@44131
  1083
  the rules \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C626F74746F6D3E}{\isasymbottom}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} achieves
wenzelm@44131
  1084
  a similar effect as the corresponding sequent rules.  For the other
wenzelm@44131
  1085
  connectives, we use sequent-style elimination rules instead of
wenzelm@44131
  1086
  destruction rules such as \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616E643E}{\isasymand}}E{\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@44131
  1087
  But note that the rule \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}L{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} has no effect under our
wenzelm@44131
  1088
  representation of sequents!
wenzelm@44131
  1089
  \[
wenzelm@44131
  1090
  \infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}L{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{22}{\isachardoublequote}}}}{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ P{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1091
  \]
wenzelm@44131
  1092
wenzelm@44131
  1093
  What about reasoning on the right?  Introduction rules can only
wenzelm@44131
  1094
  affect the formula in the conclusion, namely \isa{{\isaliteral{22}{\isachardoublequote}}Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}.  The
wenzelm@44131
  1095
  other right-side formulae are represented as negated assumptions,
wenzelm@44131
  1096
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{2}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n{\isaliteral{22}{\isachardoublequote}}}.  In order to operate on one of these, it
wenzelm@44131
  1097
  must first be exchanged with \isa{{\isaliteral{22}{\isachardoublequote}}Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}.  Elim-resolution with the
wenzelm@44131
  1098
  \isa{swap} rule has this effect: \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ R\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{22}{\isachardoublequote}}}
wenzelm@44131
  1099
wenzelm@44131
  1100
  To ensure that swaps occur only when necessary, each introduction
wenzelm@44131
  1101
  rule is converted into a swapped form: it is resolved with the
wenzelm@44131
  1102
  second premise of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}swap{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}.  The swapped form of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616E643E}{\isasymand}}I{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, which might be called \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}{\isaliteral{5C3C616E643E}{\isasymand}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, is
wenzelm@44131
  1103
  \begin{isabelle}%
wenzelm@44131
  1104
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C616E643E}{\isasymand}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ R\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ R\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1105
\end{isabelle}
wenzelm@44131
  1106
wenzelm@44131
  1107
  Similarly, the swapped form of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}I{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} is
wenzelm@44131
  1108
  \begin{isabelle}%
wenzelm@44131
  1109
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ R\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1110
\end{isabelle}
wenzelm@44131
  1111
wenzelm@44131
  1112
  Swapped introduction rules are applied using elim-resolution, which
wenzelm@44131
  1113
  deletes the negated formula.  Our representation of sequents also
wenzelm@44131
  1114
  requires the use of ordinary introduction rules.  If we had no
wenzelm@44131
  1115
  regard for readability of intermediate goal states, we could treat
wenzelm@44131
  1116
  the right side more uniformly by representing sequents as \begin{isabelle}%
wenzelm@44131
  1117
{\isaliteral{22}{\isachardoublequote}}P\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\isaliteral{5C3C5E7375623E}{}\isactrlsub m\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub {\isadigit{1}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C646F74733E}{\isasymdots}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\isaliteral{5C3C5E7375623E}{}\isactrlsub n\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C626F74746F6D3E}{\isasymbottom}}{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1118
\end{isabelle}%
wenzelm@44131
  1119
\end{isamarkuptext}%
wenzelm@44131
  1120
\isamarkuptrue%
wenzelm@44131
  1121
%
wenzelm@44131
  1122
\isamarkupsubsubsection{Extra rules for the sequent calculus%
wenzelm@44131
  1123
}
wenzelm@44131
  1124
\isamarkuptrue%
wenzelm@44131
  1125
%
wenzelm@44131
  1126
\begin{isamarkuptext}%
wenzelm@44131
  1127
As mentioned, destruction rules such as \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C616E643E}{\isasymand}}E{\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and
wenzelm@44131
  1128
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} must be replaced by sequent-style elimination rules.
wenzelm@44131
  1129
  In addition, we need rules to embody the classical equivalence
wenzelm@44131
  1130
  between \isa{{\isaliteral{22}{\isachardoublequote}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q{\isaliteral{22}{\isachardoublequote}}}.  The introduction
wenzelm@44131
  1131
  rules \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}I{\isadigit{1}}{\isaliteral{2C}{\isacharcomma}}\ {\isadigit{2}}{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} are replaced by a rule that simulates
wenzelm@44131
  1132
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}: \begin{isabelle}%
wenzelm@44131
  1133
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ Q\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1134
\end{isabelle}
wenzelm@44131
  1135
wenzelm@44131
  1136
  The destruction rule \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} is replaced by \begin{isabelle}%
wenzelm@44131
  1137
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}P\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}Q\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1138
\end{isabelle}
wenzelm@44131
  1139
wenzelm@44131
  1140
  Quantifier replication also requires special rules.  In classical
wenzelm@44131
  1141
  logic, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}} is equivalent to \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}};
wenzelm@44131
  1142
  the rules \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}L{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} are dual:
wenzelm@44131
  1143
  \[
wenzelm@44131
  1144
  \infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}}}{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{2C}{\isacharcomma}}\ P\ t{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1145
  \qquad
wenzelm@44131
  1146
  \infer[\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}L{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}]{\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{22}{\isachardoublequote}}}}{\isa{{\isaliteral{22}{\isachardoublequote}}P\ t{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{2C}{\isacharcomma}}\ {\isaliteral{5C3C47616D6D613E}{\isasymGamma}}\ {\isaliteral{5C3C7475726E7374696C653E}{\isasymturnstile}}\ {\isaliteral{5C3C44656C74613E}{\isasymDelta}}{\isaliteral{22}{\isachardoublequote}}}}
wenzelm@44131
  1147
  \]
wenzelm@44131
  1148
  Thus both kinds of quantifier may be replicated.  Theorems requiring
wenzelm@44131
  1149
  multiple uses of a universal formula are easy to invent; consider
wenzelm@44131
  1150
  \begin{isabelle}%
wenzelm@44131
  1151
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P\ {\isaliteral{28}{\isacharparenleft}}f\ x{\isaliteral{29}{\isacharparenright}}{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C616E643E}{\isasymand}}\ P\ a\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P\ {\isaliteral{28}{\isacharparenleft}}f\isaliteral{5C3C5E7375703E}{}\isactrlsup n\ a{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1152
\end{isabelle} for any
wenzelm@44131
  1153
  \isa{{\isaliteral{22}{\isachardoublequote}}n\ {\isaliteral{3E}{\isachargreater}}\ {\isadigit{1}}{\isaliteral{22}{\isachardoublequote}}}.  Natural examples of the multiple use of an
wenzelm@44131
  1154
  existential formula are rare; a standard one is \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}y{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}\ P\ y{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@44131
  1155
wenzelm@44131
  1156
  Forgoing quantifier replication loses completeness, but gains
wenzelm@44131
  1157
  decidability, since the search space becomes finite.  Many useful
wenzelm@44131
  1158
  theorems can be proved without replication, and the search generally
wenzelm@44131
  1159
  delivers its verdict in a reasonable time.  To adopt this approach,
wenzelm@44131
  1160
  represent the sequent rules \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}L{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and
wenzelm@44131
  1161
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}R{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} by \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}I{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}I{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}},
wenzelm@44131
  1162
  respectively, and put \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} into elimination form: \begin{isabelle}%
wenzelm@44131
  1163
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}P\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1164
\end{isabelle}
wenzelm@44131
  1165
wenzelm@44131
  1166
  Elim-resolution with this rule will delete the universal formula
wenzelm@44131
  1167
  after a single use.  To replicate universal quantifiers, replace the
wenzelm@44131
  1168
  rule by \begin{isabelle}%
wenzelm@44131
  1169
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}P\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1170
\end{isabelle}
wenzelm@44131
  1171
wenzelm@44131
  1172
  To replicate existential quantifiers, replace \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}I{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} by
wenzelm@44131
  1173
  \begin{isabelle}%
wenzelm@44131
  1174
{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ t{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}%
wenzelm@44131
  1175
\end{isabelle}
wenzelm@44131
  1176
wenzelm@44131
  1177
  All introduction rules mentioned above are also useful in swapped
wenzelm@44131
  1178
  form.
wenzelm@44131
  1179
wenzelm@44131
  1180
  Replication makes the search space infinite; we must apply the rules
wenzelm@44131
  1181
  with care.  The classical reasoner distinguishes between safe and
wenzelm@44131
  1182
  unsafe rules, applying the latter only when there is no alternative.
wenzelm@44131
  1183
  Depth-first search may well go down a blind alley; best-first search
wenzelm@44131
  1184
  is better behaved in an infinite search space.  However, quantifier
wenzelm@44131
  1185
  replication is too expensive to prove any but the simplest theorems.%
wenzelm@44131
  1186
\end{isamarkuptext}%
wenzelm@44131
  1187
\isamarkuptrue%
wenzelm@44131
  1188
%
wenzelm@44132
  1189
\isamarkupsubsection{Rule declarations%
wenzelm@44132
  1190
}
wenzelm@44132
  1191
\isamarkuptrue%
wenzelm@44132
  1192
%
wenzelm@44132
  1193
\begin{isamarkuptext}%
wenzelm@44132
  1194
The proof tools of the Classical Reasoner depend on
wenzelm@44132
  1195
  collections of rules declared in the context, which are classified
wenzelm@44132
  1196
  as introduction, elimination or destruction and as \emph{safe} or
wenzelm@44132
  1197
  \emph{unsafe}.  In general, safe rules can be attempted blindly,
wenzelm@44132
  1198
  while unsafe rules must be used with care.  A safe rule must never
wenzelm@44132
  1199
  reduce a provable goal to an unprovable set of subgoals.
wenzelm@44132
  1200
wenzelm@44132
  1201
  The rule \isa{{\isaliteral{22}{\isachardoublequote}}P\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q{\isaliteral{22}{\isachardoublequote}}} is unsafe because it reduces \isa{{\isaliteral{22}{\isachardoublequote}}P\ {\isaliteral{5C3C6F723E}{\isasymor}}\ Q{\isaliteral{22}{\isachardoublequote}}} to \isa{{\isaliteral{22}{\isachardoublequote}}P{\isaliteral{22}{\isachardoublequote}}}, which might turn out as premature choice of an
wenzelm@44132
  1202
  unprovable subgoal.  Any rule is unsafe whose premises contain new
wenzelm@44132
  1203
  unknowns.  The elimination rule \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}P\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{22}{\isachardoublequote}}} is
wenzelm@44132
  1204
  unsafe, since it is applied via elim-resolution, which discards the
wenzelm@44132
  1205
  assumption \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}} and replaces it by the weaker
wenzelm@44132
  1206
  assumption \isa{{\isaliteral{22}{\isachardoublequote}}P\ t{\isaliteral{22}{\isachardoublequote}}}.  The rule \isa{{\isaliteral{22}{\isachardoublequote}}P\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C6578697374733E}{\isasymexists}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}} is
wenzelm@44132
  1207
  unsafe for similar reasons.  The quantifier duplication rule \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}P\ t\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ Q{\isaliteral{22}{\isachardoublequote}}} is unsafe in a different sense:
wenzelm@44132
  1208
  since it keeps the assumption \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}}, it is prone to
wenzelm@44132
  1209
  looping.  In classical first-order logic, all rules are safe except
wenzelm@44132
  1210
  those mentioned above.
wenzelm@44132
  1211
wenzelm@44132
  1212
  The safe~/ unsafe distinction is vague, and may be regarded merely
wenzelm@44132
  1213
  as a way of giving some rules priority over others.  One could argue
wenzelm@44132
  1214
  that \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6F723E}{\isasymor}}E{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} is unsafe, because repeated application of it
wenzelm@44132
  1215
  could generate exponentially many subgoals.  Induction rules are
wenzelm@44132
  1216
  unsafe because inductive proofs are difficult to set up
wenzelm@44132
  1217
  automatically.  Any inference is unsafe that instantiates an unknown
wenzelm@44132
  1218
  in the proof state --- thus matching must be used, rather than
wenzelm@44132
  1219
  unification.  Even proof by assumption is unsafe if it instantiates
wenzelm@44132
  1220
  unknowns shared with other subgoals.
wenzelm@44132
  1221
wenzelm@44132
  1222
  \begin{matharray}{rcl}
wenzelm@44132
  1223
    \indexdef{}{command}{print\_claset}\hypertarget{command.print-claset}{\hyperlink{command.print-claset}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}claset}}}}}\isa{{\isaliteral{22}{\isachardoublequote}}\isaliteral{5C3C5E7375703E}{}\isactrlsup {\isaliteral{2A}{\isacharasterisk}}{\isaliteral{22}{\isachardoublequote}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}context\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}{\isaliteral{22}{\isachardoublequote}}} \\
wenzelm@44132
  1224
    \indexdef{}{attribute}{intro}\hypertarget{attribute.intro}{\hyperlink{attribute.intro}{\mbox{\isa{intro}}}} & : & \isa{attribute} \\
wenzelm@44132
  1225
    \indexdef{}{attribute}{elim}\hypertarget{attribute.elim}{\hyperlink{attribute.elim}{\mbox{\isa{elim}}}} & : & \isa{attribute} \\
wenzelm@44132
  1226
    \indexdef{}{attribute}{dest}\hypertarget{attribute.dest}{\hyperlink{attribute.dest}{\mbox{\isa{dest}}}} & : & \isa{attribute} \\
wenzelm@44132
  1227
    \indexdef{}{attribute}{rule}\hypertarget{attribute.rule}{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}} & : & \isa{attribute} \\
wenzelm@44132
  1228
    \indexdef{}{attribute}{iff}\hypertarget{attribute.iff}{\hyperlink{attribute.iff}{\mbox{\isa{iff}}}} & : & \isa{attribute} \\
wenzelm@44132
  1229
    \indexdef{}{attribute}{swapped}\hypertarget{attribute.swapped}{\hyperlink{attribute.swapped}{\mbox{\isa{swapped}}}} & : & \isa{attribute} \\
wenzelm@44132
  1230
  \end{matharray}
wenzelm@44132
  1231
wenzelm@44132
  1232
  \begin{railoutput}
wenzelm@44132
  1233
\rail@begin{3}{}
wenzelm@44132
  1234
\rail@bar
wenzelm@44132
  1235
\rail@term{\hyperlink{attribute.intro}{\mbox{\isa{intro}}}}[]
wenzelm@44132
  1236
\rail@nextbar{1}
wenzelm@44132
  1237
\rail@term{\hyperlink{attribute.elim}{\mbox{\isa{elim}}}}[]
wenzelm@44132
  1238
\rail@nextbar{2}
wenzelm@44132
  1239
\rail@term{\hyperlink{attribute.dest}{\mbox{\isa{dest}}}}[]
wenzelm@44132
  1240
\rail@endbar
wenzelm@44132
  1241
\rail@bar
wenzelm@44132
  1242
\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
wenzelm@44132
  1243
\rail@nextbar{1}
wenzelm@44132
  1244
\rail@nextbar{2}
wenzelm@44132
  1245
\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
wenzelm@44132
  1246
\rail@endbar
wenzelm@44132
  1247
\rail@bar
wenzelm@44132
  1248
\rail@nextbar{1}
wenzelm@44132
  1249
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@44132
  1250
\rail@endbar
wenzelm@44132
  1251
\rail@end
wenzelm@44132
  1252
\rail@begin{1}{}
wenzelm@44132
  1253
\rail@term{\hyperlink{attribute.rule}{\mbox{\isa{rule}}}}[]
wenzelm@44132
  1254
\rail@term{\isa{del}}[]
wenzelm@44132
  1255
\rail@end
wenzelm@44132
  1256
\rail@begin{3}{}
wenzelm@44132
  1257
\rail@term{\hyperlink{attribute.iff}{\mbox{\isa{iff}}}}[]
wenzelm@44132
  1258
\rail@bar
wenzelm@44132
  1259
\rail@bar
wenzelm@44132
  1260
\rail@nextbar{1}
wenzelm@44132
  1261
\rail@term{\isa{add}}[]
wenzelm@44132
  1262
\rail@endbar
wenzelm@44132
  1263
\rail@bar
wenzelm@44132
  1264
\rail@nextbar{1}
wenzelm@44132
  1265
\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
wenzelm@44132
  1266
\rail@endbar
wenzelm@44132
  1267
\rail@nextbar{2}
wenzelm@44132
  1268
\rail@term{\isa{del}}[]
wenzelm@44132
  1269
\rail@endbar
wenzelm@44132
  1270
\rail@end
wenzelm@44132
  1271
\end{railoutput}
wenzelm@44132
  1272
wenzelm@44132
  1273
wenzelm@44132
  1274
  \begin{description}
wenzelm@44132
  1275
wenzelm@44132
  1276
  \item \hyperlink{command.print-claset}{\mbox{\isa{\isacommand{print{\isaliteral{5F}{\isacharunderscore}}claset}}}} prints the collection of rules
wenzelm@44132
  1277
  declared to the Classical Reasoner, i.e.\ the \verb|claset|
wenzelm@44132
  1278
  within the context.
wenzelm@44132
  1279
wenzelm@44132
  1280
  \item \hyperlink{attribute.intro}{\mbox{\isa{intro}}}, \hyperlink{attribute.elim}{\mbox{\isa{elim}}}, and \hyperlink{attribute.dest}{\mbox{\isa{dest}}}
wenzelm@44132
  1281
  declare introduction, elimination, and destruction rules,
wenzelm@44132
  1282
  respectively.  By default, rules are considered as \emph{unsafe}
wenzelm@44132
  1283
  (i.e.\ not applied blindly without backtracking), while ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{21}{\isacharbang}}{\isaliteral{22}{\isachardoublequote}}}'' classifies as \emph{safe}.  Rule declarations marked by
wenzelm@44132
  1284
  ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}}'' coincide with those of Isabelle/Pure, cf.\
wenzelm@44132
  1285
  \secref{sec:pure-meth-att} (i.e.\ are only applied in single steps
wenzelm@44132
  1286
  of the \hyperlink{method.rule}{\mbox{\isa{rule}}} method).  The optional natural number
wenzelm@44132
  1287
  specifies an explicit weight argument, which is ignored by the
wenzelm@44132
  1288
  automated reasoning tools, but determines the search order of single
wenzelm@44132
  1289
  rule steps.
wenzelm@44132
  1290
wenzelm@44132
  1291
  Introduction rules are those that can be applied using ordinary
wenzelm@44132
  1292
  resolution.  Their swapped forms are generated internally, which
wenzelm@44132
  1293
  will be applied using elim-resolution.  Elimination rules are
wenzelm@44132
  1294
  applied using elim-resolution.  Rules are sorted by the number of
wenzelm@44132
  1295
  new subgoals they will yield; rules that generate the fewest
wenzelm@44132
  1296
  subgoals will be tried first.  Otherwise, later declarations take
wenzelm@44132
  1297
  precedence over earlier ones.
wenzelm@44132
  1298
wenzelm@44132
  1299
  Rules already present in the context with the same classification
wenzelm@44132
  1300
  are ignored.  A warning is printed if the rule has already been
wenzelm@44132
  1301
  added with some other classification, but the rule is added anyway
wenzelm@44132
  1302
  as requested.
wenzelm@44132
  1303
wenzelm@44132
  1304
  \item \hyperlink{attribute.rule}{\mbox{\isa{rule}}}~\isa{del} deletes all occurrences of a
wenzelm@44132
  1305
  rule from the classical context, regardless of its classification as
wenzelm@44132
  1306
  introduction~/ elimination~/ destruction and safe~/ unsafe.
wenzelm@44132
  1307
wenzelm@44132
  1308
  \item \hyperlink{attribute.iff}{\mbox{\isa{iff}}} declares logical equivalences to the
wenzelm@44132
  1309
  Simplifier and the Classical reasoner at the same time.
wenzelm@44132
  1310
  Non-conditional rules result in a safe introduction and elimination
wenzelm@44132
  1311
  pair; conditional ones are considered unsafe.  Rules with negative
wenzelm@44132
  1312
  conclusion are automatically inverted (using \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}{\isaliteral{22}{\isachardoublequote}}}-elimination
wenzelm@44132
  1313
  internally).
wenzelm@44132
  1314
wenzelm@44132
  1315
  The ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{3F}{\isacharquery}}{\isaliteral{22}{\isachardoublequote}}}'' version of \hyperlink{attribute.iff}{\mbox{\isa{iff}}} declares rules to
wenzelm@44132
  1316
  the Isabelle/Pure context only, and omits the Simplifier
wenzelm@44132
  1317
  declaration.
wenzelm@44132
  1318
wenzelm@44132
  1319
  \item \hyperlink{attribute.swapped}{\mbox{\isa{swapped}}} turns an introduction rule into an
wenzelm@44132
  1320
  elimination, by resolving with the classical swap principle \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ P\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{28}{\isacharparenleft}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ R\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P{\isaliteral{29}{\isacharparenright}}\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ R{\isaliteral{22}{\isachardoublequote}}} in the second position.  This is mainly for
wenzelm@44132
  1321
  illustrative purposes: the Classical Reasoner already swaps rules
wenzelm@44132
  1322
  internally as explained above.
wenzelm@44132
  1323
wenzelm@44132
  1324
  \end{description}%
wenzelm@44132
  1325
\end{isamarkuptext}%
wenzelm@44132
  1326
\isamarkuptrue%
wenzelm@44132
  1327
%
wenzelm@44236
  1328
\isamarkupsubsection{Structured methods%
wenzelm@44236
  1329
}
wenzelm@44236
  1330
\isamarkuptrue%
wenzelm@44236
  1331
%
wenzelm@44236
  1332
\begin{isamarkuptext}%
wenzelm@44236
  1333
\begin{matharray}{rcl}
wenzelm@44236
  1334
    \indexdef{}{method}{rule}\hypertarget{method.rule}{\hyperlink{method.rule}{\mbox{\isa{rule}}}} & : & \isa{method} \\
wenzelm@44236
  1335
    \indexdef{}{method}{contradiction}\hypertarget{method.contradiction}{\hyperlink{method.contradiction}{\mbox{\isa{contradiction}}}} & : & \isa{method} \\
wenzelm@44236
  1336
  \end{matharray}
wenzelm@44236
  1337
wenzelm@44236
  1338
  \begin{railoutput}
wenzelm@44236
  1339
\rail@begin{2}{}
wenzelm@44236
  1340
\rail@term{\hyperlink{method.rule}{\mbox{\isa{rule}}}}[]
wenzelm@44236
  1341
\rail@bar
wenzelm@44236
  1342
\rail@nextbar{1}
wenzelm@44236
  1343
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@44236
  1344
\rail@endbar
wenzelm@44236
  1345
\rail@end
wenzelm@44236
  1346
\end{railoutput}
wenzelm@44236
  1347
wenzelm@44236
  1348
wenzelm@44236
  1349
  \begin{description}
wenzelm@44236
  1350
wenzelm@44236
  1351
  \item \hyperlink{method.rule}{\mbox{\isa{rule}}} as offered by the Classical Reasoner is a
wenzelm@44236
  1352
  refinement over the Pure one (see \secref{sec:pure-meth-att}).  Both
wenzelm@44236
  1353
  versions work the same, but the classical version observes the
wenzelm@44236
  1354
  classical rule context in addition to that of Isabelle/Pure.
wenzelm@44236
  1355
wenzelm@44236
  1356
  Common object logics (HOL, ZF, etc.) declare a rich collection of
wenzelm@44236
  1357
  classical rules (even if these would qualify as intuitionistic
wenzelm@44236
  1358
  ones), but only few declarations to the rule context of
wenzelm@44236
  1359
  Isabelle/Pure (\secref{sec:pure-meth-att}).
wenzelm@44236
  1360
wenzelm@44236
  1361
  \item \hyperlink{method.contradiction}{\mbox{\isa{contradiction}}} solves some goal by contradiction,
wenzelm@44236
  1362
  deriving any result from both \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6E6F743E}{\isasymnot}}\ A{\isaliteral{22}{\isachardoublequote}}} and \isa{A}.  Chained
wenzelm@44236
  1363
  facts, which are guaranteed to participate, may appear in either
wenzelm@44236
  1364
  order.
wenzelm@44236
  1365
wenzelm@44236
  1366
  \end{description}%
wenzelm@44236
  1367
\end{isamarkuptext}%
wenzelm@44236
  1368
\isamarkuptrue%
wenzelm@44236
  1369
%
wenzelm@27042
  1370
\isamarkupsubsection{Automated methods%
wenzelm@26782
  1371
}
wenzelm@26782
  1372
\isamarkuptrue%
wenzelm@26782
  1373
%
wenzelm@26782
  1374
\begin{isamarkuptext}%
wenzelm@26782
  1375
\begin{matharray}{rcl}
wenzelm@28788
  1376
    \indexdef{}{method}{blast}\hypertarget{method.blast}{\hyperlink{method.blast}{\mbox{\isa{blast}}}} & : & \isa{method} \\
wenzelm@44134
  1377
    \indexdef{}{method}{auto}\hypertarget{method.auto}{\hyperlink{method.auto}{\mbox{\isa{auto}}}} & : & \isa{method} \\
wenzelm@44134
  1378
    \indexdef{}{method}{force}\hypertarget{method.force}{\hyperlink{method.force}{\mbox{\isa{force}}}} & : & \isa{method} \\
wenzelm@28788
  1379
    \indexdef{}{method}{fast}\hypertarget{method.fast}{\hyperlink{method.fast}{\mbox{\isa{fast}}}} & : & \isa{method} \\
wenzelm@28788
  1380
    \indexdef{}{method}{slow}\hypertarget{method.slow}{\hyperlink{method.slow}{\mbox{\isa{slow}}}} & : & \isa{method} \\
wenzelm@28788
  1381
    \indexdef{}{method}{best}\hypertarget{method.best}{\hyperlink{method.best}{\mbox{\isa{best}}}} & : & \isa{method} \\
wenzelm@44134
  1382
    \indexdef{}{method}{fastsimp}\hypertarget{method.fastsimp}{\hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}} & : & \isa{method} \\
wenzelm@44134
  1383
    \indexdef{}{method}{slowsimp}\hypertarget{method.slowsimp}{\hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}} & : & \isa{method} \\
wenzelm@44134
  1384
    \indexdef{}{method}{bestsimp}\hypertarget{method.bestsimp}{\hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}} & : & \isa{method} \\
wenzelm@44238
  1385
    \indexdef{}{method}{deepen}\hypertarget{method.deepen}{\hyperlink{method.deepen}{\mbox{\isa{deepen}}}} & : & \isa{method} \\
wenzelm@26782
  1386
  \end{matharray}
wenzelm@26782
  1387
wenzelm@43467
  1388
  \begin{railoutput}
wenzelm@43535
  1389
\rail@begin{2}{}
wenzelm@43467
  1390
\rail@term{\hyperlink{method.blast}{\mbox{\isa{blast}}}}[]
wenzelm@43467
  1391
\rail@bar
wenzelm@43467
  1392
\rail@nextbar{1}
wenzelm@43467
  1393
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@43467
  1394
\rail@endbar
wenzelm@43467
  1395
\rail@plus
wenzelm@43467
  1396
\rail@nextplus{1}
wenzelm@43467
  1397
\rail@cnont{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}[]
wenzelm@43467
  1398
\rail@endplus
wenzelm@43467
  1399
\rail@end
wenzelm@44134
  1400
\rail@begin{2}{}
wenzelm@44134
  1401
\rail@term{\hyperlink{method.auto}{\mbox{\isa{auto}}}}[]
wenzelm@44134
  1402
\rail@bar
wenzelm@44134
  1403
\rail@nextbar{1}
wenzelm@44134
  1404
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@44134
  1405
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@44134
  1406
\rail@endbar
wenzelm@44134
  1407
\rail@plus
wenzelm@44134
  1408
\rail@nextplus{1}
wenzelm@44134
  1409
\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
wenzelm@44134
  1410
\rail@endplus
wenzelm@44134
  1411
\rail@end
wenzelm@44134
  1412
\rail@begin{2}{}
wenzelm@44134
  1413
\rail@term{\hyperlink{method.force}{\mbox{\isa{force}}}}[]
wenzelm@44134
  1414
\rail@plus
wenzelm@44134
  1415
\rail@nextplus{1}
wenzelm@44134
  1416
\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
wenzelm@44134
  1417
\rail@endplus
wenzelm@44134
  1418
\rail@end
wenzelm@44134
  1419
\rail@begin{3}{}
wenzelm@43467
  1420
\rail@bar
wenzelm@43467
  1421
\rail@term{\hyperlink{method.fast}{\mbox{\isa{fast}}}}[]
wenzelm@43467
  1422
\rail@nextbar{1}
wenzelm@43467
  1423
\rail@term{\hyperlink{method.slow}{\mbox{\isa{slow}}}}[]
wenzelm@43467
  1424
\rail@nextbar{2}
wenzelm@43467
  1425
\rail@term{\hyperlink{method.best}{\mbox{\isa{best}}}}[]
wenzelm@43467
  1426
\rail@endbar
wenzelm@43467
  1427
\rail@plus
wenzelm@43467
  1428
\rail@nextplus{1}
wenzelm@43467
  1429
\rail@cnont{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}[]
wenzelm@43467
  1430
\rail@endplus
wenzelm@43467
  1431
\rail@end
wenzelm@44134
  1432
\rail@begin{3}{}
wenzelm@44134
  1433
\rail@bar
wenzelm@44134
  1434
\rail@term{\hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}}[]
wenzelm@44134
  1435
\rail@nextbar{1}
wenzelm@44134
  1436
\rail@term{\hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}}[]
wenzelm@44134
  1437
\rail@nextbar{2}
wenzelm@44134
  1438
\rail@term{\hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}}}[]
wenzelm@44134
  1439
\rail@endbar
wenzelm@44134
  1440
\rail@plus
wenzelm@44134
  1441
\rail@nextplus{1}
wenzelm@44134
  1442
\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
wenzelm@44134
  1443
\rail@endplus
wenzelm@44134
  1444
\rail@end
wenzelm@44238
  1445
\rail@begin{2}{}
wenzelm@44238
  1446
\rail@term{\hyperlink{method.deepen}{\mbox{\isa{deepen}}}}[]
wenzelm@44238
  1447
\rail@bar
wenzelm@44238
  1448
\rail@nextbar{1}
wenzelm@44238
  1449
\rail@nont{\hyperlink{syntax.nat}{\mbox{\isa{nat}}}}[]
wenzelm@44238
  1450
\rail@endbar
wenzelm@44238
  1451
\rail@plus
wenzelm@44238
  1452
\rail@nextplus{1}
wenzelm@44238
  1453
\rail@cnont{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}[]
wenzelm@44238
  1454
\rail@endplus
wenzelm@44238
  1455
\rail@end
wenzelm@43467
  1456
\rail@begin{4}{\indexdef{}{syntax}{clamod}\hypertarget{syntax.clamod}{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}}
wenzelm@43467
  1457
\rail@bar
wenzelm@43467
  1458
\rail@bar
wenzelm@43467
  1459
\rail@term{\isa{intro}}[]
wenzelm@43467
  1460
\rail@nextbar{1}
wenzelm@43467
  1461
\rail@term{\isa{elim}}[]
wenzelm@43467
  1462
\rail@nextbar{2}
wenzelm@43467
  1463
\rail@term{\isa{dest}}[]
wenzelm@43467
  1464
\rail@endbar
wenzelm@43467
  1465
\rail@bar
wenzelm@43467
  1466
\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
wenzelm@43467
  1467
\rail@nextbar{1}
wenzelm@43467
  1468
\rail@nextbar{2}
wenzelm@43467
  1469
\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
wenzelm@43467
  1470
\rail@endbar
wenzelm@43467
  1471
\rail@nextbar{3}
wenzelm@43467
  1472
\rail@term{\isa{del}}[]
wenzelm@43467
  1473
\rail@endbar
wenzelm@43467
  1474
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
wenzelm@43467
  1475
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
  1476
\rail@end
wenzelm@43467
  1477
\rail@begin{14}{\indexdef{}{syntax}{clasimpmod}\hypertarget{syntax.clasimpmod}{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}}
wenzelm@43467
  1478
\rail@bar
wenzelm@43467
  1479
\rail@term{\isa{simp}}[]
wenzelm@43467
  1480
\rail@bar
wenzelm@43467
  1481
\rail@nextbar{1}
wenzelm@43467
  1482
\rail@term{\isa{add}}[]
wenzelm@43467
  1483
\rail@nextbar{2}
wenzelm@43467
  1484
\rail@term{\isa{del}}[]
wenzelm@43467
  1485
\rail@nextbar{3}
wenzelm@43467
  1486
\rail@term{\isa{only}}[]
wenzelm@43467
  1487
\rail@endbar
wenzelm@43467
  1488
\rail@nextbar{4}
wenzelm@43467
  1489
\rail@bar
wenzelm@43467
  1490
\rail@term{\isa{cong}}[]
wenzelm@43467
  1491
\rail@nextbar{5}
wenzelm@43467
  1492
\rail@term{\isa{split}}[]
wenzelm@43467
  1493
\rail@endbar
wenzelm@43467
  1494
\rail@bar
wenzelm@43467
  1495
\rail@nextbar{5}
wenzelm@43467
  1496
\rail@term{\isa{add}}[]
wenzelm@43467
  1497
\rail@nextbar{6}
wenzelm@43467
  1498
\rail@term{\isa{del}}[]
wenzelm@43467
  1499
\rail@endbar
wenzelm@43467
  1500
\rail@nextbar{7}
wenzelm@43467
  1501
\rail@term{\isa{iff}}[]
wenzelm@43467
  1502
\rail@bar
wenzelm@43467
  1503
\rail@bar
wenzelm@43467
  1504
\rail@nextbar{8}
wenzelm@43467
  1505
\rail@term{\isa{add}}[]
wenzelm@43467
  1506
\rail@endbar
wenzelm@43467
  1507
\rail@bar
wenzelm@43467
  1508
\rail@nextbar{8}
wenzelm@43467
  1509
\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
wenzelm@43467
  1510
\rail@endbar
wenzelm@43467
  1511
\rail@nextbar{9}
wenzelm@43467
  1512
\rail@term{\isa{del}}[]
wenzelm@43467
  1513
\rail@endbar
wenzelm@43467
  1514
\rail@nextbar{10}
wenzelm@43467
  1515
\rail@bar
wenzelm@43467
  1516
\rail@bar
wenzelm@43467
  1517
\rail@term{\isa{intro}}[]
wenzelm@43467
  1518
\rail@nextbar{11}
wenzelm@43467
  1519
\rail@term{\isa{elim}}[]
wenzelm@43467
  1520
\rail@nextbar{12}
wenzelm@43467
  1521
\rail@term{\isa{dest}}[]
wenzelm@43467
  1522
\rail@endbar
wenzelm@43467
  1523
\rail@bar
wenzelm@43467
  1524
\rail@term{\isa{{\isaliteral{21}{\isacharbang}}}}[]
wenzelm@43467
  1525
\rail@nextbar{11}
wenzelm@43467
  1526
\rail@nextbar{12}
wenzelm@43467
  1527
\rail@term{\isa{{\isaliteral{3F}{\isacharquery}}}}[]
wenzelm@43467
  1528
\rail@endbar
wenzelm@43467
  1529
\rail@nextbar{13}
wenzelm@43467
  1530
\rail@term{\isa{del}}[]
wenzelm@43467
  1531
\rail@endbar
wenzelm@43467
  1532
\rail@endbar
wenzelm@43467
  1533
\rail@term{\isa{{\isaliteral{3A}{\isacharcolon}}}}[]
wenzelm@43467
  1534
\rail@nont{\hyperlink{syntax.thmrefs}{\mbox{\isa{thmrefs}}}}[]
wenzelm@43467
  1535
\rail@end
wenzelm@43467
  1536
\end{railoutput}
wenzelm@26782
  1537
wenzelm@26782
  1538
wenzelm@28788
  1539
  \begin{description}
wenzelm@26782
  1540
wenzelm@44134
  1541
  \item \hyperlink{method.blast}{\mbox{\isa{blast}}} is a separate classical tableau prover that
wenzelm@44134
  1542
  uses the same classical rule declarations as explained before.
wenzelm@26782
  1543
wenzelm@44134
  1544
  Proof search is coded directly in ML using special data structures.
wenzelm@44134
  1545
  A successful proof is then reconstructed using regular Isabelle
wenzelm@44134
  1546
  inferences.  It is faster and more powerful than the other classical
wenzelm@44134
  1547
  reasoning tools, but has major limitations too.
wenzelm@44134
  1548
wenzelm@44134
  1549
  \begin{itemize}
wenzelm@44134
  1550
wenzelm@44134
  1551
  \item It does not use the classical wrapper tacticals, such as the
wenzelm@44134
  1552
  integration with the Simplifier of \hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}.
wenzelm@44134
  1553
wenzelm@44134
  1554
  \item It does not perform higher-order unification, as needed by the
wenzelm@44134
  1555
  rule \isa{{\isaliteral{3F}{\isacharquery}}f\ {\isaliteral{3F}{\isacharquery}}x\ {\isaliteral{5C3C696E3E}{\isasymin}}\ range\ {\isaliteral{3F}{\isacharquery}}f} in HOL.  There are often
wenzelm@44134
  1556
  alternatives to such rules, for example \isa{{\isaliteral{3F}{\isacharquery}}b\ {\isaliteral{3D}{\isacharequal}}\ {\isaliteral{3F}{\isacharquery}}f\ {\isaliteral{3F}{\isacharquery}}x\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ {\isaliteral{3F}{\isacharquery}}b\ {\isaliteral{5C3C696E3E}{\isasymin}}\ range\ {\isaliteral{3F}{\isacharquery}}f}.
wenzelm@44134
  1557
wenzelm@44134
  1558
  \item Function variables may only be applied to parameters of the
wenzelm@44134
  1559
  subgoal.  (This restriction arises because the prover does not use
wenzelm@44134
  1560
  higher-order unification.)  If other function variables are present
wenzelm@44134
  1561
  then the prover will fail with the message \texttt{Function Var's
wenzelm@44134
  1562
  argument not a bound variable}.
wenzelm@44134
  1563
wenzelm@44134
  1564
  \item Its proof strategy is more general than \hyperlink{method.fast}{\mbox{\isa{fast}}} but can
wenzelm@44134
  1565
  be slower.  If \hyperlink{method.blast}{\mbox{\isa{blast}}} fails or seems to be running forever,
wenzelm@44134
  1566
  try \hyperlink{method.fast}{\mbox{\isa{fast}}} and the other proof tools described below.
wenzelm@44134
  1567
wenzelm@44134
  1568
  \end{itemize}
wenzelm@44134
  1569
wenzelm@44134
  1570
  The optional integer argument specifies a bound for the number of
wenzelm@44134
  1571
  unsafe steps used in a proof.  By default, \hyperlink{method.blast}{\mbox{\isa{blast}}} starts
wenzelm@44134
  1572
  with a bound of 0 and increases it successively to 20.  In contrast,
wenzelm@44134
  1573
  \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}blast\ lim{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} tries to prove the goal using a search bound
wenzelm@44134
  1574
  of \isa{{\isaliteral{22}{\isachardoublequote}}lim{\isaliteral{22}{\isachardoublequote}}}.  Sometimes a slow proof using \hyperlink{method.blast}{\mbox{\isa{blast}}} can
wenzelm@44134
  1575
  be made much faster by supplying the successful search bound to this
wenzelm@44134
  1576
  proof method instead.
wenzelm@44134
  1577
wenzelm@44134
  1578
  \item \hyperlink{method.auto}{\mbox{\isa{auto}}} combines classical reasoning with
wenzelm@44134
  1579
  simplification.  It is intended for situations where there are a lot
wenzelm@44134
  1580
  of mostly trivial subgoals; it proves all the easy ones, leaving the
wenzelm@44134
  1581
  ones it cannot prove.  Occasionally, attempting to prove the hard
wenzelm@44134
  1582
  ones may take a long time.
wenzelm@44134
  1583
wenzelm@44214
  1584
  The optional depth arguments in \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}auto\ m\ n{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} refer to its
wenzelm@44214
  1585
  builtin classical reasoning procedures: \isa{m} (default 4) is for
wenzelm@44214
  1586
  \hyperlink{method.blast}{\mbox{\isa{blast}}}, which is tried first, and \isa{n} (default 2) is
wenzelm@44214
  1587
  for a slower but more general alternative that also takes wrappers
wenzelm@44214
  1588
  into account.
wenzelm@44134
  1589
wenzelm@44134
  1590
  \item \hyperlink{method.force}{\mbox{\isa{force}}} is intended to prove the first subgoal
wenzelm@44134
  1591
  completely, using many fancy proof tools and performing a rather
wenzelm@44134
  1592
  exhaustive search.  As a result, proof attempts may take rather long
wenzelm@44134
  1593
  or diverge easily.
wenzelm@44134
  1594
wenzelm@44134
  1595
  \item \hyperlink{method.fast}{\mbox{\isa{fast}}}, \hyperlink{method.best}{\mbox{\isa{best}}}, \hyperlink{method.slow}{\mbox{\isa{slow}}} attempt to
wenzelm@44134
  1596
  prove the first subgoal using sequent-style reasoning as explained
wenzelm@44134
  1597
  before.  Unlike \hyperlink{method.blast}{\mbox{\isa{blast}}}, they construct proofs directly in
wenzelm@44134
  1598
  Isabelle.
wenzelm@44134
  1599
wenzelm@44134
  1600
  There is a difference in search strategy and back-tracking: \hyperlink{method.fast}{\mbox{\isa{fast}}} uses depth-first search and \hyperlink{method.best}{\mbox{\isa{best}}} uses best-first
wenzelm@44134
  1601
  search (guided by a heuristic function: normally the total size of
wenzelm@44134
  1602
  the proof state).
wenzelm@44134
  1603
wenzelm@44134
  1604
  Method \hyperlink{method.slow}{\mbox{\isa{slow}}} is like \hyperlink{method.fast}{\mbox{\isa{fast}}}, but conducts a broader
wenzelm@44134
  1605
  search: it may, when backtracking from a failed proof attempt, undo
wenzelm@44134
  1606
  even the step of proving a subgoal by assumption.
wenzelm@44134
  1607
wenzelm@44134
  1608
  \item \hyperlink{method.fastsimp}{\mbox{\isa{fastsimp}}}, \hyperlink{method.slowsimp}{\mbox{\isa{slowsimp}}}, \hyperlink{method.bestsimp}{\mbox{\isa{bestsimp}}} are
wenzelm@44134
  1609
  like \hyperlink{method.fast}{\mbox{\isa{fast}}}, \hyperlink{method.slow}{\mbox{\isa{slow}}}, \hyperlink{method.best}{\mbox{\isa{best}}}, respectively,
wenzelm@44134
  1610
  but use the Simplifier as additional wrapper.
wenzelm@44134
  1611
wenzelm@44238
  1612
  \item \hyperlink{method.deepen}{\mbox{\isa{deepen}}} works by exhaustive search up to a certain
wenzelm@44238
  1613
  depth.  The start depth is 4 (unless specified explicitly), and the
wenzelm@44238
  1614
  depth is increased iteratively up to 10.  Unsafe rules are modified
wenzelm@44238
  1615
  to preserve the formula they act on, so that it be used repeatedly.
wenzelm@44238
  1616
  This method can prove more goals than \hyperlink{method.fast}{\mbox{\isa{fast}}}, but is much
wenzelm@44238
  1617
  slower, for example if the assumptions have many universal
wenzelm@44238
  1618
  quantifiers.
wenzelm@44238
  1619
wenzelm@44134
  1620
  \end{description}
wenzelm@44134
  1621
wenzelm@44134
  1622
  Any of the above methods support additional modifiers of the context
wenzelm@44134
  1623
  of classical (and simplifier) rules, but the ones related to the
wenzelm@44134
  1624
  Simplifier are explicitly prefixed by \isa{simp} here.  The
wenzelm@44134
  1625
  semantics of these ad-hoc rule declarations is analogous to the
wenzelm@44134
  1626
  attributes given before.  Facts provided by forward chaining are
wenzelm@44134
  1627
  inserted into the goal before commencing proof search.%
wenzelm@44134
  1628
\end{isamarkuptext}%
wenzelm@44134
  1629
\isamarkuptrue%
wenzelm@44134
  1630
%
wenzelm@44134
  1631
\isamarkupsubsection{Semi-automated methods%
wenzelm@44134
  1632
}
wenzelm@44134
  1633
\isamarkuptrue%
wenzelm@44134
  1634
%
wenzelm@44134
  1635
\begin{isamarkuptext}%
wenzelm@44134
  1636
These proof methods may help in situations when the
wenzelm@44134
  1637
  fully-automated tools fail.  The result is a simpler subgoal that
wenzelm@44134
  1638
  can be tackled by other means, such as by manual instantiation of
wenzelm@44134
  1639
  quantifiers.
wenzelm@44134
  1640
wenzelm@44134
  1641
  \begin{matharray}{rcl}
wenzelm@44134
  1642
    \indexdef{}{method}{safe}\hypertarget{method.safe}{\hyperlink{method.safe}{\mbox{\isa{safe}}}} & : & \isa{method} \\
wenzelm@44134
  1643
    \indexdef{}{method}{clarify}\hypertarget{method.clarify}{\hyperlink{method.clarify}{\mbox{\isa{clarify}}}} & : & \isa{method} \\
wenzelm@44134
  1644
    \indexdef{}{method}{clarsimp}\hypertarget{method.clarsimp}{\hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}} & : & \isa{method} \\
wenzelm@44134
  1645
  \end{matharray}
wenzelm@44134
  1646
wenzelm@44134
  1647
  \begin{railoutput}
wenzelm@44134
  1648
\rail@begin{2}{}
wenzelm@44134
  1649
\rail@bar
wenzelm@44134
  1650
\rail@term{\hyperlink{method.safe}{\mbox{\isa{safe}}}}[]
wenzelm@44134
  1651
\rail@nextbar{1}
wenzelm@44134
  1652
\rail@term{\hyperlink{method.clarify}{\mbox{\isa{clarify}}}}[]
wenzelm@44134
  1653
\rail@endbar
wenzelm@44134
  1654
\rail@plus
wenzelm@44134
  1655
\rail@nextplus{1}
wenzelm@44134
  1656
\rail@cnont{\hyperlink{syntax.clamod}{\mbox{\isa{clamod}}}}[]
wenzelm@44134
  1657
\rail@endplus
wenzelm@44134
  1658
\rail@end
wenzelm@44134
  1659
\rail@begin{2}{}
wenzelm@44134
  1660
\rail@term{\hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}}}[]
wenzelm@44134
  1661
\rail@plus
wenzelm@44134
  1662
\rail@nextplus{1}
wenzelm@44134
  1663
\rail@cnont{\hyperlink{syntax.clasimpmod}{\mbox{\isa{clasimpmod}}}}[]
wenzelm@44134
  1664
\rail@endplus
wenzelm@44134
  1665
\rail@end
wenzelm@44134
  1666
\end{railoutput}
wenzelm@44134
  1667
wenzelm@44134
  1668
wenzelm@44134
  1669
  \begin{description}
wenzelm@44134
  1670
wenzelm@44134
  1671
  \item \hyperlink{method.safe}{\mbox{\isa{safe}}} repeatedly performs safe steps on all subgoals.
wenzelm@44134
  1672
  It is deterministic, with at most one outcome.
wenzelm@44134
  1673
wenzelm@44237
  1674
  \item \hyperlink{method.clarify}{\mbox{\isa{clarify}}} performs a series of safe steps without
wenzelm@44237
  1675
  splitting subgoals; see also \verb|clarify_step_tac|.
wenzelm@44134
  1676
wenzelm@44134
  1677
  \item \hyperlink{method.clarsimp}{\mbox{\isa{clarsimp}}} acts like \hyperlink{method.clarify}{\mbox{\isa{clarify}}}, but also does
wenzelm@44134
  1678
  simplification.  Note that if the Simplifier context includes a
wenzelm@44134
  1679
  splitter for the premises, the subgoal may still be split.
wenzelm@26782
  1680
wenzelm@28788
  1681
  \end{description}%
wenzelm@26782
  1682
\end{isamarkuptext}%
wenzelm@26782
  1683
\isamarkuptrue%
wenzelm@26782
  1684
%
wenzelm@44237
  1685
\isamarkupsubsection{Single-step tactics%
wenzelm@44237
  1686
}
wenzelm@44237
  1687
\isamarkuptrue%
wenzelm@44237
  1688
%
wenzelm@44237
  1689
\begin{isamarkuptext}%
wenzelm@44237
  1690
\begin{matharray}{rcl}
wenzelm@44237
  1691
    \indexdef{}{ML}{safe\_step\_tac}\verb|safe_step_tac: Proof.context -> int -> tactic| \\
wenzelm@44237
  1692
    \indexdef{}{ML}{inst\_step\_tac}\verb|inst_step_tac: Proof.context -> int -> tactic| \\
wenzelm@44237
  1693
    \indexdef{}{ML}{step\_tac}\verb|step_tac: Proof.context -> int -> tactic| \\
wenzelm@44237
  1694
    \indexdef{}{ML}{slow\_step\_tac}\verb|slow_step_tac: Proof.context -> int -> tactic| \\
wenzelm@44237
  1695
    \indexdef{}{ML}{clarify\_step\_tac}\verb|clarify_step_tac: Proof.context -> int -> tactic| \\
wenzelm@44237
  1696
  \end{matharray}
wenzelm@44237
  1697
wenzelm@44237
  1698
  These are the primitive tactics behind the (semi)automated proof
wenzelm@44237
  1699
  methods of the Classical Reasoner.  By calling them yourself, you
wenzelm@44237
  1700
  can execute these procedures one step at a time.
wenzelm@44237
  1701
wenzelm@44237
  1702
  \begin{description}
wenzelm@44237
  1703
wenzelm@44237
  1704
  \item \verb|safe_step_tac|~\isa{{\isaliteral{22}{\isachardoublequote}}ctxt\ i{\isaliteral{22}{\isachardoublequote}}} performs a safe step on
wenzelm@44237
  1705
  subgoal \isa{i}.  The safe wrapper tacticals are applied to a
wenzelm@44237
  1706
  tactic that may include proof by assumption or Modus Ponens (taking
wenzelm@44237
  1707
  care not to instantiate unknowns), or substitution.
wenzelm@44237
  1708
wenzelm@44237
  1709
  \item \verb|inst_step_tac| is like \verb|safe_step_tac|, but allows
wenzelm@44237
  1710
  unknowns to be instantiated.
wenzelm@44237
  1711
wenzelm@44237
  1712
  \item \verb|step_tac|~\isa{{\isaliteral{22}{\isachardoublequote}}ctxt\ i{\isaliteral{22}{\isachardoublequote}}} is the basic step of the proof
wenzelm@44237
  1713
  procedure.  The unsafe wrapper tacticals are applied to a tactic
wenzelm@44237
  1714
  that tries \verb|safe_tac|, \verb|inst_step_tac|, or applies an unsafe
wenzelm@44237
  1715
  rule from the context.
wenzelm@44237
  1716
wenzelm@44237
  1717
  \item \verb|slow_step_tac| resembles \verb|step_tac|, but allows
wenzelm@44237
  1718
  backtracking between using safe rules with instantiation (\verb|inst_step_tac|) and using unsafe rules.  The resulting search space
wenzelm@44237
  1719
  is larger.
wenzelm@44237
  1720
wenzelm@44237
  1721
  \item \verb|clarify_step_tac|~\isa{{\isaliteral{22}{\isachardoublequote}}ctxt\ i{\isaliteral{22}{\isachardoublequote}}} performs a safe step
wenzelm@44237
  1722
  on subgoal \isa{i}.  No splitting step is applied; for example,
wenzelm@44237
  1723
  the subgoal \isa{{\isaliteral{22}{\isachardoublequote}}A\ {\isaliteral{5C3C616E643E}{\isasymand}}\ B{\isaliteral{22}{\isachardoublequote}}} is left as a conjunction.  Proof by
wenzelm@44237
  1724
  assumption, Modus Ponens, etc., may be performed provided they do
wenzelm@44237
  1725
  not instantiate unknowns.  Assumptions of the form \isa{{\isaliteral{22}{\isachardoublequote}}x\ {\isaliteral{3D}{\isacharequal}}\ t{\isaliteral{22}{\isachardoublequote}}}
wenzelm@44237
  1726
  may be eliminated.  The safe wrapper tactical is applied.
wenzelm@44237
  1727
wenzelm@44237
  1728
  \end{description}%
wenzelm@44237
  1729
\end{isamarkuptext}%
wenzelm@44237
  1730
\isamarkuptrue%
wenzelm@44237
  1731
%
wenzelm@27047
  1732
\isamarkupsection{Object-logic setup \label{sec:object-logic}%
wenzelm@26790
  1733
}
wenzelm@26790
  1734
\isamarkuptrue%
wenzelm@26790
  1735
%
wenzelm@26790
  1736
\begin{isamarkuptext}%
wenzelm@26790
  1737
\begin{matharray}{rcl}
wenzelm@40685
  1738
    \indexdef{}{command}{judgment}\hypertarget{command.judgment}{\hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}} & : & \isa{{\isaliteral{22}{\isachardoublequote}}theory\ {\isaliteral{5C3C72696768746172726F773E}{\isasymrightarrow}}\ theory{\isaliteral{22}{\isachardoublequote}}} \\
wenzelm@28788
  1739
    \indexdef{}{method}{atomize}\hypertarget{method.atomize}{\hyperlink{method.atomize}{\mbox{\isa{atomize}}}} & : & \isa{method} \\
wenzelm@28788
  1740
    \indexdef{}{attribute}{atomize}\hypertarget{attribute.atomize}{\hyperlink{attribute.atomize}{\mbox{\isa{atomize}}}} & : & \isa{attribute} \\
wenzelm@40685
  1741
    \indexdef{}{attribute}{rule\_format}\hypertarget{attribute.rule-format}{\hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}format}}}} & : & \isa{attribute} \\
wenzelm@28788
  1742
    \indexdef{}{attribute}{rulify}\hypertarget{attribute.rulify}{\hyperlink{attribute.rulify}{\mbox{\isa{rulify}}}} & : & \isa{attribute} \\
wenzelm@26790
  1743
  \end{matharray}
wenzelm@26790
  1744
wenzelm@26790
  1745
  The very starting point for any Isabelle object-logic is a ``truth
wenzelm@26790
  1746
  judgment'' that links object-level statements to the meta-logic
wenzelm@26790
  1747
  (with its minimal language of \isa{prop} that covers universal
wenzelm@40685
  1748
  quantification \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{22}{\isachardoublequote}}} and implication \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}}).
wenzelm@26790
  1749
wenzelm@26790
  1750
  Common object-logics are sufficiently expressive to internalize rule
wenzelm@40685
  1751
  statements over \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}} within their own
wenzelm@26790
  1752
  language.  This is useful in certain situations where a rule needs
wenzelm@26790
  1753
  to be viewed as an atomic statement from the meta-level perspective,
wenzelm@40685
  1754
  e.g.\ \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}x{\isaliteral{2E}{\isachardot}}\ x\ {\isaliteral{5C3C696E3E}{\isasymin}}\ A\ {\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}\ P\ x{\isaliteral{22}{\isachardoublequote}}} versus \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}x\ {\isaliteral{5C3C696E3E}{\isasymin}}\ A{\isaliteral{2E}{\isachardot}}\ P\ x{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@26790
  1755
wenzelm@26902
  1756
  From the following language elements, only the \hyperlink{method.atomize}{\mbox{\isa{atomize}}}
wenzelm@40685
  1757
  method and \hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}format}}} attribute are occasionally
wenzelm@26790
  1758
  required by end-users, the rest is for those who need to setup their
wenzelm@26790
  1759
  own object-logic.  In the latter case existing formulations of
wenzelm@26790
  1760
  Isabelle/FOL or Isabelle/HOL may be taken as realistic examples.
wenzelm@26790
  1761
wenzelm@26790
  1762
  Generic tools may refer to the information provided by object-logic
wenzelm@26790
  1763
  declarations internally.
wenzelm@26790
  1764
wenzelm@43467
  1765
  \begin{railoutput}
wenzelm@43535
  1766
\rail@begin{1}{}
wenzelm@43467
  1767
\rail@term{\hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}}[]
wenzelm@43467
  1768
\rail@nont{\hyperlink{syntax.constdecl}{\mbox{\isa{constdecl}}}}[]
wenzelm@43467
  1769
\rail@end
wenzelm@43535
  1770
\rail@begin{2}{}
wenzelm@43467
  1771
\rail@term{\hyperlink{attribute.atomize}{\mbox{\isa{atomize}}}}[]
wenzelm@43467
  1772
\rail@bar
wenzelm@43467
  1773
\rail@nextbar{1}
wenzelm@43467
  1774
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
  1775
\rail@term{\isa{full}}[]
wenzelm@43467
  1776
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
  1777
\rail@endbar
wenzelm@43467
  1778
\rail@end
wenzelm@43535
  1779
\rail@begin{2}{}
wenzelm@43467
  1780
\rail@term{\hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}format}}}}[]
wenzelm@43467
  1781
\rail@bar
wenzelm@43467
  1782
\rail@nextbar{1}
wenzelm@43467
  1783
\rail@term{\isa{{\isaliteral{28}{\isacharparenleft}}}}[]
wenzelm@43467
  1784
\rail@term{\isa{noasm}}[]
wenzelm@43467
  1785
\rail@term{\isa{{\isaliteral{29}{\isacharparenright}}}}[]
wenzelm@43467
  1786
\rail@endbar
wenzelm@43467
  1787
\rail@end
wenzelm@43467
  1788
\end{railoutput}
wenzelm@43467
  1789
wenzelm@26790
  1790
wenzelm@28788
  1791
  \begin{description}
wenzelm@26790
  1792
  
wenzelm@40685
  1793
  \item \hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}~\isa{{\isaliteral{22}{\isachardoublequote}}c\ {\isaliteral{3A}{\isacharcolon}}{\isaliteral{3A}{\isacharcolon}}\ {\isaliteral{5C3C7369676D613E}{\isasymsigma}}\ {\isaliteral{28}{\isacharparenleft}}mx{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} declares constant
wenzelm@28788
  1794
  \isa{c} as the truth judgment of the current object-logic.  Its
wenzelm@40685
  1795
  type \isa{{\isaliteral{5C3C7369676D613E}{\isasymsigma}}} should specify a coercion of the category of
wenzelm@28788
  1796
  object-level propositions to \isa{prop} of the Pure meta-logic;
wenzelm@40685
  1797
  the mixfix annotation \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}mx{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} would typically just link the
wenzelm@28788
  1798
  object language (internally of syntactic category \isa{logic})
wenzelm@28788
  1799
  with that of \isa{prop}.  Only one \hyperlink{command.judgment}{\mbox{\isa{\isacommand{judgment}}}}
wenzelm@28788
  1800
  declaration may be given in any theory development.
wenzelm@26790
  1801
  
wenzelm@28788
  1802
  \item \hyperlink{method.atomize}{\mbox{\isa{atomize}}} (as a method) rewrites any non-atomic
wenzelm@26790
  1803
  premises of a sub-goal, using the meta-level equations declared via
wenzelm@26902
  1804
  \hyperlink{attribute.atomize}{\mbox{\isa{atomize}}} (as an attribute) beforehand.  As a result,
wenzelm@26790
  1805
  heavily nested goals become amenable to fundamental operations such
wenzelm@43497
  1806
  as resolution (cf.\ the \hyperlink{method.Pure.rule}{\mbox{\isa{rule}}} method).  Giving the ``\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}full{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}}'' option here means to turn the whole subgoal into an
wenzelm@26790
  1807
  object-statement (if possible), including the outermost parameters
wenzelm@26790
  1808
  and assumptions as well.
wenzelm@26790
  1809
wenzelm@26902
  1810
  A typical collection of \hyperlink{attribute.atomize}{\mbox{\isa{atomize}}} rules for a particular
wenzelm@26790
  1811
  object-logic would provide an internalization for each of the
wenzelm@40685
  1812
  connectives of \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{22}{\isachardoublequote}}}, \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}}, and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C65717569763E}{\isasymequiv}}{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@26790
  1813
  Meta-level conjunction should be covered as well (this is
wenzelm@26790
  1814
  particularly important for locales, see \secref{sec:locale}).
wenzelm@26790
  1815
wenzelm@40685
  1816
  \item \hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}format}}} rewrites a theorem by the equalities
wenzelm@28788
  1817
  declared as \hyperlink{attribute.rulify}{\mbox{\isa{rulify}}} rules in the current object-logic.
wenzelm@28788
  1818
  By default, the result is fully normalized, including assumptions
wenzelm@40685
  1819
  and conclusions at any depth.  The \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{28}{\isacharparenleft}}no{\isaliteral{5F}{\isacharunderscore}}asm{\isaliteral{29}{\isacharparenright}}{\isaliteral{22}{\isachardoublequote}}} option
wenzelm@28788
  1820
  restricts the transformation to the conclusion of a rule.
wenzelm@26790
  1821
wenzelm@40685
  1822
  In common object-logics (HOL, FOL, ZF), the effect of \hyperlink{attribute.rule-format}{\mbox{\isa{rule{\isaliteral{5F}{\isacharunderscore}}format}}} is to replace (bounded) universal quantification
wenzelm@40685
  1823
  (\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C666F72616C6C3E}{\isasymforall}}{\isaliteral{22}{\isachardoublequote}}}) and implication (\isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C6C6F6E6772696768746172726F773E}{\isasymlongrightarrow}}{\isaliteral{22}{\isachardoublequote}}}) by the corresponding
wenzelm@40685
  1824
  rule statements over \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C416E643E}{\isasymAnd}}{\isaliteral{22}{\isachardoublequote}}} and \isa{{\isaliteral{22}{\isachardoublequote}}{\isaliteral{5C3C4C6F6E6772696768746172726F773E}{\isasymLongrightarrow}}{\isaliteral{22}{\isachardoublequote}}}.
wenzelm@26790
  1825
wenzelm@28788
  1826
  \end{description}%
wenzelm@26790
  1827
\end{isamarkuptext}%
wenzelm@26790
  1828
\isamarkuptrue%
wenzelm@26790
  1829
%
wenzelm@26782
  1830
\isadelimtheory
wenzelm@26782
  1831
%
wenzelm@26782
  1832
\endisadelimtheory
wenzelm@26782
  1833
%
wenzelm@26782
  1834
\isatagtheory
wenzelm@26782
  1835
\isacommand{end}\isamarkupfalse%
wenzelm@26782
  1836
%
wenzelm@26782
  1837
\endisatagtheory
wenzelm@26782
  1838
{\isafoldtheory}%
wenzelm@26782
  1839
%
wenzelm@26782
  1840
\isadelimtheory
wenzelm@26782
  1841
%
wenzelm@26782
  1842
\endisadelimtheory
wenzelm@26782
  1843
\isanewline
wenzelm@26782
  1844
\end{isabellebody}%
wenzelm@26782
  1845
%%% Local Variables:
wenzelm@26782
  1846
%%% mode: latex
wenzelm@26782
  1847
%%% TeX-master: "root"
wenzelm@26782
  1848
%%% End: