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