Fixing function for wire structures.
Function:
(defun wire-fix$inline (x) (declare (xargs :guard (wire-p x))) (let ((__function__ 'wire-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((name (name-fix (std::prod-car (std::prod-car x)))) (width (pos-fix (std::prod-car (std::prod-cdr (std::prod-car x))))) (low-idx (ifix (std::prod-cdr (std::prod-cdr (std::prod-car x))))) (delay (acl2::maybe-posp-fix (std::prod-car (std::prod-car (std::prod-cdr x))))) (revp (std::prod-cdr (std::prod-car (std::prod-cdr x)))) (type (wiretype-fix (std::prod-car (std::prod-cdr (std::prod-cdr x))))) (atts (attributes-fix (std::prod-cdr (std::prod-cdr (std::prod-cdr x)))))) (std::prod-cons (std::prod-cons name (std::prod-cons width low-idx)) (std::prod-cons (std::prod-cons delay revp) (std::prod-cons type atts)))) :exec x)))
Theorem:
(defthm wire-p-of-wire-fix (b* ((new-x (wire-fix$inline x))) (wire-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm wire-fix-when-wire-p (implies (wire-p x) (equal (wire-fix x) x)))
Function:
(defun wire-equiv$inline (x y) (declare (xargs :guard (and (wire-p x) (wire-p y)))) (equal (wire-fix x) (wire-fix y)))
Theorem:
(defthm wire-equiv-is-an-equivalence (and (booleanp (wire-equiv x y)) (wire-equiv x x) (implies (wire-equiv x y) (wire-equiv y x)) (implies (and (wire-equiv x y) (wire-equiv y z)) (wire-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm wire-equiv-implies-equal-wire-fix-1 (implies (wire-equiv x x-equiv) (equal (wire-fix x) (wire-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm wire-fix-under-wire-equiv (wire-equiv (wire-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-wire-fix-1-forward-to-wire-equiv (implies (equal (wire-fix x) y) (wire-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-wire-fix-2-forward-to-wire-equiv (implies (equal x (wire-fix y)) (wire-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm wire-equiv-of-wire-fix-1-forward (implies (wire-equiv (wire-fix x) y) (wire-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm wire-equiv-of-wire-fix-2-forward (implies (wire-equiv x (wire-fix y)) (wire-equiv x y)) :rule-classes :forward-chaining)