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