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