• 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
        • Soft
        • Bv
        • Imp-language
        • Ethereum
          • Mmp-trees
          • Semaphore
          • Database
          • Cryptography
          • Rlp
          • Transactions
            • Make-signed-transaction
            • Transaction
            • Maybe-byte-list20
              • Maybe-byte-list20-fix
                • Maybe-byte-list20-equiv
                • Maybe-byte-list20-case
                • Maybe-byte-list20-some
                • Maybe-byte-list20-none
                • Maybe-byte-list20p
              • Rlp-decode-transaction
              • Rlp-encode-transaction
              • Rlp-transaction-encoding-p
            • Hex-prefix
            • Basics
            • Addresses
          • 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
    • Maybe-byte-list20

    Maybe-byte-list20-fix

    Fixing function for maybe-byte-list20 structures.

    Signature
    (maybe-byte-list20-fix x) → new-x
    Arguments
    x — Guard (maybe-byte-list20p x).
    Returns
    new-x — Type (maybe-byte-list20p new-x).

    Definitions and Theorems

    Function: maybe-byte-list20-fix$inline

    (defun maybe-byte-list20-fix$inline (x)
      (declare (xargs :guard (maybe-byte-list20p x)))
      (let ((__function__ 'maybe-byte-list20-fix))
        (declare (ignorable __function__))
        (mbe :logic (cond ((not x) nil)
                          (t (b* ((fty::val (acl2::byte-list20-fix x)))
                               fty::val)))
             :exec x)))

    Theorem: maybe-byte-list20p-of-maybe-byte-list20-fix

    (defthm maybe-byte-list20p-of-maybe-byte-list20-fix
      (b* ((new-x (maybe-byte-list20-fix$inline x)))
        (maybe-byte-list20p new-x))
      :rule-classes :rewrite)

    Theorem: maybe-byte-list20-fix-when-maybe-byte-list20p

    (defthm maybe-byte-list20-fix-when-maybe-byte-list20p
      (implies (maybe-byte-list20p x)
               (equal (maybe-byte-list20-fix x) x)))

    Function: maybe-byte-list20-equiv$inline

    (defun maybe-byte-list20-equiv$inline (acl2::x acl2::y)
      (declare (xargs :guard (and (maybe-byte-list20p acl2::x)
                                  (maybe-byte-list20p acl2::y))))
      (equal (maybe-byte-list20-fix acl2::x)
             (maybe-byte-list20-fix acl2::y)))

    Theorem: maybe-byte-list20-equiv-is-an-equivalence

    (defthm maybe-byte-list20-equiv-is-an-equivalence
      (and (booleanp (maybe-byte-list20-equiv x y))
           (maybe-byte-list20-equiv x x)
           (implies (maybe-byte-list20-equiv x y)
                    (maybe-byte-list20-equiv y x))
           (implies (and (maybe-byte-list20-equiv x y)
                         (maybe-byte-list20-equiv y z))
                    (maybe-byte-list20-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: maybe-byte-list20-equiv-implies-equal-maybe-byte-list20-fix-1

    (defthm
          maybe-byte-list20-equiv-implies-equal-maybe-byte-list20-fix-1
      (implies (maybe-byte-list20-equiv acl2::x x-equiv)
               (equal (maybe-byte-list20-fix acl2::x)
                      (maybe-byte-list20-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: maybe-byte-list20-fix-under-maybe-byte-list20-equiv

    (defthm maybe-byte-list20-fix-under-maybe-byte-list20-equiv
      (maybe-byte-list20-equiv (maybe-byte-list20-fix acl2::x)
                               acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-maybe-byte-list20-fix-1-forward-to-maybe-byte-list20-equiv

    (defthm
     equal-of-maybe-byte-list20-fix-1-forward-to-maybe-byte-list20-equiv
     (implies (equal (maybe-byte-list20-fix acl2::x)
                     acl2::y)
              (maybe-byte-list20-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: equal-of-maybe-byte-list20-fix-2-forward-to-maybe-byte-list20-equiv

    (defthm
     equal-of-maybe-byte-list20-fix-2-forward-to-maybe-byte-list20-equiv
     (implies (equal acl2::x (maybe-byte-list20-fix acl2::y))
              (maybe-byte-list20-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)

    Theorem: maybe-byte-list20-equiv-of-maybe-byte-list20-fix-1-forward

    (defthm maybe-byte-list20-equiv-of-maybe-byte-list20-fix-1-forward
      (implies (maybe-byte-list20-equiv (maybe-byte-list20-fix acl2::x)
                                        acl2::y)
               (maybe-byte-list20-equiv acl2::x acl2::y))
      :rule-classes :forward-chaining)

    Theorem: maybe-byte-list20-equiv-of-maybe-byte-list20-fix-2-forward

    (defthm maybe-byte-list20-equiv-of-maybe-byte-list20-fix-2-forward
     (implies
       (maybe-byte-list20-equiv acl2::x (maybe-byte-list20-fix acl2::y))
       (maybe-byte-list20-equiv acl2::x acl2::y))
     :rule-classes :forward-chaining)