doc-src/TutorialI/Misc/cases.thy
author wenzelm
Tue, 01 Aug 2000 13:43:22 +0200
changeset 9490 c2606af9922c
parent 9458 c613cd06d5cf
child 9721 7e51c9f3d5a0
permissions -rw-r--r--
tuned msg;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     1
(*<*)
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     2
theory "cases" = Main:;
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     3
(*>*)
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     4
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     5
lemma "(case xs of [] \\<Rightarrow> [] | y#ys \\<Rightarrow> xs) = xs";
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     6
apply(case_tac xs);
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
     7
8771
026f37a86ea7 *** empty log message ***
nipkow
parents: 8745
diff changeset
     8
txt{*\noindent
026f37a86ea7 *** empty log message ***
nipkow
parents: 8745
diff changeset
     9
results in the proof state
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    10
\begin{isabellepar}%
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    11
~1.~xs~=~[]~{\isasymLongrightarrow}~(case~xs~of~[]~{\isasymRightarrow}~[]~|~y~\#~ys~{\isasymRightarrow}~xs)~=~xs\isanewline
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    12
~2.~{\isasymAnd}a~list.~xs=a\#list~{\isasymLongrightarrow}~(case~xs~of~[]~{\isasymRightarrow}~[]~|~y\#ys~{\isasymRightarrow}~xs)~=~xs%
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    13
\end{isabellepar}%
8771
026f37a86ea7 *** empty log message ***
nipkow
parents: 8745
diff changeset
    14
which is solved automatically:
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    15
*}
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    16
9458
c613cd06d5cf apply. -> by
nipkow
parents: 8771
diff changeset
    17
by(auto);
8745
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    18
(**)
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    19
(*<*)
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    20
end
13b32661dde4 I wonder which files i forgot.
nipkow
parents:
diff changeset
    21
(*>*)