Fixing function for bin-expo structures.
Function:
(defun bin-expo-fix$inline (x) (declare (xargs :guard (bin-expop x))) (let ((__function__ 'bin-expo-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((prefix (bin-expo-prefix-fix (cdr (std::da-nth 0 x)))) (sign? (sign-option-fix (cdr (std::da-nth 1 x)))) (digits (str::dec-digit-char-list-fix (cdr (std::da-nth 2 x))))) (list (cons 'prefix prefix) (cons 'sign? sign?) (cons 'digits digits))) :exec x)))
Theorem:
(defthm bin-expop-of-bin-expo-fix (b* ((new-x (bin-expo-fix$inline x))) (bin-expop new-x)) :rule-classes :rewrite)
Theorem:
(defthm bin-expo-fix-when-bin-expop (implies (bin-expop x) (equal (bin-expo-fix x) x)))
Function:
(defun bin-expo-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (bin-expop acl2::x) (bin-expop acl2::y)))) (equal (bin-expo-fix acl2::x) (bin-expo-fix acl2::y)))
Theorem:
(defthm bin-expo-equiv-is-an-equivalence (and (booleanp (bin-expo-equiv x y)) (bin-expo-equiv x x) (implies (bin-expo-equiv x y) (bin-expo-equiv y x)) (implies (and (bin-expo-equiv x y) (bin-expo-equiv y z)) (bin-expo-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm bin-expo-equiv-implies-equal-bin-expo-fix-1 (implies (bin-expo-equiv acl2::x x-equiv) (equal (bin-expo-fix acl2::x) (bin-expo-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm bin-expo-fix-under-bin-expo-equiv (bin-expo-equiv (bin-expo-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-bin-expo-fix-1-forward-to-bin-expo-equiv (implies (equal (bin-expo-fix acl2::x) acl2::y) (bin-expo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-bin-expo-fix-2-forward-to-bin-expo-equiv (implies (equal acl2::x (bin-expo-fix acl2::y)) (bin-expo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bin-expo-equiv-of-bin-expo-fix-1-forward (implies (bin-expo-equiv (bin-expo-fix acl2::x) acl2::y) (bin-expo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bin-expo-equiv-of-bin-expo-fix-2-forward (implies (bin-expo-equiv acl2::x (bin-expo-fix acl2::y)) (bin-expo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)