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