doc-src/IsarRef/pure.tex
changeset 10858 479dad7b3b41
parent 10686 60c795d6bd9e
child 10899 5de31ddf9c03
equal deleted inserted replaced
10857:47b1f34ddd09 10858:479dad7b3b41
   416   $\isarkeyword{files}$ dependency declaration given in the theory header (see
   416   $\isarkeyword{files}$ dependency declaration given in the theory header (see
   417   also \S\ref{sec:begin-thy}).
   417   also \S\ref{sec:begin-thy}).
   418   
   418   
   419 \item [$\isarkeyword{ML}~text$ and $\isarkeyword{ML_command}~text$] execute ML
   419 \item [$\isarkeyword{ML}~text$ and $\isarkeyword{ML_command}~text$] execute ML
   420   commands from $text$.  The theory context is passed in the same way as for
   420   commands from $text$.  The theory context is passed in the same way as for
   421   $\isarkeyword{use}$, but may not be changed.  Note that
   421   $\isarkeyword{use}$, but may not be changed.  Note that the output of
   422   $\isarkeyword{ML_command}$ is less verbose than plain $\isarkeyword{ML}$.
   422   $\isarkeyword{ML_command}$ is less verbose than plain $\isarkeyword{ML}$.
   423   
   423   
   424 \item [$\isarkeyword{ML_setup}~text$] executes ML commands from $text$.  The
   424 \item [$\isarkeyword{ML_setup}~text$] executes ML commands from $text$.  The
   425   theory context is passed down to the ML session, and fetched back
   425   theory context is passed down to the ML session, and fetched back
   426   afterwards.  Thus $text$ may actually change the theory as a side effect.
   426   afterwards.  Thus $text$ may actually change the theory as a side effect.
   541 of operation:
   541 of operation:
   542 \begin{descr}
   542 \begin{descr}
   543 \item [$proof(prove)$] means that a new goal has just been stated that is now
   543 \item [$proof(prove)$] means that a new goal has just been stated that is now
   544   to be \emph{proven}; the next command may refine it by some proof method,
   544   to be \emph{proven}; the next command may refine it by some proof method,
   545   and enter a sub-proof to establish the actual result.
   545   and enter a sub-proof to establish the actual result.
   546 \item [$proof(state)$] is like an internal theory mode: the context may be
   546 \item [$proof(state)$] is like a nested theory mode: the context may be
   547   augmented by \emph{stating} additional assumptions, intermediate results
   547   augmented by \emph{stating} additional assumptions, intermediate results
   548   etc.
   548   etc.
   549 \item [$proof(chain)$] is intermediate between $proof(state)$ and
   549 \item [$proof(chain)$] is intermediate between $proof(state)$ and
   550   $proof(prove)$: existing facts (i.e.\ the contents of the special ``$this$''
   550   $proof(prove)$: existing facts (i.e.\ the contents of the special ``$this$''
   551   register) have been just picked up in order to be used when refining the
   551   register) have been just picked up in order to be used when refining the
   691   introduction.  Automatic methods usually insert the facts into the goal
   691   introduction.  Automatic methods usually insert the facts into the goal
   692   state before operation.  This provides a simple scheme to control relevance
   692   state before operation.  This provides a simple scheme to control relevance
   693   of facts in automated proof search.
   693   of facts in automated proof search.
   694 \item [$\FROM{\vec b}$] abbreviates $\NOTE{}{\vec b}~\THEN$; thus $\THEN$ is
   694 \item [$\FROM{\vec b}$] abbreviates $\NOTE{}{\vec b}~\THEN$; thus $\THEN$ is
   695   equivalent to $\FROM{this}$.
   695   equivalent to $\FROM{this}$.
   696 \item [$\WITH{\vec b}$] abbreviates $\FROM{\vec b~facts}$; thus the forward
   696 \item [$\WITH{\vec b}$] abbreviates $\FROM{\vec b~this}$; thus the forward
   697   chaining is from earlier facts together with the current ones.
   697   chaining is from earlier facts together with the current ones.
   698 \end{descr}
   698 \end{descr}
   699 
   699 
   700 Basic proof methods (such as $rule$, see \S\ref{sec:pure-meth-att}) expect
   700 Basic proof methods (such as $rule$, see \S\ref{sec:pure-meth-att}) expect
   701 multiple facts to be given in their proper order, corresponding to a prefix of
   701 multiple facts to be given in their proper order, corresponding to a prefix of
  1185 
  1185 
  1186 \section{Other commands}
  1186 \section{Other commands}
  1187 
  1187 
  1188 \subsection{Diagnostics}
  1188 \subsection{Diagnostics}
  1189 
  1189 
  1190 \indexisarcmd{pr}\indexisarcmd{thm}\indexisarcmd{term}\indexisarcmd{prop}\indexisarcmd{typ}
  1190 \indexisarcmd{pr}\indexisarcmd{thm}\indexisarcmd{term}
       
  1191 \indexisarcmd{prop}\indexisarcmd{typ}
  1191 \begin{matharray}{rcl}
  1192 \begin{matharray}{rcl}
  1192   \isarcmd{pr}^* & : & \isarkeep{\cdot} \\
  1193   \isarcmd{pr}^* & : & \isarkeep{\cdot} \\
  1193   \isarcmd{thm}^* & : & \isarkeep{theory~|~proof} \\
  1194   \isarcmd{thm}^* & : & \isarkeep{theory~|~proof} \\
  1194   \isarcmd{term}^* & : & \isarkeep{theory~|~proof} \\
  1195   \isarcmd{term}^* & : & \isarkeep{theory~|~proof} \\
  1195   \isarcmd{prop}^* & : & \isarkeep{theory~|~proof} \\
  1196   \isarcmd{prop}^* & : & \isarkeep{theory~|~proof} \\
  1250 \subsection{Inspecting the context}
  1251 \subsection{Inspecting the context}
  1251 
  1252 
  1252 \indexisarcmd{print-facts}\indexisarcmd{print-binds}
  1253 \indexisarcmd{print-facts}\indexisarcmd{print-binds}
  1253 \indexisarcmd{print-commands}\indexisarcmd{print-syntax}
  1254 \indexisarcmd{print-commands}\indexisarcmd{print-syntax}
  1254 \indexisarcmd{print-methods}\indexisarcmd{print-attributes}
  1255 \indexisarcmd{print-methods}\indexisarcmd{print-attributes}
       
  1256 \indexisarcmd{thms-containing}\indexisarcmd{thm-deps}
       
  1257 \indexisarcmd{print-theorems}
  1255 \begin{matharray}{rcl}
  1258 \begin{matharray}{rcl}
  1256   \isarcmd{print_commands}^* & : & \isarkeep{\cdot} \\
  1259   \isarcmd{print_commands}^* & : & \isarkeep{\cdot} \\
  1257   \isarcmd{print_syntax}^* & : & \isarkeep{theory~|~proof} \\
  1260   \isarcmd{print_syntax}^* & : & \isarkeep{theory~|~proof} \\
  1258   \isarcmd{print_methods}^* & : & \isarkeep{theory~|~proof} \\
  1261   \isarcmd{print_methods}^* & : & \isarkeep{theory~|~proof} \\
  1259   \isarcmd{print_attributes}^* & : & \isarkeep{theory~|~proof} \\
  1262   \isarcmd{print_attributes}^* & : & \isarkeep{theory~|~proof} \\
       
  1263   \isarcmd{print_theorems}^* & : & \isarkeep{theory~|~proof} \\
       
  1264   \isarcmd{thms_containing}^* & : & \isarkeep{theory~|~proof} \\
       
  1265   \isarcmd{thms_deps}^* & : & \isarkeep{theory~|~proof} \\
  1260   \isarcmd{print_facts}^* & : & \isarkeep{proof} \\
  1266   \isarcmd{print_facts}^* & : & \isarkeep{proof} \\
  1261   \isarcmd{print_binds}^* & : & \isarkeep{proof} \\
  1267   \isarcmd{print_binds}^* & : & \isarkeep{proof} \\
  1262 \end{matharray}
  1268 \end{matharray}
  1263 
  1269 
  1264 These commands print parts of the theory and proof context.  Note that there
  1270 \railalias{thmscontaining}{thms\_containing}
  1265 are some further ones available, such as for the set of rules declared for
  1271 \railterm{thmscontaining}
  1266 simplifications.
  1272 
       
  1273 \railalias{thmdeps}{thm\_deps}
       
  1274 \railterm{thmdeps}
       
  1275 
       
  1276 \begin{rail}
       
  1277   thmscontaining (name * )
       
  1278   ;
       
  1279   thmdeps thmrefs
       
  1280   ;
       
  1281 \end{rail}
       
  1282 
       
  1283 These commands print certain parts of the theory and proof context.  Note that
       
  1284 there are some further ones available, such as for the set of rules declared
       
  1285 for simplifications.
  1267 
  1286 
  1268 \begin{descr}
  1287 \begin{descr}
  1269 \item [$\isarkeyword{print_commands}$] prints Isabelle's outer theory syntax,
  1288 \item [$\isarkeyword{print_commands}$] prints Isabelle's outer theory syntax,
  1270   including keywords and command.
  1289   including keywords and command.
  1271 \item [$\isarkeyword{print_syntax}$] prints the inner syntax of types and
  1290 \item [$\isarkeyword{print_syntax}$] prints the inner syntax of types and
  1272   terms, depending on the current context.  The output can be very verbose,
  1291   terms, depending on the current context.  The output can be very verbose,
  1273   including grammar tables and syntax translation rules.  See \cite[\S7,
  1292   including grammar tables and syntax translation rules.  See \cite[\S7,
  1274   \S8]{isabelle-ref} for further information on Isabelle's inner syntax.
  1293   \S8]{isabelle-ref} for further information on Isabelle's inner syntax.
  1275 \item [$\isarkeyword{print_methods}$] all proof methods available in the
  1294 \item [$\isarkeyword{print_methods}$] prints all proof methods available in
  1276   current theory context.
  1295   the current theory context.
  1277 \item [$\isarkeyword{print_attributes}$] all attributes available in the
  1296 \item [$\isarkeyword{print_attributes}$] prints all attributes available in
  1278   current theory context.
  1297   the current theory context.
       
  1298 \item [$\isarkeyword{print_theorems}$] prints theorems available in the
       
  1299   current theory context.  In interactive mode this actually refers to the
       
  1300   theorems left by the last transaction; this allows to inspect the result of
       
  1301   advanced definitional packages, such as $\isarkeyword{datatype}$.
       
  1302 \item [$\isarkeyword{thms_containing}~\vec c$] retrieves theorems from the
       
  1303   theory context containing all of the constants $\vec c$.  Note that giving
       
  1304   the empty list yields \emph{all} theorems of the current theory.
       
  1305 \item [$\isarkeyword{thm_deps}~\vec a$] visualizes dependencies of theorems
       
  1306   and lemmas, using Isabelle's graph browser tool (see also
       
  1307   \cite{isabelle-sys}).
  1279 \item [$\isarkeyword{print_facts}$] prints any named facts of the current
  1308 \item [$\isarkeyword{print_facts}$] prints any named facts of the current
  1280   context, including assumptions and local results.
  1309   context, including assumptions and local results.
  1281 \item [$\isarkeyword{print_binds}$] prints all term abbreviations present in
  1310 \item [$\isarkeyword{print_binds}$] prints all term abbreviations present in
  1282   the context.
  1311   the context.
  1283 \end{descr}
  1312 \end{descr}
  1293 \end{matharray}
  1322 \end{matharray}
  1294 
  1323 
  1295 The Isabelle/Isar top-level maintains a two-stage history, for theory and
  1324 The Isabelle/Isar top-level maintains a two-stage history, for theory and
  1296 proof state transformation.  Basically, any command can be undone using
  1325 proof state transformation.  Basically, any command can be undone using
  1297 $\isarkeyword{undo}$, excluding mere diagnostic elements.  Its effect may be
  1326 $\isarkeyword{undo}$, excluding mere diagnostic elements.  Its effect may be
  1298 revoked via $\isarkeyword{redo}$, unless the corresponding the
  1327 revoked via $\isarkeyword{redo}$, unless the corresponding
  1299 $\isarkeyword{undo}$ step has crossed the beginning of a proof or theory.  The
  1328 $\isarkeyword{undo}$ step has crossed the beginning of a proof or theory.  The
  1300 $\isarkeyword{kill}$ command aborts the current history node altogether,
  1329 $\isarkeyword{kill}$ command aborts the current history node altogether,
  1301 discontinuing a proof or even the whole theory.  This operation is \emph{not}
  1330 discontinuing a proof or even the whole theory.  This operation is \emph{not}
  1302 undoable.
  1331 undoable.
  1303 
  1332