Fixing function for vl-msg structures.
Function:
(defun vl-msg-fix$inline (x) (declare (xargs :guard (vl-msg-p x))) (let ((__function__ 'vl-msg-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((msg (str-fix (if (atom x) x (car x)))) (args (list-fix (and (consp x) (cdr x))))) (if args (cons msg args) msg)) :exec x)))
Theorem:
(defthm vl-msg-p-of-vl-msg-fix (b* ((new-x (vl-msg-fix$inline x))) (vl-msg-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-msg-fix-when-vl-msg-p (implies (vl-msg-p x) (equal (vl-msg-fix x) x)))
Function:
(defun vl-msg-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-msg-p acl2::x) (vl-msg-p acl2::y)))) (equal (vl-msg-fix acl2::x) (vl-msg-fix acl2::y)))
Theorem:
(defthm vl-msg-equiv-is-an-equivalence (and (booleanp (vl-msg-equiv x y)) (vl-msg-equiv x x) (implies (vl-msg-equiv x y) (vl-msg-equiv y x)) (implies (and (vl-msg-equiv x y) (vl-msg-equiv y z)) (vl-msg-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-msg-equiv-implies-equal-vl-msg-fix-1 (implies (vl-msg-equiv acl2::x x-equiv) (equal (vl-msg-fix acl2::x) (vl-msg-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-msg-fix-under-vl-msg-equiv (vl-msg-equiv (vl-msg-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-msg-fix-1-forward-to-vl-msg-equiv (implies (equal (vl-msg-fix acl2::x) acl2::y) (vl-msg-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-msg-fix-2-forward-to-vl-msg-equiv (implies (equal acl2::x (vl-msg-fix acl2::y)) (vl-msg-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-msg-equiv-of-vl-msg-fix-1-forward (implies (vl-msg-equiv (vl-msg-fix acl2::x) acl2::y) (vl-msg-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-msg-equiv-of-vl-msg-fix-2-forward (implies (vl-msg-equiv acl2::x (vl-msg-fix acl2::y)) (vl-msg-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)