Fixing function for outcome structures.
Function:
(defun outcome-fix$inline (x) (declare (xargs :guard (outcomep x))) (let ((__function__ 'outcome-fix)) (declare (ignorable __function__)) (mbe :logic (case (outcome-kind x) (:function-success (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :function-success (list message)))) (:type-success (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :type-success (list message)))) (:specification-success (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :specification-success (list message)))) (:theorem-success (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :theorem-success (list message)))) (:transformation-success (b* ((message (str-fix (std::da-nth 0 (cdr x)))) (toplevels (toplevel-list-fix (std::da-nth 1 (cdr x))))) (cons :transformation-success (list message toplevels)))) (:proof-obligation-failure (b* ((message (str-fix (std::da-nth 0 (cdr x)))) (obligation-expr (expression-fix (std::da-nth 1 (cdr x))))) (cons :proof-obligation-failure (list message obligation-expr)))) (:theorem-failure (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :theorem-failure (list message)))) (:transformation-failure (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :transformation-failure (list message)))) (:unexpected-failure (b* ((message (str-fix (std::da-nth 0 (cdr x))))) (cons :unexpected-failure (list message))))) :exec x)))
Theorem:
(defthm outcomep-of-outcome-fix (b* ((new-x (outcome-fix$inline x))) (outcomep new-x)) :rule-classes :rewrite)
Theorem:
(defthm outcome-fix-when-outcomep (implies (outcomep x) (equal (outcome-fix x) x)))
Function:
(defun outcome-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (outcomep acl2::x) (outcomep acl2::y)))) (equal (outcome-fix acl2::x) (outcome-fix acl2::y)))
Theorem:
(defthm outcome-equiv-is-an-equivalence (and (booleanp (outcome-equiv x y)) (outcome-equiv x x) (implies (outcome-equiv x y) (outcome-equiv y x)) (implies (and (outcome-equiv x y) (outcome-equiv y z)) (outcome-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm outcome-equiv-implies-equal-outcome-fix-1 (implies (outcome-equiv acl2::x x-equiv) (equal (outcome-fix acl2::x) (outcome-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm outcome-fix-under-outcome-equiv (outcome-equiv (outcome-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-outcome-fix-1-forward-to-outcome-equiv (implies (equal (outcome-fix acl2::x) acl2::y) (outcome-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-outcome-fix-2-forward-to-outcome-equiv (implies (equal acl2::x (outcome-fix acl2::y)) (outcome-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm outcome-equiv-of-outcome-fix-1-forward (implies (outcome-equiv (outcome-fix acl2::x) acl2::y) (outcome-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm outcome-equiv-of-outcome-fix-2-forward (implies (outcome-equiv acl2::x (outcome-fix acl2::y)) (outcome-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm outcome-kind$inline-of-outcome-fix-x (equal (outcome-kind$inline (outcome-fix x)) (outcome-kind$inline x)))
Theorem:
(defthm outcome-kind$inline-outcome-equiv-congruence-on-x (implies (outcome-equiv x x-equiv) (equal (outcome-kind$inline x) (outcome-kind$inline x-equiv))) :rule-classes :congruence)
Theorem:
(defthm consp-of-outcome-fix (consp (outcome-fix x)) :rule-classes :type-prescription)