Fixing function for nati structures.
Function:
(defun nati-fix$inline (x) (declare (xargs :guard (natip x))) (let ((__function__ 'nati-fix)) (declare (ignorable __function__)) (mbe :logic (case (nati-kind x) (:finite (b* ((get (nfix (std::da-nth 0 (cdr x))))) (cons :finite (list get)))) (:infinity (cons :infinity (list)))) :exec x)))
Theorem:
(defthm natip-of-nati-fix (b* ((new-x (nati-fix$inline x))) (natip new-x)) :rule-classes :rewrite)
Theorem:
(defthm nati-fix-when-natip (implies (natip x) (equal (nati-fix x) x)))
Function:
(defun nati-equiv$inline (x y) (declare (xargs :guard (and (natip x) (natip y)))) (equal (nati-fix x) (nati-fix y)))
Theorem:
(defthm nati-equiv-is-an-equivalence (and (booleanp (nati-equiv x y)) (nati-equiv x x) (implies (nati-equiv x y) (nati-equiv y x)) (implies (and (nati-equiv x y) (nati-equiv y z)) (nati-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm nati-equiv-implies-equal-nati-fix-1 (implies (nati-equiv x x-equiv) (equal (nati-fix x) (nati-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm nati-fix-under-nati-equiv (nati-equiv (nati-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-nati-fix-1-forward-to-nati-equiv (implies (equal (nati-fix x) y) (nati-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-nati-fix-2-forward-to-nati-equiv (implies (equal x (nati-fix y)) (nati-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm nati-equiv-of-nati-fix-1-forward (implies (nati-equiv (nati-fix x) y) (nati-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm nati-equiv-of-nati-fix-2-forward (implies (nati-equiv x (nati-fix y)) (nati-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm nati-kind$inline-of-nati-fix-x (equal (nati-kind$inline (nati-fix x)) (nati-kind$inline x)))
Theorem:
(defthm nati-kind$inline-nati-equiv-congruence-on-x (implies (nati-equiv x x-equiv) (equal (nati-kind$inline x) (nati-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-nati-fix (consp (nati-fix x)) :rule-classes :type-prescription)