• 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
      • Bitcoin
      • Riscv
      • Des
      • Ethereum
      • X86isa
      • Sha-2
      • Yul
        • Transformations
        • Language
          • Abstract-syntax
            • Escape
            • Swcase-list->value-list
            • Hex-digit-list->chars
            • Fundef-list->name-list
            • Literal
            • Path
            • Hex-string-rest-element
            • Plain-string
            • String-element
            • Hex-string-content-option
            • Hex-string-content
            • Identifier
            • Funcall-option
            • Expression-option
            • Statement-option
            • Literal-option
            • Identifier-option
            • Hex-string
            • Hex-quad
            • Hex-digit
            • Hex-pair
            • Data-value
            • Data-item
            • Statements-to-fundefs
            • String-element-list-result
            • Identifier-identifier-map-result
            • Swcase-result
            • String-element-result
            • Statement-result
            • Literal-result
            • Identifier-set-result
            • Identifier-result
            • Identifier-list-result
            • Fundef-result
            • Funcall-result
            • Expression-result
            • Escape-result
            • Path-result
              • Path-result-fix
                • Path-result-equiv
                • Path-result-ok
                • Path-result-err
                • Path-resultp
                • Path-result-kind
              • Block-result
              • Objects
              • Statements/blocks/cases/fundefs
              • Identifier-list
              • Identifier-set
              • Identifier-identifier-map
              • Identifier-identifier-alist
              • Hex-string-rest-element-list
              • String-element-list
              • Path-list
              • Hex-digit-list
              • Literal-list
              • Fundef-list
              • Expressions/funcalls
              • Abstract-syntax-induction-schemas
            • Dynamic-semantics
            • Concrete-syntax
            • Static-soundness
            • Static-semantics
            • Errors
          • Yul-json
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Path-result

    Path-result-fix

    Fixing function for path-result structures.

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

    Definitions and Theorems

    Function: path-result-fix$inline

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

    Theorem: path-resultp-of-path-result-fix

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

    Theorem: path-result-fix-when-path-resultp

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

    Function: path-result-equiv$inline

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

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

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

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

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

    Theorem: path-result-fix-under-path-result-equiv

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

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

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

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

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

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

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

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

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

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

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

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

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

    Theorem: consp-of-path-result-fix

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