Fixing function for vl-funtemplate structures.
(vl-funtemplate-fix x) → new-x
Function:
(defun vl-funtemplate-fix$inline (x) (declare (xargs :guard (vl-funtemplate-p x))) (let ((__function__ 'vl-funtemplate-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (str-fix (std::prod-car (std::prod-car (cdr x))))) (inputs (vl-vardecllist-fix (std::prod-cdr (std::prod-car (cdr x))))) (locals (vl-vardecllist-fix (std::prod-car (std::prod-cdr (cdr x))))) (out (vl-vardecl-fix (std::prod-car (std::prod-cdr (std::prod-cdr (cdr x)))))) (assigns (vl-assignlist-fix (std::prod-cdr (std::prod-cdr (std::prod-cdr (cdr x))))))) (cons :vl-funtemplate (std::prod-cons (std::prod-cons name inputs) (std::prod-cons locals (std::prod-cons out assigns))))) :exec x)))
Theorem:
(defthm vl-funtemplate-p-of-vl-funtemplate-fix (b* ((new-x (vl-funtemplate-fix$inline x))) (vl-funtemplate-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-funtemplate-fix-when-vl-funtemplate-p (implies (vl-funtemplate-p x) (equal (vl-funtemplate-fix x) x)))
Function:
(defun vl-funtemplate-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-funtemplate-p acl2::x) (vl-funtemplate-p acl2::y)))) (equal (vl-funtemplate-fix acl2::x) (vl-funtemplate-fix acl2::y)))
Theorem:
(defthm vl-funtemplate-equiv-is-an-equivalence (and (booleanp (vl-funtemplate-equiv x y)) (vl-funtemplate-equiv x x) (implies (vl-funtemplate-equiv x y) (vl-funtemplate-equiv y x)) (implies (and (vl-funtemplate-equiv x y) (vl-funtemplate-equiv y z)) (vl-funtemplate-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-funtemplate-equiv-implies-equal-vl-funtemplate-fix-1 (implies (vl-funtemplate-equiv acl2::x x-equiv) (equal (vl-funtemplate-fix acl2::x) (vl-funtemplate-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-funtemplate-fix-under-vl-funtemplate-equiv (vl-funtemplate-equiv (vl-funtemplate-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-funtemplate-fix-1-forward-to-vl-funtemplate-equiv (implies (equal (vl-funtemplate-fix acl2::x) acl2::y) (vl-funtemplate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-funtemplate-fix-2-forward-to-vl-funtemplate-equiv (implies (equal acl2::x (vl-funtemplate-fix acl2::y)) (vl-funtemplate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-funtemplate-equiv-of-vl-funtemplate-fix-1-forward (implies (vl-funtemplate-equiv (vl-funtemplate-fix acl2::x) acl2::y) (vl-funtemplate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-funtemplate-equiv-of-vl-funtemplate-fix-2-forward (implies (vl-funtemplate-equiv acl2::x (vl-funtemplate-fix acl2::y)) (vl-funtemplate-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)