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