Fixing function for type-result structures.
(type-result-fix x) → new-x
Function:
(defun type-result-fix$inline (x) (declare (xargs :guard (type-resultp x))) (let ((__function__ 'type-result-fix)) (declare (ignorable __function__)) (mbe :logic (case (type-result-kind x) (:ok (b* ((types (type-list-fix (std::da-nth 0 (cdr x)))) (obligations (proof-obligation-list-fix (std::da-nth 1 (cdr x))))) (cons :ok (list types obligations)))) (:err (b* ((info (identity (std::da-nth 0 (cdr x))))) (cons :err (list info))))) :exec x)))
Theorem:
(defthm type-resultp-of-type-result-fix (b* ((new-x (type-result-fix$inline x))) (type-resultp new-x)) :rule-classes :rewrite)
Theorem:
(defthm type-result-fix-when-type-resultp (implies (type-resultp x) (equal (type-result-fix x) x)))
Function:
(defun type-result-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (type-resultp acl2::x) (type-resultp acl2::y)))) (equal (type-result-fix acl2::x) (type-result-fix acl2::y)))
Theorem:
(defthm type-result-equiv-is-an-equivalence (and (booleanp (type-result-equiv x y)) (type-result-equiv x x) (implies (type-result-equiv x y) (type-result-equiv y x)) (implies (and (type-result-equiv x y) (type-result-equiv y z)) (type-result-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm type-result-equiv-implies-equal-type-result-fix-1 (implies (type-result-equiv acl2::x x-equiv) (equal (type-result-fix acl2::x) (type-result-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm type-result-fix-under-type-result-equiv (type-result-equiv (type-result-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-type-result-fix-1-forward-to-type-result-equiv (implies (equal (type-result-fix acl2::x) acl2::y) (type-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-type-result-fix-2-forward-to-type-result-equiv (implies (equal acl2::x (type-result-fix acl2::y)) (type-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm type-result-equiv-of-type-result-fix-1-forward (implies (type-result-equiv (type-result-fix acl2::x) acl2::y) (type-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm type-result-equiv-of-type-result-fix-2-forward (implies (type-result-equiv acl2::x (type-result-fix acl2::y)) (type-result-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm type-result-kind$inline-of-type-result-fix-x (equal (type-result-kind$inline (type-result-fix x)) (type-result-kind$inline x)))
Theorem:
(defthm type-result-kind$inline-type-result-equiv-congruence-on-x (implies (type-result-equiv x x-equiv) (equal (type-result-kind$inline x) (type-result-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-type-result-fix (consp (type-result-fix x)) :rule-classes :type-prescription)