Depth of a cons tree.
Function:
(defun max-depth (x) (declare (xargs :guard t)) (if (atom x) 0 (1+ (max (max-depth (car x)) (max-depth (cdr x))))))
Function:
(defun max-depth-memoize-condition (x) (declare (ignorable x) (xargs :guard 't)) (consp x))