Fixer for pointer.
Function:
(defun pointer-fix (x) (declare (xargs :guard (pointerp x))) (mbe :logic (if (pointerp x) x (new-pointer-raw nil)) :exec x))
Theorem:
(defthm pointerp-of-pointer-fix (b* ((fixed-x (pointer-fix x))) (pointerp fixed-x)) :rule-classes :rewrite)
Theorem:
(defthm pointer-fix-when-pointerp (implies (pointerp x) (equal (pointer-fix x) x)))