Fixing function for funtype structures.
Function:
(defun funtype-fix$inline (x) (declare (xargs :guard (funtypep x))) (let ((__function__ 'funtype-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((in (nfix (cdr (std::da-nth 0 (cdr x))))) (out (nfix (cdr (std::da-nth 1 (cdr x)))))) (cons :funtype (list (cons 'in in) (cons 'out out)))) :exec x)))
Theorem:
(defthm funtypep-of-funtype-fix (b* ((new-x (funtype-fix$inline x))) (funtypep new-x)) :rule-classes :rewrite)
Theorem:
(defthm funtype-fix-when-funtypep (implies (funtypep x) (equal (funtype-fix x) x)))
Function:
(defun funtype-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (funtypep acl2::x) (funtypep acl2::y)))) (equal (funtype-fix acl2::x) (funtype-fix acl2::y)))
Theorem:
(defthm funtype-equiv-is-an-equivalence (and (booleanp (funtype-equiv x y)) (funtype-equiv x x) (implies (funtype-equiv x y) (funtype-equiv y x)) (implies (and (funtype-equiv x y) (funtype-equiv y z)) (funtype-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm funtype-equiv-implies-equal-funtype-fix-1 (implies (funtype-equiv acl2::x x-equiv) (equal (funtype-fix acl2::x) (funtype-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm funtype-fix-under-funtype-equiv (funtype-equiv (funtype-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-funtype-fix-1-forward-to-funtype-equiv (implies (equal (funtype-fix acl2::x) acl2::y) (funtype-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-funtype-fix-2-forward-to-funtype-equiv (implies (equal acl2::x (funtype-fix acl2::y)) (funtype-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm funtype-equiv-of-funtype-fix-1-forward (implies (funtype-equiv (funtype-fix acl2::x) acl2::y) (funtype-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm funtype-equiv-of-funtype-fix-2-forward (implies (funtype-equiv acl2::x (funtype-fix acl2::y)) (funtype-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)