• 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
          • Omaps
            • Defomap
            • Update
            • Mapp
            • Assoc
            • Update*
            • Size
            • Keys
              • From-lists
              • Update-induction-on-maps
              • Compatiblep
              • Tail
              • Head
              • Restrict
              • Submap
              • Map
              • Rlookup
              • Emptyp
              • Rlookup*
              • Lookup*
              • Delete*
              • Values
              • In*
              • Lookup
              • Delete
              • Mfix
              • Head-val
              • Head-key
              • Omap-induction2
              • Omap-order-rules
            • Directed-untranslate
            • Include-book-paths
            • Ubi
            • Numbered-names
            • Digits-any-base
            • Context-message-pair
            • With-auto-termination
            • Make-termination-theorem
            • Theorems-about-true-list-lists
            • Checkpoint-list
            • Sublis-expr+
            • Integers-from-to
            • Prove$
            • Defthm<w
            • System-utilities-non-built-in
            • Integer-range-fix
            • Minimize-ruler-extenders
            • Add-const-to-untranslate-preprocess
            • Unsigned-byte-fix
            • Signed-byte-fix
            • Defthmr
            • Paired-names
            • Unsigned-byte-list-fix
            • Signed-byte-list-fix
            • Show-books
            • Skip-in-book
            • Typed-tuplep
            • List-utilities
            • Checkpoint-list-pretty
            • Defunt
            • Keyword-value-list-to-alist
            • Magic-macroexpand
            • Top-command-number-fn
            • Bits-as-digits-in-base-2
            • Show-checkpoint-list
            • Ubyte11s-as-digits-in-base-2048
            • Named-formulas
            • Bytes-as-digits-in-base-256
            • String-utilities
            • Make-keyword-value-list-from-keys-and-value
            • Defmacroq
            • Integer-range-listp
            • Apply-fn-if-known
            • Trans-eval-error-triple
            • Checkpoint-info-list
            • Previous-subsumer-hints
            • Fms!-lst
            • Zp-listp
            • Trans-eval-state
            • Injections
            • Doublets-to-alist
            • Theorems-about-osets
            • Typed-list-utilities
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Message-utilities
            • Subsetp-eq-linear
            • Oset-utilities
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Thm<w
            • Defthmd<w
            • Io-utilities
          • Set
          • Soft
          • C
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • 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
    • Omaps

    Keys

    Oset of the keys of an omap.

    Signature
    (keys map) → keys
    Arguments
    map — Guard (mapp map).
    Returns
    keys — Type (setp keys).

    Definitions and Theorems

    Function: keys

    (defun keys (map)
      (declare (xargs :guard (mapp map)))
      (let ((__function__ 'keys))
        (declare (ignorable __function__))
        (cond ((emptyp map) nil)
              (t (mv-let (key val)
                         (head map)
                   (declare (ignore val))
                   (insert key (keys (tail map))))))))

    Theorem: setp-of-keys

    (defthm setp-of-keys
      (b* ((keys (keys map))) (setp keys))
      :rule-classes :rewrite)

    Theorem: keys-of-mfix

    (defthm keys-of-mfix
      (equal (keys (mfix map)) (keys map)))

    Theorem: keys-when-emptyp

    (defthm keys-when-emptyp
      (implies (emptyp map)
               (equal (keys map) nil))
      :rule-classes (:rewrite :type-prescription))

    Theorem: keys-iff-not-emptyp

    (defthm keys-iff-not-emptyp
      (iff (keys map) (not (emptyp map))))

    Theorem: consp-of-assoc-to-in-of-keys

    (defthm consp-of-assoc-to-in-of-keys
      (equal (consp (assoc key map))
             (set::in key (keys map))))

    Theorem: assoc-to-in-of-keys

    (defthm assoc-to-in-of-keys
      (iff (assoc key map)
           (set::in key (keys map))))

    Theorem: in-of-keys-to-assoc

    (defthm in-of-keys-to-assoc
      (iff (set::in key (keys map))
           (assoc key map)))

    Theorem: in-keys-when-assoc-forward

    (defthm in-keys-when-assoc-forward
      (implies (assoc key map)
               (set::in key (keys map)))
      :rule-classes :forward-chaining)

    Theorem: in-keys-when-assoc-is-cons

    (defthm in-keys-when-assoc-is-cons
      (implies (equal (assoc a m) (cons a b))
               (set::in a (keys m))))

    Theorem: keys-of-update

    (defthm keys-of-update
      (equal (keys (update key val m))
             (insert key (keys m))))

    Theorem: keys-of-update*

    (defthm keys-of-update*
      (equal (keys (update* new old))
             (union (keys new) (keys old))))

    Theorem: keys-of-restrict

    (defthm keys-of-restrict
      (equal (keys (restrict keys map))
             (intersect keys (keys map))))

    Theorem: head-key-not-in-keys-of-tail

    (defthm head-key-not-in-keys-of-tail
      (not (set::in (mv-nth 0 (head map))
                    (keys (tail map)))))