• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
          • Mmp-trees
          • Semaphore
          • Database
            • Databasep
              • Database-fix
              • Database-equiv
            • Cryptography
            • Rlp
            • Transactions
            • Hex-prefix
            • Basics
            • Addresses
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Json
          • Syntheto
          • File-io-light
          • Cryptography
          • Number-theory
          • Lists-light
          • Axe
          • Builtins
          • Solidity
          • Helpers
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Math
      • Testing-utilities
    • Database

    Databasep

    Recognizer for database.

    Signature
    (databasep x) → *

    Definitions and Theorems

    Function: databasep

    (defun databasep (x)
      (declare (xargs :guard t))
      (if (atom x)
          (null x)
        (and (consp (car x))
             (byte-list32p (caar x))
             (byte-listp (cdar x))
             (or (null (cdr x))
                 (and (consp (cdr x))
                      (consp (cadr x))
                      (acl2::fast-<< (caar x) (caadr x))
                      (databasep (cdr x)))))))

    Theorem: booleanp-of-databasep

    (defthm booleanp-of-databasep
      (booleanp (databasep x)))

    Theorem: mapp-when-databasep

    (defthm mapp-when-databasep
      (implies (databasep x) (omap::mapp x))
      :rule-classes (:rewrite :forward-chaining))

    Theorem: databasep-of-tail

    (defthm databasep-of-tail
      (implies (databasep x)
               (databasep (omap::tail x))))

    Theorem: byte-list32p-of-head-key-when-databasep

    (defthm byte-list32p-of-head-key-when-databasep
      (implies (and (databasep x)
                    (not (omap::emptyp x)))
               (byte-list32p (mv-nth 0 (omap::head x)))))

    Theorem: byte-listp-of-head-val-when-databasep

    (defthm byte-listp-of-head-val-when-databasep
      (implies (and (databasep x)
                    (not (omap::emptyp x)))
               (byte-listp (mv-nth 1 (omap::head x)))))

    Theorem: databasep-of-update

    (defthm databasep-of-update
      (implies (and (databasep x)
                    (byte-list32p k)
                    (byte-listp v))
               (databasep (omap::update k v x))))

    Theorem: databasep-of-update*

    (defthm databasep-of-update*
      (implies (and (databasep x) (databasep y))
               (databasep (omap::update* x y))))

    Theorem: databasep-of-delete

    (defthm databasep-of-delete
      (implies (databasep x)
               (databasep (omap::delete k x))))

    Theorem: databasep-of-delete*

    (defthm databasep-of-delete*
      (implies (databasep x)
               (databasep (omap::delete* k x))))

    Theorem: byte-list32p-when-assoc-databasep-binds-free-x

    (defthm byte-list32p-when-assoc-databasep-binds-free-x
      (implies (and (omap::assoc k x) (databasep x))
               (byte-list32p k)))

    Theorem: byte-list32p-of-car-of-assoc-databasep

    (defthm byte-list32p-of-car-of-assoc-databasep
      (implies (and (databasep x) (omap::assoc k x))
               (byte-list32p (car (omap::assoc k x)))))

    Theorem: byte-listp-of-cdr-of-assoc-databasep

    (defthm byte-listp-of-cdr-of-assoc-databasep
      (implies (and (databasep x) (omap::assoc k x))
               (byte-listp (cdr (omap::assoc k x)))))

    Theorem: byte-listp-of-lookup-when-databasep

    (defthm byte-listp-of-lookup-when-databasep
      (implies (and (databasep x) (omap::assoc k x))
               (byte-listp (omap::lookup k x))))