• 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
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
              • Exec
              • Find-fun
              • Init-local
              • Write-vars-values
              • Add-vars-values
              • Add-funs
              • Eoutcome
              • Soutcome
                • Soutcome-fix
                  • Soutcome-equiv
                  • Make-soutcome
                  • Soutcome->cstate
                  • Change-soutcome
                  • Soutcome->mode
                  • Soutcomep
                • Ensure-funscope-disjoint
                • Write-var-value
                • Restrict-vars
                • Add-var-value
                • Funinfo
                • Exec-top-block
                • Values
                • Cstate
                • Funinfo+funenv
                • Read-vars-values
                • Read-var-value
                • Funenv
                • Funscope-for-fundefs
                • Exec-path
                • Path-to-var
                • Funinfo+funenv-result
                • Exec-literal
                • Soutcome-result
                • Mode-set-result
                • Literal-evaluation
                • Funscope-result
                • Funinfo-result
                • Funenv-result
                • Eoutcome-result
                • Cstate-result
                • Paths-to-vars
                • Funinfo-for-fundef
                • Lstate
                • Funscope
                • Mode-set
                • Modes
              • Concrete-syntax
              • Static-soundness
              • Static-semantics
              • Errors
            • Yul-json
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Soutcome

    Soutcome-fix

    Fixing function for soutcome structures.

    Signature
    (soutcome-fix x) → new-x
    Arguments
    x — Guard (soutcomep x).
    Returns
    new-x — Type (soutcomep new-x).

    Definitions and Theorems

    Function: soutcome-fix$inline

    (defun soutcome-fix$inline (x)
      (declare (xargs :guard (soutcomep x)))
      (let ((__function__ 'soutcome-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (b* ((cstate (cstate-fix (cdr (std::da-nth 0 (cdr x)))))
                  (mode (mode-fix (cdr (std::da-nth 1 (cdr x))))))
               (cons :soutcome (list (cons 'cstate cstate)
                                     (cons 'mode mode))))
             :exec x)))

    Theorem: soutcomep-of-soutcome-fix

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

    Theorem: soutcome-fix-when-soutcomep

    (defthm soutcome-fix-when-soutcomep
      (implies (soutcomep x)
               (equal (soutcome-fix x) x)))

    Function: soutcome-equiv$inline

    (defun soutcome-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (soutcomep acl2::x)
                                  (soutcomep acl2::y))))
      (equal (soutcome-fix acl2::x)
             (soutcome-fix acl2::y)))

    Theorem: soutcome-equiv-is-an-equivalence

    (defthm soutcome-equiv-is-an-equivalence
      (and (booleanp (soutcome-equiv x y))
           (soutcome-equiv x x)
           (implies (soutcome-equiv x y)
                    (soutcome-equiv y x))
           (implies (and (soutcome-equiv x y)
                         (soutcome-equiv y z))
                    (soutcome-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: soutcome-equiv-implies-equal-soutcome-fix-1

    (defthm soutcome-equiv-implies-equal-soutcome-fix-1
      (implies (soutcome-equiv acl2::x x-equiv)
               (equal (soutcome-fix acl2::x)
                      (soutcome-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: soutcome-fix-under-soutcome-equiv

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

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

    (defthm equal-of-soutcome-fix-1-forward-to-soutcome-equiv
      (implies (equal (soutcome-fix acl2::x) acl2::y)
               (soutcome-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-soutcome-fix-2-forward-to-soutcome-equiv

    (defthm equal-of-soutcome-fix-2-forward-to-soutcome-equiv
      (implies (equal acl2::x (soutcome-fix acl2::y))
               (soutcome-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: soutcome-equiv-of-soutcome-fix-1-forward

    (defthm soutcome-equiv-of-soutcome-fix-1-forward
      (implies (soutcome-equiv (soutcome-fix acl2::x)
                               acl2::y)
               (soutcome-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: soutcome-equiv-of-soutcome-fix-2-forward

    (defthm soutcome-equiv-of-soutcome-fix-2-forward
      (implies (soutcome-equiv acl2::x (soutcome-fix acl2::y))
               (soutcome-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)