Fixing function for partsum-comp structures.
(partsum-comp-fix x) → new-x
Function:
(defun partsum-comp-fix$inline (x) (declare (xargs :guard (partsum-comp-p x))) (let ((__function__ 'partsum-comp-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (partsum-comp-kind x) (:str (b* ((val (str-fix x))) val)) (:idx (b* ((val (ifix x))) val)) (:range (b* ((msb (ifix (car x))) (lsb (ifix (cdr x)))) (cons msb lsb)))) :exec x)))
Theorem:
(defthm partsum-comp-p-of-partsum-comp-fix (b* ((new-x (partsum-comp-fix$inline x))) (partsum-comp-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm partsum-comp-fix-when-partsum-comp-p (implies (partsum-comp-p x) (equal (partsum-comp-fix x) x)))
Function:
(defun partsum-comp-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (partsum-comp-p acl2::x) (partsum-comp-p acl2::y)))) (equal (partsum-comp-fix acl2::x) (partsum-comp-fix acl2::y)))
Theorem:
(defthm partsum-comp-equiv-is-an-equivalence (and (booleanp (partsum-comp-equiv x y)) (partsum-comp-equiv x x) (implies (partsum-comp-equiv x y) (partsum-comp-equiv y x)) (implies (and (partsum-comp-equiv x y) (partsum-comp-equiv y z)) (partsum-comp-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm partsum-comp-equiv-implies-equal-partsum-comp-fix-1 (implies (partsum-comp-equiv acl2::x x-equiv) (equal (partsum-comp-fix acl2::x) (partsum-comp-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm partsum-comp-fix-under-partsum-comp-equiv (partsum-comp-equiv (partsum-comp-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-partsum-comp-fix-1-forward-to-partsum-comp-equiv (implies (equal (partsum-comp-fix acl2::x) acl2::y) (partsum-comp-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-partsum-comp-fix-2-forward-to-partsum-comp-equiv (implies (equal acl2::x (partsum-comp-fix acl2::y)) (partsum-comp-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm partsum-comp-equiv-of-partsum-comp-fix-1-forward (implies (partsum-comp-equiv (partsum-comp-fix acl2::x) acl2::y) (partsum-comp-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm partsum-comp-equiv-of-partsum-comp-fix-2-forward (implies (partsum-comp-equiv acl2::x (partsum-comp-fix acl2::y)) (partsum-comp-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm partsum-comp-kind$inline-of-partsum-comp-fix-x (equal (partsum-comp-kind$inline (partsum-comp-fix x)) (partsum-comp-kind$inline x)))
Theorem:
(defthm partsum-comp-kind$inline-partsum-comp-equiv-congruence-on-x (implies (partsum-comp-equiv x x-equiv) (equal (partsum-comp-kind$inline x) (partsum-comp-kind$inline x-equiv))) :rule-classes :congruence)