Fixing function for isuffix structures.
Function:
(defun isuffix-fix$inline (x) (declare (xargs :guard (isuffixp x))) (let ((__function__ 'isuffix-fix)) (declare (ignorable __function__)) (mbe :logic (case (isuffix-kind x) (:u (b* ((unsigned (usuffix-fix (std::da-nth 0 (cdr x))))) (cons :u (list unsigned)))) (:l (b* ((length (lsuffix-fix (std::da-nth 0 (cdr x))))) (cons :l (list length)))) (:ul (b* ((unsigned (usuffix-fix (std::da-nth 0 (cdr x)))) (length (lsuffix-fix (std::da-nth 1 (cdr x))))) (cons :ul (list unsigned length)))) (:lu (b* ((length (lsuffix-fix (std::da-nth 0 (cdr x)))) (unsigned (usuffix-fix (std::da-nth 1 (cdr x))))) (cons :lu (list length unsigned))))) :exec x)))
Theorem:
(defthm isuffixp-of-isuffix-fix (b* ((new-x (isuffix-fix$inline x))) (isuffixp new-x)) :rule-classes :rewrite)
Theorem:
(defthm isuffix-fix-when-isuffixp (implies (isuffixp x) (equal (isuffix-fix x) x)))
Function:
(defun isuffix-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (isuffixp acl2::x) (isuffixp acl2::y)))) (equal (isuffix-fix acl2::x) (isuffix-fix acl2::y)))
Theorem:
(defthm isuffix-equiv-is-an-equivalence (and (booleanp (isuffix-equiv x y)) (isuffix-equiv x x) (implies (isuffix-equiv x y) (isuffix-equiv y x)) (implies (and (isuffix-equiv x y) (isuffix-equiv y z)) (isuffix-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm isuffix-equiv-implies-equal-isuffix-fix-1 (implies (isuffix-equiv acl2::x x-equiv) (equal (isuffix-fix acl2::x) (isuffix-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm isuffix-fix-under-isuffix-equiv (isuffix-equiv (isuffix-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-isuffix-fix-1-forward-to-isuffix-equiv (implies (equal (isuffix-fix acl2::x) acl2::y) (isuffix-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-isuffix-fix-2-forward-to-isuffix-equiv (implies (equal acl2::x (isuffix-fix acl2::y)) (isuffix-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm isuffix-equiv-of-isuffix-fix-1-forward (implies (isuffix-equiv (isuffix-fix acl2::x) acl2::y) (isuffix-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm isuffix-equiv-of-isuffix-fix-2-forward (implies (isuffix-equiv acl2::x (isuffix-fix acl2::y)) (isuffix-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm isuffix-kind$inline-of-isuffix-fix-x (equal (isuffix-kind$inline (isuffix-fix x)) (isuffix-kind$inline x)))
Theorem:
(defthm isuffix-kind$inline-isuffix-equiv-congruence-on-x (implies (isuffix-equiv x x-equiv) (equal (isuffix-kind$inline x) (isuffix-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-isuffix-fix (consp (isuffix-fix x)) :rule-classes :type-prescription)