9717
|
1 |
%
|
|
2 |
\begin{isabellebody}%
|
8749
|
3 |
%
|
|
4 |
\begin{isamarkuptext}%
|
|
5 |
Using the simplifier effectively may take a bit of experimentation. Set the
|
|
6 |
\ttindexbold{trace_simp} \rmindex{flag} to get a better idea of what is going
|
|
7 |
on:%
|
|
8 |
\end{isamarkuptext}%
|
9673
|
9 |
\isacommand{ML}\ {\isachardoublequote}set\ trace{\isacharunderscore}simp{\isachardoublequote}\isanewline
|
|
10 |
\isacommand{lemma}\ {\isachardoublequote}rev\ {\isacharbrackleft}a{\isacharbrackright}\ {\isacharequal}\ {\isacharbrackleft}{\isacharbrackright}{\isachardoublequote}\isanewline
|
|
11 |
\isacommand{apply}{\isacharparenleft}simp{\isacharparenright}%
|
8749
|
12 |
\begin{isamarkuptxt}%
|
|
13 |
\noindent
|
|
14 |
produces the trace
|
|
15 |
|
|
16 |
\begin{ttbox}
|
|
17 |
Applying instance of rewrite rule:
|
|
18 |
rev (?x1 \# ?xs1) == rev ?xs1 @ [?x1]
|
|
19 |
Rewriting:
|
|
20 |
rev [x] == rev [] @ [x]
|
|
21 |
Applying instance of rewrite rule:
|
|
22 |
rev [] == []
|
|
23 |
Rewriting:
|
|
24 |
rev [] == []
|
|
25 |
Applying instance of rewrite rule:
|
|
26 |
[] @ ?y == ?y
|
|
27 |
Rewriting:
|
|
28 |
[] @ [x] == [x]
|
|
29 |
Applying instance of rewrite rule:
|
|
30 |
?x3 \# ?t3 = ?t3 == False
|
|
31 |
Rewriting:
|
|
32 |
[x] = [] == False
|
|
33 |
\end{ttbox}
|
|
34 |
|
8771
|
35 |
In more complicated cases, the trace can be quite lenghty, especially since
|
8749
|
36 |
invocations of the simplifier are often nested (e.g.\ when solving conditions
|
|
37 |
of rewrite rules). Thus it is advisable to reset it:%
|
|
38 |
\end{isamarkuptxt}%
|
9673
|
39 |
\isacommand{ML}\ {\isachardoublequote}reset\ trace{\isacharunderscore}simp{\isachardoublequote}\isanewline
|
9717
|
40 |
\end{isabellebody}%
|
9145
|
41 |
%%% Local Variables:
|
|
42 |
%%% mode: latex
|
|
43 |
%%% TeX-master: "root"
|
|
44 |
%%% End:
|