Fixing function for vl-scopestack structures.
(vl-scopestack-fix x) → new-x
Function:
(defun vl-scopestack-fix$inline (x) (declare (xargs :guard (vl-scopestack-p x))) (let ((__function__ 'vl-scopestack-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (vl-scopestack-kind x) (:null nil) (:global (b* ((design (vl-design-fix (cdr x)))) (cons :global design))) (:local (b* ((top (vl-scope-fix (car x))) (super (vl-scopestack-fix (cdr x)))) (cons top super)))) :exec x)))
Theorem:
(defthm vl-scopestack-p-of-vl-scopestack-fix (b* ((new-x (vl-scopestack-fix$inline x))) (vl-scopestack-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-scopestack-fix-when-vl-scopestack-p (implies (vl-scopestack-p x) (equal (vl-scopestack-fix x) x)))
Function:
(defun vl-scopestack-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-scopestack-p acl2::x) (vl-scopestack-p acl2::y)))) (equal (vl-scopestack-fix acl2::x) (vl-scopestack-fix acl2::y)))
Theorem:
(defthm vl-scopestack-equiv-is-an-equivalence (and (booleanp (vl-scopestack-equiv x y)) (vl-scopestack-equiv x x) (implies (vl-scopestack-equiv x y) (vl-scopestack-equiv y x)) (implies (and (vl-scopestack-equiv x y) (vl-scopestack-equiv y z)) (vl-scopestack-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-scopestack-equiv-implies-equal-vl-scopestack-fix-1 (implies (vl-scopestack-equiv acl2::x x-equiv) (equal (vl-scopestack-fix acl2::x) (vl-scopestack-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-scopestack-fix-under-vl-scopestack-equiv (vl-scopestack-equiv (vl-scopestack-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-scopestack-fix-1-forward-to-vl-scopestack-equiv (implies (equal (vl-scopestack-fix acl2::x) acl2::y) (vl-scopestack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-scopestack-fix-2-forward-to-vl-scopestack-equiv (implies (equal acl2::x (vl-scopestack-fix acl2::y)) (vl-scopestack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-scopestack-equiv-of-vl-scopestack-fix-1-forward (implies (vl-scopestack-equiv (vl-scopestack-fix acl2::x) acl2::y) (vl-scopestack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-scopestack-equiv-of-vl-scopestack-fix-2-forward (implies (vl-scopestack-equiv acl2::x (vl-scopestack-fix acl2::y)) (vl-scopestack-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-scopestack-kind$inline-of-vl-scopestack-fix-x (equal (vl-scopestack-kind$inline (vl-scopestack-fix x)) (vl-scopestack-kind$inline x)))
Theorem:
(defthm vl-scopestack-kind$inline-vl-scopestack-equiv-congruence-on-x (implies (vl-scopestack-equiv x x-equiv) (equal (vl-scopestack-kind$inline x) (vl-scopestack-kind$inline x-equiv))) :rule-classes :congruence)