% nice addition. anecdote. we are not relying on fully correct code.

Throughout this paper, \CodeIn{AvlTree}~\cite{avltree,cpp_ds} from our benchmark (Section~\ref{sec:benchmark}) will be used as a running example to illustrate the workflow. An AVL tree is a self-balancing binary search tree (BST) where the difference in heights between the left and right subtrees of any node (called the balance factor) is at most 1. This ensures that the tree remains approximately balanced. In this implementation shown in Figure~\ref{fig:avl_header} in Section~\ref{subsec:generation}, the \CodeIn{AvlTree} class contains several public methods: \CodeIn{insert}, \CodeIn{remove}, \CodeIn{contains}, \CodeIn{clear}, \CodeIn{height}, \CodeIn{size}, \CodeIn{empty}, \CodeIn{in\_order\_traversal}, \CodeIn{pre\_order\_traversal}, \CodeIn{post\_order\_traversal}. \CodeIn{AvlTree} maintains several class invariants determined by the authors of this paper: 
\begin{itemize}
    \item BST Property: Left child values are less than the node's value, and right child values are greater.
    \item Balance Factor: For each node, the difference in the heights of the left and right subtrees is between -1 and 1.
    \item Correct Heights: The height of each node is 1 plus the maximum height of its children.
    % \item Valid Rotations: Any rotations performed must maintain AVL properties. \shuvendu{This does not appear to be an invariant}
    % \item Parent-Child Consistency: Parent pointers (if used) are correctly maintained during modifications. \shuvendu{What is this consistency property?}
\end{itemize}

Each of these invariants should hold true before and after every public method call, and be established after the constructor method. The task is to infer these high-quality invariants from the source code.
