doc-src/IsarRef/generic.tex
author wenzelm
Sat, 05 Feb 2000 16:54:27 +0100
changeset 8195 af2575a5c5ae
parent 7990 0a604b2fc2b1
child 8203 2fcc6017cb72
permissions -rw-r--r--
'.' == by this;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7135
wenzelm
parents:
diff changeset
     1
7167
wenzelm
parents: 7141
diff changeset
     2
\chapter{Generic Tools and Packages}\label{ch:gen-tools}
wenzelm
parents: 7141
diff changeset
     3
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
     4
\section{Basic proof methods}\label{sec:pure-meth}
7167
wenzelm
parents: 7141
diff changeset
     5
8195
af2575a5c5ae '.' == by this;
wenzelm
parents: 7990
diff changeset
     6
\indexisarmeth{fail}\indexisarmeth{succeed}\indexisarmeth{$-$}
af2575a5c5ae '.' == by this;
wenzelm
parents: 7990
diff changeset
     7
\indexisarmeth{assumption}\indexisarmeth{this}
7458
bb282845ca77 updated;
wenzelm
parents: 7396
diff changeset
     8
\indexisarmeth{fold}\indexisarmeth{unfold}
7167
wenzelm
parents: 7141
diff changeset
     9
\indexisarmeth{rule}\indexisarmeth{erule}
wenzelm
parents: 7141
diff changeset
    10
\begin{matharray}{rcl}
wenzelm
parents: 7141
diff changeset
    11
  - & : & \isarmeth \\
wenzelm
parents: 7141
diff changeset
    12
  assumption & : & \isarmeth \\
8195
af2575a5c5ae '.' == by this;
wenzelm
parents: 7990
diff changeset
    13
  this & : & \isarmeth \\
7321
wenzelm
parents: 7319
diff changeset
    14
  rule & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
    15
  erule^* & : & \isarmeth \\[0.5ex]
7167
wenzelm
parents: 7141
diff changeset
    16
  fold & : & \isarmeth \\
7321
wenzelm
parents: 7319
diff changeset
    17
  unfold & : & \isarmeth \\[0.5ex]
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    18
  succeed & : & \isarmeth \\
7321
wenzelm
parents: 7319
diff changeset
    19
  fail & : & \isarmeth \\
7167
wenzelm
parents: 7141
diff changeset
    20
\end{matharray}
wenzelm
parents: 7141
diff changeset
    21
wenzelm
parents: 7141
diff changeset
    22
\begin{rail}
wenzelm
parents: 7141
diff changeset
    23
  ('fold' | 'unfold' | 'rule' | 'erule') thmrefs
wenzelm
parents: 7141
diff changeset
    24
  ;
wenzelm
parents: 7141
diff changeset
    25
\end{rail}
wenzelm
parents: 7141
diff changeset
    26
wenzelm
parents: 7141
diff changeset
    27
\begin{descr}
7321
wenzelm
parents: 7319
diff changeset
    28
\item [``$-$''] does nothing but insert the forward chaining facts as premises
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    29
  into the goal.  Note that command $\PROOFNAME$ without any method actually
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    30
  performs a single reduction step using the $rule$ method (see below); thus a
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    31
  plain \emph{do-nothing} proof step would be $\PROOF{-}$ rather than
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    32
  $\PROOFNAME$ alone.
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
    33
\item [$assumption$] solves some goal by assumption.  Any facts given are
8195
af2575a5c5ae '.' == by this;
wenzelm
parents: 7990
diff changeset
    34
  guaranteed to participate in the refinement.
af2575a5c5ae '.' == by this;
wenzelm
parents: 7990
diff changeset
    35
\item [$this$] applies the current facts directly as rules.  Note that
af2575a5c5ae '.' == by this;
wenzelm
parents: 7990
diff changeset
    36
  ``$\DOT$'' (dot) abbreviates $\BY{this}$.
7321
wenzelm
parents: 7319
diff changeset
    37
\item [$rule~thms$] applies some rule given as argument in backward manner;
wenzelm
parents: 7319
diff changeset
    38
  facts are used to reduce the rule before applying it to the goal.  Thus
wenzelm
parents: 7319
diff changeset
    39
  $rule$ without facts is plain \emph{introduction}, while with facts it
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
    40
  becomes a (generalized) \emph{elimination}.
7321
wenzelm
parents: 7319
diff changeset
    41
  
wenzelm
parents: 7319
diff changeset
    42
  Note that the classical reasoner introduces another version of $rule$ that
7987
wenzelm
parents: 7981
diff changeset
    43
  is able to pick appropriate rules automatically, whenever $thms$ are omitted
wenzelm
parents: 7981
diff changeset
    44
  (see \S\ref{sec:classical-basic}); that method is the default for
wenzelm
parents: 7981
diff changeset
    45
  $\PROOFNAME$ steps.  Note that ``$\DDOT$'' (double-dot) abbreviates
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
    46
  $\BY{default}$.
7321
wenzelm
parents: 7319
diff changeset
    47
\item [$erule~thms$] is similar to $rule$, but applies rules by
wenzelm
parents: 7319
diff changeset
    48
  elim-resolution.  This is an improper method, mainly for experimentation and
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    49
  porting of old scripts.  Actual elimination proofs are usually done with
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
    50
  $rule$ (single step, involving facts) or $elim$ (repeated steps, see
7321
wenzelm
parents: 7319
diff changeset
    51
  \S\ref{sec:classical-basic}).
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    52
\item [$unfold~thms$ and $fold~thms$] expand and fold back again the given
7987
wenzelm
parents: 7981
diff changeset
    53
  meta-level definitions throughout all goals; any facts provided are inserted
wenzelm
parents: 7981
diff changeset
    54
  into the goal and subject to rewriting as well.
wenzelm
parents: 7981
diff changeset
    55
\item [$succeed$] yields a single (unchanged) result; it is the identity of
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
    56
  the ``\texttt{,}'' method combinator (cf.\ \S\ref{sec:syn-meth}).
7987
wenzelm
parents: 7981
diff changeset
    57
\item [$fail$] yields an empty result sequence; it is the identity of the
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
    58
  ``\texttt{|}'' method combinator (cf.\ \S\ref{sec:syn-meth}).
7321
wenzelm
parents: 7319
diff changeset
    59
\end{descr}
7167
wenzelm
parents: 7141
diff changeset
    60
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
    61
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
    62
\section{Miscellaneous attributes}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
    63
7167
wenzelm
parents: 7141
diff changeset
    64
\indexisaratt{tag}\indexisaratt{untag}\indexisaratt{COMP}\indexisaratt{RS}
wenzelm
parents: 7141
diff changeset
    65
\indexisaratt{OF}\indexisaratt{where}\indexisaratt{of}\indexisaratt{standard}
wenzelm
parents: 7141
diff changeset
    66
\indexisaratt{elimify}\indexisaratt{transfer}\indexisaratt{export}
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
    67
\indexisaratt{unfold}\indexisaratt{fold}
7167
wenzelm
parents: 7141
diff changeset
    68
\begin{matharray}{rcl}
wenzelm
parents: 7141
diff changeset
    69
  tag & : & \isaratt \\
7321
wenzelm
parents: 7319
diff changeset
    70
  untag & : & \isaratt \\[0.5ex]
wenzelm
parents: 7319
diff changeset
    71
  OF & : & \isaratt \\
7167
wenzelm
parents: 7141
diff changeset
    72
  RS & : & \isaratt \\
7321
wenzelm
parents: 7319
diff changeset
    73
  COMP & : & \isaratt \\[0.5ex]
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    74
  of & : & \isaratt \\
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    75
  where & : & \isaratt \\[0.5ex]
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
    76
  unfold & : & \isaratt \\
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
    77
  fold & : & \isaratt \\[0.5ex]
7167
wenzelm
parents: 7141
diff changeset
    78
  standard & : & \isaratt \\
wenzelm
parents: 7141
diff changeset
    79
  elimify & : & \isaratt \\
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
    80
  export^* & : & \isaratt \\
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
    81
  transfer & : & \isaratt \\[0.5ex]
7167
wenzelm
parents: 7141
diff changeset
    82
\end{matharray}
wenzelm
parents: 7141
diff changeset
    83
wenzelm
parents: 7141
diff changeset
    84
\begin{rail}
wenzelm
parents: 7141
diff changeset
    85
  ('tag' | 'untag') (nameref+)
wenzelm
parents: 7141
diff changeset
    86
  ;
wenzelm
parents: 7141
diff changeset
    87
  'OF' thmrefs
wenzelm
parents: 7141
diff changeset
    88
  ;
7321
wenzelm
parents: 7319
diff changeset
    89
  ('RS' | 'COMP') nat? thmref
7167
wenzelm
parents: 7141
diff changeset
    90
  ;
7175
wenzelm
parents: 7167
diff changeset
    91
  'of' (inst * ) ('concl' ':' (inst * ))?
7167
wenzelm
parents: 7141
diff changeset
    92
  ;
7321
wenzelm
parents: 7319
diff changeset
    93
  'where' (name '=' term * 'and')
wenzelm
parents: 7319
diff changeset
    94
  ;
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
    95
  ('unfold' | 'fold') thmrefs
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
    96
  ;
7167
wenzelm
parents: 7141
diff changeset
    97
wenzelm
parents: 7141
diff changeset
    98
  inst: underscore | term
wenzelm
parents: 7141
diff changeset
    99
  ;
wenzelm
parents: 7141
diff changeset
   100
\end{rail}
wenzelm
parents: 7141
diff changeset
   101
wenzelm
parents: 7141
diff changeset
   102
\begin{descr}
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   103
\item [$tag~tags$ and $untag~tags$] add and remove $tags$ of the theorem,
7321
wenzelm
parents: 7319
diff changeset
   104
  respectively.  Tags may be any list of strings that serve as comment for
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   105
  some tools (e.g.\ $\LEMMANAME$ causes the tag ``$lemma$'' to be added to the
7321
wenzelm
parents: 7319
diff changeset
   106
  result).
wenzelm
parents: 7319
diff changeset
   107
\item [$OF~thms$, $RS~n~thm$, and $COMP~n~thm$] compose rules.  $OF$ applies
wenzelm
parents: 7319
diff changeset
   108
  $thms$ in parallel (cf.\ \texttt{MRS} in \cite[\S5]{isabelle-ref}, but note
7987
wenzelm
parents: 7981
diff changeset
   109
  the reversed order).  Note that premises may be skipped by including
wenzelm
parents: 7981
diff changeset
   110
  ``$\_$'' (underscore) as argument.
7396
d3f231fe725c OF: "_" as argument;
wenzelm
parents: 7391
diff changeset
   111
  
d3f231fe725c OF: "_" as argument;
wenzelm
parents: 7391
diff changeset
   112
  $RS$ resolves with the $n$-th premise of $thm$; $COMP$ is a version of $RS$
7987
wenzelm
parents: 7981
diff changeset
   113
  that skips the automatic lifting process that is normally intended (cf.\ 
wenzelm
parents: 7981
diff changeset
   114
  \texttt{RS} and \texttt{COMP} in \cite[\S5]{isabelle-ref}).
7321
wenzelm
parents: 7319
diff changeset
   115
  
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   116
\item [$of~\vec t$ and $where~\vec x = \vec t$] perform positional and named
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   117
  instantiation, respectively.  The terms given in $of$ are substituted for
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   118
  any schematic variables occurring in a theorem from left to right;
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   119
  ``\texttt{_}'' (underscore) indicates to skip a position.  Arguments
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   120
  following a ``$concl\colon$'' specification refer to positions of the
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   121
  conclusion of a rule.
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   122
  
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   123
\item [$unfold~thms$ and $fold~thms$] expand and fold back again the given
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   124
  meta-level definitions throughout a rule.
7321
wenzelm
parents: 7319
diff changeset
   125
 
wenzelm
parents: 7319
diff changeset
   126
\item [$standard$] puts a theorem into the standard form of object-rules, just
wenzelm
parents: 7319
diff changeset
   127
  as the ML function \texttt{standard} (see \cite[\S5]{isabelle-ref}).
wenzelm
parents: 7319
diff changeset
   128
  
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   129
\item [$elimify$] turns an destruction rule into an elimination, just as the
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   130
  ML function \texttt{make\_elim} (see \cite{isabelle-ref}).
7321
wenzelm
parents: 7319
diff changeset
   131
  
wenzelm
parents: 7319
diff changeset
   132
\item [$export$] lifts a local result out of the current proof context,
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   133
  generalizing all fixed variables and discharging all assumptions.  Note that
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   134
  (partial) export is usually done automatically behind the scenes.  This
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   135
  attribute is mainly for experimentation.
7321
wenzelm
parents: 7319
diff changeset
   136
  
wenzelm
parents: 7319
diff changeset
   137
\item [$transfer$] promotes a theorem to the current theory context, which has
wenzelm
parents: 7319
diff changeset
   138
  to enclose the former one.  Normally, this is done automatically when rules
wenzelm
parents: 7319
diff changeset
   139
  are joined by inference.
wenzelm
parents: 7319
diff changeset
   140
7167
wenzelm
parents: 7141
diff changeset
   141
\end{descr}
wenzelm
parents: 7141
diff changeset
   142
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   143
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   144
\section{Calculational proof}\label{sec:calculation}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   145
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   146
\indexisarcmd{also}\indexisarcmd{finally}\indexisaratt{trans}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   147
\begin{matharray}{rcl}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   148
  \isarcmd{also} & : & \isartrans{proof(state)}{proof(state)} \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   149
  \isarcmd{finally} & : & \isartrans{proof(state)}{proof(chain)} \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   150
  trans & : & \isaratt \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   151
\end{matharray}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   152
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   153
Calculational proof is forward reasoning with implicit application of
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   154
transitivity rules (such those of $=$, $\le$, $<$).  Isabelle/Isar maintains
7391
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   155
an auxiliary register $calculation$\indexisarthm{calculation} for accumulating
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   156
results obtained by transitivity composed with the current result.  Command
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   157
$\ALSO$ updates $calculation$ involving $this$, while $\FINALLY$ exhibits the
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   158
final $calculation$ by forward chaining towards the next goal statement.  Both
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   159
commands require valid current facts, i.e.\ may occur only after commands that
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   160
produce theorems such as $\ASSUMENAME$, $\NOTENAME$, or some finished proof of
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   161
$\HAVENAME$, $\SHOWNAME$ etc.
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   162
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   163
Also note that the automatic term abbreviation ``$\dots$'' has its canonical
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   164
application with calculational proofs.  It automatically refers to the
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   165
argument\footnote{The argument of a curried infix expression is its right-hand
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   166
  side.} of the preceding statement.
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   167
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   168
Isabelle/Isar calculations are implicitly subject to block structure in the
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   169
sense that new threads of calculational reasoning are commenced for any new
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   170
block (as opened by a local goal, for example).  This means that, apart from
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   171
being able to nest calculations, there is no separate \emph{begin-calculation}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   172
command required.
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   173
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   174
\begin{rail}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   175
  ('also' | 'finally') transrules? comment?
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   176
  ;
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   177
  'trans' (() | 'add' ':' | 'del' ':') thmrefs
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   178
  ;
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   179
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   180
  transrules: '(' thmrefs ')' interest?
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   181
  ;
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   182
\end{rail}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   183
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   184
\begin{descr}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   185
\item [$\ALSO~(thms)$] maintains the auxiliary $calculation$ register as
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   186
  follows.  The first occurrence of $\ALSO$ in some calculational thread
7905
wenzelm
parents: 7897
diff changeset
   187
  initializes $calculation$ by $this$. Any subsequent $\ALSO$ on the same
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   188
  level of block-structure updates $calculation$ by some transitivity rule
7458
bb282845ca77 updated;
wenzelm
parents: 7396
diff changeset
   189
  applied to $calculation$ and $this$ (in that order).  Transitivity rules are
bb282845ca77 updated;
wenzelm
parents: 7396
diff changeset
   190
  picked from the current context plus those given as $thms$ (the latter have
bb282845ca77 updated;
wenzelm
parents: 7396
diff changeset
   191
  precedence).
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   192
  
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   193
\item [$\FINALLY~(thms)$] maintaining $calculation$ in the same way as
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   194
  $\ALSO$, and concludes the current calculational thread.  The final result
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   195
  is exhibited as fact for forward chaining towards the next goal. Basically,
7987
wenzelm
parents: 7981
diff changeset
   196
  $\FINALLY$ just abbreviates $\ALSO~\FROM{calculation}$.  Note that
wenzelm
parents: 7981
diff changeset
   197
  ``$\FINALLY~\SHOW{}{\Var{thesis}}~\DOT$'' and
wenzelm
parents: 7981
diff changeset
   198
  ``$\FINALLY~\HAVE{}{\phi}~\DOT$'' are typical idioms for concluding
wenzelm
parents: 7981
diff changeset
   199
  calculational proofs.
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   200
  
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   201
\item [$trans$] maintains the set of transitivity rules of the theory or proof
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   202
  context, by adding or deleting theorems (the default is to add).
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   203
\end{descr}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   204
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   205
%FIXME
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   206
%See theory \texttt{HOL/Isar_examples/Group} for a simple application of
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   207
%calculations for basic equational reasoning.
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   208
%\texttt{HOL/Isar_examples/KnasterTarski} involves a few more advanced
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   209
%calculational steps in combination with natural deduction.
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   210
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   211
7135
wenzelm
parents:
diff changeset
   212
\section{Axiomatic Type Classes}\label{sec:axclass}
wenzelm
parents:
diff changeset
   213
7356
1714c91b8729 expand_classes renamed to intro_classes;
wenzelm
parents: 7335
diff changeset
   214
\indexisarcmd{axclass}\indexisarcmd{instance}\indexisarmeth{intro-classes}
7135
wenzelm
parents:
diff changeset
   215
\begin{matharray}{rcl}
wenzelm
parents:
diff changeset
   216
  \isarcmd{axclass} & : & \isartrans{theory}{theory} \\
wenzelm
parents:
diff changeset
   217
  \isarcmd{instance} & : & \isartrans{theory}{proof(prove)} \\
7356
1714c91b8729 expand_classes renamed to intro_classes;
wenzelm
parents: 7335
diff changeset
   218
  intro_classes & : & \isarmeth \\
7135
wenzelm
parents:
diff changeset
   219
\end{matharray}
wenzelm
parents:
diff changeset
   220
7987
wenzelm
parents: 7981
diff changeset
   221
Axiomatic type classes are provided by Isabelle/Pure as a \emph{definitional}
wenzelm
parents: 7981
diff changeset
   222
interface to type classes (cf.~\S\ref{sec:classes}).  Thus any object logic
wenzelm
parents: 7981
diff changeset
   223
may make use of this light-weight mechanism of abstract theories.  See
wenzelm
parents: 7981
diff changeset
   224
\cite{Wenzel:1997:TPHOL} for more information.  There is also a tutorial on
wenzelm
parents: 7981
diff changeset
   225
\emph{Using Axiomatic Type Classes in Isabelle} that is part of the standard
wenzelm
parents: 7981
diff changeset
   226
Isabelle documentation.
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   227
%FIXME cite
7135
wenzelm
parents:
diff changeset
   228
wenzelm
parents:
diff changeset
   229
\begin{rail}
wenzelm
parents:
diff changeset
   230
  'axclass' classdecl (axmdecl prop comment? +)
wenzelm
parents:
diff changeset
   231
  ;
wenzelm
parents:
diff changeset
   232
  'instance' (nameref '<' nameref | nameref '::' simplearity) comment?
wenzelm
parents:
diff changeset
   233
  ;
wenzelm
parents:
diff changeset
   234
\end{rail}
wenzelm
parents:
diff changeset
   235
7167
wenzelm
parents: 7141
diff changeset
   236
\begin{descr}
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   237
\item [$\isarkeyword{axclass}~c < \vec c~axms$] defines an axiomatic type
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   238
  class as the intersection of existing classes, with additional axioms
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   239
  holding.  Class axioms may not contain more than one type variable.  The
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   240
  class axioms (with implicit sort constraints added) are bound to the given
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   241
  names.  Furthermore a class introduction rule is generated, which is
7987
wenzelm
parents: 7981
diff changeset
   242
  employed by method $intro_classes$ to support instantiation proofs of this
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   243
  class.
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   244
  
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   245
\item [$\isarkeyword{instance}~c@1 < c@2$ and $\isarkeyword{instance}~t ::
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   246
  (\vec s)c$] setup up a goal stating the class relation or type arity.  The
7987
wenzelm
parents: 7981
diff changeset
   247
  proof would usually proceed by $intro_classes$, and then establish the
wenzelm
parents: 7981
diff changeset
   248
  characteristic theorems of the type classes involved.  After finishing the
wenzelm
parents: 7981
diff changeset
   249
  proof, the theory will be augmented by a type signature declaration
wenzelm
parents: 7981
diff changeset
   250
  corresponding to the resulting theorem.
wenzelm
parents: 7981
diff changeset
   251
\item [$intro_classes$] repeatedly expands all class introduction rules of
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   252
  this theory.
7167
wenzelm
parents: 7141
diff changeset
   253
\end{descr}
7135
wenzelm
parents:
diff changeset
   254
7987
wenzelm
parents: 7981
diff changeset
   255
%FIXME
wenzelm
parents: 7981
diff changeset
   256
%See theory \texttt{HOL/Isar_examples/Group} for a simple example of using
wenzelm
parents: 7981
diff changeset
   257
%axiomatic type classes, including instantiation proofs.
7135
wenzelm
parents:
diff changeset
   258
wenzelm
parents:
diff changeset
   259
wenzelm
parents:
diff changeset
   260
\section{The Simplifier}
wenzelm
parents:
diff changeset
   261
7321
wenzelm
parents: 7319
diff changeset
   262
\subsection{Simplification methods}\label{sec:simp}
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   263
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   264
\indexisarmeth{simp}
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   265
\begin{matharray}{rcl}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   266
  simp & : & \isarmeth \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   267
\end{matharray}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   268
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   269
\begin{rail}
7905
wenzelm
parents: 7897
diff changeset
   270
  'simp' ('!' ?) (simpmod * )
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   271
  ;
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   272
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   273
  simpmod: ('add' | 'del' | 'only' | 'other') ':' thmrefs
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   274
  ;
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   275
\end{rail}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   276
7321
wenzelm
parents: 7319
diff changeset
   277
\begin{descr}
7897
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   278
\item [$simp$] invokes Isabelle's simplifier, after modifying the context by
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   279
  adding or deleting rules as specified.  The \railtoken{only} modifier first
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   280
  removes all other rewrite rules and congruences, and then is like
7f18f5ffbb92 *** empty log message ***
wenzelm
parents: 7526
diff changeset
   281
  \railtoken{add}.  In contrast, \railtoken{other} ignores its arguments;
7905
wenzelm
parents: 7897
diff changeset
   282
  nevertheless there may be side-effects on the context via
wenzelm
parents: 7897
diff changeset
   283
  attributes.\footnote{This provides a back door for arbitrary context
wenzelm
parents: 7897
diff changeset
   284
    manipulation.}
7321
wenzelm
parents: 7319
diff changeset
   285
  
7905
wenzelm
parents: 7897
diff changeset
   286
  The $simp$ method is based on \texttt{asm_full_simp_tac}
wenzelm
parents: 7897
diff changeset
   287
  \cite[\S10]{isabelle-ref}, but is much better behaved in practice.  Just the
wenzelm
parents: 7897
diff changeset
   288
  local premises of the actual goal are involved by default.  Additional facts
wenzelm
parents: 7897
diff changeset
   289
  may be inserted via forward-chaining (using $\THEN$, $\FROMNAME$ etc.).  The
wenzelm
parents: 7897
diff changeset
   290
  full context of assumptions is only included in the $simp!$ version, which
wenzelm
parents: 7897
diff changeset
   291
  should be used with care.
7321
wenzelm
parents: 7319
diff changeset
   292
\end{descr}
wenzelm
parents: 7319
diff changeset
   293
wenzelm
parents: 7319
diff changeset
   294
\subsection{Modifying the context}
wenzelm
parents: 7319
diff changeset
   295
wenzelm
parents: 7319
diff changeset
   296
\indexisaratt{simp}
wenzelm
parents: 7319
diff changeset
   297
\begin{matharray}{rcl}
wenzelm
parents: 7319
diff changeset
   298
  simp & : & \isaratt \\
wenzelm
parents: 7319
diff changeset
   299
\end{matharray}
wenzelm
parents: 7319
diff changeset
   300
wenzelm
parents: 7319
diff changeset
   301
\begin{rail}
wenzelm
parents: 7319
diff changeset
   302
  'simp' (() | 'add' | 'del')
wenzelm
parents: 7319
diff changeset
   303
  ;
wenzelm
parents: 7319
diff changeset
   304
\end{rail}
wenzelm
parents: 7319
diff changeset
   305
wenzelm
parents: 7319
diff changeset
   306
\begin{descr}
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   307
\item [$simp$] adds or deletes rules from the theory or proof context (the
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   308
  default is to add).
7321
wenzelm
parents: 7319
diff changeset
   309
\end{descr}
7319
wenzelm
parents: 7315
diff changeset
   310
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   311
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   312
\subsection{Forward simplification}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   313
7391
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   314
\indexisaratt{simplify}\indexisaratt{asm-simplify}
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   315
\indexisaratt{full-simplify}\indexisaratt{asm-full-simplify}
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   316
\begin{matharray}{rcl}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   317
  simplify & : & \isaratt \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   318
  asm_simplify & : & \isaratt \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   319
  full_simplify & : & \isaratt \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   320
  asm_full_simplify & : & \isaratt \\
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   321
\end{matharray}
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   322
7321
wenzelm
parents: 7319
diff changeset
   323
These attributes provide forward rules for simplification, which should be
7905
wenzelm
parents: 7897
diff changeset
   324
used only very rarely.  There are no separate options for adding or deleting
wenzelm
parents: 7897
diff changeset
   325
simplification rules locally.
wenzelm
parents: 7897
diff changeset
   326
wenzelm
parents: 7897
diff changeset
   327
See the ML functions of the same name in \cite[\S10]{isabelle-ref} for more
wenzelm
parents: 7897
diff changeset
   328
information.
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   329
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   330
7135
wenzelm
parents:
diff changeset
   331
\section{The Classical Reasoner}
wenzelm
parents:
diff changeset
   332
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   333
\subsection{Basic methods}\label{sec:classical-basic}
7321
wenzelm
parents: 7319
diff changeset
   334
7974
34245feb6e82 improved;
wenzelm
parents: 7905
diff changeset
   335
\indexisarmeth{rule}\indexisarmeth{intro}
34245feb6e82 improved;
wenzelm
parents: 7905
diff changeset
   336
\indexisarmeth{elim}\indexisarmeth{default}\indexisarmeth{contradiction}
7321
wenzelm
parents: 7319
diff changeset
   337
\begin{matharray}{rcl}
wenzelm
parents: 7319
diff changeset
   338
  rule & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   339
  intro & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   340
  elim & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   341
  contradiction & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   342
\end{matharray}
wenzelm
parents: 7319
diff changeset
   343
wenzelm
parents: 7319
diff changeset
   344
\begin{rail}
wenzelm
parents: 7319
diff changeset
   345
  ('rule' | 'intro' | 'elim') thmrefs
wenzelm
parents: 7319
diff changeset
   346
  ;
wenzelm
parents: 7319
diff changeset
   347
\end{rail}
wenzelm
parents: 7319
diff changeset
   348
wenzelm
parents: 7319
diff changeset
   349
\begin{descr}
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   350
\item [$rule$] as offered by the classical reasoner is a refinement over the
7905
wenzelm
parents: 7897
diff changeset
   351
  primitive one (see \S\ref{sec:pure-meth}).  In case that no rules are
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   352
  provided as arguments, it automatically determines elimination and
7321
wenzelm
parents: 7319
diff changeset
   353
  introduction rules from the context (see also \S\ref{sec:classical-mod}).
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   354
  In that form it is the default method for basic proof steps, such as
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   355
  $\PROOFNAME$ and ``$\DDOT$'' (two dots).
7321
wenzelm
parents: 7319
diff changeset
   356
  
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   357
\item [$intro$ and $elim$] repeatedly refine some goal by intro- or
7905
wenzelm
parents: 7897
diff changeset
   358
  elim-resolution, after having inserted any facts.  Omitting the arguments
7321
wenzelm
parents: 7319
diff changeset
   359
  refers to any suitable rules from the context, otherwise only the explicitly
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   360
  given ones may be applied.  The latter form admits better control of what
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   361
  actually happens, thus it is very appropriate as an initial method for
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   362
  $\PROOFNAME$ that splits up certain connectives of the goal, before entering
7987
wenzelm
parents: 7981
diff changeset
   363
  the actual sub-proof.
7458
bb282845ca77 updated;
wenzelm
parents: 7396
diff changeset
   364
  
7466
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   365
\item [$contradiction$] solves some goal by contradiction, deriving any result
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   366
  from both $\neg A$ and $A$.  Facts, which are guaranteed to participate, may
7df66ce6508a updated;
wenzelm
parents: 7458
diff changeset
   367
  appear in either order.
7321
wenzelm
parents: 7319
diff changeset
   368
\end{descr}
wenzelm
parents: 7319
diff changeset
   369
wenzelm
parents: 7319
diff changeset
   370
7981
wenzelm
parents: 7974
diff changeset
   371
\subsection{Automated methods}\label{sec:classical-auto}
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   372
7321
wenzelm
parents: 7319
diff changeset
   373
\indexisarmeth{blast}
7391
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   374
\indexisarmeth{fast}\indexisarmeth{best}\indexisarmeth{slow}\indexisarmeth{slow-best}
7321
wenzelm
parents: 7319
diff changeset
   375
\begin{matharray}{rcl}
wenzelm
parents: 7319
diff changeset
   376
 blast & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   377
 fast & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   378
 best & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   379
 slow & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   380
 slow_best & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   381
\end{matharray}
wenzelm
parents: 7319
diff changeset
   382
wenzelm
parents: 7319
diff changeset
   383
\railalias{slowbest}{slow\_best}
wenzelm
parents: 7319
diff changeset
   384
\railterm{slowbest}
wenzelm
parents: 7319
diff changeset
   385
wenzelm
parents: 7319
diff changeset
   386
\begin{rail}
7905
wenzelm
parents: 7897
diff changeset
   387
  'blast' ('!' ?) nat? (clamod * )
7321
wenzelm
parents: 7319
diff changeset
   388
  ;
7905
wenzelm
parents: 7897
diff changeset
   389
  ('fast' | 'best' | 'slow' | slowbest) ('!' ?) (clamod * )
7321
wenzelm
parents: 7319
diff changeset
   390
  ;
wenzelm
parents: 7319
diff changeset
   391
wenzelm
parents: 7319
diff changeset
   392
  clamod: (('intro' | 'elim' | 'dest') (() | '!' | '!!') | 'del') ':' thmrefs
wenzelm
parents: 7319
diff changeset
   393
  ;
wenzelm
parents: 7319
diff changeset
   394
\end{rail}
wenzelm
parents: 7319
diff changeset
   395
wenzelm
parents: 7319
diff changeset
   396
\begin{descr}
wenzelm
parents: 7319
diff changeset
   397
\item [$blast$] refers to the classical tableau prover (see \texttt{blast_tac}
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   398
  in \cite[\S11]{isabelle-ref}).  The optional argument specifies a
7321
wenzelm
parents: 7319
diff changeset
   399
  user-supplied search bound (default 20).
wenzelm
parents: 7319
diff changeset
   400
\item [$fast$, $best$, $slow$, $slow_best$] refer to the generic classical
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   401
  reasoner (see \cite[\S11]{isabelle-ref}, tactic \texttt{fast_tac} etc).
7321
wenzelm
parents: 7319
diff changeset
   402
\end{descr}
wenzelm
parents: 7319
diff changeset
   403
wenzelm
parents: 7319
diff changeset
   404
Any of above methods support additional modifiers of the context of classical
wenzelm
parents: 7319
diff changeset
   405
rules.  There semantics is analogous to the attributes given in
7987
wenzelm
parents: 7981
diff changeset
   406
\S\ref{sec:classical-mod}.  Facts provided by forward chaining are inserted
wenzelm
parents: 7981
diff changeset
   407
into the goal before doing the search.  The ``!''~argument causes the full
wenzelm
parents: 7981
diff changeset
   408
context of assumptions to be included as well.\footnote{This is slightly less
wenzelm
parents: 7981
diff changeset
   409
  hazardous than for the Simplifier (see \S\ref{sec:simp}).}
7321
wenzelm
parents: 7319
diff changeset
   410
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   411
7981
wenzelm
parents: 7974
diff changeset
   412
\subsection{Combined automated methods}
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   413
7321
wenzelm
parents: 7319
diff changeset
   414
\indexisarmeth{auto}\indexisarmeth{force}
wenzelm
parents: 7319
diff changeset
   415
\begin{matharray}{rcl}
wenzelm
parents: 7319
diff changeset
   416
  force & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   417
  auto & : & \isarmeth \\
wenzelm
parents: 7319
diff changeset
   418
\end{matharray}
wenzelm
parents: 7319
diff changeset
   419
wenzelm
parents: 7319
diff changeset
   420
\begin{rail}
7905
wenzelm
parents: 7897
diff changeset
   421
  ('force' | 'auto') ('!' ?) (clasimpmod * )
7321
wenzelm
parents: 7319
diff changeset
   422
  ;
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   423
7987
wenzelm
parents: 7981
diff changeset
   424
  clasimpmod: ('simp' ('add' | 'del' | 'only') | 'other' |
7321
wenzelm
parents: 7319
diff changeset
   425
    (('intro' | 'elim' | 'dest') (() | '!' | '!!') | 'del')) ':' thmrefs
wenzelm
parents: 7319
diff changeset
   426
\end{rail}
7315
76a39a3784b5 checkpoint;
wenzelm
parents: 7175
diff changeset
   427
7321
wenzelm
parents: 7319
diff changeset
   428
\begin{descr}
wenzelm
parents: 7319
diff changeset
   429
\item [$force$ and $auto$] provide access to Isabelle's combined
wenzelm
parents: 7319
diff changeset
   430
  simplification and classical reasoning tactics.  See \texttt{force_tac} and
wenzelm
parents: 7319
diff changeset
   431
  \texttt{auto_tac} in \cite[\S11]{isabelle-ref} for more information.  The
wenzelm
parents: 7319
diff changeset
   432
  modifier arguments correspond to those given in \S\ref{sec:simp} and
7905
wenzelm
parents: 7897
diff changeset
   433
  \S\ref{sec:classical-auto}.  Just note that the ones related to the
wenzelm
parents: 7897
diff changeset
   434
  Simplifier are prefixed by \railtoken{simp} here.
7987
wenzelm
parents: 7981
diff changeset
   435
  
wenzelm
parents: 7981
diff changeset
   436
  Facts provided by forward chaining are inserted into the goal before doing
wenzelm
parents: 7981
diff changeset
   437
  the search.  The ``!''~argument causes the full context of assumptions to be
wenzelm
parents: 7981
diff changeset
   438
  included as well.
7321
wenzelm
parents: 7319
diff changeset
   439
\end{descr}
wenzelm
parents: 7319
diff changeset
   440
7987
wenzelm
parents: 7981
diff changeset
   441
7321
wenzelm
parents: 7319
diff changeset
   442
\subsection{Modifying the context}\label{sec:classical-mod}
7135
wenzelm
parents:
diff changeset
   443
7391
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   444
\indexisaratt{intro}\indexisaratt{elim}\indexisaratt{dest}
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   445
\indexisaratt{iff}\indexisaratt{delrule}
7321
wenzelm
parents: 7319
diff changeset
   446
\begin{matharray}{rcl}
wenzelm
parents: 7319
diff changeset
   447
  intro & : & \isaratt \\
wenzelm
parents: 7319
diff changeset
   448
  elim & : & \isaratt \\
wenzelm
parents: 7319
diff changeset
   449
  dest & : & \isaratt \\
7391
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   450
  iff & : & \isaratt \\
7321
wenzelm
parents: 7319
diff changeset
   451
  delrule & : & \isaratt \\
wenzelm
parents: 7319
diff changeset
   452
\end{matharray}
7135
wenzelm
parents:
diff changeset
   453
7321
wenzelm
parents: 7319
diff changeset
   454
\begin{rail}
wenzelm
parents: 7319
diff changeset
   455
  ('intro' | 'elim' | 'dest') (() | '!' | '!!')
wenzelm
parents: 7319
diff changeset
   456
  ;
wenzelm
parents: 7319
diff changeset
   457
\end{rail}
7135
wenzelm
parents:
diff changeset
   458
7321
wenzelm
parents: 7319
diff changeset
   459
\begin{descr}
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   460
\item [$intro$, $elim$, $dest$] add introduction, elimination, destruct rules,
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   461
  respectively.  By default, rules are considered as \emph{safe}, while a
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   462
  single ``!'' classifies as \emph{unsafe}, and ``!!'' as \emph{extra} (i.e.\ 
7990
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   463
  not applied in the search-oriented automated methods, but only in
0a604b2fc2b1 updated;
wenzelm
parents: 7987
diff changeset
   464
  single-step methods such as $rule$).
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   465
  
7391
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   466
\item [$iff$] declares equations both as rewrite rules for the simplifier and
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   467
  classical reasoning rules.
b7ca64c8fa64 'iff' attribute;
wenzelm
parents: 7356
diff changeset
   468
7335
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   469
\item [$delrule$] deletes introduction or elimination rules from the context.
abba35b98892 draft release;
wenzelm
parents: 7321
diff changeset
   470
  Note that destruction rules would have to be turned into elimination rules
7321
wenzelm
parents: 7319
diff changeset
   471
  first, e.g.\ by using the $elimify$ attribute.
wenzelm
parents: 7319
diff changeset
   472
\end{descr}
7135
wenzelm
parents:
diff changeset
   473
wenzelm
parents:
diff changeset
   474
%%% Local Variables: 
wenzelm
parents:
diff changeset
   475
%%% mode: latex
wenzelm
parents:
diff changeset
   476
%%% TeX-master: "isar-ref"
wenzelm
parents:
diff changeset
   477
%%% End: