• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
      • Std/lists
      • Omaps
        • Defomap
        • Update
        • Mapp
        • Assoc
        • Update*
        • From-lists
        • Keys
        • List-lookup
        • Size
        • Compatiblep
        • Submap
        • Tail
        • Restrict
        • Head
        • Update-induction-on-maps
        • Rlookup
        • Lookup
        • List-notin
        • Emptyp
        • Rlookup*
        • Map
        • Lookup*
        • Values
        • List-in
        • Delete*
        • In*
        • Delete
          • From-alist
          • Mfix
          • Head-val
          • Head-key
          • Omap-induction2
          • Omap-order-rules
        • Std/alists
        • Obags
        • Std/util
        • Std/strings
        • Std/osets
        • Std/io
        • Std/basic
        • Std/system
        • Std/typed-lists
        • Std/bitsets
        • Std/testing
        • Std/typed-alists
        • Std/stobjs
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Omaps

    Delete

    Remove a key, and associated value, from an omap.

    Signature
    (delete key map) → map1
    Arguments
    map — Guard (mapp map).
    Returns
    map1 — Type (mapp map1).

    This is similar to set::delete for osets.

    Definitions and Theorems

    Function: delete

    (defun delete (key map)
      (declare (xargs :guard (mapp map)))
      (let ((__function__ 'delete))
        (declare (ignorable __function__))
        (cond ((emptyp map) nil)
              (t (mv-let (key0 val0)
                         (head map)
                   (cond ((equal key key0) (tail map))
                         (t (update key0
                                    val0 (delete key (tail map))))))))))

    Theorem: mapp-of-delete

    (defthm mapp-of-delete
      (b* ((map1 (delete key map)))
        (mapp map1))
      :rule-classes :rewrite)

    Theorem: delete-when-emptyp

    (defthm delete-when-emptyp
      (implies (emptyp map)
               (equal (delete key map) nil)))

    Theorem: delete-of-mfix-map

    (defthm delete-of-mfix-map
      (equal (delete key (mfix map))
             (delete key map)))

    Theorem: delete-mequiv-congruence-on-map

    (defthm delete-mequiv-congruence-on-map
      (implies (mequiv map map-equiv)
               (equal (delete key map)
                      (delete key map-equiv)))
      :rule-classes :congruence)