• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • C
      • Proof-checker-array
      • Soft
      • Farray
      • Rp-rewriter
      • Instant-runoff-voting
      • Imp-language
      • Sidekick
      • Ethereum
      • Leftist-trees
      • Java
      • Riscv
      • Taspi
      • Bitcoin
      • Zcash
      • Des
      • X86isa
      • Sha-2
      • Yul
      • Proof-checker-itp13
      • Regex
      • ACL2-programming-language
      • Json
      • Jfkr
      • Equational
      • Cryptography
      • Axe
      • Poseidon
      • Where-do-i-place-my-book
      • Aleo
        • Aleobft
        • Aleovm
        • Leo
          • Grammar
          • Early-version
            • Json2ast
            • Testing
            • Definition
              • Flattening
              • Abstract-syntax
              • Dynamic-semantics
                • Execution
                • Values
                • Dynamic-environments
                • Arithmetic-operations
                • Curve-parameterization
                • Shift-operations
                • Errors
                • Value-expressions
                • Locations
                • Input-execution
                  • Eval-input-item-list
                  • Eval-input-item
                  • Funarg
                  • Funarg-option
                  • Eval-input-section-list
                  • Eval-input-section
                  • Eval-input-file
                  • Funarg-result
                    • Funarg-result-fix
                      • Funarg-result-equiv
                      • Funarg-result-ok
                      • Funarg-result-err
                      • Funarg-resultp
                      • Funarg-result-kind
                    • Funarg-list-result
                    • Funarg-list
                  • Edwards-bls12-generator
                  • Equality-operations
                  • Logical-operations
                  • Program-execution
                  • Ordering-operations
                  • Bitwise-operations
                  • Literal-evaluation
                  • Type-maps-for-struct-components
                  • Output-execution
                  • Tuple-operations
                  • Struct-operations
                • Compilation
                • Static-semantics
                • Concrete-syntax
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Community
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Funarg-result

    Funarg-result-fix

    Fixing function for funarg-result structures.

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

    Definitions and Theorems

    Function: funarg-result-fix$inline

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

    Theorem: funarg-resultp-of-funarg-result-fix

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

    Theorem: funarg-result-fix-when-funarg-resultp

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

    Function: funarg-result-equiv$inline

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

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

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

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

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

    Theorem: funarg-result-fix-under-funarg-result-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-funarg-result-fix

    (defthm consp-of-funarg-result-fix
      (consp (funarg-result-fix acl2::x))
      :rule-classes :type-prescription)