Fixing function for vl-scopecontext structures.
(vl-scopecontext-fix x) → new-x
Function:
(defun vl-scopecontext-fix$inline (x) (declare (xargs :guard (vl-scopecontext-p x))) (let ((__function__ 'vl-scopecontext-fix)) (declare (ignorable __function__)) (mbe :logic (common-lisp::case (vl-scopecontext-kind x) (:local (b* ((levels (nfix (cdr x)))) (cons :local levels))) (:root (cons :root nil)) (:package (b* ((pkg (vl-package-fix (cdr x)))) (cons :package pkg))) (:class (b* ((class (vl-class-fix (cdr x)))) (cons :class class))) (:module (b* ((mod (vl-module-fix (cdr x)))) (cons :module mod))) (:interface (b* ((iface (vl-interface-fix (cdr x)))) (cons :interface iface)))) :exec x)))
Theorem:
(defthm vl-scopecontext-p-of-vl-scopecontext-fix (b* ((new-x (vl-scopecontext-fix$inline x))) (vl-scopecontext-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vl-scopecontext-fix-when-vl-scopecontext-p (implies (vl-scopecontext-p x) (equal (vl-scopecontext-fix x) x)))
Function:
(defun vl-scopecontext-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (vl-scopecontext-p acl2::x) (vl-scopecontext-p acl2::y)))) (equal (vl-scopecontext-fix acl2::x) (vl-scopecontext-fix acl2::y)))
Theorem:
(defthm vl-scopecontext-equiv-is-an-equivalence (and (booleanp (vl-scopecontext-equiv x y)) (vl-scopecontext-equiv x x) (implies (vl-scopecontext-equiv x y) (vl-scopecontext-equiv y x)) (implies (and (vl-scopecontext-equiv x y) (vl-scopecontext-equiv y z)) (vl-scopecontext-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vl-scopecontext-equiv-implies-equal-vl-scopecontext-fix-1 (implies (vl-scopecontext-equiv acl2::x x-equiv) (equal (vl-scopecontext-fix acl2::x) (vl-scopecontext-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vl-scopecontext-fix-under-vl-scopecontext-equiv (vl-scopecontext-equiv (vl-scopecontext-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vl-scopecontext-fix-1-forward-to-vl-scopecontext-equiv (implies (equal (vl-scopecontext-fix acl2::x) acl2::y) (vl-scopecontext-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vl-scopecontext-fix-2-forward-to-vl-scopecontext-equiv (implies (equal acl2::x (vl-scopecontext-fix acl2::y)) (vl-scopecontext-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-scopecontext-equiv-of-vl-scopecontext-fix-1-forward (implies (vl-scopecontext-equiv (vl-scopecontext-fix acl2::x) acl2::y) (vl-scopecontext-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-scopecontext-equiv-of-vl-scopecontext-fix-2-forward (implies (vl-scopecontext-equiv acl2::x (vl-scopecontext-fix acl2::y)) (vl-scopecontext-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm vl-scopecontext-kind$inline-of-vl-scopecontext-fix-x (equal (vl-scopecontext-kind$inline (vl-scopecontext-fix x)) (vl-scopecontext-kind$inline x)))
Theorem:
(defthm vl-scopecontext-kind$inline-vl-scopecontext-equiv-congruence-on-x (implies (vl-scopecontext-equiv x x-equiv) (equal (vl-scopecontext-kind$inline x) (vl-scopecontext-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-vl-scopecontext-fix (consp (vl-scopecontext-fix x)) :rule-classes :type-prescription)