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