27052
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
|
3 |
\def\isabellecontext{Misc}%
|
|
4 |
%
|
|
5 |
\isadelimtheory
|
|
6 |
\isanewline
|
|
7 |
\isanewline
|
|
8 |
%
|
|
9 |
\endisadelimtheory
|
|
10 |
%
|
|
11 |
\isatagtheory
|
|
12 |
\isacommand{theory}\isamarkupfalse%
|
|
13 |
\ Misc\isanewline
|
|
14 |
\isakeyword{imports}\ Main\isanewline
|
|
15 |
\isakeyword{begin}%
|
|
16 |
\endisatagtheory
|
|
17 |
{\isafoldtheory}%
|
|
18 |
%
|
|
19 |
\isadelimtheory
|
|
20 |
%
|
|
21 |
\endisadelimtheory
|
|
22 |
%
|
28788
|
23 |
\isamarkupchapter{Other commands%
|
27052
|
24 |
}
|
|
25 |
\isamarkuptrue%
|
|
26 |
%
|
|
27 |
\isamarkupsection{Inspecting the context%
|
|
28 |
}
|
|
29 |
\isamarkuptrue%
|
|
30 |
%
|
|
31 |
\begin{isamarkuptext}%
|
|
32 |
\begin{matharray}{rcl}
|
28788
|
33 |
\indexdef{}{command}{print\_commands}\hypertarget{command.print-commands}{\hyperlink{command.print-commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
34 |
\indexdef{}{command}{print\_theory}\hypertarget{command.print-theory}{\hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
35 |
\indexdef{}{command}{print\_methods}\hypertarget{command.print-methods}{\hyperlink{command.print-methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
36 |
\indexdef{}{command}{print\_attributes}\hypertarget{command.print-attributes}{\hyperlink{command.print-attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
37 |
\indexdef{}{command}{print\_theorems}\hypertarget{command.print-theorems}{\hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
38 |
\indexdef{}{command}{find\_theorems}\hypertarget{command.find-theorems}{\hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
39 |
\indexdef{}{command}{thm\_deps}\hypertarget{command.thm-deps}{\hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
40 |
\indexdef{}{command}{print\_facts}\hypertarget{command.print-facts}{\hyperlink{command.print-facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
41 |
\indexdef{}{command}{print\_binds}\hypertarget{command.print-binds}{\hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}context\ {\isasymrightarrow}{\isachardoublequote}} \\
|
27052
|
42 |
\end{matharray}
|
|
43 |
|
|
44 |
\begin{rail}
|
|
45 |
'print\_theory' ( '!'?)
|
|
46 |
;
|
|
47 |
|
|
48 |
'find\_theorems' (('(' (nat)? ('with\_dups')? ')')?) (criterion *)
|
|
49 |
;
|
|
50 |
criterion: ('-'?) ('name' ':' nameref | 'intro' | 'elim' | 'dest' |
|
|
51 |
'simp' ':' term | term)
|
|
52 |
;
|
|
53 |
'thm\_deps' thmrefs
|
|
54 |
;
|
|
55 |
\end{rail}
|
|
56 |
|
|
57 |
These commands print certain parts of the theory and proof context.
|
|
58 |
Note that there are some further ones available, such as for the set
|
|
59 |
of rules declared for simplifications.
|
|
60 |
|
28788
|
61 |
\begin{description}
|
27052
|
62 |
|
28788
|
63 |
\item \hyperlink{command.print-commands}{\mbox{\isa{\isacommand{print{\isacharunderscore}commands}}}} prints Isabelle's outer theory
|
27052
|
64 |
syntax, including keywords and command.
|
|
65 |
|
28788
|
66 |
\item \hyperlink{command.print-theory}{\mbox{\isa{\isacommand{print{\isacharunderscore}theory}}}} prints the main logical content of
|
27052
|
67 |
the theory context; the ``\isa{{\isachardoublequote}{\isacharbang}{\isachardoublequote}}'' option indicates extra
|
|
68 |
verbosity.
|
|
69 |
|
28788
|
70 |
\item \hyperlink{command.print-methods}{\mbox{\isa{\isacommand{print{\isacharunderscore}methods}}}} prints all proof methods
|
27052
|
71 |
available in the current theory context.
|
|
72 |
|
28788
|
73 |
\item \hyperlink{command.print-attributes}{\mbox{\isa{\isacommand{print{\isacharunderscore}attributes}}}} prints all attributes
|
27052
|
74 |
available in the current theory context.
|
|
75 |
|
28788
|
76 |
\item \hyperlink{command.print-theorems}{\mbox{\isa{\isacommand{print{\isacharunderscore}theorems}}}} prints theorems resulting from
|
27052
|
77 |
the last command.
|
|
78 |
|
28788
|
79 |
\item \hyperlink{command.find-theorems}{\mbox{\isa{\isacommand{find{\isacharunderscore}theorems}}}}~\isa{criteria} retrieves facts
|
27052
|
80 |
from the theory or proof context matching all of given search
|
|
81 |
criteria. The criterion \isa{{\isachardoublequote}name{\isacharcolon}\ p{\isachardoublequote}} selects all theorems
|
|
82 |
whose fully qualified name matches pattern \isa{p}, which may
|
|
83 |
contain ``\isa{{\isachardoublequote}{\isacharasterisk}{\isachardoublequote}}'' wildcards. The criteria \isa{intro},
|
|
84 |
\isa{elim}, and \isa{dest} select theorems that match the
|
|
85 |
current goal as introduction, elimination or destruction rules,
|
|
86 |
respectively. The criterion \isa{{\isachardoublequote}simp{\isacharcolon}\ t{\isachardoublequote}} selects all rewrite
|
|
87 |
rules whose left-hand side matches the given term. The criterion
|
|
88 |
term \isa{t} selects all theorems that contain the pattern \isa{t} -- as usual, patterns may contain occurrences of the dummy
|
|
89 |
``\isa{{\isacharunderscore}}'', schematic variables, and type constraints.
|
|
90 |
|
|
91 |
Criteria can be preceded by ``\isa{{\isachardoublequote}{\isacharminus}{\isachardoublequote}}'' to select theorems that
|
|
92 |
do \emph{not} match. Note that giving the empty list of criteria
|
|
93 |
yields \emph{all} currently known facts. An optional limit for the
|
|
94 |
number of printed facts may be given; the default is 40. By
|
|
95 |
default, duplicates are removed from the search result. Use
|
|
96 |
\isa{with{\isacharunderscore}dups} to display duplicates.
|
|
97 |
|
28788
|
98 |
\item \hyperlink{command.thm-deps}{\mbox{\isa{\isacommand{thm{\isacharunderscore}deps}}}}~\isa{{\isachardoublequote}a\isactrlsub {\isadigit{1}}\ {\isasymdots}\ a\isactrlsub n{\isachardoublequote}}
|
27052
|
99 |
visualizes dependencies of facts, using Isabelle's graph browser
|
|
100 |
tool (see also \cite{isabelle-sys}).
|
|
101 |
|
28788
|
102 |
\item \hyperlink{command.print-facts}{\mbox{\isa{\isacommand{print{\isacharunderscore}facts}}}} prints all local facts of the
|
27052
|
103 |
current context, both named and unnamed ones.
|
|
104 |
|
28788
|
105 |
\item \hyperlink{command.print-binds}{\mbox{\isa{\isacommand{print{\isacharunderscore}binds}}}} prints all term abbreviations
|
27052
|
106 |
present in the context.
|
|
107 |
|
28788
|
108 |
\end{description}%
|
27052
|
109 |
\end{isamarkuptext}%
|
|
110 |
\isamarkuptrue%
|
|
111 |
%
|
|
112 |
\isamarkupsection{History commands \label{sec:history}%
|
|
113 |
}
|
|
114 |
\isamarkuptrue%
|
|
115 |
%
|
|
116 |
\begin{isamarkuptext}%
|
|
117 |
\begin{matharray}{rcl}
|
28788
|
118 |
\indexdef{}{command}{undo}\hypertarget{command.undo}{\hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}}^{{ * }{ * }} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}\ any{\isachardoublequote}} \\
|
|
119 |
\indexdef{}{command}{linear\_undo}\hypertarget{command.linear-undo}{\hyperlink{command.linear-undo}{\mbox{\isa{\isacommand{linear{\isacharunderscore}undo}}}}}^{{ * }{ * }} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}\ any{\isachardoublequote}} \\
|
|
120 |
\indexdef{}{command}{kill}\hypertarget{command.kill}{\hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}}}^{{ * }{ * }} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}\ any{\isachardoublequote}} \\
|
27052
|
121 |
\end{matharray}
|
|
122 |
|
|
123 |
The Isabelle/Isar top-level maintains a two-stage history, for
|
|
124 |
theory and proof state transformation. Basically, any command can
|
|
125 |
be undone using \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}, excluding mere diagnostic
|
27598
|
126 |
elements. Note that a theorem statement with a \emph{finished}
|
|
127 |
proof is treated as a single unit by \hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}. In
|
|
128 |
contrast, the variant \hyperlink{command.linear-undo}{\mbox{\isa{\isacommand{linear{\isacharunderscore}undo}}}} admits to step back
|
|
129 |
into the middle of a proof. The \hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}} command aborts
|
|
130 |
the current history node altogether, discontinuing a proof or even
|
|
131 |
the whole theory. This operation is \emph{not} undo-able.
|
27052
|
132 |
|
|
133 |
\begin{warn}
|
|
134 |
History commands should never be used with user interfaces such as
|
|
135 |
Proof~General \cite{proofgeneral,Aspinall:TACAS:2000}, which takes
|
|
136 |
care of stepping forth and back itself. Interfering by manual
|
27598
|
137 |
\hyperlink{command.undo}{\mbox{\isa{\isacommand{undo}}}}, \hyperlink{command.linear-undo}{\mbox{\isa{\isacommand{linear{\isacharunderscore}undo}}}}, or even \hyperlink{command.kill}{\mbox{\isa{\isacommand{kill}}}} commands would quickly result in utter confusion.
|
27052
|
138 |
\end{warn}%
|
|
139 |
\end{isamarkuptext}%
|
|
140 |
\isamarkuptrue%
|
|
141 |
%
|
27054
|
142 |
\isamarkupsection{System commands%
|
27052
|
143 |
}
|
|
144 |
\isamarkuptrue%
|
|
145 |
%
|
|
146 |
\begin{isamarkuptext}%
|
|
147 |
\begin{matharray}{rcl}
|
28788
|
148 |
\indexdef{}{command}{cd}\hypertarget{command.cd}{\hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
149 |
\indexdef{}{command}{pwd}\hypertarget{command.pwd}{\hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
|
|
150 |
\indexdef{}{command}{use\_thy}\hypertarget{command.use-thy}{\hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}}\isa{{\isachardoublequote}\isactrlsup {\isacharasterisk}{\isachardoublequote}} & : & \isa{{\isachardoublequote}any\ {\isasymrightarrow}{\isachardoublequote}} \\
|
27052
|
151 |
\end{matharray}
|
|
152 |
|
|
153 |
\begin{rail}
|
|
154 |
('cd' | 'use\_thy' | 'update\_thy') name
|
|
155 |
;
|
|
156 |
\end{rail}
|
|
157 |
|
28788
|
158 |
\begin{description}
|
27052
|
159 |
|
28788
|
160 |
\item \hyperlink{command.cd}{\mbox{\isa{\isacommand{cd}}}}~\isa{path} changes the current directory
|
27052
|
161 |
of the Isabelle process.
|
|
162 |
|
28788
|
163 |
\item \hyperlink{command.pwd}{\mbox{\isa{\isacommand{pwd}}}} prints the current working directory.
|
27052
|
164 |
|
28788
|
165 |
\item \hyperlink{command.use-thy}{\mbox{\isa{\isacommand{use{\isacharunderscore}thy}}}}~\isa{A} preload theory \isa{A}.
|
27052
|
166 |
These system commands are scarcely used when working interactively,
|
|
167 |
since loading of theories is done automatically as required.
|
|
168 |
|
28788
|
169 |
\end{description}%
|
27052
|
170 |
\end{isamarkuptext}%
|
|
171 |
\isamarkuptrue%
|
|
172 |
%
|
|
173 |
\isadelimtheory
|
|
174 |
%
|
|
175 |
\endisadelimtheory
|
|
176 |
%
|
|
177 |
\isatagtheory
|
|
178 |
\isacommand{end}\isamarkupfalse%
|
|
179 |
%
|
|
180 |
\endisatagtheory
|
|
181 |
{\isafoldtheory}%
|
|
182 |
%
|
|
183 |
\isadelimtheory
|
|
184 |
%
|
|
185 |
\endisadelimtheory
|
|
186 |
\isanewline
|
|
187 |
\end{isabellebody}%
|
|
188 |
%%% Local Variables:
|
|
189 |
%%% mode: latex
|
|
190 |
%%% TeX-master: "root"
|
|
191 |
%%% End:
|