• 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
              • Check-stmt
              • Check-cond
              • Check-binary-pure
              • Var-table-add-var
              • Check-unary
              • Check-obj-declon
              • Fun-table-add-fun
              • Check-fundef
              • Fun-sinfo
              • Check-expr-asg
              • Check-expr-call
              • Check-arrsub
              • Uaconvert-types
              • Apconvert-type-list
              • Check-initer
              • Adjust-type-list
              • Types+vartab
              • Promote-type
              • Check-tag-declon
              • Check-expr-call-or-asg
              • Check-ext-declon
              • Check-param-declon
              • Check-member
              • Check-expr-pure
              • Init-type-matchp
              • Check-obj-adeclor
              • Check-memberp
              • Check-expr-call-or-pure
              • Check-cast
              • Check-struct-declon-list
              • Check-fun-declor
              • Expr-type
              • Check-ext-declon-list
              • Check-transunit
              • Check-fun-declon
              • Var-defstatus
              • Struct-member-lookup
              • Wellformed
              • Preprocess
              • Check-tyspecseq
              • Check-param-declon-list
              • Check-iconst
              • Check-expr-pure-list
              • Var-sinfo-option
              • Fun-sinfo-option
              • Funtab+vartab+tagenv
              • Var-scope-all-definedp
              • Var-sinfo
              • Var-table-lookup
              • Apconvert-type
              • Var-table
              • Check-tyname
              • Types+vartab-result
              • Funtab+vartab+tagenv-result
              • Wellformed-result
              • Fun-table-lookup
              • Var-table-scope
              • Var-table-result
              • Var-table-add-block
              • Fun-table-result
                • Fun-table-result-fix
                  • Fun-table-result-equiv
                  • Fun-table-result-ok
                  • Fun-table-result-err
                  • Fun-table-resultp
                  • Fun-table-result-kind
                • Expr-type-result
                • Adjust-type
                • Check-fileset
                • Var-table-all-definedp
                • Check-const
                • Fun-table-all-definedp
                • Check-ident
                • Fun-table
                • Var-table-init
                • Fun-table-init
              • Grammar
              • Types
              • Integer-formats-definitions
              • Computation-states
              • Portable-ascii-identifiers
              • Values
              • Integer-operations
              • Object-designators
              • Operations
              • Errors
              • Tag-environments
              • Function-environments
              • 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-table-result

    Fun-table-result-fix

    Fixing function for fun-table-result structures.

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

    Definitions and Theorems

    Function: fun-table-result-fix$inline

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

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

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

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

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

    Function: fun-table-result-equiv$inline

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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