Fixing function for vcd-wire structures.
(vcd-wire-fix x) → new-x
Function:
(defun vcd-wire-fix$inline (x) (declare (xargs :guard (vcd-wire-p x))) (let ((__function__ 'vcd-wire-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (str-fix (cdr (std::da-nth 0 x)))) (msb (ifix (cdr (std::da-nth 1 x)))) (lsb (ifix (cdr (std::da-nth 2 x)))) (code (str-fix (cdr (std::da-nth 3 x))))) (list (cons 'name name) (cons 'msb msb) (cons 'lsb lsb) (cons 'code code))) :exec x)))
Theorem:
(defthm vcd-wire-p-of-vcd-wire-fix (b* ((new-x (vcd-wire-fix$inline x))) (vcd-wire-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm vcd-wire-fix-when-vcd-wire-p (implies (vcd-wire-p x) (equal (vcd-wire-fix x) x)))
Function:
(defun vcd-wire-equiv$inline (x y) (declare (xargs :guard (and (vcd-wire-p x) (vcd-wire-p y)))) (equal (vcd-wire-fix x) (vcd-wire-fix y)))
Theorem:
(defthm vcd-wire-equiv-is-an-equivalence (and (booleanp (vcd-wire-equiv x y)) (vcd-wire-equiv x x) (implies (vcd-wire-equiv x y) (vcd-wire-equiv y x)) (implies (and (vcd-wire-equiv x y) (vcd-wire-equiv y z)) (vcd-wire-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm vcd-wire-equiv-implies-equal-vcd-wire-fix-1 (implies (vcd-wire-equiv x x-equiv) (equal (vcd-wire-fix x) (vcd-wire-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm vcd-wire-fix-under-vcd-wire-equiv (vcd-wire-equiv (vcd-wire-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-vcd-wire-fix-1-forward-to-vcd-wire-equiv (implies (equal (vcd-wire-fix x) y) (vcd-wire-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-vcd-wire-fix-2-forward-to-vcd-wire-equiv (implies (equal x (vcd-wire-fix y)) (vcd-wire-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm vcd-wire-equiv-of-vcd-wire-fix-1-forward (implies (vcd-wire-equiv (vcd-wire-fix x) y) (vcd-wire-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm vcd-wire-equiv-of-vcd-wire-fix-2-forward (implies (vcd-wire-equiv x (vcd-wire-fix y)) (vcd-wire-equiv x y)) :rule-classes :forward-chaining)