Theory AVL2
section ‹AVL Trees in 2 Stages›
theory AVL2
imports Main
begin
text ‹
This development of AVL trees leads to the same implementation
as the monolithic one (in theorey AVL) but via an intermediate
abstraction: AVL trees where the height is recomputed rather than
stored in the tree. This two-stage devlopment is longer than the
monolithic one but each individual step is simpler. It should really
be viewed as a blueprint for the development of data structures where
some of the fields contain redundant information (for efficiency
reasons).
›
subsection ‹Step 1: Pure binary and AVL trees›
text ‹
The basic formulation of AVL trees builds on pure binary trees
and recomputes all height information whenever it is required. This
simplifies the correctness proofs.
›