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