Fixing function for sllong-array structures.
(sllong-array-fix x) → new-x
Function:
(defun sllong-array-fix$inline (x) (declare (xargs :guard (sllong-arrayp x))) (let ((__function__ 'sllong-array-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((elemtype (type-fix (std::da-nth 0 (cdr x)))) (elements (sllong-list-fix (std::da-nth 1 (cdr x))))) (let ((elemtype (if (type-case elemtype :sllong) elemtype (type-sllong))) (elements (if (consp elements) elements (list (sllong-from-integer 0))))) (cons :array (list elemtype elements)))) :exec x)))
Theorem:
(defthm sllong-arrayp-of-sllong-array-fix (b* ((new-x (sllong-array-fix$inline x))) (sllong-arrayp new-x)) :rule-classes :rewrite)
Theorem:
(defthm sllong-array-fix-when-sllong-arrayp (implies (sllong-arrayp x) (equal (sllong-array-fix x) x)))
Function:
(defun sllong-array-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (sllong-arrayp acl2::x) (sllong-arrayp acl2::y)))) (equal (sllong-array-fix acl2::x) (sllong-array-fix acl2::y)))
Theorem:
(defthm sllong-array-equiv-is-an-equivalence (and (booleanp (sllong-array-equiv x y)) (sllong-array-equiv x x) (implies (sllong-array-equiv x y) (sllong-array-equiv y x)) (implies (and (sllong-array-equiv x y) (sllong-array-equiv y z)) (sllong-array-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm sllong-array-equiv-implies-equal-sllong-array-fix-1 (implies (sllong-array-equiv acl2::x x-equiv) (equal (sllong-array-fix acl2::x) (sllong-array-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm sllong-array-fix-under-sllong-array-equiv (sllong-array-equiv (sllong-array-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-sllong-array-fix-1-forward-to-sllong-array-equiv (implies (equal (sllong-array-fix acl2::x) acl2::y) (sllong-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-sllong-array-fix-2-forward-to-sllong-array-equiv (implies (equal acl2::x (sllong-array-fix acl2::y)) (sllong-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm sllong-array-equiv-of-sllong-array-fix-1-forward (implies (sllong-array-equiv (sllong-array-fix acl2::x) acl2::y) (sllong-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm sllong-array-equiv-of-sllong-array-fix-2-forward (implies (sllong-array-equiv acl2::x (sllong-array-fix acl2::y)) (sllong-array-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)