Fixing function for fconst structures.
Function:
(defun fconst-fix$inline (x) (declare (xargs :guard (fconstp x))) (let ((__function__ 'fconst-fix)) (declare (ignorable __function__)) (mbe :logic (case (fconst-kind x) (:dec (b* ((core (dec-core-fconst-fix (std::da-nth 0 (cdr x)))) (suffix? (fsuffix-option-fix (std::da-nth 1 (cdr x))))) (cons :dec (list core suffix?)))) (:hex (b* ((prefix (hprefix-fix (std::da-nth 0 (cdr x)))) (core (hex-core-fconst-fix (std::da-nth 1 (cdr x)))) (suffix? (fsuffix-option-fix (std::da-nth 2 (cdr x))))) (cons :hex (list prefix core suffix?))))) :exec x)))
Theorem:
(defthm fconstp-of-fconst-fix (b* ((new-x (fconst-fix$inline x))) (fconstp new-x)) :rule-classes :rewrite)
Theorem:
(defthm fconst-fix-when-fconstp (implies (fconstp x) (equal (fconst-fix x) x)))
Function:
(defun fconst-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (fconstp acl2::x) (fconstp acl2::y)))) (equal (fconst-fix acl2::x) (fconst-fix acl2::y)))
Theorem:
(defthm fconst-equiv-is-an-equivalence (and (booleanp (fconst-equiv x y)) (fconst-equiv x x) (implies (fconst-equiv x y) (fconst-equiv y x)) (implies (and (fconst-equiv x y) (fconst-equiv y z)) (fconst-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm fconst-equiv-implies-equal-fconst-fix-1 (implies (fconst-equiv acl2::x x-equiv) (equal (fconst-fix acl2::x) (fconst-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm fconst-fix-under-fconst-equiv (fconst-equiv (fconst-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-fconst-fix-1-forward-to-fconst-equiv (implies (equal (fconst-fix acl2::x) acl2::y) (fconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-fconst-fix-2-forward-to-fconst-equiv (implies (equal acl2::x (fconst-fix acl2::y)) (fconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm fconst-equiv-of-fconst-fix-1-forward (implies (fconst-equiv (fconst-fix acl2::x) acl2::y) (fconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm fconst-equiv-of-fconst-fix-2-forward (implies (fconst-equiv acl2::x (fconst-fix acl2::y)) (fconst-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm fconst-kind$inline-of-fconst-fix-x (equal (fconst-kind$inline (fconst-fix x)) (fconst-kind$inline x)))
Theorem:
(defthm fconst-kind$inline-fconst-equiv-congruence-on-x (implies (fconst-equiv x x-equiv) (equal (fconst-kind$inline x) (fconst-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-fconst-fix (consp (fconst-fix x)) :rule-classes :type-prescription)