Fixing function for module structures.
Function:
(defun module-fix$inline (x) (declare (xargs :guard (module-p x))) (let ((__function__ 'module-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((wires (wirelist-fix (cdr (std::da-nth 0 x)))) (insts (modinstlist-fix (cdr (std::da-nth 1 x)))) (assigns (assigns-fix (cdr (std::da-nth 2 x)))) (fixups (assigns-fix (cdr (std::da-nth 3 x)))) (constraints (constraintlist-fix (cdr (std::da-nth 4 x)))) (aliaspairs (lhspairs-fix (cdr (std::da-nth 5 x))))) (list (cons 'wires wires) (cons 'insts insts) (cons 'assigns assigns) (cons 'fixups fixups) (cons 'constraints constraints) (cons 'aliaspairs aliaspairs))) :exec x)))
Theorem:
(defthm module-p-of-module-fix (b* ((new-x (module-fix$inline x))) (module-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm module-fix-when-module-p (implies (module-p x) (equal (module-fix x) x)))
Function:
(defun module-equiv$inline (x y) (declare (xargs :guard (and (module-p x) (module-p y)))) (equal (module-fix x) (module-fix y)))
Theorem:
(defthm module-equiv-is-an-equivalence (and (booleanp (module-equiv x y)) (module-equiv x x) (implies (module-equiv x y) (module-equiv y x)) (implies (and (module-equiv x y) (module-equiv y z)) (module-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm module-equiv-implies-equal-module-fix-1 (implies (module-equiv x x-equiv) (equal (module-fix x) (module-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm module-fix-under-module-equiv (module-equiv (module-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-module-fix-1-forward-to-module-equiv (implies (equal (module-fix x) y) (module-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-module-fix-2-forward-to-module-equiv (implies (equal x (module-fix y)) (module-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm module-equiv-of-module-fix-1-forward (implies (module-equiv (module-fix x) y) (module-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm module-equiv-of-module-fix-2-forward (implies (module-equiv x (module-fix y)) (module-equiv x y)) :rule-classes :forward-chaining)