doc-src/Ref/thm.tex
author wenzelm
Wed, 25 Jan 2012 14:13:59 +0100
changeset 46255 6fae74ee591a
parent 42932 34ed34804d90
child 46256 bc874d2ee55a
permissions -rw-r--r--
removed obscure/outdated material;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30184
37969710e61f removed parts of the manual that are clearly obsolete, or covered by
wenzelm
parents: 11625
diff changeset
     1
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     2
\chapter{Theorems and Forward Proof}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
     3
\index{theorems|(}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
     4
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
     5
Theorems, which represent the axioms, theorems and rules of
42932
34ed34804d90 removed obsolete material (superseded by implementation manual);
wenzelm
parents: 30184
diff changeset
     6
object-logics, have type \mltydx{thm}.  This chapter describes
34ed34804d90 removed obsolete material (superseded by implementation manual);
wenzelm
parents: 30184
diff changeset
     7
operations that join theorems in forward proof.  Most theorem
34ed34804d90 removed obsolete material (superseded by implementation manual);
wenzelm
parents: 30184
diff changeset
     8
operations are intended for advanced applications, such as programming
34ed34804d90 removed obsolete material (superseded by implementation manual);
wenzelm
parents: 30184
diff changeset
     9
new proof procedures.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    10
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    11
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    12
\section{Basic operations on theorems}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    13
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    14
\subsection{Forward proof: joining rules by resolution}
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    15
\index{theorems!joining by resolution}
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    16
\index{resolution}\index{forward proof}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    17
\begin{ttbox} 
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    18
RSN : thm * (int * thm) -> thm                 \hfill\textbf{infix}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    19
RS  : thm * thm -> thm                         \hfill\textbf{infix}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    20
MRS : thm list * thm -> thm                    \hfill\textbf{infix}
9288
06a55195741b infix 'OF' is a version of 'MRS' with more appropriate argument order;
wenzelm
parents: 9258
diff changeset
    21
OF  : thm * thm list -> thm                    \hfill\textbf{infix}
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    22
RLN : thm list * (int * thm list) -> thm list  \hfill\textbf{infix}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    23
RL  : thm list * thm list -> thm list          \hfill\textbf{infix}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    24
MRL : thm list list * thm list -> thm list     \hfill\textbf{infix}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    25
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    26
Joining rules together is a simple way of deriving new rules.  These
876
5c18634db55d Under RS added cross reference to bind_thm
lcp
parents: 866
diff changeset
    27
functions are especially useful with destruction rules.  To store
5c18634db55d Under RS added cross reference to bind_thm
lcp
parents: 866
diff changeset
    28
the result in the theorem database, use \ttindex{bind_thm}
5c18634db55d Under RS added cross reference to bind_thm
lcp
parents: 866
diff changeset
    29
(\S\ref{ExtractingAndStoringTheProvedTheorem}). 
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    30
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    31
\item[\tt$thm@1$ RSN $(i,thm@2)$] \indexbold{*RSN} 
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    32
  resolves the conclusion of $thm@1$ with the $i$th premise of~$thm@2$.
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    33
  Unless there is precisely one resolvent it raises exception
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    34
  \xdx{THM}; in that case, use {\tt RLN}.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    35
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    36
\item[\tt$thm@1$ RS $thm@2$] \indexbold{*RS} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    37
abbreviates \hbox{\tt$thm@1$ RSN $(1,thm@2)$}.  Thus, it resolves the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    38
conclusion of $thm@1$ with the first premise of~$thm@2$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    39
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    40
\item[\tt {$[thm@1,\ldots,thm@n]$} MRS $thm$] \indexbold{*MRS} 
332
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
    41
  uses {\tt RSN} to resolve $thm@i$ against premise~$i$ of $thm$, for
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    42
  $i=n$, \ldots,~1.  This applies $thm@n$, \ldots, $thm@1$ to the first $n$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    43
  premises of $thm$.  Because the theorems are used from right to left, it
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    44
  does not matter if the $thm@i$ create new premises.  {\tt MRS} is useful
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    45
  for expressing proof trees.
9288
06a55195741b infix 'OF' is a version of 'MRS' with more appropriate argument order;
wenzelm
parents: 9258
diff changeset
    46
  
06a55195741b infix 'OF' is a version of 'MRS' with more appropriate argument order;
wenzelm
parents: 9258
diff changeset
    47
\item[\tt {$thm$ OF $[thm@1,\ldots,thm@n]$}] \indexbold{*OF} is the same as
06a55195741b infix 'OF' is a version of 'MRS' with more appropriate argument order;
wenzelm
parents: 9258
diff changeset
    48
  \texttt{$[thm@1,\ldots,thm@n]$ MRS $thm$}, with slightly more readable
06a55195741b infix 'OF' is a version of 'MRS' with more appropriate argument order;
wenzelm
parents: 9258
diff changeset
    49
  argument order, though.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    50
151
c5e636ca6576 corrected some obvious errors;
wenzelm
parents: 104
diff changeset
    51
\item[\tt$thms@1$ RLN $(i,thms@2)$] \indexbold{*RLN} 
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    52
  joins lists of theorems.  For every $thm@1$ in $thms@1$ and $thm@2$ in
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    53
  $thms@2$, it resolves the conclusion of $thm@1$ with the $i$th premise
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    54
  of~$thm@2$, accumulating the results. 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    55
151
c5e636ca6576 corrected some obvious errors;
wenzelm
parents: 104
diff changeset
    56
\item[\tt$thms@1$ RL $thms@2$] \indexbold{*RL} 
c5e636ca6576 corrected some obvious errors;
wenzelm
parents: 104
diff changeset
    57
abbreviates \hbox{\tt$thms@1$ RLN $(1,thms@2)$}. 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    58
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    59
\item[\tt {$[thms@1,\ldots,thms@n]$} MRL $thms$] \indexbold{*MRL} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    60
is analogous to {\tt MRS}, but combines theorem lists rather than theorems.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    61
It too is useful for expressing proof trees.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    62
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    63
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    64
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    65
\subsection{Expanding definitions in theorems}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    66
\index{meta-rewriting!in theorems}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    67
\begin{ttbox} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    68
rewrite_rule       : thm list -> thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    69
rewrite_goals_rule : thm list -> thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    70
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    71
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    72
\item[\ttindexbold{rewrite_rule} {\it defs} {\it thm}]  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    73
unfolds the {\it defs} throughout the theorem~{\it thm}.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    74
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    75
\item[\ttindexbold{rewrite_goals_rule} {\it defs} {\it thm}]  
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    76
unfolds the {\it defs} in the premises of~{\it thm}, but it leaves the
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    77
conclusion unchanged.  This rule is the basis for \ttindex{rewrite_goals_tac},
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    78
but it serves little purpose in forward proof.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    79
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    80
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    81
4383
25704541008b Tidying to fix overfull lines, etc
paulson
parents: 4376
diff changeset
    82
\subsection{Instantiating unknowns in a theorem} \label{sec:instantiate}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    83
\index{instantiation}
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    84
\begin{alltt}\footnotesize
4383
25704541008b Tidying to fix overfull lines, etc
paulson
parents: 4376
diff changeset
    85
read_instantiate    :                (string*string) list -> thm -> thm
25704541008b Tidying to fix overfull lines, etc
paulson
parents: 4376
diff changeset
    86
read_instantiate_sg :     Sign.sg -> (string*string) list -> thm -> thm
25704541008b Tidying to fix overfull lines, etc
paulson
parents: 4376
diff changeset
    87
cterm_instantiate   :                  (cterm*cterm) list -> thm -> thm
25704541008b Tidying to fix overfull lines, etc
paulson
parents: 4376
diff changeset
    88
instantiate'      : ctyp option list -> cterm option list -> thm -> thm
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
    89
\end{alltt}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    90
These meta-rules instantiate type and term unknowns in a theorem.  They are
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    91
occasionally useful.  They can prevent difficulties with higher-order
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    92
unification, and define specialized versions of rules.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    93
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    94
\item[\ttindexbold{read_instantiate} {\it insts} {\it thm}] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    95
processes the instantiations {\it insts} and instantiates the rule~{\it
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    96
thm}.  The processing of instantiations is described
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
    97
in \S\ref{res_inst_tac}, under {\tt res_inst_tac}.  
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    98
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
    99
Use {\tt res_inst_tac}, not {\tt read_instantiate}, to instantiate a rule
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   100
and refine a particular subgoal.  The tactic allows instantiation by the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   101
subgoal's parameters, and reads the instantiations using the signature
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   102
associated with the proof state.
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   103
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   104
Use {\tt read_instantiate_sg} below if {\it insts\/} appears to be treated
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   105
incorrectly.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   106
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   107
\item[\ttindexbold{read_instantiate_sg} {\it sg} {\it insts} {\it thm}]
4597
a0bdee64194c Fixed a lot of overfull and underfull lines (hboxes)
paulson
parents: 4383
diff changeset
   108
  is like \texttt{read_instantiate {\it insts}~{\it thm}}, but it reads
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   109
  the instantiations under signature~{\it sg}.  This is necessary to
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   110
  instantiate a rule from a general theory, such as first-order logic,
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   111
  using the notation of some specialized theory.  Use the function {\tt
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   112
    sign_of} to get a theory's signature.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   113
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   114
\item[\ttindexbold{cterm_instantiate} {\it ctpairs} {\it thm}] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   115
is similar to {\tt read_instantiate}, but the instantiations are provided
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   116
as pairs of certified terms, not as strings to be read.
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   117
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   118
\item[\ttindexbold{instantiate'} {\it ctyps} {\it cterms} {\it thm}]
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   119
  instantiates {\it thm} according to the positional arguments {\it
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   120
    ctyps} and {\it cterms}.  Counting from left to right, schematic
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   121
  variables $?x$ are either replaced by $t$ for any argument
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   122
  \texttt{Some\(\;t\)}, or left unchanged in case of \texttt{None} or
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   123
  if the end of the argument list is encountered.  Types are
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   124
  instantiated before terms.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   125
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   126
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   127
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   128
866
2d3d020eef11 added documentation of bind_thm, qed, qed_goal, get_thm, thms_of
clasohm
parents: 332
diff changeset
   129
\subsection{Miscellaneous forward rules}\label{MiscellaneousForwardRules}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   130
\index{theorems!standardizing}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   131
\begin{ttbox} 
8969
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   132
standard         :               thm -> thm
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   133
zero_var_indexes :               thm -> thm
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   134
make_elim        :               thm -> thm
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   135
rule_by_tactic   :     tactic -> thm -> thm
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   136
rotate_prems     :        int -> thm -> thm
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   137
permute_prems    : int -> int -> thm -> thm
11163
14732e3eaa6e added rearrange_prems
oheimb
parents: 9499
diff changeset
   138
rearrange_prems  :   int list -> thm -> thm
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   139
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   140
\begin{ttdescription}
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   141
\item[\ttindexbold{standard} $thm$] puts $thm$ into the standard form
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   142
  of object-rules.  It discharges all meta-assumptions, replaces free
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   143
  variables by schematic variables, renames schematic variables to
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   144
  have subscript zero, also strips outer (meta) quantifiers and
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   145
  removes dangling sort hypotheses.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   146
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   147
\item[\ttindexbold{zero_var_indexes} $thm$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   148
makes all schematic variables have subscript zero, renaming them to avoid
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   149
clashes. 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   150
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   151
\item[\ttindexbold{make_elim} $thm$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   152
\index{rules!converting destruction to elimination}
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   153
converts $thm$, which should be  a destruction rule of the form
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   154
$\List{P@1;\ldots;P@m}\Imp 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   155
Q$, to the elimination rule $\List{P@1; \ldots; P@m; Q\Imp R}\Imp R$.  This
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   156
is the basis for destruct-resolution: {\tt dresolve_tac}, etc.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   157
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   158
\item[\ttindexbold{rule_by_tactic} {\it tac} {\it thm}] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   159
  applies {\it tac\/} to the {\it thm}, freezing its variables first, then
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   160
  yields the proof state returned by the tactic.  In typical usage, the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   161
  {\it thm\/} represents an instance of a rule with several premises, some
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   162
  with contradictory assumptions (because of the instantiation).  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   163
  tactic proves those subgoals and does whatever else it can, and returns
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   164
  whatever is left.
4607
6759ba6d3cc1 Added reference to rotate_prems
paulson
parents: 4597
diff changeset
   165
  
6759ba6d3cc1 Added reference to rotate_prems
paulson
parents: 4597
diff changeset
   166
\item[\ttindexbold{rotate_prems} $k$ $thm$] rotates the premises of $thm$ to
8969
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   167
  the left by~$k$ positions (to the right if $k<0$).  It simply calls
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   168
  \texttt{permute_prems}, below, with $j=0$.  Used with
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   169
  \texttt{eresolve_tac}\index{*eresolve_tac!on other than first premise}, it
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   170
  gives the effect of applying the tactic to some other premise of $thm$ than
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   171
  the first.
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   172
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   173
\item[\ttindexbold{permute_prems} $j$ $k$ $thm$] rotates the premises of $thm$
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   174
  leaving the first $j$ premises unchanged.  It
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   175
  requires $0\leq j\leq n$, where $n$ is the number of premises.  If $k$ is
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   176
  positive then it rotates the remaining $n-j$ premises to the left; if $k$ is
23c6e0ca0086 documented permute_prems
paulson
parents: 8136
diff changeset
   177
  negative then it rotates the premises to the right.
11163
14732e3eaa6e added rearrange_prems
oheimb
parents: 9499
diff changeset
   178
14732e3eaa6e added rearrange_prems
oheimb
parents: 9499
diff changeset
   179
\item[\ttindexbold{rearrange_prems} $ps$ $thm$] permutes the premises of $thm$
14732e3eaa6e added rearrange_prems
oheimb
parents: 9499
diff changeset
   180
   where the value at the $i$-th position (counting from $0$) in the list $ps$
14732e3eaa6e added rearrange_prems
oheimb
parents: 9499
diff changeset
   181
   gives the position within the original thm to be transferred to position $i$.
14732e3eaa6e added rearrange_prems
oheimb
parents: 9499
diff changeset
   182
   Any remaining trailing positions are left unchanged.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   183
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   184
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   185
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   186
\subsection{Taking a theorem apart}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   187
\index{theorems!taking apart}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   188
\index{flex-flex constraints}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   189
\begin{ttbox} 
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   190
cprop_of      : thm -> cterm
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   191
concl_of      : thm -> term
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   192
prems_of      : thm -> term list
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   193
cprems_of     : thm -> cterm list
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   194
nprems_of     : thm -> int
4383
25704541008b Tidying to fix overfull lines, etc
paulson
parents: 4376
diff changeset
   195
tpairs_of     : thm -> (term*term) list
866
2d3d020eef11 added documentation of bind_thm, qed, qed_goal, get_thm, thms_of
clasohm
parents: 332
diff changeset
   196
theory_of_thm : thm -> theory
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   197
dest_state : thm * int -> (term*term) list * term list * term * term
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   198
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   199
\begin{ttdescription}
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   200
\item[\ttindexbold{cprop_of} $thm$] returns the statement of $thm$ as
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   201
  a certified term.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   202
  
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   203
\item[\ttindexbold{concl_of} $thm$] returns the conclusion of $thm$ as
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   204
  a term.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   205
  
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   206
\item[\ttindexbold{prems_of} $thm$] returns the premises of $thm$ as a
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   207
  list of terms.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   208
  
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   209
\item[\ttindexbold{cprems_of} $thm$] returns the premises of $thm$ as
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   210
  a list of certified terms.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   211
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   212
\item[\ttindexbold{nprems_of} $thm$] 
286
e7efbf03562b first draft of Springer book
lcp
parents: 151
diff changeset
   213
returns the number of premises in $thm$, and is equivalent to {\tt
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   214
  length~(prems_of~$thm$)}.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   215
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   216
\item[\ttindexbold{tpairs_of} $thm$] returns the flex-flex constraints
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   217
  of $thm$.
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   218
  
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   219
\item[\ttindexbold{theory_of_thm} $thm$] returns the theory associated
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   220
  with $thm$.  Note that this does a lookup in Isabelle's global
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   221
  database of loaded theories.
866
2d3d020eef11 added documentation of bind_thm, qed, qed_goal, get_thm, thms_of
clasohm
parents: 332
diff changeset
   222
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   223
\item[\ttindexbold{dest_state} $(thm,i)$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   224
decomposes $thm$ as a tuple containing a list of flex-flex constraints, a
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   225
list of the subgoals~1 to~$i-1$, subgoal~$i$, and the rest of the theorem
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   226
(this will be an implication if there are more than $i$ subgoals).
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   227
2040
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   228
\end{ttdescription}
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   229
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   230
5777
5c0aa825c18e shyps note for prim. rules;
wenzelm
parents: 5371
diff changeset
   231
\subsection{*Sort hypotheses} \label{sec:sort-hyps}
2040
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   232
\index{sort hypotheses}
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   233
\begin{ttbox} 
7644
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   234
strip_shyps         : thm -> thm
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   235
strip_shyps_warning : thm -> thm
2040
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   236
\end{ttbox}
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   237
2044
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   238
Isabelle's type variables are decorated with sorts, constraining them to
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   239
certain ranges of types.  This has little impact when sorts only serve for
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   240
syntactic classification of types --- for example, FOL distinguishes between
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   241
terms and other types.  But when type classes are introduced through axioms,
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   242
this may result in some sorts becoming {\em empty\/}: where one cannot exhibit
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   243
a type belonging to it because certain sets of axioms are unsatisfiable.
2044
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   244
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   245
If a theorem contains a type variable that is constrained by an empty
3485
f27a30a18a17 Now there are TWO spaces after each full stop, so that the Emacs sentence
paulson
parents: 3135
diff changeset
   246
sort, then that theorem has no instances.  It is basically an instance
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   247
of {\em ex falso quodlibet}.  But what if it is used to prove another
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   248
theorem that no longer involves that sort?  The latter theorem holds
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   249
only if under an additional non-emptiness assumption.
2040
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   250
3485
f27a30a18a17 Now there are TWO spaces after each full stop, so that the Emacs sentence
paulson
parents: 3135
diff changeset
   251
Therefore, Isabelle's theorems carry around sort hypotheses.  The {\tt
2044
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   252
shyps} field is a list of sorts occurring in type variables in the current
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   253
{\tt prop} and {\tt hyps} fields.  It may also includes sorts used in the
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   254
theorem's proof that no longer appear in the {\tt prop} or {\tt hyps}
3485
f27a30a18a17 Now there are TWO spaces after each full stop, so that the Emacs sentence
paulson
parents: 3135
diff changeset
   255
fields --- so-called {\em dangling\/} sort constraints.  These are the
2044
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   256
critical ones, asserting non-emptiness of the corresponding sorts.
e8d52d05530a Improved discussion of shyps thanks to Markus Wenzel
paulson
parents: 2040
diff changeset
   257
 
7644
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   258
Isabelle automatically removes extraneous sorts from the {\tt shyps} field at
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   259
the end of a proof, provided that non-emptiness can be established by looking
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   260
at the theorem's signature: from the {\tt classes} and {\tt arities}
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   261
information.  This operation is performed by \texttt{strip_shyps} and
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   262
\texttt{strip_shyps_warning}.
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   263
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   264
\begin{ttdescription}
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   265
  
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   266
\item[\ttindexbold{strip_shyps} $thm$] removes any extraneous sort hypotheses
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   267
  that can be witnessed from the type signature.
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   268
  
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   269
\item[\ttindexbold{strip_shyps_warning}] is like \texttt{strip_shyps}, but
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   270
  issues a warning message of any pending sort hypotheses that do not have a
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   271
  (syntactic) witness.
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   272
054ecaf3ca22 strip_shyps(_warning);
wenzelm
parents: 6924
diff changeset
   273
\end{ttdescription}
2040
6db93e6f1b11 Documented sort hypotheses and improved discussion of derivations
paulson
parents: 1876
diff changeset
   274
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   275
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   276
\subsection{Tracing flags for unification}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   277
\index{tracing!of unification}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   278
\begin{ttbox} 
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   279
Unify.trace_simp   : bool ref \hfill\textbf{initially false}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   280
Unify.trace_types  : bool ref \hfill\textbf{initially false}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   281
Unify.trace_bound  : int ref \hfill\textbf{initially 10}
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   282
Unify.search_bound : int ref \hfill\textbf{initially 20}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   283
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   284
Tracing the search may be useful when higher-order unification behaves
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   285
unexpectedly.  Letting {\tt res_inst_tac} circumvent the problem is easier,
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   286
though.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   287
\begin{ttdescription}
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   288
\item[set Unify.trace_simp;] 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   289
causes tracing of the simplification phase.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   290
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   291
\item[set Unify.trace_types;] 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   292
generates warnings of incompleteness, when unification is not considering
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   293
all possible instantiations of type unknowns.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   294
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   295
\item[Unify.trace_bound := $n$;] 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   296
causes unification to print tracing information once it reaches depth~$n$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   297
Use $n=0$ for full tracing.  At the default value of~10, tracing
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   298
information is almost never printed.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   299
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   300
\item[Unify.search_bound := $n$;] prevents unification from
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   301
  searching past the depth~$n$.  Because of this bound, higher-order
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   302
  unification cannot return an infinite sequence, though it can return
8136
8c65f3ca13f2 fixed many bad line & page breaks
paulson
parents: 8135
diff changeset
   303
  an exponentially long one.  The search rarely approaches the default value
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   304
  of~20.  If the search is cut off, unification prints a warning
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   305
  \texttt{Unification bound exceeded}.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   306
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   307
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   308
4317
7264fa2ff2ec several minor updates;
wenzelm
parents: 4276
diff changeset
   309
\section{*Primitive meta-level inference rules}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   310
\index{meta-rules|(}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   311
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   312
\subsection{Logical equivalence rules}
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   313
\index{meta-equality}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   314
\begin{ttbox} 
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   315
equal_intr : thm -> thm -> thm 
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   316
equal_elim : thm -> thm -> thm
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   317
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   318
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   319
\item[\ttindexbold{equal_intr} $thm@1$ $thm@2$] 
332
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   320
applies $({\equiv}I)$ to $thm@1$ and~$thm@2$.  It maps the premises~$\psi$
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   321
and~$\phi$ to the conclusion~$\phi\equiv\psi$; the assumptions are those of
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   322
the first premise with~$\phi$ removed, plus those of
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   323
the second premise with~$\psi$ removed.
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   324
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   325
\item[\ttindexbold{equal_elim} $thm@1$ $thm@2$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   326
applies $({\equiv}E)$ to $thm@1$ and~$thm@2$.  It maps the premises
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   327
$\phi\equiv\psi$ and $\phi$ to the conclusion~$\psi$.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   328
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   329
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   330
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   331
\subsection{Equality rules}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   332
\index{meta-equality}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   333
\begin{ttbox} 
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   334
reflexive  : cterm -> thm
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   335
symmetric  : thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   336
transitive : thm -> thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   337
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   338
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   339
\item[\ttindexbold{reflexive} $ct$] 
151
c5e636ca6576 corrected some obvious errors;
wenzelm
parents: 104
diff changeset
   340
makes the theorem \(ct\equiv ct\). 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   341
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   342
\item[\ttindexbold{symmetric} $thm$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   343
maps the premise $a\equiv b$ to the conclusion $b\equiv a$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   344
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   345
\item[\ttindexbold{transitive} $thm@1$ $thm@2$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   346
maps the premises $a\equiv b$ and $b\equiv c$ to the conclusion~${a\equiv c}$.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   347
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   348
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   349
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   350
\subsection{The $\lambda$-conversion rules}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   351
\index{lambda calc@$\lambda$-calculus}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   352
\begin{ttbox} 
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   353
beta_conversion : cterm -> thm
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   354
extensional     : thm -> thm
3108
335efc3f5632 misc updates, tuning, cleanup;
wenzelm
parents: 2044
diff changeset
   355
abstract_rule   : string -> cterm -> thm -> thm
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   356
combination     : thm -> thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   357
\end{ttbox} 
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   358
There is no rule for $\alpha$-conversion because Isabelle regards
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   359
$\alpha$-convertible theorems as equal.
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   360
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   361
\item[\ttindexbold{beta_conversion} $ct$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   362
makes the theorem $((\lambda x.a)(b)) \equiv a[b/x]$, where $ct$ is the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   363
term $(\lambda x.a)(b)$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   364
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   365
\item[\ttindexbold{extensional} $thm$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   366
maps the premise $f(x) \equiv g(x)$ to the conclusion $f\equiv g$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   367
Parameter~$x$ is taken from the premise.  It may be an unknown or a free
332
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   368
variable (provided it does not occur in the assumptions); it must not occur
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   369
in $f$ or~$g$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   370
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   371
\item[\ttindexbold{abstract_rule} $v$ $x$ $thm$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   372
maps the premise $a\equiv b$ to the conclusion $(\lambda x.a) \equiv
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   373
(\lambda x.b)$, abstracting over all occurrences (if any!) of~$x$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   374
Parameter~$x$ is supplied as a cterm.  It may be an unknown or a free
332
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   375
variable (provided it does not occur in the assumptions).  In the
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   376
conclusion, the bound variable is named~$v$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   377
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   378
\item[\ttindexbold{combination} $thm@1$ $thm@2$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   379
maps the premises $f\equiv g$ and $a\equiv b$ to the conclusion~$f(a)\equiv
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   380
g(b)$.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   381
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   382
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   383
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   384
\section{Derived rules for goal-directed proof}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   385
Most of these rules have the sole purpose of implementing particular
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   386
tactics.  There are few occasions for applying them directly to a theorem.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   387
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   388
\subsection{Resolution}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   389
\index{resolution}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   390
\begin{ttbox} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   391
biresolution : bool -> (bool*thm)list -> int -> thm
4276
a770eae2cdb0 changed Pure/Sequence interface;
wenzelm
parents: 3657
diff changeset
   392
               -> thm Seq.seq
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   393
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   394
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   395
\item[\ttindexbold{biresolution} $match$ $rules$ $i$ $state$] 
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   396
performs bi-resolution on subgoal~$i$ of $state$, using the list of $\it
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   397
(flag,rule)$ pairs.  For each pair, it applies resolution if the flag
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   398
is~{\tt false} and elim-resolution if the flag is~{\tt true}.  If $match$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   399
is~{\tt true}, the $state$ is not instantiated.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   400
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   401
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   402
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   403
\subsection{Composition: resolution without lifting}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   404
\index{resolution!without lifting}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   405
\begin{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   406
compose   : thm * int * thm -> thm list
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   407
COMP      : thm * thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   408
bicompose : bool -> bool * thm * int -> int -> thm
4276
a770eae2cdb0 changed Pure/Sequence interface;
wenzelm
parents: 3657
diff changeset
   409
            -> thm Seq.seq
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   410
\end{ttbox}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   411
In forward proof, a typical use of composition is to regard an assertion of
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   412
the form $\phi\Imp\psi$ as atomic.  Schematic variables are not renamed, so
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   413
beware of clashes!
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   414
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   415
\item[\ttindexbold{compose} ($thm@1$, $i$, $thm@2$)] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   416
uses $thm@1$, regarded as an atomic formula, to solve premise~$i$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   417
of~$thm@2$.  Let $thm@1$ and $thm@2$ be $\psi$ and $\List{\phi@1; \ldots;
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   418
\phi@n} \Imp \phi$.  For each $s$ that unifies~$\psi$ and $\phi@i$, the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   419
result list contains the theorem
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   420
\[ (\List{\phi@1; \ldots; \phi@{i-1}; \phi@{i+1}; \ldots; \phi@n} \Imp \phi)s.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   421
\]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   422
1119
49ed9a415637 Indexing of COMP
lcp
parents: 876
diff changeset
   423
\item[$thm@1$ \ttindexbold{COMP} $thm@2$] 
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   424
calls \hbox{\tt compose ($thm@1$, 1, $thm@2$)} and returns the result, if
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   425
unique; otherwise, it raises exception~\xdx{THM}\@.  It is
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   426
analogous to {\tt RS}\@.  
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   427
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   428
For example, suppose that $thm@1$ is $a=b\Imp b=a$, a symmetry rule, and
332
01b87a921967 final Springer copy
lcp
parents: 326
diff changeset
   429
that $thm@2$ is $\List{P\Imp Q; \neg Q} \Imp\neg P$, which is the
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   430
principle of contrapositives.  Then the result would be the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   431
derived rule $\neg(b=a)\Imp\neg(a=b)$.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   432
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   433
\item[\ttindexbold{bicompose} $match$ ($flag$, $rule$, $m$) $i$ $state$]
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   434
refines subgoal~$i$ of $state$ using $rule$, without lifting.  The $rule$
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   435
is taken to have the form $\List{\psi@1; \ldots; \psi@m} \Imp \psi$, where
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   436
$\psi$ need not be atomic; thus $m$ determines the number of new
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   437
subgoals.  If $flag$ is {\tt true} then it performs elim-resolution --- it
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   438
solves the first premise of~$rule$ by assumption and deletes that
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   439
assumption.  If $match$ is~{\tt true}, the $state$ is not instantiated.
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   440
\end{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   441
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   442
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   443
\subsection{Other meta-rules}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   444
\begin{ttbox} 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   445
rename_params_rule : string list * int -> thm -> thm
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   446
\end{ttbox}
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   447
\begin{ttdescription}
104
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   448
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   449
\item[\ttindexbold{rename_params_rule} ({\it names}, {\it i}) $thm$] 
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   450
uses the $names$ to rename the parameters of premise~$i$ of $thm$.  The
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   451
names must be distinct.  If there are fewer names than parameters, then the
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   452
rule renames the innermost parameters and may modify the remaining ones to
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   453
ensure that all the parameters are distinct.
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   454
\index{parameters!renaming}
d8205bb279a7 Initial revision
lcp
parents:
diff changeset
   455
326
bef614030e24 penultimate Springer draft
lcp
parents: 286
diff changeset
   456
\end{ttdescription}
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   457
\index{meta-rules|)}
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   458
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   459
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   460
\section{Proof terms}\label{sec:proofObjects}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   461
\index{proof terms|(} Isabelle can record the full meta-level proof of each
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   462
theorem.  The proof term contains all logical inferences in detail.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   463
%while
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   464
%omitting bookkeeping steps that have no logical meaning to an outside
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   465
%observer.  Rewriting steps are recorded in similar detail as the output of
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   466
%simplifier tracing. 
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   467
Resolution and rewriting steps are broken down to primitive rules of the
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   468
meta-logic. The proof term can be inspected by a separate proof-checker,
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   469
for example.
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   470
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   471
According to the well-known {\em Curry-Howard isomorphism}, a proof can
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   472
be viewed as a $\lambda$-term. Following this idea, proofs
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   473
in Isabelle are internally represented by a datatype similar to the one for
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   474
terms described in \S\ref{sec:terms}.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   475
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   476
infix 8 % %%;
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   477
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   478
datatype proof =
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   479
   PBound of int
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   480
 | Abst of string * typ option * proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   481
 | AbsP of string * term option * proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   482
 | op % of proof * term option
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   483
 | op %% of proof * proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   484
 | Hyp of term
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   485
 | PThm of (string * (string * string list) list) *
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   486
           proof * term * typ list option
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   487
 | PAxm of string * term * typ list option
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   488
 | Oracle of string * term * typ list option
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   489
 | MinProof of proof list;
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   490
\end{ttbox}
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   491
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   492
\begin{ttdescription}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   493
\item[\ttindexbold{Abst} ($a$, $\tau$, $prf$)] is the abstraction over
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   494
a {\it term variable} of type $\tau$ in the body $prf$. Logically, this
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   495
corresponds to $\bigwedge$ introduction. The name $a$ is used only for
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   496
parsing and printing.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   497
\item[\ttindexbold{AbsP} ($a$, $\varphi$, $prf$)] is the abstraction
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   498
over a {\it proof variable} standing for a proof of proposition $\varphi$
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   499
in the body $prf$. This corresponds to $\Longrightarrow$ introduction.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   500
\item[$prf$ \% $t$] \index{\%@{\tt\%}|bold}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   501
is the application of proof $prf$ to term $t$
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   502
which corresponds to $\bigwedge$ elimination.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   503
\item[$prf@1$ \%\% $prf@2$] \index{\%\%@{\tt\%\%}|bold}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   504
is the application of proof $prf@1$ to
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   505
proof $prf@2$ which corresponds to $\Longrightarrow$ elimination.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   506
\item[\ttindexbold{PBound} $i$] is a {\em proof variable} with de Bruijn
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   507
\cite{debruijn72} index $i$.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   508
\item[\ttindexbold{Hyp} $\varphi$] corresponds to the use of a meta level
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   509
hypothesis $\varphi$.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   510
\item[\ttindexbold{PThm} (($name$, $tags$), $prf$, $\varphi$, $\overline{\tau}$)]
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   511
stands for a pre-proved theorem, where $name$ is the name of the theorem,
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   512
$prf$ is its actual proof, $\varphi$ is the proven proposition,
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   513
and $\overline{\tau}$ is
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   514
a type assignment for the type variables occurring in the proposition.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   515
\item[\ttindexbold{PAxm} ($name$, $\varphi$, $\overline{\tau}$)]
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   516
corresponds to the use of an axiom with name $name$ and proposition
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   517
$\varphi$, where $\overline{\tau}$ is a type assignment for the type
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   518
variables occurring in the proposition.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   519
\item[\ttindexbold{Oracle} ($name$, $\varphi$, $\overline{\tau}$)]
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   520
denotes the invocation of an oracle with name $name$ which produced
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   521
a proposition $\varphi$, where $\overline{\tau}$ is a type assignment
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   522
for the type variables occurring in the proposition.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   523
\item[\ttindexbold{MinProof} $prfs$]
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   524
represents a {\em minimal proof} where $prfs$ is a list of theorems,
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   525
axioms or oracles.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   526
\end{ttdescription}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   527
Note that there are no separate constructors
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   528
for abstraction and application on the level of {\em types}, since
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   529
instantiation of type variables is accomplished via the type assignments
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   530
attached to {\tt Thm}, {\tt Axm} and {\tt Oracle}.
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   531
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   532
Each theorem's derivation is stored as the {\tt der} field of its internal
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   533
record: 
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   534
\begin{ttbox} 
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   535
#2 (#der (rep_thm conjI));
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   536
{\out PThm (("HOL.conjI", []),}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   537
{\out   AbsP ("H", None, AbsP ("H", None, \dots)), \dots, None) %}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   538
{\out     None % None : Proofterm.proof}
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   539
\end{ttbox}
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   540
This proof term identifies a labelled theorem, {\tt conjI} of theory
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   541
\texttt{HOL}, whose underlying proof is
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   542
{\tt AbsP ("H", None, AbsP ("H", None, $\dots$))}. 
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   543
The theorem is applied to two (implicit) term arguments, which correspond
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   544
to the two variables occurring in its proposition.
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   545
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   546
Isabelle's inference kernel can produce proof objects with different
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   547
levels of detail. This is controlled via the global reference variable
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   548
\ttindexbold{proofs}:
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   549
\begin{ttdescription}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   550
\item[proofs := 0;] only record uses of oracles
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   551
\item[proofs := 1;] record uses of oracles as well as dependencies
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   552
  on other theorems and axioms
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   553
\item[proofs := 2;] record inferences in full detail
1590
1547174673e1 Describes proof objects and Deriv module
paulson
parents: 1119
diff changeset
   554
\end{ttdescription}
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   555
Reconstruction and checking of proofs as described in \S\ref{sec:reconstruct_proofs}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   556
will not work for proofs constructed with {\tt proofs} set to
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   557
{\tt 0} or {\tt 1}.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   558
Theorems involving oracles will be printed with a
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   559
suffixed \verb|[!]| to point out the different quality of confidence achieved.
5371
e27558a68b8d emacs local vars;
wenzelm
parents: 4607
diff changeset
   560
7871
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   561
\medskip
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   562
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   563
The dependencies of theorems can be viewed using the function
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   564
\ttindexbold{thm_deps}\index{theorems!dependencies}:
7871
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   565
\begin{ttbox}
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   566
thm_deps [\(thm@1\), \(\ldots\), \(thm@n\)];
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   567
\end{ttbox}
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   568
generates the dependency graph of the theorems $thm@1$, $\ldots$, $thm@n$ and
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   569
displays it using Isabelle's graph browser. For this to work properly,
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   570
the theorems in question have to be proved with {\tt proofs} set to a value
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   571
greater than {\tt 0}. You can use
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   572
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   573
ThmDeps.enable : unit -> unit
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   574
ThmDeps.disable : unit -> unit
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   575
\end{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   576
to set \texttt{proofs} appropriately.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   577
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   578
\subsection{Reconstructing and checking proof terms}\label{sec:reconstruct_proofs}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   579
\index{proof terms!reconstructing}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   580
\index{proof terms!checking}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   581
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   582
When looking at the above datatype of proofs more closely, one notices that
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   583
some arguments of constructors are {\it optional}. The reason for this is that
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   584
keeping a full proof term for each theorem would result in enormous memory
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   585
requirements. Fortunately, typical proof terms usually contain quite a lot of
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   586
redundant information that can be reconstructed from the context. Therefore,
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   587
Isabelle's inference kernel creates only {\em partial} (or {\em implicit})
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   588
\index{proof terms!partial} proof terms, in which
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   589
all typing information in terms, all term and type labels of abstractions
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   590
{\tt AbsP} and {\tt Abst}, and (if possible) some argument terms of
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   591
\verb!%! are omitted. The following functions are available for
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   592
reconstructing and checking proof terms:
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   593
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   594
Reconstruct.reconstruct_proof :
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   595
  Sign.sg -> term -> Proofterm.proof -> Proofterm.proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   596
Reconstruct.expand_proof :
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   597
  Sign.sg -> string list -> Proofterm.proof -> Proofterm.proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   598
ProofChecker.thm_of_proof : theory -> Proofterm.proof -> thm
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   599
\end{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   600
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   601
\begin{ttdescription}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   602
\item[Reconstruct.reconstruct_proof $sg$ $t$ $prf$]
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   603
turns the partial proof $prf$ into a full proof of the
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   604
proposition denoted by $t$, with respect to signature $sg$.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   605
Reconstruction will fail with an error message if $prf$
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   606
is not a proof of $t$, is ill-formed, or does not contain
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   607
sufficient information for reconstruction by
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   608
{\em higher order pattern unification}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   609
\cite{nipkow-patterns, Berghofer-Nipkow:2000:TPHOL}.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   610
The latter may only happen for proofs
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   611
built up ``by hand'' but not for those produced automatically
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   612
by Isabelle's inference kernel.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   613
\item[Reconstruct.expand_proof $sg$
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   614
  \ttlbrack$name@1$, $\ldots$, $name@n${\ttrbrack} $prf$]
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   615
expands and reconstructs the proofs of all theorems with names
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   616
$name@1$, $\ldots$, $name@n$ in the (full) proof $prf$.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   617
\item[ProofChecker.thm_of_proof $thy$ $prf$] turns the (full) proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   618
$prf$ into a theorem with respect to theory $thy$ by replaying
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   619
it using only primitive rules from Isabelle's inference kernel.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   620
\end{ttdescription}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   621
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   622
\subsection{Parsing and printing proof terms}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   623
\index{proof terms!parsing}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   624
\index{proof terms!printing}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   625
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   626
Isabelle offers several functions for parsing and printing
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   627
proof terms. The concrete syntax for proof terms is described
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   628
in Fig.\ts\ref{fig:proof_gram}.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   629
Implicit term arguments in partial proofs are indicated
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   630
by ``{\tt _}''.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   631
Type arguments for theorems and axioms may be specified using
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   632
\verb!%! or ``$\cdot$'' with an argument of the form {\tt TYPE($type$)}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   633
(see \S\ref{sec:basic_syntax}).
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   634
They must appear before any other term argument of a theorem
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   635
or axiom. In contrast to term arguments, type arguments may
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   636
be completely omitted.
7871
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   637
\begin{ttbox}
11625
74cdf24724ea Tuned section about parsing and printing proof terms.
berghofe
parents: 11622
diff changeset
   638
ProofSyntax.read_proof : theory -> bool -> string -> Proofterm.proof
74cdf24724ea Tuned section about parsing and printing proof terms.
berghofe
parents: 11622
diff changeset
   639
ProofSyntax.pretty_proof : Sign.sg -> Proofterm.proof -> Pretty.T
74cdf24724ea Tuned section about parsing and printing proof terms.
berghofe
parents: 11622
diff changeset
   640
ProofSyntax.pretty_proof_of : bool -> thm -> Pretty.T
74cdf24724ea Tuned section about parsing and printing proof terms.
berghofe
parents: 11622
diff changeset
   641
ProofSyntax.print_proof_of : bool -> thm -> unit
7871
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   642
\end{ttbox}
11622
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   643
\begin{figure}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   644
\begin{center}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   645
\begin{tabular}{rcl}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   646
$proof$  & $=$ & {\tt Lam} $params${\tt .} $proof$ ~~$|$~~
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   647
                 $\Lambda params${\tt .} $proof$ \\
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   648
         & $|$ & $proof$ \verb!%! $any$ ~~$|$~~
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   649
                 $proof$ $\cdot$ $any$ \\
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   650
         & $|$ & $proof$ \verb!%%! $proof$ ~~$|$~~
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   651
                 $proof$ {\boldmath$\cdot$} $proof$ \\
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   652
         & $|$ & $id$ ~~$|$~~ $longid$ \\\\
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   653
$param$  & $=$ & $idt$ ~~$|$~~ $idt$ {\tt :} $prop$ ~~$|$~~
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   654
                 {\tt (} $param$ {\tt )} \\\\
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   655
$params$ & $=$ & $param$ ~~$|$~~ $param$ $params$
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   656
\end{tabular}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   657
\end{center}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   658
\caption{Proof term syntax}\label{fig:proof_gram}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   659
\end{figure}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   660
The function {\tt read_proof} reads in a proof term with
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   661
respect to a given theory. The boolean flag indicates whether
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   662
the proof term to be parsed contains explicit typing information
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   663
to be taken into account.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   664
Usually, typing information is left implicit and
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   665
is inferred during proof reconstruction. The pretty printing
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   666
functions operating on theorems take a boolean flag as an
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   667
argument which indicates whether the proof term should
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   668
be reconstructed before printing.
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   669
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   670
The following example (based on Isabelle/HOL) illustrates how
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   671
to parse and check proof terms. We start by parsing a partial
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   672
proof term
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   673
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   674
val prf = ProofSyntax.read_proof Main.thy false
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   675
  "impI % _ % _ %% (Lam H : _. conjE % _ % _ % _ %% H %%
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   676
     (Lam (H1 : _) H2 : _. conjI % _ % _ %% H2 %% H1))";
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   677
{\out val prf = PThm (("HOL.impI", []), \dots, \dots, None) % None % None %%}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   678
{\out   AbsP ("H", None, PThm (("HOL.conjE", []), \dots, \dots, None) %}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   679
{\out     None % None % None %% PBound 0 %%}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   680
{\out     AbsP ("H1", None, AbsP ("H2", None, \dots))) : Proofterm.proof}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   681
\end{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   682
The statement to be established by this proof is
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   683
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   684
val t = term_of
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   685
  (read_cterm (sign_of Main.thy) ("A & B --> B & A", propT));
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   686
{\out val t = Const ("Trueprop", "bool => prop") $}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   687
{\out   (Const ("op -->", "[bool, bool] => bool") $}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   688
{\out     \dots $ \dots : Term.term}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   689
\end{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   690
Using {\tt t} we can reconstruct the full proof
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   691
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   692
val prf' = Reconstruct.reconstruct_proof (sign_of Main.thy) t prf;
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   693
{\out val prf' = PThm (("HOL.impI", []), \dots, \dots, Some []) %}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   694
{\out   Some (Const ("op &", \dots) $ Free ("A", \dots) $ Free ("B", \dots)) %}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   695
{\out   Some (Const ("op &", \dots) $ Free ("B", \dots) $ Free ("A", \dots)) %%}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   696
{\out   AbsP ("H", Some (Const ("Trueprop", \dots) $ \dots), \dots)}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   697
{\out     : Proofterm.proof}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   698
\end{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   699
This proof can finally be turned into a theorem
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   700
\begin{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   701
val thm = ProofChecker.thm_of_proof Main.thy prf';
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   702
{\out val thm = "A & B --> B & A" : Thm.thm}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   703
\end{ttbox}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   704
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   705
\index{proof terms|)}
27f858e70b3f Added documentation for proof terms.
berghofe
parents: 11163
diff changeset
   706
\index{theorems|)}
7871
30fb773113a1 Documented thm_deps.
berghofe
parents: 7644
diff changeset
   707
5371
e27558a68b8d emacs local vars;
wenzelm
parents: 4607
diff changeset
   708
e27558a68b8d emacs local vars;
wenzelm
parents: 4607
diff changeset
   709
%%% Local Variables: 
e27558a68b8d emacs local vars;
wenzelm
parents: 4607
diff changeset
   710
%%% mode: latex
e27558a68b8d emacs local vars;
wenzelm
parents: 4607
diff changeset
   711
%%% TeX-master: "ref"
e27558a68b8d emacs local vars;
wenzelm
parents: 4607
diff changeset
   712
%%% End: