• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
          • Process-syntheto-toplevel-fn
          • Translation
          • Language
            • Static-semantics
            • Abstract-syntax
            • Outcome
              • Outcome-fix
                • Outcome-case
                • Outcomep
                • Outcome-equiv
                • Outcome-proof-obligation-failure
                • Outcome-transformation-success
                • Outcome-kind
                • Outcome-unexpected-failure
                • Outcome-type-success
                • Outcome-transformation-failure
                • Outcome-theorem-success
                • Outcome-theorem-failure
                • Outcome-specification-success
                • Outcome-function-success
              • Abstract-syntax-operations
              • Outcome-list
              • Outcomes
            • Process-syntheto-toplevel
            • Shallow-embedding
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Outcome

    Outcome-fix

    Fixing function for outcome structures.

    Signature
    (outcome-fix x) → new-x
    Arguments
    x — Guard (outcomep x).
    Returns
    new-x — Type (outcomep new-x).

    Definitions and Theorems

    Function: outcome-fix$inline

    (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: outcomep-of-outcome-fix

    (defthm outcomep-of-outcome-fix
      (b* ((new-x (outcome-fix$inline x)))
        (outcomep new-x))
      :rule-classes :rewrite)

    Theorem: outcome-fix-when-outcomep

    (defthm outcome-fix-when-outcomep
      (implies (outcomep x)
               (equal (outcome-fix x) x)))

    Function: outcome-equiv$inline

    (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: outcome-equiv-is-an-equivalence

    (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: outcome-equiv-implies-equal-outcome-fix-1

    (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: outcome-fix-under-outcome-equiv

    (defthm outcome-fix-under-outcome-equiv
      (outcome-equiv (outcome-fix acl2::x)
                     acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-outcome-fix-1-forward-to-outcome-equiv

    (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: equal-of-outcome-fix-2-forward-to-outcome-equiv

    (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: outcome-equiv-of-outcome-fix-1-forward

    (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: outcome-equiv-of-outcome-fix-2-forward

    (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: outcome-kind$inline-of-outcome-fix-x

    (defthm outcome-kind$inline-of-outcome-fix-x
      (equal (outcome-kind$inline (outcome-fix x))
             (outcome-kind$inline x)))

    Theorem: outcome-kind$inline-outcome-equiv-congruence-on-x

    (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: consp-of-outcome-fix

    (defthm consp-of-outcome-fix
      (consp (outcome-fix x))
      :rule-classes :type-prescription)