equal
deleted
inserted
replaced
79 text{*\noindent |
79 text{*\noindent |
80 or globally: |
80 or globally: |
81 *} |
81 *} |
82 lemmas [split del] = list.split; |
82 lemmas [split del] = list.split; |
83 |
83 |
|
84 text{* |
|
85 The above split rules intentionally only affect the conclusion of a |
|
86 subgoal. If you want to split an \isa{if} or \isa{case}-expression in |
|
87 the assumptions, you have to apply \isa{split\_if\_asm} or $t$\isa{.split_asm}: |
|
88 *} |
|
89 |
|
90 lemma "if xs = [] then ys ~= [] else ys = [] ==> xs @ ys ~= []" |
|
91 apply(simp only: split: split_if_asm); |
|
92 |
|
93 txt{*\noindent |
|
94 In contrast to splitting the conclusion, this actually creates two |
|
95 separate subgoals (which are solved by \isa{simp\_all}): |
|
96 \begin{isabelle} |
|
97 \ \isadigit{1}{\isachardot}\ {\isasymlbrakk}\mbox{xs}\ {\isacharequal}\ {\isacharbrackleft}{\isacharbrackright}{\isacharsemicolon}\ \mbox{ys}\ {\isasymnoteq}\ {\isacharbrackleft}{\isacharbrackright}{\isasymrbrakk}\ {\isasymLongrightarrow}\ {\isacharbrackleft}{\isacharbrackright}\ {\isacharat}\ \mbox{ys}\ {\isasymnoteq}\ {\isacharbrackleft}{\isacharbrackright}\isanewline |
|
98 \ \isadigit{2}{\isachardot}\ {\isasymlbrakk}\mbox{xs}\ {\isasymnoteq}\ {\isacharbrackleft}{\isacharbrackright}{\isacharsemicolon}\ \mbox{ys}\ {\isacharequal}\ {\isacharbrackleft}{\isacharbrackright}{\isasymrbrakk}\ {\isasymLongrightarrow}\ \mbox{xs}\ {\isacharat}\ {\isacharbrackleft}{\isacharbrackright}\ {\isasymnoteq}\ {\isacharbrackleft}{\isacharbrackright} |
|
99 \end{isabelle} |
|
100 If you need to split both in the assumptions and the conclusion, |
|
101 use $t$\isa{.splits} which subsumes $t$\isa{.split} and $t$\isa{.split_asm}. |
|
102 *} |
|
103 |
84 (*<*) |
104 (*<*) |
|
105 by(simp_all) |
85 end |
106 end |
86 (*>*) |
107 (*>*) |