Fixing function for num-base structures.
(num-base-fix x) → new-x
Function:
(defun num-base-fix$inline (x) (declare (xargs :guard (num-base-p x))) (let ((__function__ 'num-base-fix)) (declare (ignorable __function__)) (mbe :logic (case (num-base-kind x) (:dec (cons :dec (list))) (:hex (cons :hex (list))) (:bin (cons :bin (list)))) :exec x)))
Theorem:
(defthm num-base-p-of-num-base-fix (b* ((new-x (num-base-fix$inline x))) (num-base-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm num-base-fix-when-num-base-p (implies (num-base-p x) (equal (num-base-fix x) x)))
Function:
(defun num-base-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (num-base-p acl2::x) (num-base-p acl2::y)))) (equal (num-base-fix acl2::x) (num-base-fix acl2::y)))
Theorem:
(defthm num-base-equiv-is-an-equivalence (and (booleanp (num-base-equiv x y)) (num-base-equiv x x) (implies (num-base-equiv x y) (num-base-equiv y x)) (implies (and (num-base-equiv x y) (num-base-equiv y z)) (num-base-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm num-base-equiv-implies-equal-num-base-fix-1 (implies (num-base-equiv acl2::x x-equiv) (equal (num-base-fix acl2::x) (num-base-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm num-base-fix-under-num-base-equiv (num-base-equiv (num-base-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-num-base-fix-1-forward-to-num-base-equiv (implies (equal (num-base-fix acl2::x) acl2::y) (num-base-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-num-base-fix-2-forward-to-num-base-equiv (implies (equal acl2::x (num-base-fix acl2::y)) (num-base-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm num-base-equiv-of-num-base-fix-1-forward (implies (num-base-equiv (num-base-fix acl2::x) acl2::y) (num-base-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm num-base-equiv-of-num-base-fix-2-forward (implies (num-base-equiv acl2::x (num-base-fix acl2::y)) (num-base-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm num-base-kind$inline-of-num-base-fix-x (equal (num-base-kind$inline (num-base-fix x)) (num-base-kind$inline x)))
Theorem:
(defthm num-base-kind$inline-num-base-equiv-congruence-on-x (implies (num-base-equiv x x-equiv) (equal (num-base-kind$inline x) (num-base-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-num-base-fix (consp (num-base-fix x)) :rule-classes :type-prescription)