Fixing function for bexpo structures.
Function:
(defun bexpo-fix$inline (x) (declare (xargs :guard (bexpop x))) (mbe :logic (b* ((prefix (bexprefix-fix (car x))) (sign? (sign-option-fix (car (cdr x)))) (digits (str::dec-digit-char-list-fix (cdr (cdr x))))) (cons prefix (cons sign? digits))) :exec x))
Theorem:
(defthm bexpop-of-bexpo-fix (b* ((new-x (bexpo-fix$inline x))) (bexpop new-x)) :rule-classes :rewrite)
Theorem:
(defthm bexpo-fix-when-bexpop (implies (bexpop x) (equal (bexpo-fix x) x)))
Function:
(defun bexpo-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (bexpop acl2::x) (bexpop acl2::y)))) (equal (bexpo-fix acl2::x) (bexpo-fix acl2::y)))
Theorem:
(defthm bexpo-equiv-is-an-equivalence (and (booleanp (bexpo-equiv x y)) (bexpo-equiv x x) (implies (bexpo-equiv x y) (bexpo-equiv y x)) (implies (and (bexpo-equiv x y) (bexpo-equiv y z)) (bexpo-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm bexpo-equiv-implies-equal-bexpo-fix-1 (implies (bexpo-equiv acl2::x x-equiv) (equal (bexpo-fix acl2::x) (bexpo-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm bexpo-fix-under-bexpo-equiv (bexpo-equiv (bexpo-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-bexpo-fix-1-forward-to-bexpo-equiv (implies (equal (bexpo-fix acl2::x) acl2::y) (bexpo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-bexpo-fix-2-forward-to-bexpo-equiv (implies (equal acl2::x (bexpo-fix acl2::y)) (bexpo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bexpo-equiv-of-bexpo-fix-1-forward (implies (bexpo-equiv (bexpo-fix acl2::x) acl2::y) (bexpo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bexpo-equiv-of-bexpo-fix-2-forward (implies (bexpo-equiv acl2::x (bexpo-fix acl2::y)) (bexpo-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm bexpo-fix$inline-of-bexpo-fix-x (equal (bexpo-fix$inline (bexpo-fix x)) (bexpo-fix$inline x)))
Theorem:
(defthm bexpo-fix$inline-bexpo-equiv-congruence-on-x (implies (bexpo-equiv x x-equiv) (equal (bexpo-fix$inline x) (bexpo-fix$inline x-equiv))) :rule-classes :congruence)