Fixing function for vl-distitem structures.
(vl-distitem-fix x) → new-x
Function:
(defun vl-distitem-fix$inline (x) (declare (xargs :guard (vl-distitem-p x))) (let ((__function__ 'vl-distitem-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((left (vl-expr-fix (std::prod-car (std::prod-car (cdr x))))) (right (vl-maybe-expr-fix (std::prod-cdr (std::prod-car (cdr x))))) (type (vl-distweighttype-fix (std::prod-car (std::prod-cdr (cdr x))))) (weight (vl-expr-fix (std::prod-cdr (std::prod-cdr (cdr x)))))) (cons :vl-distitem (std::prod-cons (std::prod-cons left right) (std::prod-cons type weight)))) :exec x)))
Theorem:
(defthm vl-distitem-p-of-vl-distitem-fix (b* ((new-x (vl-distitem-fix$inline x))) (vl-distitem-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-distitem-fix-when-vl-distitem-p (implies (vl-distitem-p x) (equal (vl-distitem-fix x) x)))
Function:
(defun vl-distitem-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-distitem-p acl2::x) (vl-distitem-p acl2::y)))) (equal (vl-distitem-fix acl2::x) (vl-distitem-fix acl2::y)))
Theorem:
(defthm vl-distitem-equiv-is-an-equivalence (and (booleanp (vl-distitem-equiv x y)) (vl-distitem-equiv x x) (implies (vl-distitem-equiv x y) (vl-distitem-equiv y x)) (implies (and (vl-distitem-equiv x y) (vl-distitem-equiv y z)) (vl-distitem-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-distitem-equiv-implies-equal-vl-distitem-fix-1 (implies (vl-distitem-equiv acl2::x x-equiv) (equal (vl-distitem-fix acl2::x) (vl-distitem-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-distitem-fix-under-vl-distitem-equiv (vl-distitem-equiv (vl-distitem-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-distitem-fix-1-forward-to-vl-distitem-equiv (implies (equal (vl-distitem-fix acl2::x) acl2::y) (vl-distitem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-distitem-fix-2-forward-to-vl-distitem-equiv (implies (equal acl2::x (vl-distitem-fix acl2::y)) (vl-distitem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-distitem-equiv-of-vl-distitem-fix-1-forward (implies (vl-distitem-equiv (vl-distitem-fix acl2::x) acl2::y) (vl-distitem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-distitem-equiv-of-vl-distitem-fix-2-forward (implies (vl-distitem-equiv acl2::x (vl-distitem-fix acl2::y)) (vl-distitem-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)