2 % |
2 % |
3 \begin{isamarkuptext}% |
3 \begin{isamarkuptext}% |
4 By default, assumptions are part of the simplification process: they are used |
4 By default, assumptions are part of the simplification process: they are used |
5 as simplification rules and are simplified themselves. For example:% |
5 as simplification rules and are simplified themselves. For example:% |
6 \end{isamarkuptext}% |
6 \end{isamarkuptext}% |
7 \isacommand{lemma}\ {"}{\isasymlbrakk}\ xs\ @\ zs\ =\ ys\ @\ xs;\ []\ @\ xs\ =\ []\ @\ []\ {\isasymrbrakk}\ {\isasymLongrightarrow}\ ys\ =\ zs{"}\isanewline |
7 \isacommand{lemma}\ {\isachardoublequote}{\isasymlbrakk}\ xs\ {\isacharat}\ zs\ {\isacharequal}\ ys\ {\isacharat}\ xs{\isacharsemicolon}\ {\isacharbrackleft}{\isacharbrackright}\ {\isacharat}\ xs\ {\isacharequal}\ {\isacharbrackleft}{\isacharbrackright}\ {\isacharat}\ {\isacharbrackleft}{\isacharbrackright}\ {\isasymrbrakk}\ {\isasymLongrightarrow}\ ys\ {\isacharequal}\ zs{\isachardoublequote}\isanewline |
8 \isacommand{by}\ simp% |
8 \isacommand{by}\ simp% |
9 \begin{isamarkuptext}% |
9 \begin{isamarkuptext}% |
10 \noindent |
10 \noindent |
11 The second assumption simplifies to \isa{\mbox{xs}\ =\ []}, which in turn |
11 The second assumption simplifies to \isa{\mbox{xs}\ {\isacharequal}\ {\isacharbrackleft}{\isacharbrackright}}, which in turn |
12 simplifies the first assumption to \isa{\mbox{zs}\ =\ \mbox{ys}}, thus reducing the |
12 simplifies the first assumption to \isa{\mbox{zs}\ {\isacharequal}\ \mbox{ys}}, thus reducing the |
13 conclusion to \isa{\mbox{ys}\ =\ \mbox{ys}} and hence to \isa{True}. |
13 conclusion to \isa{\mbox{ys}\ {\isacharequal}\ \mbox{ys}} and hence to \isa{True}. |
14 |
14 |
15 In some cases this may be too much of a good thing and may lead to |
15 In some cases this may be too much of a good thing and may lead to |
16 nontermination:% |
16 nontermination:% |
17 \end{isamarkuptext}% |
17 \end{isamarkuptext}% |
18 \isacommand{lemma}\ {"}{\isasymforall}x.\ f\ x\ =\ g\ (f\ (g\ x))\ {\isasymLongrightarrow}\ f\ []\ =\ f\ []\ @\ []{"}% |
18 \isacommand{lemma}\ {\isachardoublequote}{\isasymforall}x{\isachardot}\ f\ x\ {\isacharequal}\ g\ {\isacharparenleft}f\ {\isacharparenleft}g\ x{\isacharparenright}{\isacharparenright}\ {\isasymLongrightarrow}\ f\ {\isacharbrackleft}{\isacharbrackright}\ {\isacharequal}\ f\ {\isacharbrackleft}{\isacharbrackright}\ {\isacharat}\ {\isacharbrackleft}{\isacharbrackright}{\isachardoublequote}% |
19 \begin{isamarkuptxt}% |
19 \begin{isamarkuptxt}% |
20 \noindent |
20 \noindent |
21 cannot be solved by an unmodified application of \isa{simp} because the |
21 cannot be solved by an unmodified application of \isa{simp} because the |
22 simplification rule \isa{\mbox{f}\ \mbox{x}\ =\ \mbox{g}\ (\mbox{f}\ (\mbox{g}\ \mbox{x}))} extracted from the assumption |
22 simplification rule \isa{\mbox{f}\ \mbox{x}\ {\isacharequal}\ \mbox{g}\ {\isacharparenleft}\mbox{f}\ {\isacharparenleft}\mbox{g}\ \mbox{x}{\isacharparenright}{\isacharparenright}} extracted from the assumption |
23 does not terminate. Isabelle notices certain simple forms of |
23 does not terminate. Isabelle notices certain simple forms of |
24 nontermination but not this one. The problem can be circumvented by |
24 nontermination but not this one. The problem can be circumvented by |
25 explicitly telling the simplifier to ignore the assumptions:% |
25 explicitly telling the simplifier to ignore the assumptions:% |
26 \end{isamarkuptxt}% |
26 \end{isamarkuptxt}% |
27 \isacommand{by}(simp\ (no\_asm))% |
27 \isacommand{by}{\isacharparenleft}simp\ {\isacharparenleft}no{\isacharunderscore}asm{\isacharparenright}{\isacharparenright}% |
28 \begin{isamarkuptext}% |
28 \begin{isamarkuptext}% |
29 \noindent |
29 \noindent |
30 There are three options that influence the treatment of assumptions: |
30 There are three options that influence the treatment of assumptions: |
31 \begin{description} |
31 \begin{description} |
32 \item[\isa{(no_asm)}]\indexbold{*no_asm} |
32 \item[\isa{(no_asm)}]\indexbold{*no_asm} |