• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Prime-field-constraint-systems
        • Soft
        • Bv
        • Imp-language
        • Event-macros
        • 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
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Solidity
          • Axe
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Execloader
        • Axe
      • Testing-utilities
      • Math
    • 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::empty 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::empty 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-in-databasep-binds-free-x

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

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

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

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

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

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

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