• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Leftist-trees
      • Java
      • Taspi
      • Riscv
      • Bitcoin
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
        • Language
          • Abstract-syntax
          • Dynamic-semantics
          • Concrete-syntax
          • Static-soundness
          • Static-semantics
            • Static-safety-checking
              • Check-safe-statements/blocks/cases/fundefs
              • Check-safe-expressions
              • Check-safe-fundef-list
              • Check-safe-variable-multi
              • Check-safe-variable-single
              • Check-safe-assign-multi
              • Check-safe-assign-single
              • Check-safe-path
              • Check-safe-extends-varset
              • Vars+modes
              • Add-vars
              • Add-var
              • Add-funtypes
              • Check-safe-literal
              • Funtype
              • Get-funtype
              • Check-var
              • Check-safe-top-block
              • Check-safe-path-list
              • Vars+modes-result
              • Funtype-result
              • Funtable-result
                • Funtable-result-fix
                  • Funtable-result-equiv
                  • Funtable-result-ok
                  • Funtable-result-err
                  • Funtable-resultp
                  • Funtable-result-kind
                • Funtable-for-fundefs
                • Funtype-for-fundef
                • Funtable
              • Static-shadowing-checking
              • Mode-set-result
              • Literal-evaluation
              • Static-identifier-checking
              • Static-safety-checking-evm
              • Mode-set
              • Modes
            • Errors
          • Yul-json
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Funtable-result

    Funtable-result-fix

    Fixing function for funtable-result structures.

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

    Definitions and Theorems

    Function: funtable-result-fix$inline

    (defun funtable-result-fix$inline (acl2::x)
      (declare (xargs :guard (funtable-resultp acl2::x)))
      (let ((__function__ 'funtable-result-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (case (funtable-result-kind acl2::x)
               (:ok (b* ((get (funtable-fix acl2::x))) get))
               (:err (b* ((get (fty::reserr-fix acl2::x)))
                       get)))
             :exec acl2::x)))

    Theorem: funtable-resultp-of-funtable-result-fix

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

    Theorem: funtable-result-fix-when-funtable-resultp

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

    Function: funtable-result-equiv$inline

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

    Theorem: funtable-result-equiv-is-an-equivalence

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

    Theorem: funtable-result-equiv-implies-equal-funtable-result-fix-1

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

    Theorem: funtable-result-fix-under-funtable-result-equiv

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

    Theorem: equal-of-funtable-result-fix-1-forward-to-funtable-result-equiv

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

    Theorem: equal-of-funtable-result-fix-2-forward-to-funtable-result-equiv

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

    Theorem: funtable-result-equiv-of-funtable-result-fix-1-forward

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

    Theorem: funtable-result-equiv-of-funtable-result-fix-2-forward

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

    Theorem: funtable-result-kind$inline-of-funtable-result-fix-x

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

    Theorem: funtable-result-kind$inline-funtable-result-equiv-congruence-on-x

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