• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Types
            • Integer-formats-definitions
            • Computation-states
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
              • Init-fun-env
              • Fun-info
              • Fun-info-option
              • Fun-env-extend
              • Fun-env-result
                • Fun-env-result-fix
                  • Fun-env-result-equiv
                  • Fun-env-result-ok
                  • Fun-env-result-err
                  • Fun-env-resultp
                  • Fun-env-result-kind
                • Fun-env-lookup
                • Fun-info-from-fundef
                • Fun-env
              • Character-sets
              • Flexible-array-member-removal
              • Arithmetic-operations
              • Pointer-operations
              • Real-operations
              • Array-operations
              • Scalar-operations
              • Structure-operations
            • Representation
            • Insertion-sort
            • Pack
          • Soft
          • Bv
          • Imp-language
          • Ethereum
          • Event-macros
          • Java
          • Riscv
          • Bitcoin
          • Zcash
          • Yul
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Axe
          • Lists-light
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Fun-env-result

    Fun-env-result-fix

    Fixing function for fun-env-result structures.

    Signature
    (fun-env-result-fix acl2::x) → new-x
    Arguments
    acl2::x — Guard (fun-env-resultp acl2::x).
    Returns
    new-x — Type (fun-env-resultp new-x).

    Definitions and Theorems

    Function: fun-env-result-fix$inline

    (defun fun-env-result-fix$inline (acl2::x)
      (declare (xargs :guard (fun-env-resultp acl2::x)))
      (mbe :logic
           (case (fun-env-result-kind acl2::x)
             (:ok (b* ((get (fun-env-fix acl2::x))) get))
             (:err (b* ((get (fty::reserr-fix acl2::x)))
                     get)))
           :exec acl2::x))

    Theorem: fun-env-resultp-of-fun-env-result-fix

    (defthm fun-env-resultp-of-fun-env-result-fix
      (b* ((new-x (fun-env-result-fix$inline acl2::x)))
        (fun-env-resultp new-x))
      :rule-classes :rewrite)

    Theorem: fun-env-result-fix-when-fun-env-resultp

    (defthm fun-env-result-fix-when-fun-env-resultp
      (implies (fun-env-resultp acl2::x)
               (equal (fun-env-result-fix acl2::x)
                      acl2::x)))

    Function: fun-env-result-equiv$inline

    (defun fun-env-result-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (fun-env-resultp acl2::x)
                                  (fun-env-resultp acl2::y))))
      (equal (fun-env-result-fix acl2::x)
             (fun-env-result-fix acl2::y)))

    Theorem: fun-env-result-equiv-is-an-equivalence

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

    Theorem: fun-env-result-equiv-implies-equal-fun-env-result-fix-1

    (defthm fun-env-result-equiv-implies-equal-fun-env-result-fix-1
      (implies (fun-env-result-equiv acl2::x x-equiv)
               (equal (fun-env-result-fix acl2::x)
                      (fun-env-result-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: fun-env-result-fix-under-fun-env-result-equiv

    (defthm fun-env-result-fix-under-fun-env-result-equiv
      (fun-env-result-equiv (fun-env-result-fix acl2::x)
                            acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-fun-env-result-fix-1-forward-to-fun-env-result-equiv

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

    Theorem: equal-of-fun-env-result-fix-2-forward-to-fun-env-result-equiv

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

    Theorem: fun-env-result-equiv-of-fun-env-result-fix-1-forward

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

    Theorem: fun-env-result-equiv-of-fun-env-result-fix-2-forward

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

    Theorem: fun-env-result-kind$inline-of-fun-env-result-fix-x

    (defthm fun-env-result-kind$inline-of-fun-env-result-fix-x
      (equal (fun-env-result-kind$inline (fun-env-result-fix acl2::x))
             (fun-env-result-kind$inline acl2::x)))

    Theorem: fun-env-result-kind$inline-fun-env-result-equiv-congruence-on-x

    (defthm
        fun-env-result-kind$inline-fun-env-result-equiv-congruence-on-x
      (implies (fun-env-result-equiv acl2::x x-equiv)
               (equal (fun-env-result-kind$inline acl2::x)
                      (fun-env-result-kind$inline x-equiv)))
      :rule-classes :congruence)

    Theorem: fun-env-result-fix$inline-of-fun-env-result-fix-x

    (defthm fun-env-result-fix$inline-of-fun-env-result-fix-x
      (equal (fun-env-result-fix$inline (fun-env-result-fix acl2::x))
             (fun-env-result-fix$inline acl2::x)))

    Theorem: fun-env-result-fix$inline-fun-env-result-equiv-congruence-on-x

    (defthm
         fun-env-result-fix$inline-fun-env-result-equiv-congruence-on-x
      (implies (fun-env-result-equiv acl2::x x-equiv)
               (equal (fun-env-result-fix$inline acl2::x)
                      (fun-env-result-fix$inline x-equiv)))
      :rule-classes :congruence)