doc-src/TutorialI/Misc/document/Tree.tex
author nipkow
Wed, 02 Aug 2000 11:30:38 +0200
changeset 9493 494f8cd34df7
parent 9145 9f7b8de5bfaf
child 9541 d17c0b34d5c8
permissions -rw-r--r--
*** empty log message ***

\begin{isabelle}%
%
\begin{isamarkuptext}%
\noindent
Define the datatype of binary trees%
\end{isamarkuptext}%
\isacommand{datatype}~'a~tree~=~Tip~|~Node~{"}'a~tree{"}~'a~{"}'a~tree{"}%
\begin{isamarkuptext}%
\noindent
and a function \isa{mirror} that mirrors a binary tree
by swapping subtrees (recursively). Prove%
\end{isamarkuptext}%
\isacommand{lemma}~mirror\_mirror:~{"}mirror(mirror~t)~=~t{"}%
\begin{isamarkuptext}%
\noindent
Define a function \isa{flatten} that flattens a tree into a list
by traversing it in infix order. Prove%
\end{isamarkuptext}%
\isacommand{lemma}~{"}flatten(mirror~t)~=~rev(flatten~t){"}\end{isabelle}%
%%% Local Variables:
%%% mode: latex
%%% TeX-master: "root"
%%% End: