Fixing function for typecodes.
(typecode-fix x) → code
Function:
(defun typecode-fix (x) (declare (xargs :guard t)) (let ((__function__ 'typecode-fix)) (declare (ignorable __function__)) (if (typecodep x) x 0)))
Theorem:
(defthm typecodep-of-typecode-fix (b* ((code (typecode-fix x))) (typecodep code)) :rule-classes :rewrite)
Theorem:
(defthm typecode-fix-when-typecodep (implies (typecodep x) (equal (typecode-fix x) x)))