• 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
        • Mmp-trees
        • Semaphore
        • Database
          • Databasep
            • Database-fix
            • Database-equiv
          • Cryptography
          • Rlp
          • Transactions
          • Hex-prefix
          • Basics
          • Addresses
        • X86isa
        • Sha-2
        • Yul
        • 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
    • 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))))